From 16ee7692b27702b6bde8698cd3804e6dcd390722 Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 7 Dec 2022 14:37:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=9D=83=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/parser/parser-graph.js | 11 ++++++++++- src/jmapNew/theme/components/utils/menuJudge.js | 13 +++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/jmapNew/parser/parser-graph.js b/src/jmapNew/parser/parser-graph.js index a1fdfc591..3c80b6032 100644 --- a/src/jmapNew/parser/parser-graph.js +++ b/src/jmapNew/parser/parser-graph.js @@ -17,10 +17,19 @@ export function parser(data, skinCode, showConfig) { var mapDevice = {}; var propConvert = skinCode ? Vue.prototype.$theme.loadPropConvert(skinCode) : null; if (data) { + const centralStationList = []; zrUtil.each(data.stationList || [], elem => { + if (elem.centralized) { + centralStationList.push(elem); + } mapDevice[elem.code] = createDevice(deviceType.Station, elem, propConvert, showConfig); }, this); - + zrUtil.each(centralStationList, elem => { + mapDevice[elem.code].stationCode = elem.code; + zrUtil.each(elem.chargeStationCodeList || [], item => { + mapDevice[item].stationCode = elem.code; + }); + }); zrUtil.each(data.sectionList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Section, elem, propConvert, showConfig); elem = propConvert.initPrivateProps(elem); diff --git a/src/jmapNew/theme/components/utils/menuJudge.js b/src/jmapNew/theme/components/utils/menuJudge.js index 3085d58dc..00728d78e 100644 --- a/src/jmapNew/theme/components/utils/menuJudge.js +++ b/src/jmapNew/theme/components/utils/menuJudge.js @@ -4,10 +4,15 @@ import store from '@/store/index'; * @param {String} stationCode 所属车站code * @param {String} centralStationCode 所属集中站code * */ -export function judgeStationControl(stationCode, centralStationCode) { +export function judgeStationControl(stationCode, centralStationCode, work) { const centralStation = this.$store.getters['map/getDeviceByCode'](centralStationCode); // 角色车站是 设备所属车站或所属集中站 - const flag1 = store.state.training.roleDeviceCode === stationCode || store.state.training.roleDeviceCode === centralStationCode; - const flag2 = centralStation.controlMode === 'Local' || centralStation.controlMode === 'Emergency'; - return flag1 && flag2; + if (work === 'localWork') { + const flag1 = store.state.training.roleDeviceCode === stationCode || store.state.training.roleDeviceCode === centralStationCode; + const flag2 = centralStation.controlMode === 'Local' || centralStation.controlMode === 'Emergency'; + return flag1 && flag2; + } else { + return centralStation.controlMode === 'Center'; + } + }