From 78e065ec7a868777fcd790fda388d9bdc40b4620 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 15 Sep 2022 13:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E4=B8=89=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=E5=88=97=E8=BD=A6=E6=98=BE=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/graph/Train/ETriangle.js | 49 ++++++++++++++++++++-- src/jmapNew/shape/graph/Train/index.js | 3 ++ src/utils/baseUrl.js | 4 +- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/jmapNew/shape/graph/Train/ETriangle.js b/src/jmapNew/shape/graph/Train/ETriangle.js index 72a07e6c9..ce3fbf8b3 100644 --- a/src/jmapNew/shape/graph/Train/ETriangle.js +++ b/src/jmapNew/shape/graph/Train/ETriangle.js @@ -17,7 +17,7 @@ export default class ETriangle extends Group { if (model && model.point) { const right = model.right == 1 ? 1 : -1; if (this.style.Section.trainPosition.specialShow) { - this.stopRect = new Rect({ // 停车标识 + this.openDoorRect = new Rect({ // 停车标识 zlevel: model.zlevel, z: model.z, shape: { @@ -31,6 +31,20 @@ export default class ETriangle extends Group { fill: 'rgba(26, 54, 88, 0.7)' } }); + this.stopRect = new Rect({ + zlevel: model.zlevel, + z: model.z, + shape: { + x: model.point.x - this.style.Section.trainPosition.stopTrainRectWidth, + y: model.point.y - this.style.Section.line.width / 4, + width: 4, + height: this.style.Section.line.width + 2 + }, + style: { + lineWidth: 0, + fill: 'rgba(255,0,0,0.7)' + } + }); this.angle1 = new Rect({ zlevel: model.zlevel, z: model.z, @@ -64,8 +78,9 @@ export default class ETriangle extends Group { }); this.add(this.angle1); this.add(this.angle); + this.add(this.openDoorRect); this.add(this.stopRect); - this.stopRect.hide(); + this.openDoorRect.hide(); } else { this.angle = new Polygon({ zlevel: model.zlevel, @@ -136,7 +151,7 @@ export default class ETriangle extends Group { }); this.angle1.dirty(); } - if (this.stopRect) { + if (this.openDoorRect) { const offset = (this.style.Section.trainPosition.specialRectWidth - this.style.Section.line.width) / 2; let trainRight = model.x + offset; if (right == 1) { @@ -148,6 +163,26 @@ export default class ETriangle extends Group { width: this.style.Section.line.width - 2, height: this.style.Section.line.width - 2 }; + this.openDoorRect.attr({ + shape: pointsData + }); + this.openDoorRect.animateTo({ + shape: pointsData + }, 10, 0, 'elasticOut', function () { + }); + this.openDoorRect.dirty(); + } + if (this.stopRect) { + let trainRight = model.x + this.style.Section.trainPosition.specialRectWidth; + if (right == 1) { + trainRight = model.x - this.style.Section.trainPosition.specialRectWidth - 4; + } + const pointsData = { + x: trainRight, + y: model.y - this.style.Section.line.width / 2, + width: 4, + height: this.style.Section.line.width + 2 + }; this.stopRect.attr({ shape: pointsData }); @@ -161,7 +196,6 @@ export default class ETriangle extends Group { trainB.setPositionText(model, right); } } - setStopShow(flag) { if (flag) { this.stopRect && this.stopRect.show(); @@ -169,4 +203,11 @@ export default class ETriangle extends Group { this.stopRect && this.stopRect.hide(); } } + setOpenDoorShow(flag) { + if (flag) { + this.openDoorRect && this.openDoorRect.show(); + } else { + this.openDoorRect && this.openDoorRect.hide(); + } + } } diff --git a/src/jmapNew/shape/graph/Train/index.js b/src/jmapNew/shape/graph/Train/index.js index 66e737160..4bd545f5c 100644 --- a/src/jmapNew/shape/graph/Train/index.js +++ b/src/jmapNew/shape/graph/Train/index.js @@ -347,11 +347,14 @@ export default class Train extends Group { if (status != undefined) { if (status) { this.trainB && this.trainB.setDShow(false); + this.triangle && this.triangle.setOpenDoorShow(false); } else { this.trainB && this.trainB.setDShow(true); + this.triangle && this.triangle.setOpenDoorShow(true); } } else { this.trainB && this.trainB.setDShow(false); + this.triangle && this.triangle.setOpenDoorShow(false); } } // 设置通信状态类型 diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index b654d6b38..0c6bfc252 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -24,14 +24,14 @@ export function handlerUrl(data) { if (process.env.NODE_ENV === 'development') { // const data = null; // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.233/rtss-server'; // BASE_API = 'http://114.116.51.125/jlcloud'; // BASE_API = 'http://192.168.3.90:9100'; // 周寅 // BASE_API = 'http://192.168.3.94:9000'; // 旭强 // BASE_API = 'http://192.168.3.15:9000'; // 张赛 // BASE_API = 'http://192.168.3.5:9000'; // 夏增彬 - BASE_API = 'http://192.168.3.37:9000'; // 卫志宏 + // BASE_API = 'http://192.168.3.37:9000'; // 卫志宏 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛