diff --git a/api/app/lib/models/user.js b/api/app/lib/models/user.js index 0e1c4c6..311f40a 100644 --- a/api/app/lib/models/user.js +++ b/api/app/lib/models/user.js @@ -96,21 +96,21 @@ module.exports = dc => { field: "post", autoIncrement: false }, - // structure: { - // type: DataTypes.STRING, - // allowNull: true, - // defaultValue: null, - // comment: "结构物", - // primaryKey: false, - // field: "structure", - // autoIncrement: false - // } + structure: { + type: DataTypes.JSON, + allowNull: true, + defaultValue: null, + comment: "结构物", + primaryKey: false, + field: "structure", + autoIncrement: false + } }, { tableName: "user", comment: "", indexes: [] }); - + dc.models.User = User; return User; }; \ 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 index ec5bd1c..9cc7023 100644 --- a/script/1.0.3/schema/7.update_user.sql +++ b/script/1.0.3/schema/7.update_user.sql @@ -1 +1 @@ -ALTER TABLE "user" ADD structure VARCHAR(40); \ No newline at end of file +ALTER TABLE "user" ADD structure jsonb; \ No newline at end of file diff --git a/weapp/app.json b/weapp/app.json index a9321fa..48ca4ea 100644 --- a/weapp/app.json +++ b/weapp/app.json @@ -14,7 +14,8 @@ "basic/basic", "startInspection/startInspection", "inspectionInput/inspectionInput", - "troubleshooting/index" + "troubleshooting/index", + "troubleshooting/shootingForm/index" ] } ], diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index 1219045..ffa2bbb 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -12,7 +12,9 @@ Page({ structResult: ['a', 'b'], pointList: ['a', 'b', 'c'], pointResult: ['a', 'b'], - + // 时间筛选 + startTime: '', + endTime: '' }, // 顶部tab切换 @@ -58,6 +60,30 @@ Page({ }, noop () { }, + // 时间选择 + onStartTimeChange (event) { + this.setData({ + startTime: event.detail, + }); + }, + onEndTimeChange (event) { + this.setData({ + endTime: event.detail, + }); + }, + + search () { + console.log(this.data); + }, + + // 页面跳转 + toShootingForm (e) { + console.log(e); + const { shootingid } = e.currentTarget.dataset + wx.navigateTo({ + url: '/package/troubleshooting/shootingForm/index?shootingid=' + shootingid, + }) + }, /** * 生命周期函数--监听页面加载 diff --git a/weapp/package/troubleshooting/index.wxml b/weapp/package/troubleshooting/index.wxml index 0734315..45c5093 100644 --- a/weapp/package/troubleshooting/index.wxml +++ b/weapp/package/troubleshooting/index.wxml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,9 +33,11 @@ - - - + + + + + @@ -44,7 +46,9 @@ asd - 按钮 + + 按钮 + diff --git a/weapp/package/troubleshooting/index.wxss b/weapp/package/troubleshooting/index.wxss index be72845..33f25ba 100644 --- a/weapp/package/troubleshooting/index.wxss +++ b/weapp/package/troubleshooting/index.wxss @@ -54,4 +54,8 @@ .value-class { flex: none !important; +} + +.time-option .van-picker{ + width: 45vw; } \ No newline at end of file diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js new file mode 100644 index 0000000..dd490de --- /dev/null +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -0,0 +1,109 @@ +// package/troubleshooting/shootingForm/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + shootingid: '', + maintenancePersonId: null, + maintenanceRequirement: '', + planStartTimePopupShow: false, + planStartTime: '', + planEndTimePopupShow: false, + planEndTime: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + const { shootingid } = options + if (shootingid) { + this.setData({ + shootingid + }) + } else { + + } + }, + + onMaintenancePersonPopupChange (e) { + this.setData({ + multiIndex: e.detail.value + }) + }, + + showPlanStartTimePopup () { + this.setData({ planStartTimePopupShow: true }) + }, + + closePlanStartTimePopup () { + this.setData({ planStartTimePopupShow: false }) + }, + + onPlanStartTimeChange (event) { + this.setData({ planStartTime: event.detail, }) + }, + + showPlanEndTimePopup () { + this.setData({ planEndTimePopupShow: true }) + }, + + closePlanEndTimePopup () { + this.setData({ planEndTimePopupShow: false }) + }, + + onPlanEndTimeChange (event) { + this.setData({ planEndTime: event.detail, }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage () { + + } +}) \ No newline at end of file diff --git a/weapp/package/troubleshooting/shootingForm/index.json b/weapp/package/troubleshooting/shootingForm/index.json new file mode 100644 index 0000000..31ef396 --- /dev/null +++ b/weapp/package/troubleshooting/shootingForm/index.json @@ -0,0 +1,12 @@ +{ + "usingComponents": { + "van-button": "@vant/weapp/button/index", + "van-field": "@vant/weapp/field/index", + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index", + "van-picker": "@vant/weapp/picker/index", + "van-popup": "@vant/weapp/popup/index", + "van-icon": "@vant/weapp/icon/index", + "van-datetime-picker": "@vant/weapp/datetime-picker/index" + } +} \ No newline at end of file diff --git a/weapp/package/troubleshooting/shootingForm/index.wxml b/weapp/package/troubleshooting/shootingForm/index.wxml new file mode 100644 index 0000000..aaaa05d --- /dev/null +++ b/weapp/package/troubleshooting/shootingForm/index.wxml @@ -0,0 +1,78 @@ + + + + 巡检信息 + + + + + + + 问题详情 + + + + + + + + 现场照片 + + 123 + + + + + + 维修计划信息 + + + + 维修人 + + + 当前选择 + + + + + + + + + 质检人 + + + 当前选择 + + + + + + + + 计划开始时间 + + 当前选择 + + + + + + + + + + 计划结束时间 + + 当前选择 + + + + + + + + + + \ No newline at end of file diff --git a/weapp/package/troubleshooting/shootingForm/index.wxss b/weapp/package/troubleshooting/shootingForm/index.wxss new file mode 100644 index 0000000..d523d05 --- /dev/null +++ b/weapp/package/troubleshooting/shootingForm/index.wxss @@ -0,0 +1,26 @@ +/* package/troubleshooting/shootingForm/index.wxss */ + +.mission-card-title { + background-color: #fff; + overflow: auto; + padding: 24rpx 16px; + display: flex; + justify-content: space-between; + align-items: center +} + +.mission-center-card-title { + padding-top: 64rpx; +} + +.fs-cell-title { + max-width: 6.2em; + min-width: 6.2em; + margin-right: 12px; + text-align: left; + color: var(--field-label-color, #646566) +} + +.fs-cell-content { + color: var(--field-input-text-color, #323233) +} \ No newline at end of file diff --git a/weapp/project.private.config.json b/weapp/project.private.config.json index b16d2d1..7aeb8b7 100644 --- a/weapp/project.private.config.json +++ b/weapp/project.private.config.json @@ -14,6 +14,13 @@ "query": "", "launchMode": "default", "scene": null + }, + { + "name": "事件处理详情", + "pathName": "package/troubleshooting/shootingForm/index", + "query": "shootingid=5", + "launchMode": "default", + "scene": null } ] } diff --git a/web/client/src/sections/organization/components/userModal.js b/web/client/src/sections/organization/components/userModal.js index 4988b85..1feddd6 100644 --- a/web/client/src/sections/organization/components/userModal.js +++ b/web/client/src/sections/organization/components/userModal.js @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { Spin, Card, Modal, TreeSelect, message } from 'antd'; -import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; +import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect ,ProFormSelect} from '@ant-design/pro-form'; const UserModal = (props) => { const { visible, modalType, depData, onVisibleChange, onConfirm, editData ,tableList} = props @@ -105,10 +105,11 @@ const UserModal = (props) => { /> - { }} fieldProps={{ + mode: 'multiple', fieldNames: { label: 'title', }, @@ -132,7 +134,24 @@ const UserModal = (props) => { return opts }} expandedKeys={["title"]} - /> + /> */} + handleChange(val), + // }} + request={async () => { + console.log(tableList); + const opts = tableList?.map(i=>({label:i.name,value:i.id})) + return opts + }} + placeholder="请选择结构物" + rules={[{ required: true, message: '结构物不能为空' }]} + /> + : '' diff --git a/web/client/src/sections/organization/nav-item.js b/web/client/src/sections/organization/nav-item.js index 6b25267..fdb9d75 100644 --- a/web/client/src/sections/organization/nav-item.js +++ b/web/client/src/sections/organization/nav-item.js @@ -2,7 +2,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { Menu } from 'antd'; import { SettingOutlined } from '@ant-design/icons'; - +import { Func } from '$utils'; const SubMenu = Menu.SubMenu; export function getNavItem(user, dispatch) { @@ -10,13 +10,13 @@ export function getNavItem(user, dispatch) { // return null // } return ( - } title={'组织管理'}> - + Func.isAuthorized('ORG_MANAGE') && } title={'组织管理'}> + {Func.isAuthorized('USER_CONFIG') && 部门成员 - - + } + {Func.isAuthorized('AUTH_CONFIG') && 权限配置 - + } ); } \ No newline at end of file diff --git a/web/client/src/sections/patrolManage/nav-item.js b/web/client/src/sections/patrolManage/nav-item.js index 62639a8..7b75be9 100644 --- a/web/client/src/sections/patrolManage/nav-item.js +++ b/web/client/src/sections/patrolManage/nav-item.js @@ -2,7 +2,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { Menu } from 'antd'; import { SettingOutlined } from '@ant-design/icons'; - +import { Func } from '$utils'; const SubMenu = Menu.SubMenu; export function getNavItem (user, dispatch) { @@ -10,19 +10,19 @@ export function getNavItem (user, dispatch) { // return null // } return ( - } title={'巡检管理'}> - + Func.isAuthorized('PATROL_MANAGE') && } title={'巡检管理'}> + {Func.isAuthorized('PATROL_PLAN_CONFIG') && 巡检计划制定 - - + } + {Func.isAuthorized('PATROL_RECORD_VIEW') && 巡检记录 - - + } + {Func.isAuthorized('CHECKITEMSET') && 检查项设定 - - + } + {Func.isAuthorized('CHECKMOULD') && 巡检模板 - + } ); } \ No newline at end of file diff --git a/web/client/src/sections/projectRegime/nav-item.js b/web/client/src/sections/projectRegime/nav-item.js index 72ac1b4..cd3973c 100644 --- a/web/client/src/sections/projectRegime/nav-item.js +++ b/web/client/src/sections/projectRegime/nav-item.js @@ -2,17 +2,17 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { Menu } from 'antd'; import { SettingOutlined } from '@ant-design/icons'; - +import { Func } from '$utils'; const SubMenu = Menu.SubMenu; export function getNavItem (user, dispatch) { - return } title={'结构物管理'}> - + return Func.isAuthorized('STRUCTURE_MANAGE') && } title={'结构物管理'}> + {Func.isAuthorized('STRU_INFO_CONFIG') && 结构物基础信息管理 - - + } + {Func.isAuthorized('QR_CODE_CONFIG') && 二维码管理 - + } } \ No newline at end of file diff --git a/web/client/src/utils/func.js b/web/client/src/utils/func.js index e473145..bbfb815 100644 --- a/web/client/src/utils/func.js +++ b/web/client/src/utils/func.js @@ -3,8 +3,8 @@ export default class Func { static isAuthorized(authcode) { if (JSON.parse(sessionStorage.getItem('user'))) { - const { resources } = JSON.parse(sessionStorage.getItem('user')); - return resources.includes(authcode); + const { userResources } = JSON.parse(sessionStorage.getItem('user')); + return userResources.includes(authcode); }else{ return false; }