diff --git a/src/api/login.js b/src/api/login.js index f3daeace4..3bb76e7a4 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -46,7 +46,7 @@ export function logout(token) { }); } -// 检查登录状态 +// 检查登录状态 WAIT,SCAN,SUCCESS,CANCEL,EXPIRE, export function checkLoginStatus(sessionId) { return new Promise((resolve, reject) => { request({ diff --git a/src/api/project.js b/src/api/project.js index 337853df6..ce0e79f5b 100644 --- a/src/api/project.js +++ b/src/api/project.js @@ -3,22 +3,22 @@ import request from '@/utils/request'; /** 新建项目设备*/ export function createDevice(data) { return request({ - url: `/api/project/device`, + url: `/api/device`, method: 'post', data: data }); } /** 项目设备编码是否已存在 */ -export function deviceIsExist(projectCode, code) { +export function deviceIsExist(code) { return request({ - url: `/api/project/device/exist/${projectCode}/${code}`, + url: `/api/device/exist/${code}`, method: 'get' }); } -/** 分页查询项目设备 */ +/** 分页查询项目设备n */ export function getProjectDeviceList(params) { return request({ - url: `/api/project/device/paging`, + url: `/api/device/paging`, method: 'get', params:params }); @@ -40,7 +40,7 @@ export function getDeviceDetail(id) { /** 添加/修改屏蔽门设备网关映射配置 */ export function setPsdConfig(id, data) { return request({ - url: `/api/project/device/${id}/config/psd`, + url: `/api/device/${id}/config/psd`, method: 'put', data: data }); @@ -48,7 +48,7 @@ export function setPsdConfig(id, data) { /** 添加/修改信号机设备网关映射配置 */ export function setSignalConfig(id, data) { return request({ - url: `/api/project/device/${id}/config/signal`, + url: `/api/device/${id}/config/signal`, method: 'put', data: data }); @@ -56,7 +56,7 @@ export function setSignalConfig(id, data) { /** 添加/修改信号机设备网关映射配置 */ export function setSwitchConfig(id, data) { return request({ - url: `/api/project/device/${id}/config/switch`, + url: `/api/device/${id}/config/switch`, method: 'put', data: data }); @@ -69,3 +69,26 @@ export function getAllDeviceInProject(params) { params }); } +/** 添加/修改ibp设备配置 */ +export function setIbpConfig(id, data) { + return request({ + url: `/api/device/${id}/config/ibp`, + method: 'put', + data: data + }); +} +/** 添加/修改现地工作站配置 */ +export function setLwConfig(id, data) { + return request({ + url: `/api/device/${id}/config/lw`, + method: 'put', + data: data + }); +} +/** 查询所有的某类型设备 */ +export function getDevicesByType(type) { + return request({ + url: `/api/device/${type}/all`, + method: 'get' + }); +} diff --git a/src/layout/components/userInfo.vue b/src/layout/components/userInfo.vue index e3fa06ec0..379d82b0a 100644 --- a/src/layout/components/userInfo.vue +++ b/src/layout/components/userInfo.vue @@ -254,8 +254,7 @@
绑定微信成功
- -
+
绑定微信:
生成微信二维码 diff --git a/src/permission.js b/src/permission.js index 1a025ad91..552e0ff60 100644 --- a/src/permission.js +++ b/src/permission.js @@ -42,7 +42,8 @@ function getRouteInfo(to) { } if (isDesignPage(toRoutePath)) { - loginPath = loginDesignPage; + const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; + loginPath = whitePage || loginDesignPage; if (current_session && !current_session.startsWith('design')) { removeToken(); } diff --git a/src/router/index_Common.js b/src/router/index_Common.js index bcaab712c..6181233e7 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -42,7 +42,6 @@ const News = () => import('@/views/system/news/index'); const CommandDictionary = () => import('@/views/system/commandDictionary/index'); const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit'); const configLine = () => import('@/views/system/configLine/index'); -// const Mapedit = () => import('@/views/mapdraft/index'); const IscsSystem = () => import('@/views/iscs/iscsSystem/index'); const IscsDraw = () => import('@/views/iscs/iscsDraw/index'); @@ -780,14 +779,14 @@ export const asyncRouter = [ meta: { i18n: 'router.configLine' } - }, - { - path: 'deviceManage', - component: DeviceManage, - meta: { - i18n: 'router.deviceManage' - } } + // { + // path: 'deviceManage', + // component: DeviceManage, + // meta: { + // i18n: 'router.deviceManage' + // } + // } ] }, { // 发布申请 @@ -982,7 +981,7 @@ export const asyncRouter = [ ] } ]; - +/* merge 是否再路由处理中与asyncRouter进行合并 mergeIndex合并进入asyncRouter【mergeIndex】 慎重调整asyncRouter顺序 */ export const projectRoute = { designgzb: [ { @@ -1004,6 +1003,46 @@ export const projectRoute = { } } ] + }, + { // 系统管理 + path: '/system', + component: Layout, + merge: true, + mergeIndex: 4, + meta: { + i18n: 'router.systemManage', + roles: [admin] + }, + children: [ + { + path: 'deviceManage', + component: DeviceManage, + meta: { + i18n: 'router.deviceManage' + } + } + ] + } + ], + designxty: [ + { // 系统管理 + path: '/system', + component: Layout, + merge: true, + mergeIndex: 4, + meta: { + i18n: 'router.systemManage', + roles: [admin] + }, + children: [ + { + path: 'deviceManage', + component: DeviceManage, + meta: { + i18n: 'router.deviceManage' + } + } + ] } ] }; diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 888634f42..1564245c2 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -40,9 +40,27 @@ function resetAsyncRouter({ systemType }) { } else if (systemType == projectXian) { list = [...list, ...asyncRouter]; } else if (systemType == projectXty) { + if (projectRoute.designxty && projectRoute.designxty.length) { + projectRoute.designxty.forEach(item => { + if (item.merge) { + asyncRouter[item.mergeIndex].children = [...asyncRouter[item.mergeIndex].children, ...item.children]; + } else { + list.push(item); + } + }); + } list = [...list, ...asyncRouter]; } else if (systemType == projectGzzb) { - list = [...list, ...asyncRouter, ...projectRoute.designgzb]; + if (projectRoute.designgzb && projectRoute.designgzb.length) { + projectRoute.designgzb.forEach(item => { + if (item.merge) { + asyncRouter[item.mergeIndex].children = [...asyncRouter[item.mergeIndex].children, ...item.children]; + } else { + list.push(item); + } + }); + } + list = [...list, ...asyncRouter]; } else if (systemType == projectJsxt) { list = [...list, ...JSXT]; } else if (systemType == projectJyd) { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index b7035e491..56d232123 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -151,7 +151,6 @@ export default { loadingCode: false, checkLogin: null, checkTimeout: null, - scanSuccess: false, pwdDisplay: true, cookiesName: 'UserName', cookiesToken: 'UserToken', @@ -251,11 +250,11 @@ export default { this.sessionId = response.data.sessionId; this.loginUrl = response.data.url; this.loadingCode = false; - this.clearTimer(this.checkTimeout); - this.checkTimeout = setTimeout(() => { - this.loadingCode = true; - this.loginUrl = ''; - }, 3 * 60 * 1000); + // this.clearTimer(this.checkTimeout); + // this.checkTimeout = setTimeout(() => { + // this.loadingCode = true; + // this.loginUrl = ''; + // }, 3 * 60 * 1000); this.checkLoginStatus(); }).catch(() => { this.loadingCode = false; @@ -281,10 +280,12 @@ export default { this.handleLoginSucessRoute(); }); }).catch(error => { - if (error.data && error.data.status === 'WAIT') { - self.scanSuccess = true; + if (error.data && error.data.status === 'EXPIRE') { + this.loadingCode = true; + this.loginUrl = ''; + } else { + self.checkLoginStatus(); } - self.checkLoginStatus(); }); }, 3000); }, diff --git a/src/views/mapdraft/configMap.vue b/src/views/mapdraft/configMap.vue deleted file mode 100644 index 739ed64ff..000000000 --- a/src/views/mapdraft/configMap.vue +++ /dev/null @@ -1,233 +0,0 @@ - - - - - diff --git a/src/views/mapdraft/dataRelation/automaticoperate/detail.vue b/src/views/mapdraft/dataRelation/automaticoperate/detail.vue deleted file mode 100644 index 69c86bd14..000000000 --- a/src/views/mapdraft/dataRelation/automaticoperate/detail.vue +++ /dev/null @@ -1,189 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/automaticoperate/index.vue b/src/views/mapdraft/dataRelation/automaticoperate/index.vue deleted file mode 100644 index f34b6496f..000000000 --- a/src/views/mapdraft/dataRelation/automaticoperate/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - diff --git a/src/views/mapdraft/dataRelation/automaticoperate/route.vue b/src/views/mapdraft/dataRelation/automaticoperate/route.vue deleted file mode 100644 index ed6fcfee0..000000000 --- a/src/views/mapdraft/dataRelation/automaticoperate/route.vue +++ /dev/null @@ -1,237 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/espOperate/index.vue b/src/views/mapdraft/dataRelation/espOperate/index.vue deleted file mode 100644 index fd4b5353f..000000000 --- a/src/views/mapdraft/dataRelation/espOperate/index.vue +++ /dev/null @@ -1,154 +0,0 @@ - - diff --git a/src/views/mapdraft/dataRelation/index.vue b/src/views/mapdraft/dataRelation/index.vue deleted file mode 100644 index bae9e2fb3..000000000 --- a/src/views/mapdraft/dataRelation/index.vue +++ /dev/null @@ -1,252 +0,0 @@ - - - - diff --git a/src/views/mapdraft/dataRelation/pathoperate/detail.vue b/src/views/mapdraft/dataRelation/pathoperate/detail.vue deleted file mode 100644 index 3861174e8..000000000 --- a/src/views/mapdraft/dataRelation/pathoperate/detail.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/pathoperate/index.vue b/src/views/mapdraft/dataRelation/pathoperate/index.vue deleted file mode 100644 index 191c9df12..000000000 --- a/src/views/mapdraft/dataRelation/pathoperate/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - diff --git a/src/views/mapdraft/dataRelation/pathoperate/pathRoute.vue b/src/views/mapdraft/dataRelation/pathoperate/pathRoute.vue deleted file mode 100644 index 25ae9d74a..000000000 --- a/src/views/mapdraft/dataRelation/pathoperate/pathRoute.vue +++ /dev/null @@ -1,200 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/pathoperate/route.vue b/src/views/mapdraft/dataRelation/pathoperate/route.vue deleted file mode 100644 index feaecfac7..000000000 --- a/src/views/mapdraft/dataRelation/pathoperate/route.vue +++ /dev/null @@ -1,293 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/psdOperate/index.vue b/src/views/mapdraft/dataRelation/psdOperate/index.vue deleted file mode 100644 index b71ca8f56..000000000 --- a/src/views/mapdraft/dataRelation/psdOperate/index.vue +++ /dev/null @@ -1,154 +0,0 @@ - - diff --git a/src/views/mapdraft/dataRelation/routeoperate/detail.vue b/src/views/mapdraft/dataRelation/routeoperate/detail.vue deleted file mode 100644 index 68ecf6fd0..000000000 --- a/src/views/mapdraft/dataRelation/routeoperate/detail.vue +++ /dev/null @@ -1,446 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/routeoperate/index.vue b/src/views/mapdraft/dataRelation/routeoperate/index.vue deleted file mode 100644 index 33ace43fb..000000000 --- a/src/views/mapdraft/dataRelation/routeoperate/index.vue +++ /dev/null @@ -1,85 +0,0 @@ - - diff --git a/src/views/mapdraft/dataRelation/routeoperate/preview.vue b/src/views/mapdraft/dataRelation/routeoperate/preview.vue deleted file mode 100644 index 09b2554ee..000000000 --- a/src/views/mapdraft/dataRelation/routeoperate/preview.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/routeoperate/related.vue b/src/views/mapdraft/dataRelation/routeoperate/related.vue deleted file mode 100644 index efd8c828d..000000000 --- a/src/views/mapdraft/dataRelation/routeoperate/related.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/routeoperate/route.vue b/src/views/mapdraft/dataRelation/routeoperate/route.vue deleted file mode 100644 index 1ef7cc5bc..000000000 --- a/src/views/mapdraft/dataRelation/routeoperate/route.vue +++ /dev/null @@ -1,541 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/routingoperate/detail.vue b/src/views/mapdraft/dataRelation/routingoperate/detail.vue deleted file mode 100644 index 93f36fbfa..000000000 --- a/src/views/mapdraft/dataRelation/routingoperate/detail.vue +++ /dev/null @@ -1,251 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/routingoperate/index.vue b/src/views/mapdraft/dataRelation/routingoperate/index.vue deleted file mode 100644 index 888de5cee..000000000 --- a/src/views/mapdraft/dataRelation/routingoperate/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - diff --git a/src/views/mapdraft/dataRelation/routingoperate/preview.vue b/src/views/mapdraft/dataRelation/routingoperate/preview.vue deleted file mode 100644 index 2392047b5..000000000 --- a/src/views/mapdraft/dataRelation/routingoperate/preview.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/routingoperate/route.vue b/src/views/mapdraft/dataRelation/routingoperate/route.vue deleted file mode 100644 index a7bdcd243..000000000 --- a/src/views/mapdraft/dataRelation/routingoperate/route.vue +++ /dev/null @@ -1,377 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/signaloperate/detail.vue b/src/views/mapdraft/dataRelation/signaloperate/detail.vue deleted file mode 100644 index e61a029c1..000000000 --- a/src/views/mapdraft/dataRelation/signaloperate/detail.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - diff --git a/src/views/mapdraft/dataRelation/signaloperate/index.vue b/src/views/mapdraft/dataRelation/signaloperate/index.vue deleted file mode 100644 index eb4fb632b..000000000 --- a/src/views/mapdraft/dataRelation/signaloperate/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - diff --git a/src/views/mapdraft/dataRelation/signaloperate/route.vue b/src/views/mapdraft/dataRelation/signaloperate/route.vue deleted file mode 100644 index ffbc56bf6..000000000 --- a/src/views/mapdraft/dataRelation/signaloperate/route.vue +++ /dev/null @@ -1,207 +0,0 @@ - - - diff --git a/src/views/mapdraft/index.vue b/src/views/mapdraft/index.vue deleted file mode 100644 index d1e642c5c..000000000 --- a/src/views/mapdraft/index.vue +++ /dev/null @@ -1,427 +0,0 @@ - - - diff --git a/src/views/mapdraft/mapoperate/ImageControl.vue b/src/views/mapdraft/mapoperate/ImageControl.vue deleted file mode 100644 index 2552c1afc..000000000 --- a/src/views/mapdraft/mapoperate/ImageControl.vue +++ /dev/null @@ -1,276 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/buttonDraft.vue b/src/views/mapdraft/mapoperate/buttonDraft.vue deleted file mode 100644 index 8a4c6b97d..000000000 --- a/src/views/mapdraft/mapoperate/buttonDraft.vue +++ /dev/null @@ -1,285 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/checkboxDraft.vue b/src/views/mapdraft/mapoperate/checkboxDraft.vue deleted file mode 100644 index 828ad259c..000000000 --- a/src/views/mapdraft/mapoperate/checkboxDraft.vue +++ /dev/null @@ -1,197 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/config/data.vue b/src/views/mapdraft/mapoperate/config/data.vue deleted file mode 100644 index 36e6e02ce..000000000 --- a/src/views/mapdraft/mapoperate/config/data.vue +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - diff --git a/src/views/mapdraft/mapoperate/config/list.vue b/src/views/mapdraft/mapoperate/config/list.vue deleted file mode 100644 index 4f5c3faa3..000000000 --- a/src/views/mapdraft/mapoperate/config/list.vue +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - diff --git a/src/views/mapdraft/mapoperate/counter.vue b/src/views/mapdraft/mapoperate/counter.vue deleted file mode 100644 index fe9f4760c..000000000 --- a/src/views/mapdraft/mapoperate/counter.vue +++ /dev/null @@ -1,255 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/delayunlock.vue b/src/views/mapdraft/mapoperate/delayunlock.vue deleted file mode 100644 index 3f50a5633..000000000 --- a/src/views/mapdraft/mapoperate/delayunlock.vue +++ /dev/null @@ -1,237 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/index.vue b/src/views/mapdraft/mapoperate/index.vue deleted file mode 100644 index 171e6b2cb..000000000 --- a/src/views/mapdraft/mapoperate/index.vue +++ /dev/null @@ -1,453 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/lcControl.vue b/src/views/mapdraft/mapoperate/lcControl.vue deleted file mode 100644 index 85ab25e8c..000000000 --- a/src/views/mapdraft/mapoperate/lcControl.vue +++ /dev/null @@ -1,255 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/limitControl.vue b/src/views/mapdraft/mapoperate/limitControl.vue deleted file mode 100644 index ca371e788..000000000 --- a/src/views/mapdraft/mapoperate/limitControl.vue +++ /dev/null @@ -1,246 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/line.vue b/src/views/mapdraft/mapoperate/line.vue deleted file mode 100644 index ea5127960..000000000 --- a/src/views/mapdraft/mapoperate/line.vue +++ /dev/null @@ -1,310 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/link.vue b/src/views/mapdraft/mapoperate/link.vue deleted file mode 100644 index 4eda10514..000000000 --- a/src/views/mapdraft/mapoperate/link.vue +++ /dev/null @@ -1,551 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/section.vue b/src/views/mapdraft/mapoperate/section.vue deleted file mode 100644 index b1f2ad1bb..000000000 --- a/src/views/mapdraft/mapoperate/section.vue +++ /dev/null @@ -1,1238 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/signal.vue b/src/views/mapdraft/mapoperate/signal.vue deleted file mode 100644 index 02565de38..000000000 --- a/src/views/mapdraft/mapoperate/signal.vue +++ /dev/null @@ -1,445 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/station.vue b/src/views/mapdraft/mapoperate/station.vue deleted file mode 100644 index 94e462aec..000000000 --- a/src/views/mapdraft/mapoperate/station.vue +++ /dev/null @@ -1,284 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/stationcontrol.vue b/src/views/mapdraft/mapoperate/stationcontrol.vue deleted file mode 100644 index a074e67ec..000000000 --- a/src/views/mapdraft/mapoperate/stationcontrol.vue +++ /dev/null @@ -1,254 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/stationstand.vue b/src/views/mapdraft/mapoperate/stationstand.vue deleted file mode 100644 index 93d71d1bc..000000000 --- a/src/views/mapdraft/mapoperate/stationstand.vue +++ /dev/null @@ -1,308 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/switch.vue b/src/views/mapdraft/mapoperate/switch.vue deleted file mode 100644 index 4e764d272..000000000 --- a/src/views/mapdraft/mapoperate/switch.vue +++ /dev/null @@ -1,513 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/text.vue b/src/views/mapdraft/mapoperate/text.vue deleted file mode 100644 index 136a37d7c..000000000 --- a/src/views/mapdraft/mapoperate/text.vue +++ /dev/null @@ -1,272 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/train/create.vue b/src/views/mapdraft/mapoperate/train/create.vue deleted file mode 100644 index 249208f8b..000000000 --- a/src/views/mapdraft/mapoperate/train/create.vue +++ /dev/null @@ -1,153 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/train/index.vue b/src/views/mapdraft/mapoperate/train/index.vue deleted file mode 100644 index 4e9f34139..000000000 --- a/src/views/mapdraft/mapoperate/train/index.vue +++ /dev/null @@ -1,216 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/train/trainmodel.vue b/src/views/mapdraft/mapoperate/train/trainmodel.vue deleted file mode 100644 index 802171bd8..000000000 --- a/src/views/mapdraft/mapoperate/train/trainmodel.vue +++ /dev/null @@ -1,199 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/trainwindow.vue b/src/views/mapdraft/mapoperate/trainwindow.vue deleted file mode 100644 index 76072f9a7..000000000 --- a/src/views/mapdraft/mapoperate/trainwindow.vue +++ /dev/null @@ -1,309 +0,0 @@ - - - - diff --git a/src/views/mapdraft/mapoperate/zcControl.vue b/src/views/mapdraft/mapoperate/zcControl.vue deleted file mode 100644 index ba87a30cb..000000000 --- a/src/views/mapdraft/mapoperate/zcControl.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - - diff --git a/src/views/system/deviceManage/add.vue b/src/views/system/deviceManage/add.vue index e2612372a..0a4711e85 100644 --- a/src/views/system/deviceManage/add.vue +++ b/src/views/system/deviceManage/add.vue @@ -13,10 +13,10 @@ import { createDevice, deviceIsExist} from '@/api/project'; export default { name: 'DeviceAdd', props: { - // type: { - // type: String, - // required: true - // } + projectCode: { + type: String, + required: true + } }, data() { return { @@ -29,7 +29,13 @@ export default { LessonList: [], UserList: [], UserLoading: false, - deviceTypeList:[{label: '道岔', value: 'SWITCH'}, {label: '信号机', value:'SIGNAL'}, {label: '屏蔽门', value: 'PSD'}], + deviceTypeList:[ + {label: '道岔', value: 'SWITCH'}, + {label: '信号机', value:'SIGNAL'}, + {label: '屏蔽门', value: 'PSD'}, + {label: 'IBP盘', value: 'IBP'}, + {label: '车站', value: 'LW'} + ], projectList: [{label:'西铁院', value: 'XTY'}, {label: '贵州装备', value:'GZB'}], gatewayList: [] }; @@ -41,7 +47,7 @@ export default { items: [ { prop: 'code', label: this.$t('system.deviceCode'), type: 'text', required: true, placeholder: this.$t('rules.enterDeviceCode') }, { prop: 'type', label: this.$t('system.deviceType1'), type: 'select', required: true, options: this.deviceTypeList, placeholder: this.$t('rules.selectDeviceType') }, - { prop: 'projectCode', label: this.$t('system.belongProject'), type: 'select', required: true, options: this.projectList, placeholder: this.$t('rules.selectBelongProject')} + { prop: 'projectCode', label: this.$t('system.belongProject'), type: 'select', required: true, options: this.projectList, placeholder: this.$t('rules.selectBelongProject'), disabled: true} ] }; return form; @@ -69,6 +75,7 @@ export default { methods: { show(data) { this.dialogVisible = true; + this.formModel.projectCode = this.projectCode; }, doSave() { const self = this; @@ -78,7 +85,7 @@ export default { type: this.formModel.type, projectCode: this.formModel.projectCode }; - deviceIsExist(params.projectCode, params.code).then(response => { + deviceIsExist(params.code).then(response => { if (!response.data) { createDevice(params).then(response => { self.$message.success(this.$t('tip.createProjectDeviceSuccessfully')); @@ -88,7 +95,7 @@ export default { self.$message.error(this.$t('error.addFailed') + error.message); }); } else { - self.$message.error(this.$t('tip.deviceCodeTip')); + self.$message.error('项目设备编号已存在!'); } }); diff --git a/src/views/system/deviceManage/editConfig.vue b/src/views/system/deviceManage/editConfig.vue index afdd0f5b2..54339c123 100644 --- a/src/views/system/deviceManage/editConfig.vue +++ b/src/views/system/deviceManage/editConfig.vue @@ -1,28 +1,30 @@ diff --git a/src/views/system/deviceManage/index.vue b/src/views/system/deviceManage/index.vue index 34123d576..6af31b7d2 100644 --- a/src/views/system/deviceManage/index.vue +++ b/src/views/system/deviceManage/index.vue @@ -1,7 +1,8 @@ @@ -9,11 +10,14 @@