From 693938a367b5f314870577be333eaf930010b5dc Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Tue, 13 Apr 2021 17:37:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E6=89=93=E9=93=81=20?= =?UTF-8?q?=E9=81=93=E5=B2=94=E7=8A=B6=E6=80=81=E7=9A=AE=E8=82=A4=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/datie_01.js | 25 +++++++++++++---- src/jmapNew/config/skinCode/foshan_01.js | 4 ++- src/jmapNew/config/skinCode/race_01.js | 8 ++++-- src/jmapNew/shape/Switch/index.js | 35 ++++++++++++++++++------ 4 files changed, 53 insertions(+), 19 deletions(-) diff --git a/src/jmapNew/config/skinCode/datie_01.js b/src/jmapNew/config/skinCode/datie_01.js index 4a0e58e8b..45fe14d64 100644 --- a/src/jmapNew/config/skinCode/datie_01.js +++ b/src/jmapNew/config/skinCode/datie_01.js @@ -458,17 +458,23 @@ class SkinCode extends defaultStyle { inversionColor: '#FFFF00', // 道岔反位颜色 monolockLocationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色) monolockInversionColor: '#FFFF00', // 道岔单锁'反位'颜色 (黄色) - faultFlashing: true // 故障闪烁 + faultFlashing: false // 故障闪烁 }, sectionAction: { flag: false, // 道岔 关联区段显示 spareColor: '#5b5b5b' // 区段显示颜色 }, core: { - length: 6 // 道岔单边长度 + length: 6, // 道岔单边长度 + graphShow: true, // 图形显示 + graphInversionColor: '#FFFF00', // 反位颜色 + graphLocalColor: '#00FF00' // 定位颜色 }, jointImg: { // 道岔 A B C D四元素属性配置 - trapezoidLength: 8 // 直角梯形元素默认长度 + trapezoidLength: 8, // 直角梯形元素默认长度 + faultStatus: true, // 挤岔表示 + fork: true, // 挤岔专用(如有挤岔操作 变为true) + forKColor: 'red' // 挤岔颜色 配合挤岔专用 }, arcBlcok: { // 圆形封锁图形 show: false, // 显示 @@ -479,10 +485,17 @@ class SkinCode extends defaultStyle { rectLock: { // 矩形封锁框图形 rectWidth: 18, // 矩形框 宽高 rectBorderColor: '#fff', // 矩形边框颜色 - monolock: true, // 单锁显示 block: true, // 封锁显示 - blockColor: 'red' // 封锁颜色 - } + blockColor: 'red', // 封锁颜色 + followName: true, // 位置跟随名称确定 + }, + arcBlcok: { // 圆形封锁图形 + show: true, // 显示 + shapeR: 10, + arcBorderColor: 'red', // 默认边框颜色 + locationColor: 'red', // 定位封锁颜色 + inversionColor: 'red' // 反位封锁颜色 + }, }; this[deviceType.LcControl] = { diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index 3616fb85c..769efeaf3 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -470,7 +470,9 @@ class SkinCode extends defaultStyle { }, core: { length: 6, // 道岔单边长度 - graphShow: true // 图形显示 + graphShow: true, // 图形显示 + graphInversionColor: '#FFFF00', // 反位颜色 + graphLocalColor: '#00FF00' // 定位颜色 }, jointImg: { // 道岔 A B C D四元素属性配置 trapezoidLength: 8, // 直角梯形元素默认长度 diff --git a/src/jmapNew/config/skinCode/race_01.js b/src/jmapNew/config/skinCode/race_01.js index 5d9fedb1c..034037688 100644 --- a/src/jmapNew/config/skinCode/race_01.js +++ b/src/jmapNew/config/skinCode/race_01.js @@ -527,8 +527,10 @@ class SkinCode extends defaultStyle { spareColor: '#5b5b5b' // 区段显示颜色 }, core: { - length: 6, // 道岔单边长度 - graphShow: true // 图形显示 + length: 6, // 道岔单边长度 + graphShow: true, // 图形显示 + graphInversionColor: '#FFFF00', // 反位颜色 + graphLocalColor: '#00FF00' // 定位颜色 }, jointImg: { // 道岔 A B C D四元素属性配置 trapezoidLength: 8, // 直角梯形元素默认长度 @@ -537,7 +539,7 @@ class SkinCode extends defaultStyle { forKColor: 'red' // 挤岔颜色 配合挤岔专用 }, arcBlcok: { // 圆形封锁图形 - show: true, // 显示 + show: true, // 显示 shapeR: 15, arcBorderColor: 'green', // 默认边框颜色 locationColor: 'green', // 定位封锁颜色 diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 3e31c0b3b..e1370ce0a 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -230,11 +230,22 @@ export default class Switch extends Group { offsetX = directx * this.style.Switch.rectLock.offset.x; offsetY = directy * this.style.Switch.rectLock.offset.y; } + let x = this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX; + let y = this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY; + if (this.style.Switch.rectLock.followName) { + const directx = this.triangle.drictx; + const rect = this.name.getBoundingRect(); + const wLen = this.style.Switch.rectLock.rectWidth - (directx > 0? rect.width: rect.width/2); + const hLen = this.style.Switch.rectLock.rectWidth - rect.height + x = rect.x - wLen/2; + y = rect.y - hLen/2 + } + this.lockRect = new ELockRect({ // 单锁矩形框 zlevel: this.zlevel, z: this.z + 6, - x: this.model.intersection.x - this.style.Switch.rectLock.rectWidth / 2 + offsetX, - y: this.model.intersection.y - this.style.Switch.rectLock.rectWidth / 2 + offsetY, + x, + y, width: this.style.Switch.rectLock.rectWidth, lineWidth: 1.8, stroke: this.style.Switch.rectLock.rectBorderColor, @@ -314,8 +325,9 @@ export default class Switch extends Group { /** 恢复状态*/ recover() { - this.lockRect.hide(); // 矩形包围框 - this.lockArc.hide(); // 圆形单锁框 + this.lockRect && this.lockRect.hide(); // 矩形包围框 + this.lockCircle && this.lockCircle.hide(); // 圆形包围框 + this.lockArc && this.lockArc.hide(); // 圆形单锁框 this.name.getNameText().stopAnimation(false); this.shapeModelC.hide(); // 形状 C this.shapeModelA.hide(); // 形状 A @@ -344,7 +356,7 @@ export default class Switch extends Group { } if (this.style.Switch.core.graphShow) { // 佛山线路显示 this.shapeModelB.show(); - this.shapeModelB.setColor('#00FF00'); + this.shapeModelB.setColor(this.style.Switch.core.graphLocalColor); this.shapeModelC.show(); this.shapeModelC.setColor(this.style.backgroundColor); } @@ -364,7 +376,7 @@ export default class Switch extends Group { this.shapeModelA.setColor(this.style.Section.line.spareColor); if (this.style.Switch.core.graphShow) { // 佛山线路显示 this.shapeModelC.show(); - this.shapeModelC.setColor('#FFFF00'); + this.shapeModelC.setColor(this.style.Switch.core.graphInversionColor); this.shapeModelC.attr({ z: this.z + 6 }); @@ -474,16 +486,20 @@ export default class Switch extends Group { /** 单锁*/ setMonolock(normalPosition, reversePosition) { - if (this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示 + if (this.style.Switch.rectLock && + this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示 this.lockRect.show(); if (this.style.Switch.rectLock.rectBorderFillColor) { // 西安二号线 专用显示 this.lockRect.setStyle({ stroke: this.style.Switch.rectLock.rectBorderColor, fill: this.style.Switch.rectLock.rectBorderFillColor }); } } - if (this.style.Switch.text.monolock) { // 单锁显示名称包围框 + + if (this.style.Switch.text && + this.style.Switch.text.monolock) { // 单锁显示名称包围框 this.setHasTextBorder(1); } - if (this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示 + if (this.style.Switch.arcBlcok && + this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示 this.lockArc.show(); if (normalPosition) { this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.locationColor }); @@ -545,6 +561,7 @@ export default class Switch extends Group { this.lockRect.setStyle({ stroke: this.style.Switch.rectLock.blockColor, fill: this.style.Switch.rectLock.blockFillColor }); } } + // if (this.style.Switch.coverBlock && this.style.Switch.coverBlock.show) { // this.shapeBlockCover.show(); // this.shapeBlockCover.setColor(this.style.Switch.coverBlock.coverBlockColor);