From d1cff9ff9432548e53a308489165c173bb3f83b9 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 19 Aug 2020 18:27:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E4=B8=89=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=E7=AB=99=E5=8F=B0=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/ningbo_03.js | 16 +++--- src/jmapNew/config/skinCode/xian_02.js | 2 +- src/jmapNew/shape/StationStand/EDetainRect.js | 54 +++++++++++++++++++ src/jmapNew/shape/StationStand/index.js | 25 ++++++++- 4 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 src/jmapNew/shape/StationStand/EDetainRect.js diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index b3f3833d0..cadfde703 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -350,10 +350,11 @@ class SkinCode extends defaultStyle { lineWidth: 3, // 站台线宽 spareColor: '#0080C0', // 站台空闲颜色 spareStrokeColor: '#000000', // 站台空闲描边颜色 - openStrokeColor: '#00FF00', // 站台开门描边颜色 + doorOpenColor:'#00FF00', // 车门开启状态颜色 stopColor: 'yellow', // 站台列车停站颜色 - jumpStopColor: '#6260f3', // 站台跳停颜色 - designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色 + jumpStopColor: '#C00000', // 站台跳停颜色 + designatedJumpStopColor: 'lightSkyBlue', // 站台指定列车跳停颜色 + virtualColor: '#585858' // 虚拟站台颜色 }, standEmergent: { // 紧急关闭 mergentR: 4, // 站台紧急关闭半径 @@ -367,11 +368,12 @@ class SkinCode extends defaultStyle { position: 1, // 扣车标识在站台上显示方向 text: 'H', // 扣车显示内容 offset: { x: -8, y: 10 }, // 扣车偏移量 - centerTrainColor: 'white', // 中心扣车颜色 - andCenterTrainColor: 'red', // 车站+中心扣车颜色 - detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色 + centerTrainColor: '#00FF00', // 中心扣车颜色 + andCenterTrainColor: '#00FF00', // 车站+中心扣车颜色 + detainTrainTextColor: '#FFFF00', // 车站扣除文字颜色 fontSize: 10, - fontWeight: 'normal' + fontWeight: 'normal', + specialShape: 'rect' // 扣车标志形状 }, stopTime: { // 停站时间 offset: { x: -8, y: 4 }, // 运行时间偏移量 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index 47fee0474..bbd711b68 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -288,7 +288,7 @@ class SkinCode extends defaultStyle { fontWeight: 'normal', circleWidth:14, // 西安二号线特殊样式 圆圈的宽度 defaultColor:'#808080', // 默认颜色 - special:true // 西安二号线特殊样式 + specialShape: 'circle' // 西安二号线特殊样式 }, stopTime: { // 停站时间 position: 1, // 停站时间方向 diff --git a/src/jmapNew/shape/StationStand/EDetainRect.js b/src/jmapNew/shape/StationStand/EDetainRect.js new file mode 100644 index 000000000..646076e17 --- /dev/null +++ b/src/jmapNew/shape/StationStand/EDetainRect.js @@ -0,0 +1,54 @@ +import Group from 'zrender/src/container/Group'; +import Rect from 'zrender/src/graphic/shape/Rect'; + +class EDetainCircle extends Group { + constructor(model) { + super(); + this.model = model; + this.create(); + } + + create() { + const model = this.model; + const style = this.model.style; + let y; + if (model.right && model.inside) { + y = model.y + model.height / 2; + } else if (model.right && !model.inside) { + y = model.y; + } else if (!model.right && model.inside) { + y = model.y; + } else if (!model.right && !model.inside) { + y = model.y + model.height / 2; + } + this.detainRect = new Rect({ + zlevel: model.zlevel, + z: model.z + 1, + shape: { + x: model.x, + y: y, + width: model.width, + height: model.height / 2 + }, + style: { + lineWidth: style.StationStand.stand.lineWidth || 0, + stroke: style.StationStand.stand.spareStrokeColor, + fill: '#000' + } + }); + this.add(this.detainRect); + this.detainRect.hide(); + } + + setColor(color) { + this.detainRect.setStyle('stroke', color); + } + setShow() { + this.detainRect.show(); + } + setHide() { + this.detainRect.hide(); + } +} + +export default EDetainCircle; diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index c7826cd3c..d431c74a0 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -12,6 +12,7 @@ import ETrainStop from './ETrainStop'; import ETrainDepart from './ETrainDepart'; import EControl from '../element/EControl'; import EDetainCircle from './EDetainCircle'; +import EDetainRect from './EDetainRect'; import EPatternFilter from './EPatternFilter'; import {isShowThePrdType} from '../../utils/handlePath'; @@ -148,7 +149,7 @@ class StationStand extends Group { this.add(this.reentry); } - if (style.StationStand.detainCar.special) { + if (style.StationStand.detainCar.specialShape === 'circle') { const detainD = model.right ? 1 : -1; this.detainCircle = new EDetainCircle({ zlevel: this.zlevel, @@ -159,6 +160,19 @@ class StationStand extends Group { radius:style.StationStand.detainCar.circleWidth / 2 }); this.add(this.detainCircle); + } else if (style.StationStand.detainCar.specialShape === 'rect') { + this.detainRect = new EDetainRect({ + zlevel: this.zlevel, + z: this.z, + style: style, + x: standX, + y: standY, + inside: model.inside, + right: model.right, + width: model.width, + height: model.height + }); + this.add(this.detainRect); } else { /** 站台扣车*/ const detainD = model.right ? 1 : -1; @@ -381,6 +395,7 @@ class StationStand extends Group { this.reentry && this.reentry.hideMode(); this.jump && this.jump.hideMode(); this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.defaultColor); + this.detainRect.setHide(); } /** 空闲*/ @@ -402,7 +417,7 @@ class StationStand extends Group { /** 车门开启 */ doorOpen() { - if (this.style.StationStand.common.standType && this.style.StationStand.common.standType == 'notFill') { + if (this.style.StationStand.stand.doorOpenColor) { this.safeStand && this.safeStand.setColor(this.style.StationStand.stand.doorOpenColor); } } @@ -439,6 +454,8 @@ class StationStand extends Group { this.detain && this.detain.showMode(); this.detain && this.detain.setColor(this.style.StationStand.detainCar.detainTrainTextColor); this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.centerTrainColor); + this.detainRect && this.detainRect.setShow(); + this.detainRect && this.detainRect.setColor(this.style.StationStand.detainCar.detainTrainTextColor); } /** 中心扣车*/ @@ -446,6 +463,8 @@ class StationStand extends Group { this.detain && this.detain.showMode(); this.detain && this.detain.setColor(this.style.StationStand.detainCar.centerTrainColor); this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.centerTrainColor); + this.detainRect && this.detainRect.setShow(); + this.detainRect && this.detainRect.setColor(this.style.StationStand.detainCar.centerTrainColor); } /** 中心+车站扣车*/ @@ -453,6 +472,8 @@ class StationStand extends Group { this.detain && this.detain.showMode(); this.detain && this.detain.setColor(this.style.StationStand.detainCar.andCenterTrainColor); this.detainCircle && this.detainCircle.setColor(this.style.StationStand.detainCar.centerTrainColor); + this.detainRect && this.detainRect.setShow(); + this.detainRect && this.detainRect.setColor(this.style.StationStand.detainCar.centerTrainColor); } /** 人工设置停战时间*/