diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index 66b406b91..10941d5e3 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -155,7 +155,6 @@ class SkinCode extends defaultStyle { borderWidth: 0.5, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 5, // 信号机宽度 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 0c7368295..f752f4185 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -163,7 +163,6 @@ class SkinCode extends defaultStyle { borderWidth: 2, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 5, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#C0C0C0', // 信号灯灰色 redColor: 'red', // 信号灯红色 greenColor: 'green', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 1d5b6e043..b71ee8753 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -169,7 +169,6 @@ class SkinCode extends defaultStyle { borderWidth: 2, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 6, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index e086b461e..8a3028701 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -147,7 +147,6 @@ class SkinCode extends defaultStyle { borderWidth: 1, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 6, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index c6b56ce65..d395736a9 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -147,7 +147,6 @@ class SkinCode extends defaultStyle { borderWidth: 1, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 6, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index fcaacef8c..bd4bdc16b 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -137,6 +137,7 @@ class SkinCode extends defaultStyle { distance: 10, // 设备距离区段的距离 post: { standardShow: true, // 灯柱显示 + blockColor: '#000080', // 信号机封锁颜色 standardLength: 4, // 高柱长度 standardHeight: 5, // 灯柱高度 standardColor: '#FF0000', // 灯柱颜色 @@ -164,7 +165,6 @@ class SkinCode extends defaultStyle { borderWidth: 0, // 信号灯边框线宽度 borderColor: '#FF0000', // 信号灯边框线颜色 (虚拟信号机) radiusR: 4, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index e90e45e4c..89978c01c 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -193,7 +193,7 @@ class SkinCode extends defaultStyle { borderWidth: 0, // 信号灯边框线宽度 borderColor: '#FF0000', // 信号灯边框线颜色 (虚拟信号机) radiusR: 5, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 + blockColor: '#000080', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 @@ -511,6 +511,7 @@ class SkinCode extends defaultStyle { }; this[deviceType.Switch] = { + shapeFlash: true, // 道岔转动失去表示 道岔遮罩删除 text: { show: true, // 道岔名称显示 position: 0, // 区段名称位置 1 上面 -1 下面 0 对称 @@ -525,7 +526,7 @@ class SkinCode extends defaultStyle { monolock: true, // 名称单锁显示包围框 monolockLocationColor: '#fff', // 道岔单锁'定位'颜色 monolockInversionColor: '#fff', // 道岔单锁'反位'颜色 - faultFlashing: true // 故障闪烁 + faultFlashing: false // 故障闪烁 }, sectionAction: { flag: true, // 道岔 关联区段显示 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 931469645..4bfc25034 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -150,7 +150,6 @@ class SkinCode extends defaultStyle { borderWidth: 2, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 5, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#C0C0C0', // 信号灯灰色 redColor: 'red', // 信号灯红色 greenColor: 'green', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index ea6015657..3dc6468ed 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -188,7 +188,6 @@ class SkinCode extends defaultStyle { borderColor: '#000000', // 信号灯边框线颜色 physicColor:'#ffffff', // 物理点灯信号灯边框线颜色 radiusR: 5, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#C0C0C0', // 信号灯灰色 redColor: 'red', // 信号灯红色 greenColor: 'green', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/race_01.js b/src/jmapNew/config/skinCode/race_01.js index f0902b607..6afcfb219 100644 --- a/src/jmapNew/config/skinCode/race_01.js +++ b/src/jmapNew/config/skinCode/race_01.js @@ -172,7 +172,6 @@ class SkinCode extends defaultStyle { borderWidth: 1, // 信号灯边框线宽度 borderColor: '#c0c0c0', // 信号灯边框线颜色 radiusR: 5, // 信号机宽度 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index 3bb623608..b9fe75947 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -155,7 +155,6 @@ class SkinCode extends defaultStyle { borderWidth: 1, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 6, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#7F7F7F', // 信号灯灰色 redColor: '#FF0000', // 信号灯红色 greenColor: '#00FF00', // 信号灯绿色 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 4a797e1a3..7aa0f33a0 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -168,7 +168,6 @@ class SkinCode extends defaultStyle { borderWidth: 2, // 信号灯边框线宽度 borderColor: '#3149C3', // 信号灯边框线颜色 radiusR: 5, // 信号灯半径 - blockColor: '#EF0C08', // 信号灯锁闭 grayColor: '#C0C0C0', // 信号灯灰色 redColor: 'red', // 信号灯红色 greenColor: 'green', // 信号灯绿色 diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 1355b2112..6d9c40d2a 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -256,25 +256,28 @@ export default class Section extends Group { this.line && this.line.setStyle({stroke: '#7F7F7F'}); this.name && this.name.setStyle({textFill: '#7F7F7f'}); } - /** 设置状态*/ - setState(model, flag = false) { - if (!this.isShowShape) return; - this.recover(); - // 哈尔滨线路 道岔相关区段设置 默认颜色 + handleSwitchSection(model, flag) { + // 哈尔滨线路 南京二 道岔相关区段设置 默认颜色 if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) { const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode]; - if (switchModel && switchModel.normalPosition != 0) { // 定位情况 + if (switchModel && (switchModel.normalPosition === 1 || (switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse'))) { // 定位情况 const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.line.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 && switchModel.normalPosition == 0) { // 反位情况 + } else if (switchModel && switchModel.reversePosition === 1 || (switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal')) { // 反位情况 const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; sectionB && sectionB.instance && sectionB.instance.line.setStyle({ stroke: this.style.Switch.sectionAction.spareColor }); const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; sectionC && sectionC.instance && sectionC.instance.setState(sectionC, true); } } + } + /** 设置状态*/ + setState(model, flag = false) { + if (!this.isShowShape) return; + this.recover(); + this.handleSwitchSection(model, flag); // 顺序代表优先级 /** 道岔保护区段锁闭 */ model.overlapLock && this.protectiveLock(model.lockRight); diff --git a/src/jmapNew/shape/Signal/ESigLamp.js b/src/jmapNew/shape/Signal/ESigLamp.js index 18d65e975..4d763a54e 100644 --- a/src/jmapNew/shape/Signal/ESigLamp.js +++ b/src/jmapNew/shape/Signal/ESigLamp.js @@ -119,7 +119,7 @@ class ESigLamp extends Group { style: { lineWidth: style.Signal.lamp.stopWidth, stroke: '#000000', - lineCap: 'round' + lineCap: 'round' } }); } diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 67051a2a8..d6a23a64c 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -462,8 +462,11 @@ class Signal extends Group { // 封锁 block() { this.lamps[0].setColor(this.style.Signal.lamp.redColor); - if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 - this.sigPost.setColor('#000080'); + if (this.style.Signal.post.blockColor) { // 设置底座颜色 + this.sigPost.setColor(this.style.Signal.post.blockColor); + } + if (this.style.Signal.lamp.blockColor) { + this.lamps[0].setColor(this.style.Signal.lamp.blockColor); } this.sigName.setColor(this.style.Signal.text.blockColor); if (this.style.Signal.text.nameBorderShow) { @@ -683,13 +686,13 @@ class Signal extends Group { model.isRouteSignal && this.setLowButtonShow(); } - /** 信号机封锁 */ // 缺一个功能封锁 - model.blockade && this.block(); /** 设置灯的颜色 */ model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示 model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭 model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放 model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放 + /** 信号机封锁 */ // 缺一个功能封锁 + model.blockade && this.block(); model.remainTime && this.showRemainTime(model.remainTime); if (!path.includes('/map/draw')) { // 联锁自动进路通过 diff --git a/src/jmapNew/shape/Switch/ESwLnversion.js b/src/jmapNew/shape/Switch/ESwLnversion.js index a4e128003..8200c184c 100644 --- a/src/jmapNew/shape/Switch/ESwLnversion.js +++ b/src/jmapNew/shape/Switch/ESwLnversion.js @@ -58,10 +58,11 @@ class ESwLnversion extends Group { return this.relocShelter; } - animateStyle(cb) { - this.eachChild((child) => { - cb(child); - }); + animateStyle(color1, color2) { + this.relocShelter.animateStyle(true) + .when(0, {stroke: color1}) + .when(500, {stroke: color2}) + .when(1000, {stroke: color1}).start(); } } diff --git a/src/jmapNew/shape/Switch/ESwLocal.js b/src/jmapNew/shape/Switch/ESwLocal.js index d7e47b717..f43f45601 100644 --- a/src/jmapNew/shape/Switch/ESwLocal.js +++ b/src/jmapNew/shape/Switch/ESwLocal.js @@ -56,10 +56,11 @@ class ESwLocal extends Group { this.locShelter.setStyle(data); } - animateStyle(cb) { - this.eachChild((child) => { - cb(child); - }); + animateStyle(color1, color2) { + this.locShelter.animateStyle(true) + .when(0, {stroke: color1}) + .when(500, {stroke: color2}) + .when(1000, {stroke: color1}).start(); } getLocal() { return this.locShelter; diff --git a/src/jmapNew/shape/Switch/ETriangle.js b/src/jmapNew/shape/Switch/ETriangle.js index 1c40478ea..35cf12c1b 100644 --- a/src/jmapNew/shape/Switch/ETriangle.js +++ b/src/jmapNew/shape/Switch/ETriangle.js @@ -65,10 +65,11 @@ class ETriangle extends Group { }); } - animateStyle(cb) { - this.eachChild((child) => { - cb(child); - }); + animateStyle(color1, color2) { + this.section.animateStyle(true) + .when(0, {stroke: color1}) + .when(500, {stroke: color2}) + .when(1000, {stroke: color1}).start(); } } diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 6ed243a1a..c88116a90 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -23,6 +23,7 @@ export default class Switch extends Group { this.zlevel = model.zlevel; this.z = 6; this.isShowShape = true; + this.switchPosition = ''; this.triangle = new JTriangle(model.intersection, model.skew); this.create(); this.createLockRect(); // 创建单锁矩形框显示 @@ -309,13 +310,26 @@ export default class Switch extends Group { }); } } - + // 南京二号线 A,B闪烁 + shapeFlashing() { + let bColor = '#7F7F7F'; + let aColor = '#7F7F7F'; + if (this.switchPosition === 'normal') { + aColor = '#FF0'; + } else { + bColor = '#FF0'; + } + this.shapeModelB && this.shapeModelB.animateStyle(bColor, this.style.backgroundColor); + this.shapeModelA && this.shapeModelA.animateStyle(aColor, this.style.backgroundColor); + } /** 失去*/ setLossAction() { this.shapeModelA.show(); this.shapeModelB.show(); this.shapeModelC.show(); this.shapeModelC.setColor(this.style.backgroundColor); + this.shapeModelB.animateStyle(); + this.style.Switch.shapeFlash && this.shapeFlashing(); this.setTextColor(this.style.Switch.text.lossColor); this.style.Switch.text.faultFlashing && this.nameTextAnimation(); @@ -524,8 +538,10 @@ export default class Switch extends Group { this.recover(); this.setSwitchFault(model.split, model.normalPosition, model.reversePosition); if (model.normalPosition) { + this.switchPosition = 'normal'; this.setLocationAction(model); /** 定位*/ } else if (model.reversePosition) { + this.switchPosition = 'reverse'; this.setInversionAction(model); /** 反位*/ } else { this.setLossAction(); // 失去 @@ -543,13 +559,10 @@ export default class Switch extends Group { 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); - } + const sectionB = Vue.prototype.$jlmap.mapDevice[switchModel.sectionBCode]; + sectionB && sectionB.instance && sectionB.instance.setState(sectionB); + const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode]; + sectionC && sectionC.instance && sectionC.instance.setState(sectionC); } model.noStatus && this.setAshShow(); }