diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index a4a32b5a8..a72e399ff 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -369,8 +369,8 @@ class SkinCode extends defaultStyle { monolockColor: '#fff' // 道岔单锁颜色 }, sectionAction: { - flag: true, // 道岔 关联区段显示 - spareColor: '#5b5b5b' // 区段显示颜色 + flag: true, // 道岔 关联区段显示 + spareColor: '#5b5b5b', // 区段显示颜色 (灰色) }, core: { splice: true, // 哈尔滨特殊显示 diff --git a/src/jmapNew/shape/Psd/index.js b/src/jmapNew/shape/Psd/index.js index e479a92b5..111828796 100644 --- a/src/jmapNew/shape/Psd/index.js +++ b/src/jmapNew/shape/Psd/index.js @@ -65,6 +65,9 @@ export default class Line2 extends Group { setState(model) { /** 设置屏蔽门开关*/ + // if (model.name == 'Psd44') { + // console.log(model, model.screenDoorOpenStatus, '1 为关门 0 为开门'); + // } model.screenDoorOpenStatus == 0 && this.openDoor(); /** 开门*/ model.screenDoorOpenStatus != 0 && this.closeDoor(); /** 关门*/ diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 63bf15174..3c5e62866 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -781,18 +781,24 @@ export default class Section extends Group { } /** 设置状态*/ - setState(model) { + setState(model, flag = false) { this.recover(); // 实际上就是 状态重置 必须在设置其他状态之前 设置颜色之类的 - if (this.style.Switch.sectionAction.flag && model.relSwitchCode) { + if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) { const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode]; - // const switchModel = store.getters['map/getDeviceByCode'](model.relSwitchCode); + // if (switchModel.name == 'D1801' || switchModel.name == 'D1802' || switchModel.name == 'D1803' || switchModel.name == 'D1804') { + // console.log('switchModel', switchModel, switchModel.name, switchModel.normalPosition, '1 定位 0 反位'); + // } if (switchModel.normalPosition != 0) { // 定位情况 const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.section.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); + const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; + sectionB && sectionB.instance && sectionB.instance.setState(sectionB, true); } else if (switchModel.normalPosition == 0) { // 反位情况 const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.section.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); + const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; + sectionC && sectionC.instance && sectionC.instance.setState(sectionC, true); } } /** 道岔保护区段锁闭 */ diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index bad5eac3b..d47c73450 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -441,6 +441,16 @@ export default class Switch extends Group { model.blockade && this.block(); /** 区段切除*/ model.cutOff && this.setSwitchCutOff(); + if (this.style.Switch.sectionAction.flag) { + const switchModel = Vue.prototype.$jlmap.mapDevice[model.code]; + if (switchModel.normalPosition != 0) { // 定位情况 + const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; + sectionC && sectionC.instance && sectionC.instance.setState(sectionC); + } else if (switchModel.normalPosition == 0) { // 反位情况 + const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; + sectionB && sectionB.instance && sectionB.instance.setState(sectionB); + } + } } getBoundingRect() {