From cc1a9817ab4b20d9ea0db0184ca99028fcba1349 Mon Sep 17 00:00:00 2001 From: fan Date: Fri, 21 Jul 2023 09:43:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E6=80=BB=E6=8C=87=E7=A4=BA=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datie_02/menus/menuDialog/viewName.vue | 87 +++++++++---------- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/src/jmapNew/theme/datie_02/menus/menuDialog/viewName.vue b/src/jmapNew/theme/datie_02/menus/menuDialog/viewName.vue index 6ba082468..633a21f11 100644 --- a/src/jmapNew/theme/datie_02/menus/menuDialog/viewName.vue +++ b/src/jmapNew/theme/datie_02/menus/menuDialog/viewName.vue @@ -62,6 +62,12 @@ export default { }, domIdConfirm() { return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; + }, + mapData() { + return this.$store.state.map.map; + }, + roleDeviceCode() { + return this.$store.state.training.roleDeviceCode; } }, mounted() { @@ -102,24 +108,6 @@ export default { commit() { this.setNameDisplay(); this.doClose(); - // const operate = { - // over: true, - // type: this.operate.type, - // operation: OperationEvent.Command.close.confirm.operation, - // val: this.nameLevels.sort().join('::') - // }; - // - // this.loading = true; - // this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => { - // this.loading = false; - // if (valid) { - // this.doClose(); - // this.setNameDisplay(); - // } - // }).catch((e) => { - // console.log(e, '------------'); - // this.loading = false; - // }); }, setNameDisplay() { const deviceList = []; @@ -129,7 +117,10 @@ export default { const signalList = this.$store.getters['map/signalList']; if (signalList && signalList.length > 0) { signalList.forEach(elem => { - deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow })); + const signal = this.$store.getters['map/getDeviceByCode'](elem.code); + if (signal.instance) { + deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow })); + } }); } @@ -142,18 +133,21 @@ export default { const switchList = this.$store.getters['map/switchList']; if (switchList && switchList.length > 0) { switchList.forEach(elem => { - deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow })); + const switchD = this.$store.getters['map/getDeviceByCode'](elem.code); + if (switchD.instance) { + deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, switchSectionNameShow })); + } }); } - // 控制模式 - const indicatorShow = this.nameLevels.includes(8); - const control = this.$store.getters['map/stationControlList']; - if (control && control.length > 0) { - control.forEach(elem => { - deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); // 标识灯名称 - }); - } + // // 控制模式 + // const indicatorShow = this.nameLevels.includes(8); + // const control = this.$store.getters['map/stationControlList']; + // if (control && control.length > 0) { + // control.forEach(elem => { + // deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { indicatorShow })); // 标识灯名称 + // }); + // } // 区段 nameShow = false; @@ -193,31 +187,34 @@ export default { if (elem.transferTrack) { transferTrackNameShow = this.nameLevels.includes(6); } - - deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow })); + const section = this.$store.getters['map/getDeviceByCode'](elem.code); + if (section.instance) { + deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow })); + } }); } // 停车点 - const destCodeShow = this.nameLevels.includes(10); - const stopPointList = this.$store.getters['map/stopPointList']; - if (stopPointList && stopPointList.length > 0) { - stopPointList.forEach(elem => { - deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow })); - }); - } + // const destCodeShow = this.nameLevels.includes(10); + // const stopPointList = this.$store.getters['map/stopPointList']; + // if (stopPointList && stopPointList.length > 0) { + // stopPointList.forEach(elem => { + // deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { destCodeShow })); + // }); + // } // 车站 - const kmPostShow = this.nameLevels.includes(12); - const stationList = this.$store.getters['map/stationList']; - if (stationList && stationList.length > 0) { - stationList.forEach(elem => { - deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); // 公里标 - }); - } - + // const kmPostShow = this.nameLevels.includes(12); + // const stationList = this.$store.getters['map/stationList']; + // if (stationList && stationList.length > 0) { + // stationList.forEach(elem => { + // deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); // 公里标 + // }); + // } this.$store.dispatch('map/updateMapDevices', deviceList); + } + } };