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'; + } + }