From 06b9fda264d334bf258741b6e0bf26db162d90ed Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 22 Apr 2020 18:24:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E5=AE=89=E4=B8=80=E4=B8=89=E6=8C=89?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=8A=98=E8=BF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/xian_01.js | 9 +++++++-- src/jmapNew/shape/Station/index.js | 27 ++++++++++++++++++++++++-- src/jmapNew/shape/element/EControl.js | 9 +++++++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index a5adad4c4..928dc157b 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -323,11 +323,16 @@ class SkinCode extends defaultStyle { }, turnBack: { // 按图折返 lamp: 1, // 灯数量 - lampSpace: 60 // 灯间距 + lampSpace: 60, // 灯间距 + textName: '按计划执行', + showLampBorder: true, + topText: true, + toptextDistance: 14, + lineDash: [0] }, StationControl:{ text: { - distance: 2, // 灯和文字之间的距离 + distance: 3, // 灯和文字之间的距离 fontSize: 11, // 字体大小 fontFormat: 'consolas', // 字体格式 fontColor: '#ffffff', // 字体颜色 diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index f7999da88..ca5433e33 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -112,6 +112,25 @@ export default class Station extends Group { const style = this.style; if (model.visible && model.createTurnBack) { this.turnBacks = []; + if (style.Station.turnBack.topText) { + this.turnBackTopText = new Text({ + zlevel: this.zlevel, + z: this.z, + position: [0, 0], + style: { + x: model.turnBackPoint.x, + y: model.turnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance, + fontWeight: style.Station.text.fontWeight, + fontSize: style.Station.text.fontSize, + fontFamily: style.fontFamily, + text: model.name + '站后折返', + textFill: '#fff', + textAlign: 'middle', + textVerticalAlign: 'top' + } + }); + this.add(this.turnBackTopText); + } for (let index = 0; index < style.Station.turnBack.lamp; index++) { const turnBack = new EControl({ zlevel: this.zlevel, @@ -123,6 +142,7 @@ export default class Station extends Group { r: style.Station.lamp.radiusR }, lineWidth: 0, + lineDash: style.Station.turnBack.lineDash, fill: style.Station.lamp.controlColor }, text: { @@ -132,7 +152,7 @@ export default class Station extends Group { fontWeight: style.Station.text.fontWeight, fontSize: style.Station.text.fontSize, fontFamily: style.fontFamily, - text: '按图折返', + text: style.Station.turnBack.textName || '按图折返', textFill: '#fff', textAlign: 'middle', textVerticalAlign: 'top' @@ -141,7 +161,10 @@ export default class Station extends Group { }); this.turnBacks.push(turnBack); } - this.turnBacks.forEach(lamp => { this.add(lamp); }); + this.turnBacks.forEach(lamp => { + lamp.setArcBorder(style.Station.turnBack.showLampBorder); + this.add(lamp); + }); } } // 创建控制模式 diff --git a/src/jmapNew/shape/element/EControl.js b/src/jmapNew/shape/element/EControl.js index 423588802..60fbe7483 100644 --- a/src/jmapNew/shape/element/EControl.js +++ b/src/jmapNew/shape/element/EControl.js @@ -56,9 +56,14 @@ export default class EControl extends Group { zlevel: this.zlevel, z: this.z, silent: true, - shape: arcRect, + shape: { + x: arcRect.x - 2, + y: arcRect.y - 2, + width: arcRect.width + 4, + height: arcRect.height + 4 + }, style: { - lineDash: this.style.arcBorderStyle.lineDash, + lineDash: this.arcStyle.lineDash || this.style.arcBorderStyle.lineDash, stroke: this.style.arcBorderStyle.stroke, fill: this.style.arcBorderStyle.fill }