From 103afa9f05c3f84a1ff484f52a5922a8d21677f5 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 9 Mar 2020 17:02:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=88=E5=B0=94=E6=BB=A8?= =?UTF-8?q?=E7=BA=BF=E8=B7=AF=E9=81=93=E5=B2=94=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/haerbin_01.js | 2 +- src/jmapNew/shape/Psd/index.js | 3 +++ src/jmapNew/shape/Section/index.js | 12 +++++++++--- src/jmapNew/shape/Switch/index.js | 10 ++++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index 80670bf0f..664441199 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -370,7 +370,7 @@ class SkinCode extends defaultStyle { }, sectionAction: { flag: true, // 道岔 关联区段显示 - spareColor: '#5b5b5b', // 区段显示颜色 + 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() {