diff --git a/api/app/lib/controllers/organization/user.js b/api/app/lib/controllers/organization/user.js index 8aaf88b..92c0bf1 100644 --- a/api/app/lib/controllers/organization/user.js +++ b/api/app/lib/controllers/organization/user.js @@ -235,6 +235,7 @@ async function creatUser(ctx, next) { delete: false, phone: data.phone, post: data.post, + structure:data.structure }) ctx.status = 204; @@ -275,6 +276,7 @@ async function updateUser(ctx, next) { delete: false, phone: data.phone, post: data.post, + structure:data.structure }, { where: { id: id diff --git a/api/app/lib/models/user.js b/api/app/lib/models/user.js index 3ea7040..9d7999a 100644 --- a/api/app/lib/models/user.js +++ b/api/app/lib/models/user.js @@ -95,6 +95,15 @@ module.exports = dc => { primaryKey: false, field: "post", autoIncrement: false + }, + structure: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "结构物", + primaryKey: false, + field: "structure", + autoIncrement: false } }, { tableName: "user", diff --git a/script/1.0.3/schema/5.update_resource.sql b/script/1.0.3/schema/5.update_resource.sql new file mode 100644 index 0000000..1f492e2 --- /dev/null +++ b/script/1.0.3/schema/5.update_resource.sql @@ -0,0 +1,3 @@ +UPDATE resource set name = '结构物基础信息管理' WHERE code = 'STRU_INFO_CONFIG'; +INSERT INTO public.resource (code, name, parent_resource) VALUES ('CHECKITEMSET', '检查项设定', 'PATROL_MANAGE'); +INSERT INTO public.resource (code, name, parent_resource) VALUES ('CHECKMOULD', '巡检模板', 'PATROL_MANAGE'); \ No newline at end of file diff --git a/script/1.0.3/schema/6.update_user_resource.sql b/script/1.0.3/schema/6.update_user_resource.sql new file mode 100644 index 0000000..b3f2cbb --- /dev/null +++ b/script/1.0.3/schema/6.update_user_resource.sql @@ -0,0 +1,4 @@ +DELETE FROM public.user_resource WHERE id = 12; +DELETE FROM public.user_resource WHERE id = 13; +INSERT INTO public.user_resource (id,user_id,resource) VALUES (12, 1, 'CHECKITEMSET'); +INSERT INTO public.user_resource (id,user_id,resource) VALUES (13, 1, 'CHECKMOULD'); \ No newline at end of file diff --git a/script/1.0.3/schema/7.update_user.sql b/script/1.0.3/schema/7.update_user.sql new file mode 100644 index 0000000..ec5bd1c --- /dev/null +++ b/script/1.0.3/schema/7.update_user.sql @@ -0,0 +1 @@ +ALTER TABLE "user" ADD structure VARCHAR(40); \ No newline at end of file diff --git a/weapp/app.js b/weapp/app.js index d8a5514..5ea2c11 100644 --- a/weapp/app.js +++ b/weapp/app.js @@ -1,40 +1,40 @@ // app.js App({ - onLaunch() { }, - globalData: { - userInfo: null, - baseUrl: 'http://10.8.16.221:4900', //api 本地环境 - webUrl: "http://10.8.16.221:5900/", //web 本地环境 - imgUrl: 'http://10.8.16.221:5900/_file-server/', //文件 本地环境 - key: 'ODQBZ-3FZAU-6VIVL-2XXNM-F7CP7-WVFCY' //获取位置信息 - }, - onShow(e) { - // 检查是否有更新 - const updateManager = wx.getUpdateManager(); - updateManager.onCheckForUpdate(function (res) { - // 请求完新版本信息的回调 - console.log(res.hasUpdate); - }); - updateManager.onUpdateReady(function () { - wx.showModal({ - title: "更新提示", - content: "新版本已经准备好,是否重启应用?", - success(res) { - if (res.confirm) { - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 - updateManager.applyUpdate(); - } - } - }); - }); + onLaunch () { }, + globalData: { + userInfo: null, + baseUrl: 'http://10.8.30.112:4900', //api 本地环境 + webUrl: "http://10.8.30.112:5900/", //web 本地环境 + imgUrl: 'http://10.8.30.112:5900/_file-server/', //文件 本地环境 + key: 'ODQBZ-3FZAU-6VIVL-2XXNM-F7CP7-WVFCY' //获取位置信息 + }, + onShow (e) { + // 检查是否有更新 + const updateManager = wx.getUpdateManager(); + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + console.log(res.hasUpdate); + }); + updateManager.onUpdateReady(function () { + wx.showModal({ + title: "更新提示", + content: "新版本已经准备好,是否重启应用?", + success (res) { + if (res.confirm) { + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate(); + } + } + }); + }); - updateManager.onUpdateFailed(function () { - // 新版本下载失败 - wx.showToast({ - title: "新版本下载失败", - icon: "none", - duration: 1000 - }); - }); - } + updateManager.onUpdateFailed(function () { + // 新版本下载失败 + wx.showToast({ + title: "新版本下载失败", + icon: "none", + duration: 1000 + }); + }); + } }) diff --git a/weapp/app.json b/weapp/app.json index a7fab2b..a9321fa 100644 --- a/weapp/app.json +++ b/weapp/app.json @@ -5,16 +5,19 @@ "pages/myInfo/myInfo", "pages/overview/overview" ], - "subPackages": [{ - "root": "package", - "pages": [ - "polling/polling", - "polling/inspectionRecordDetail/inspectionRecordDetail", - "basic/basic", - "startInspection/startInspection", - "inspectionInput/inspectionInput" - ] - }], + "subPackages": [ + { + "root": "package", + "pages": [ + "polling/polling", + "polling/inspectionRecordDetail/inspectionRecordDetail", + "basic/basic", + "startInspection/startInspection", + "inspectionInput/inspectionInput", + "troubleshooting/index" + ] + } + ], "window": { "backgroundTextStyle": "dark", "navigationBarBackgroundColor": "#1979ff", @@ -25,12 +28,14 @@ "selectedColor": "#2F54FF", "borderStyle": "black", "backgroundColor": "#ffffff", - "list": [{ + "list": [ + { "pagePath": "pages/index/index", "iconPath": "images/tabBar/icon_polling.png", "selectedIconPath": "images/tabBar/icon_polling_active.png", "text": "巡检总览" - }, { + }, + { "pagePath": "pages/overview/overview", "iconPath": "images/tabBar/icon_menu.png", "selectedIconPath": "images/tabBar/icon_menu_active.png", diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js new file mode 100644 index 0000000..b51d75d --- /dev/null +++ b/weapp/package/troubleshooting/index.js @@ -0,0 +1,66 @@ +// package/bindTroubleshooting/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/weapp/package/troubleshooting/index.json b/weapp/package/troubleshooting/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/weapp/package/troubleshooting/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/weapp/package/troubleshooting/index.wxml b/weapp/package/troubleshooting/index.wxml new file mode 100644 index 0000000..6f32331 --- /dev/null +++ b/weapp/package/troubleshooting/index.wxml @@ -0,0 +1,2 @@ + +package/bindTroubleshooting/index.wxml diff --git a/weapp/package/troubleshooting/index.wxss b/weapp/package/troubleshooting/index.wxss new file mode 100644 index 0000000..c0f73fc --- /dev/null +++ b/weapp/package/troubleshooting/index.wxss @@ -0,0 +1 @@ +/* package/bindTroubleshooting/index.wxss */ \ No newline at end of file diff --git a/weapp/pages/overview/overview.js b/weapp/pages/overview/overview.js index 375a9d0..ca01b03 100644 --- a/weapp/pages/overview/overview.js +++ b/weapp/pages/overview/overview.js @@ -15,6 +15,12 @@ Page({ }) }, + bindTroubleshooting() { + wx.navigateTo({ + url: '/package/troubleshooting/index', + }) + }, + /** * 生命周期函数--监听页面加载 */ diff --git a/weapp/pages/overview/overview.wxml b/weapp/pages/overview/overview.wxml index 8360bb5..f95e500 100644 --- a/weapp/pages/overview/overview.wxml +++ b/weapp/pages/overview/overview.wxml @@ -1,18 +1,18 @@ - + - - - 巡检 - - - + + + 巡检 + + + + + 问题处理 + + + \ No newline at end of file diff --git a/weapp/project.config.json b/weapp/project.config.json index faa4199..62fc226 100644 --- a/weapp/project.config.json +++ b/weapp/project.config.json @@ -41,7 +41,7 @@ }, "compileType": "miniprogram", "libVersion": "2.19.4", - "appid": "wxdd82ae635b22ccdb", + "appid": "wx79ff58f03d17f24d", "projectname": "miniprogram-92", "condition": {}, "editorSetting": { diff --git a/weapp/project.private.config.json b/weapp/project.private.config.json index 5fd81b0..86fa333 100644 --- a/weapp/project.private.config.json +++ b/weapp/project.private.config.json @@ -1,6 +1,8 @@ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "setting": { - "urlCheck": false - } + "urlCheck": false, + "compileHotReLoad": true + }, + "projectname": "%E8%BF%90%E7%BB%B4%E5%B7%A1%E6%A3%80" } \ No newline at end of file diff --git a/web/client/src/sections/organization/components/userModal.js b/web/client/src/sections/organization/components/userModal.js index 73a082a..4988b85 100644 --- a/web/client/src/sections/organization/components/userModal.js +++ b/web/client/src/sections/organization/components/userModal.js @@ -4,7 +4,7 @@ import { Spin, Card, Modal, TreeSelect, message } from 'antd'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; const UserModal = (props) => { - const { visible, modalType, depData, onVisibleChange, onConfirm, editData } = props + const { visible, modalType, depData, onVisibleChange, onConfirm, editData ,tableList} = props const reg_tel = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/; const onFinish = (values) => { if (onConfirm) { @@ -105,7 +105,35 @@ const UserModal = (props) => { /> - { + + }} + fieldProps={{ + fieldNames: { + label: 'title', + }, + treeDefaultExpandAll: false, + }} + rules={[{ required: true, message: '请选择结构物' }]} + request={async () => { + console.log(tableList); + const opts = tableList?.map(i=>({title:i.name,value:i.id})) + return opts + }} + expandedKeys={["title"]} + /> + { { type: 'email', message: '请输入正确格式的邮箱' }, ]} /> + + + {modalType == 'edit' ? null : { ]} />} + { const user = JSON.parse(sessionStorage.getItem('user')); - - const { dispatch, loading, depMessage, depUser, clientHeight } = props; + const [tableList, settableList] = useState([]) + const { dispatch, loading, depMessage, depUser, clientHeight,actions } = props; // 部门 const [deptModalVisible, setDeptModalVisible] = useState(false); const [deptModalType, setDeptModalType] = useState(); const [deptModalRecord, setDeptModalRecord] = useState(); - + const { projectRegime } = actions // 成员 const [modalVisible, setModalVisible] = useState(false); const [modalType, setModalType] = useState(); @@ -29,8 +29,20 @@ const UserManage = (props) => { useEffect(() => { dispatch(getDepMessage()) + projectList() }, []) + const projectList = (obj) => { + + dispatch(projectRegime.getProjectList()).then(res => { + // console.log(res) + if (res.success) { + settableList(res.payload.data?.rows) + // setLimits(res.payload.data?.count) + } + }) + } + useEffect(() => { if (depMessage.length) { setDepSelectedKeys([depMessage[0].id]) @@ -197,7 +209,7 @@ const UserManage = (props) => { } - +console.log(tableList,'tableList') return (
@@ -304,6 +316,7 @@ const UserManage = (props) => { modalType={modalType} onConfirm={onConfirm} editData={modalRecord} + tableList={tableList} /> : '' } @@ -325,7 +338,8 @@ function mapStateToProps(state) { clientHeight: global.clientHeight, loading: depMessage.isRequesting, depMessage: depMessage.data || [], - depUser: depUser.data || [] + depUser: depUser.data || [], + actions: global.actions }; }