From 2b548186c30efc3527c7ff9d97ae15347af92778 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 4 Sep 2020 10:44:17 +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=88=B6=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Switch/ETriangle.js | 2 +- src/jmapNew/shape/Switch/index.js | 62 ++++++++++++++++----------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/src/jmapNew/shape/Switch/ETriangle.js b/src/jmapNew/shape/Switch/ETriangle.js index 379fc4bd8..7851946d3 100644 --- a/src/jmapNew/shape/Switch/ETriangle.js +++ b/src/jmapNew/shape/Switch/ETriangle.js @@ -19,7 +19,7 @@ class ETriangle extends Group { }, style: { fill: style.Section.line.spareColor, - // fill: 'green', + // fill: 'red', lineWidth: 0, stroke: style.Section.line.spareColor }, diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 1574a8b6c..c66ab455c 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -12,7 +12,7 @@ import ELockRect from './ELockRect'; import ELockArc from './ELockArc'; import EMouse from './EMouse'; import EHighlight from '../element/EHighlight'; -import ERhomboid from './ERhomboid'; +// import ERhomboid from './ERhomboid'; import ETriangle from './ETriangle'; import store from '@/store/index_APP_TARGET'; import Vue from 'vue'; @@ -91,19 +91,19 @@ export default class Switch extends Group { onmouseout: () => { this.name.getArrowText().hide(); } }); - const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1]; - const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]]; - const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1]; - const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]]; - this.rhomboid = new ERhomboid({ // 岔芯 平行四边形 佛山线路专用 - zlevel: this.zlevel, - z: this.z, - style: style, - sectionPoints: [spoint1, spoint2, spoint3, spoint4], - cursor: 'pointer', - onmouseover: () => { this.name.getArrowText().show(); }, - onmouseout: () => { this.name.getArrowText().hide(); } - }); + // const spoint1 = [model.intersection.x + directx * width3, model.intersection.y - directy * switchWidth1]; + // const spoint2 = [spoint1[0] - directx * (width2 + width1) - directx * width3, spoint1[1]]; + // const spoint3 = [model.intersection.x - directx * width3, model.intersection.y + directy * switchWidth1]; + // const spoint4 = [spoint1[0] + directx * (width2 + width1) - directx * width3, spoint3[1]]; + // this.rhomboid = new ERhomboid({ // 岔芯 平行四边形 佛山线路专用 + // zlevel: this.zlevel, + // z: this.z, + // style: style, + // sectionPoints: [spoint1, spoint2, spoint3, spoint4], + // cursor: 'pointer', + // onmouseover: () => { this.name.getArrowText().show(); }, + // onmouseout: () => { this.name.getArrowText().hide(); } + // }); if (this.style.Switch.text.lossRect) { // 道岔失表显示红色矩形框 const lossRect = this.locShelter.getLocal().getBoundingRect(); this.lossShow = new Rect({ @@ -125,13 +125,15 @@ export default class Switch extends Group { this.add(this.lossShow); this.lossShow.hide(); } - const trapezoidWidth = this.style.Switch.jointImg.trapezoidLength; + // 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 = [Tspoint1[0] - directx * trapezoidWidth, Tspoint1[1]]; - const Tspoint3 = [Tspoint1[0] - directx * trapezoidWidth, 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({ // 岔芯 直角梯形 D + this.sheltertriangle = new ETriangle({ // 岔芯 直角梯形 C zlevel: this.zlevel, z: this.z, style: style, @@ -177,7 +179,7 @@ export default class Switch extends Group { this.add(this.locShelter); this.add(this.relocShelter); - this.add(this.rhomboid); + // this.add(this.rhomboid); this.add(this.sheltertriangle); this.add(this.name); this.add(this.enabledName); @@ -267,7 +269,7 @@ export default class Switch extends Group { this.name.getNameText().stopAnimation(false); this.sheltertriangle.hide(); // 直角梯形覆盖图形 this.sheltertriangle.stopAnimation(false); - this.rhomboid.hide(); + // this.rhomboid.hide(); this.setHasTextBorder(0); this.locShelter.hide(); // 定位覆盖图形 this.relocShelter.hide(); // 反位覆盖图形 @@ -285,6 +287,9 @@ export default class Switch extends Group { } this.relocShelter.hide(); this.sheltertriangle.hide(); + + // this.sheltertriangle.show(); // 直角梯形覆盖图形 + // this.sheltertriangle.setColor('red'); if (this.style.Switch.core.graphShow) { // 佛山线路显示 this.relocShelter.show(); this.sheltertriangle.show(); @@ -307,16 +312,20 @@ export default class Switch extends Group { this.sheltertriangle.show(); this.setSectionState(this.sheltertriangle.getSection(), 'fill', this.model); } else { - this.rhomboid.show(); - this.setSectionState(this.rhomboid.getSection(), 'fill', this.model); + // this.rhomboid.show(); + // this.setSectionState(this.rhomboid.getSection(), 'fill', this.model); + this.sheltertriangle.show(); + this.setSectionState(this.sheltertriangle.getSection(), 'fill', this.model); } if (this.style.Switch.core.graphShow) { // 佛山线路显示 - this.sheltertriangle.hide(); + // this.sheltertriangle.hide(); this.locShelter.show(); this.locShelter.setColor('#FFFF00'); - this.rhomboid.show(); - this.rhomboid.setColor('#FFFF00'); + // this.rhomboid.show(); + // this.rhomboid.setColor('#FFFF00'); + this.sheltertriangle.show(); + this.sheltertriangle.setColor('#FFFF00'); } } @@ -543,7 +552,8 @@ export default class Switch extends Group { model.blockade && this.block(); // 道岔封锁 model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态 - model.routeLock && this.setSectionState(this.rhomboid.getSection(), 'fill', this.model); + // model.routeLock && this.setSectionState(this.rhomboid.getSection(), 'fill', this.model); + model.routeLock && this.setSectionState(this.sheltertriangle.getSection(), 'fill', this.model); // this.interlockingReserved(); // 联锁预留道岔 if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色