From 8e7b653bd3fcd191cfde90fa2715608a6cb4969c Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 1 Mar 2023 15:51:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/deviceManage/editConfigGateway.vue | 148 ++++++------------ 1 file changed, 44 insertions(+), 104 deletions(-) diff --git a/src/views/system/deviceManage/editConfigGateway.vue b/src/views/system/deviceManage/editConfigGateway.vue index 4d473326d..7686e6590 100644 --- a/src/views/system/deviceManage/editConfigGateway.vue +++ b/src/views/system/deviceManage/editConfigGateway.vue @@ -43,29 +43,6 @@ - - - - - - - - - - - - - {{ $t('global.confirm') }} {{ $t('global.cancel') }} @@ -77,9 +54,8 @@ import { setDeviceConfig, getDeviceDetail } from '@/api/project'; import ConstConfig from '@/scripts/ConstConfig'; // getAllMapOnline, getStationListNeedAttendant, getPsdListByStandCode, getStandListByStationCode -import {querySimulationMemberByMapId, querySimulationStationsByMapId } from '@/api/jmap/map'; -import { getBackProjectConfigByCode } from '@/api/projectConfig'; -import { getMapFunctioById } from '@/api/trainingPlatform'; +// import {querySimulationMemberByMapId, querySimulationStationsByMapId } from '@/api/jmap/map'; +// import { getMapFunctioById } from '@/api/trainingPlatform'; export default { name: 'EditConfigGateway', @@ -95,10 +71,6 @@ export default { // setDeviceConfigFunction: null, clientList: ConstConfig.ConstSelect.clientList, data: {}, - formPis:{ - roleCode:'', - client:'' - }, titleMap: { SWITCH: '道岔', PSD:'屏蔽门', @@ -119,15 +91,7 @@ export default { // standList: [], // standCode: '', // psdList: [], - jsonConfig: '', - rulesPis: { - roleCode: [ - { required: true, message: '请选择关联角色', trigger: 'change'} - ], - client: [ - { required: true, message: '请选择关联客户端', trigger: 'change'} - ] - } + jsonConfig: '' }; }, computed: { @@ -146,30 +110,12 @@ export default { initData(row) { this.jsonConfig = '{}'; getDeviceDetail(row.id).then(resp => { - this.formPis = {roleCode:'', client:''}; if (resp.data.config) { // this.formModel = JSON.parse(resp.data.config); - const config = JSON.parse(resp.data.config); - const jsonConfig = Object.assign({}, config); - delete jsonConfig.roleCode; - delete jsonConfig.client; - this.jsonConfig = JSON.stringify(jsonConfig, null, 4); - if (['PIS_STAND', 'PIS_TRAIN'].includes(row.type)) { - getBackProjectConfigByCode(row.project).then(res=>{ - const data = res.data; - this.dialogVisible = true; - this.roleList = []; - if (config.roleCode) { this.formPis.roleCode = config.roleCode; } - if (config.client) { this.formPis.client = config.client; } - if (data.functionId) { - if (data.mapId) { this.mapIdChange(data.mapId, data.functionId); } - } else { - this.$message.error('请先配置项目信息'); - } - }); - } + this.jsonConfig = JSON.stringify(JSON.parse(resp.data.config), null, 4); } }).catch((e)=> { + console.error(e, '======'); this.$message.error('获取项目设备详情失败!'); }); // if (row.type === 'PSL' || row.type === 'PSC') { @@ -193,13 +139,7 @@ export default { }, doSave() { const self = this; - let flag = true; - if (this.$refs.formPis) { - this.$refs.formPis.validate((valid) => { - flag = valid; - this.jsonConfig = JSON.stringify(Object.assign(JSON.parse(this.jsonConfig), this.formPis)); - }); - } + const flag = true; // const form = JSON.parse(this.jsonConfig); // if (this.data.type === 'PSC' || this.data.type === 'PSL') { // form.psdCode = this.formModel.psdCode; @@ -234,44 +174,44 @@ export default { this.dialogVisible = false; this.$refs.form && this.$refs.form.resetFields(); }, - mapIdChange(mapId, functionId) { - if (mapId) { - querySimulationStationsByMapId(mapId).then(resp => { - if (resp.data && resp.data.length) { - this.stationList = resp.data; - } - }).catch(() => { - this.$message.error('获取车站列表失败'); - }); - querySimulationMemberByMapId(mapId).then(resp => { - if (resp.data) { - getMapFunctioById(functionId).then(response=>{ - if (resp.data) { - const roleList = resp.data[response.data.simType]; - const covertRoleList = []; - roleList.forEach(member => { - const data = this.handleMember(member, this.stationList); - covertRoleList.push(data); - }); - this.roleList = covertRoleList; - } - }); - } - }).catch(() => { - this.$message.error('获取角色列表失败'); - }); - } - // this.stationList = []; - // if (mapId) { - // getStationListNeedAttendant(mapId).then(resp => { - // if (resp.data && resp.data.length) { - // this.stationList = resp.data; - // } - // }).catch(() => { - // this.$message.error('获取车站列表失败'); - // }); - // } - }, + // mapIdChange(mapId, functionId) { + // if (mapId) { + // querySimulationStationsByMapId(mapId).then(resp => { + // if (resp.data && resp.data.length) { + // this.stationList = resp.data; + // } + // }).catch(() => { + // this.$message.error('获取车站列表失败'); + // }); + // querySimulationMemberByMapId(mapId).then(resp => { + // if (resp.data) { + // getMapFunctioById(functionId).then(response=>{ + // if (resp.data) { + // const roleList = resp.data[response.data.simType]; + // const covertRoleList = []; + // roleList.forEach(member => { + // const data = this.handleMember(member, this.stationList); + // covertRoleList.push(data); + // }); + // this.roleList = covertRoleList; + // } + // }); + // } + // }).catch(() => { + // this.$message.error('获取角色列表失败'); + // }); + // } + // // this.stationList = []; + // // if (mapId) { + // // getStationListNeedAttendant(mapId).then(resp => { + // // if (resp.data && resp.data.length) { + // // this.stationList = resp.data; + // // } + // // }).catch(() => { + // // this.$message.error('获取车站列表失败'); + // // }); + // // } + // }, // stationCodeChange(stationCode) { // this.standList = []; // if (stationCode) {