From b8cfb1900e355f5529e7607049ed51d28c301f21 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 8 Sep 2020 11:19:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=81=93=E5=B2=94=E7=BB=98?= =?UTF-8?q?=E5=9B=BE=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Switch/index.js | 41 ++++++------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index eeeff1bf9..9170cf43e 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -125,12 +125,9 @@ export default class Switch extends Group { this.add(this.lossShow); this.lossShow.hide(); } - // const trapezoidWidth = this.style.Switch.jointImg.trapezoidLength; const Tspoint1 = [model.intersection.x + directx * width3 + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1]; const Tspoint2 = [model.intersection.x - directx * width3, Tspoint1[1]]; const Tspoint3 = [model.intersection.x - directx * width3, model.intersection.y - directy * switchWidth1]; - // const Tspoint2 = [Tspoint1[0] - directx * trapezoidWidth, Tspoint1[1]]; - // const Tspoint3 = [Tspoint1[0] - directx * trapezoidWidth, model.intersection.y - directy * switchWidth1]; const Tspoint4 = [model.intersection.x + directx * width3, Tspoint3[1]]; const Tspoint5 = [Tspoint1[0], Tspoint1[1]]; this.sheltertriangle = new ETriangle({ // 岔芯 直角梯形 C @@ -270,7 +267,6 @@ export default class Switch extends Group { this.sheltertriangle.hide(); // 直角梯形覆盖图形 this.sheltertriangle.setColor(this.style.Section.line.spareColor); this.sheltertriangle.stopAnimation(false); - // this.rhomboid.hide(); this.setHasTextBorder(0); this.locShelter.hide(); // 定位覆盖图形 this.relocShelter.hide(); // 反位覆盖图形 @@ -308,20 +304,9 @@ export default class Switch extends Group { } this.locShelter.hide(); // 定位 this.sheltertriangle.hide(); - if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色 - this.sheltertriangle.show(); - this.setSectionState(this.sheltertriangle, this.model); - } else { - // this.rhomboid.show(); - // this.setSectionState(this.rhomboid, 'fill', this.model); - // this.setSectionState(this.sheltertriangle, 'fill', this.model); - } if (this.style.Switch.core.graphShow) { // 佛山线路显示 - // this.sheltertriangle.hide(); this.locShelter.show(); this.locShelter.setColor('#FFFF00'); - // this.rhomboid.show(); - // this.rhomboid.setColor('#FFFF00'); this.sheltertriangle.show(); this.sheltertriangle.setColor('#FFFF00'); } @@ -482,25 +467,13 @@ export default class Switch extends Group { } } - sectionCutOff(section) { - const lineWidth = this.style.Section.line.width; - if (section) { - section.animateStyle(true, [ - { time: 0, styles: { lineWidth: lineWidth } }, - { time: 1000, styles: { stroke: this.style.backgroundColor } }, - { time: 2000, styles: { lineWidth: lineWidth } } - ]); - } - } - + // 处理岔芯颜色 setSectionState(section, state) { const sectionC = store.getters['map/getDeviceByCode'](state.sectionCCode); if (sectionC) { // 空闲 - // section.setColor('fill', this.style.Section.line.spareColor); - // section.setStyle('lineWidth', 0); - // section.setStyle('stroke', this.style.Section.line.spareColor); - // this.sheltertriangle.hide(); + section.setStyle({'fill': this.style.Section.line.spareColor}); + section.show(); // 道岔保护区段锁闭 if (sectionC.overlapLock) { section.show(); @@ -522,8 +495,7 @@ export default class Switch extends Group { section.setStyle({'fill': this.style.Section.line.communicationOccupiedColor, 'stroke': this.style.Section.line.communicationOccupiedColor, 'lineWidth': this.style.Section.line.beyondWidth}); } if (sectionC.cutOff) { - section.show(); - // this.sectionCutOff(section); + section.hide(); } } } @@ -545,8 +517,9 @@ export default class Switch extends Group { model.blockade && this.block(); // 道岔封锁 model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态 - // this.hideSwitchCenter(); - this.setSectionState(this.sheltertriangle, this.model); + if (!this.style.Switch.core.graphShow) { + this.setSectionState(this.sheltertriangle, this.model); // 处理岔芯颜色 + } // this.interlockingReserved(); // 联锁预留道岔 if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色