From 61c2260d939dba4bf9f1eca11bf45a82b1d67933 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 14 Apr 2020 15:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E5=AE=89=E4=BA=8C=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=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/xian_02.js | 185 +++++++++--------- src/jmapNew/constant/deviceRender.js | 31 ++- src/jmapNew/constant/deviceType.js | 8 +- .../shape/{Station => SaidLamp}/EAxle.js | 30 +-- .../{Station => SaidLamp}/EControlSwitch.js | 0 .../{Station => SaidLamp}/EDeviceStatus.js | 38 ++-- src/jmapNew/shape/SaidLamp/EFoldbackMode.js | 127 ++++++++++++ .../{Station => SaidLamp}/ELampFilament.js | 0 src/jmapNew/shape/SaidLamp/EModeStatus.js | 80 ++++++++ .../shape/{Station => SaidLamp}/EUnmanned.js | 0 src/jmapNew/shape/SaidLamp/index.js | 165 +++++++++++++--- src/jmapNew/shape/Station/EFoldbackMode.js | 127 ------------ src/jmapNew/shape/Station/index.js | 145 -------------- src/jmapNew/shape/factory.js | 6 + src/jmapNew/utils/parser.js | 12 ++ .../newMapdraft/mapoperate/ControlDraft.vue | 2 +- .../newMapdraft/mapoperate/controlLamp.vue | 95 ++++++++- .../newMap/newMapdraft/mapoperate/index.vue | 2 +- .../newMap/newMapdraft/mapoperate/station.vue | 144 +------------- 19 files changed, 619 insertions(+), 578 deletions(-) rename src/jmapNew/shape/{Station => SaidLamp}/EAxle.js (59%) rename src/jmapNew/shape/{Station => SaidLamp}/EControlSwitch.js (100%) rename src/jmapNew/shape/{Station => SaidLamp}/EDeviceStatus.js (65%) create mode 100644 src/jmapNew/shape/SaidLamp/EFoldbackMode.js rename src/jmapNew/shape/{Station => SaidLamp}/ELampFilament.js (100%) create mode 100644 src/jmapNew/shape/SaidLamp/EModeStatus.js rename src/jmapNew/shape/{Station => SaidLamp}/EUnmanned.js (100%) delete mode 100644 src/jmapNew/shape/Station/EFoldbackMode.js diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index bf4330bbb..883401540 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -346,94 +346,6 @@ class SkinCode extends defaultStyle { lamp: 1, // 灯数量 lampSpace: 60 // 灯间距 }, - unmanned: { // 无人折返标识 - width: 25, // 无人折返宽度 - defaultColor: '#9F9C9C', // 默认颜色 - activeColor: '#FFFFFF' // 激活颜色 - }, - lampFilament:{ // 信号机灯丝警告 - width: 12, - defaultColor: '#9F9C9C', // 默认颜色 - warningColor: '#FFFF00' // 告警颜色 - }, - controlSwitch: { // LCW/ATS控制开关 - width: 25, - defaultColor: '#FFFFFF', // 默认颜色 - lcwColor: '#FFFF00', // LCW控制颜色 - faultColor: '#FF0000' // 故障颜色 - }, - foldbackMode: { // 折返模式组 - insideDistance: 2, // 折返模块边框内部距离 - outsideDistance: 10, // 折返模块边框之间距离 - rectWidth: 20, // 折返模块宽度 - lineWidth: 3, // 折返模块线宽 - fillColor: 'rgba(0,0,0,0)', // 填充色 - strokeColor: '#FFFFFF' // 线颜色 - }, - axle: { - lineLength: 14, - lineWidth: 2, - distance: 5, - radiusR: 3, - strokeColor: '#9F9C9C', - fillColor: '#9F9C9C', - resetStrokeColor: '#FFFF00', - resetFillColor: '#FFFF00' - }, - controlMode: { - fontSize: 12, // 字体大小 - distance: 30, // 模式间距 - routeMode: { - defaultText: 'AU', // 默认状态 启动自动进路模式 - defaultColor: '#00FF00', // 默认状态 启动自动进路模式 - artificialRouteText: 'MU', // 人工进路模式 - artificialRouteColor: '#FF0000' // 人工进路模式 - }, - stationControlMode: { - defaultText: 'CC', // 中央控制车站 - defaultColor: '#FFFFFF', // 中央控制车站 - localControlText: 'LC', // 本地控制车站 - localControlColor: '#FFFF00', // 本地控制车站 - emergencyControlText: 'EL', // 本地紧急越权控制 - emergencyControlColor: '#FF0000' // 本地紧急越权控制 - }, - stationCommunication: { - defaultText: 'CL', // 现场建立通信 - defaultColor: '#00FF00', // 现场建立通信 - disconnectText: 'DL', // 现场连接断开 - disconnectColor: '#FF0000' - }, - verifyBypass: { - defaultText: 'VA', // 默认 验证生效 - defaultColor: '#00FF00', // 默认 验证生效 - invalidText: 'BV', // 验证旁路检查(无检验起效) - invalidColor: '#FF0000' // 验证旁路检查(无检验起效) - } - }, - deviceStatus: { - fontSize: 12, // 字体大小 - distance: 30, // 模式间距 - psd: { - text: 'PSD', - defaultColor: '#FFF' - }, - mfa: { - text: 'MFA', - defaultColor: '#FFF' - }, - mfb: { - text: 'MFB', - defaultColor: '#FFF' - }, - pfa: { - text: 'PFA', - defaultColor: '#FFF' - }, - pfb: { - text: 'PFB', - defaultColor: '#FFF' - } - }, StationControl:{ text: { distance: 2, // 灯和文字之间的距离 @@ -588,7 +500,102 @@ class SkinCode extends defaultStyle { lineWidth: 1, // 车次窗线宽 trainWindowSmooth: 0 // 车次窗矩形圆滑程度 }; - + this[deviceType.NoOneReturn] = { + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + showShape: 'Unmanned', // 显示形状 svg 的Unmanneds + width: 25, // 无人折返宽度 + defaultColor: '#9F9C9C', // 默认颜色 + activeColor: '#FFFFFF' // 激活颜色 + }; + this[deviceType.Axle] = { + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + lineLength: 14, + lineWidth: 2, + distance: 5, + radiusR: 3, + strokeColor: '#9F9C9C', + fillColor: '#9F9C9C', + resetStrokeColor: '#FFFF00', + resetFillColor: '#FFFF00' + }; + this[deviceType.FaultStatusGroup] = { // 故障状态 + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + fontSize: 12, // 字体大小 + distance: 30, // 模式间距 + psd: { + text: 'PSD', + defaultColor: '#FFF' + }, + mfa: { + text: 'MFA', + defaultColor: '#FFF' + }, + mfb: { + text: 'MFB', + defaultColor: '#FFF' + }, + pfa: { + text: 'PFA', + defaultColor: '#FFF' + }, + pfb: { + text: 'PFB', + defaultColor: '#FFF' + } + }; + this[deviceType.ReturnModeGroup] = { + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + insideDistance: 2, // 折返模块边框内部距离 + outsideDistance: 10, // 折返模块边框之间距离 + rectWidth: 20, // 折返模块宽度 + lineWidth: 3, // 折返模块线宽 + fillColor: 'rgba(0,0,0,0)', // 填充色 + strokeColor: '#FFFFFF' // 线颜色 + }; + this[deviceType.ModeStatusGroup] = { // 车站状态模式 + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + fontSize: 12, // 字体大小 + distance: 30, // 模式间距 + routeMode: { + defaultText: 'AU', // 默认状态 启动自动进路模式 + defaultColor: '#00FF00', // 默认状态 启动自动进路模式 + artificialRouteText: 'MU', // 人工进路模式 + artificialRouteColor: '#FF0000' // 人工进路模式 + }, + stationControlMode: { + defaultText: 'CC', // 中央控制车站 + defaultColor: '#FFFFFF', // 中央控制车站 + localControlText: 'LC', // 本地控制车站 + localControlColor: '#FFFF00', // 本地控制车站 + emergencyControlText: 'EL', // 本地紧急越权控制 + emergencyControlColor: '#FF0000' // 本地紧急越权控制 + }, + stationCommunication: { + defaultText: 'CL', // 现场建立通信 + defaultColor: '#00FF00', // 现场建立通信 + disconnectText: 'DL', // 现场连接断开 + disconnectColor: '#FF0000' + }, + verifyBypass: { + defaultText: 'VA', // 默认 验证生效 + defaultColor: '#00FF00', // 默认 验证生效 + invalidText: 'BV', // 验证旁路检查(无检验起效) + invalidColor: '#FF0000' // 验证旁路检查(无检验起效) + } + }; + this[deviceType.ControlSwitch] = { // 控制开关 + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + width: 25, + defaultColor: '#FFFFFF', // 默认颜色 + lcwColor: '#FFFF00', // LCW控制颜色 + faultColor: '#FF0000' // 故障颜色 + }; + this[deviceType.LampFilament] = { // 灯丝告警 + displayCondition: '01', // 显示条件 (01所有模式下显示 02 行调显示 03现地显示) + width: 12, + defaultColor: '#9F9C9C', // 默认颜色 + warningColor: '#FFFF00' // 告警颜色 + }; this[deviceType.Train] = { trainBody: { trainBodyLineWidth: 1, // 车身line宽 diff --git a/src/jmapNew/constant/deviceRender.js b/src/jmapNew/constant/deviceRender.js index 74018fed6..61f0c9f7a 100644 --- a/src/jmapNew/constant/deviceRender.js +++ b/src/jmapNew/constant/deviceRender.js @@ -200,5 +200,34 @@ deviceRender[deviceType.ZcCommunication] = { _type: deviceType.ZcCommunication, zlevel: 1 }; - +/** FaultStatusGroup 故障状态表示组(西安二号线) */ +deviceRender[deviceType.FaultStatusGroup] = { + _type: deviceType.FaultStatusGroup, + zlevel: 1 +}; +/** ModeStatusGroup 车站状态模式表示组(西安二号线) */ +deviceRender[deviceType.ModeStatusGroup] = { + _type: deviceType.ModeStatusGroup, + zlevel: 1 +}; +/** LampFilament 信号灯丝告警 */ +deviceRender[deviceType.LampFilament] = { + _type: deviceType.LampFilament, + zlevel: 1 +}; +/** ReturnModeGroup 折返模式组(西安二号线) */ +deviceRender[deviceType.ReturnModeGroup] = { + _type: deviceType.ReturnModeGroup, + zlevel: 1 +}; +/** ControlSwitch LCW/ATS控制开关 */ +deviceRender[deviceType.ControlSwitch] = { + _type: deviceType.ControlSwitch, + zlevel: 1 +}; +/** Axle 计轴预复位 */ +deviceRender[deviceType.Axle] = { + _type:deviceType.Axle, + zlevel: 1 +}; export default deviceRender; diff --git a/src/jmapNew/constant/deviceType.js b/src/jmapNew/constant/deviceType.js index 4e2aeed9e..4dd7eebfa 100644 --- a/src/jmapNew/constant/deviceType.js +++ b/src/jmapNew/constant/deviceType.js @@ -33,7 +33,13 @@ const deviceType = { PowerSupply: 'PowerSupply', NoOneReturn: 'NoOneReturn', MaintenanceLamps: 'MaintenanceLamps', - ZcCommunication: 'ZcCommunication' + ZcCommunication: 'ZcCommunication', + FaultStatusGroup: 'FaultStatusGroup', + ModeStatusGroup: 'ModeStatusGroup', + LampFilament: 'LampFilament', + ReturnModeGroup: 'ReturnModeGroup', + ControlSwitch: 'ControlSwitch', + Axle: 'Axle' }; export default deviceType; diff --git a/src/jmapNew/shape/Station/EAxle.js b/src/jmapNew/shape/SaidLamp/EAxle.js similarity index 59% rename from src/jmapNew/shape/Station/EAxle.js rename to src/jmapNew/shape/SaidLamp/EAxle.js index 4b9d0aac0..8ac219f93 100644 --- a/src/jmapNew/shape/Station/EAxle.js +++ b/src/jmapNew/shape/SaidLamp/EAxle.js @@ -18,54 +18,54 @@ export default class EAxle extends Group { shape: { x1: model.x, y1: model.y, - x2: model.x + model.style.Station.axle.lineLength, + x2: model.x + model.style.Axle.lineLength, y2: model.y }, style: { - lineWidth: model.style.Station.axle.lineWidth, - stroke: model.style.Station.axle.strokeColor + lineWidth: model.style.Axle.lineWidth, + stroke: model.style.Axle.strokeColor } }); this.arc1 = new Arc({ zlevel: this.zlevel, z: this.z, shape: { - cx: model.x + model.style.Station.axle.distance, + cx: model.x + model.style.Axle.distance, cy: model.y, - r: model.style.Station.axle.radiusR + r: model.style.Axle.radiusR }, style: { lineWidth: 0, - fill: model.style.Station.axle.fillColor, - stroke: model.style.Station.axle.strokeColor + fill: model.style.Axle.fillColor, + stroke: model.style.Axle.strokeColor } }); this.line2 = new Line({ zlevel: this.zlevel, z: this.z, shape: { - x1: model.x + model.style.Station.axle.lineLength + model.style.Station.axle.distance, + x1: model.x + model.style.Axle.lineLength + model.style.Axle.distance, y1: model.y, - x2: model.x + model.style.Station.axle.lineLength * 2 + model.style.Station.axle.distance, + x2: model.x + model.style.Axle.lineLength * 2 + model.style.Axle.distance, y2: model.y }, style: { - lineWidth: model.style.Station.axle.lineWidth, - stroke: model.style.Station.axle.strokeColor + lineWidth: model.style.Axle.lineWidth, + stroke: model.style.Axle.strokeColor } }); this.arc2 = new Arc({ zlevel: this.zlevel, z: this.z, shape: { - cx: model.x + model.style.Station.axle.lineLength * 2, + cx: model.x + model.style.Axle.lineLength * 2, cy: model.y, - r: model.style.Station.axle.radiusR + r: model.style.Axle.radiusR }, style: { lineWidth: 0, - fill: model.style.Station.axle.fillColor, - stroke: model.style.Station.axle.strokeColor + fill: model.style.Axle.fillColor, + stroke: model.style.Axle.strokeColor } }); this.add(this.line1); diff --git a/src/jmapNew/shape/Station/EControlSwitch.js b/src/jmapNew/shape/SaidLamp/EControlSwitch.js similarity index 100% rename from src/jmapNew/shape/Station/EControlSwitch.js rename to src/jmapNew/shape/SaidLamp/EControlSwitch.js diff --git a/src/jmapNew/shape/Station/EDeviceStatus.js b/src/jmapNew/shape/SaidLamp/EDeviceStatus.js similarity index 65% rename from src/jmapNew/shape/Station/EDeviceStatus.js rename to src/jmapNew/shape/SaidLamp/EDeviceStatus.js index 17927e4bf..4ac3673d2 100644 --- a/src/jmapNew/shape/Station/EDeviceStatus.js +++ b/src/jmapNew/shape/SaidLamp/EDeviceStatus.js @@ -18,10 +18,10 @@ export default class EDeviceStatus extends Group { x: model.x, y: model.y, fontWeight: model.style.textStyle.fontWeight, - fontSize: model.style.Station.deviceStatus.fontSize, + fontSize: model.style.FaultStatusGroup.fontSize, fontFamily: model.style.fontFamily, - text: model.style.Station.deviceStatus.psd.text, - textFill: model.style.Station.deviceStatus.psd.defaultColor, + text: model.style.FaultStatusGroup.psd.text, + textFill: model.style.FaultStatusGroup.psd.defaultColor, textAlign: model.style.textStyle.textAlign, textVerticalAlign: model.style.textStyle.textVerticalAlign } @@ -30,13 +30,13 @@ export default class EDeviceStatus extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.x + model.style.Station.deviceStatus.distance, + x: model.x + model.style.FaultStatusGroup.distance, y: model.y, fontWeight: model.style.textStyle.fontWeight, - fontSize: model.style.Station.deviceStatus.fontSize, + fontSize: model.style.FaultStatusGroup.fontSize, fontFamily: model.style.fontFamily, - text: model.style.Station.deviceStatus.mfa.text, - textFill: model.style.Station.deviceStatus.mfa.defaultColor, + text: model.style.FaultStatusGroup.mfa.text, + textFill: model.style.FaultStatusGroup.mfa.defaultColor, textAlign: model.style.textStyle.textAlign, textVerticalAlign: model.style.textStyle.textVerticalAlign } @@ -45,13 +45,13 @@ export default class EDeviceStatus extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.x + model.style.Station.deviceStatus.distance * 2, + x: model.x + model.style.FaultStatusGroup.distance * 2, y: model.y, fontWeight: model.style.textStyle.fontWeight, - fontSize: model.style.Station.deviceStatus.fontSize, + fontSize: model.style.FaultStatusGroup.fontSize, fontFamily: model.style.fontFamily, - text: model.style.Station.deviceStatus.mfb.text, - textFill: model.style.Station.deviceStatus.mfb.defaultColor, + text: model.style.FaultStatusGroup.mfb.text, + textFill: model.style.FaultStatusGroup.mfb.defaultColor, textAlign: model.style.textStyle.textAlign, textVerticalAlign: model.style.textStyle.textVerticalAlign } @@ -60,13 +60,13 @@ export default class EDeviceStatus extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.x + model.style.Station.deviceStatus.distance * 3, + x: model.x + model.style.FaultStatusGroup.distance * 3, y: model.y, fontWeight: model.style.textStyle.fontWeight, - fontSize: model.style.Station.deviceStatus.fontSize, + fontSize: model.style.FaultStatusGroup.fontSize, fontFamily: model.style.fontFamily, - text: model.style.Station.deviceStatus.pfa.text, - textFill: model.style.Station.deviceStatus.pfa.defaultColor, + text: model.style.FaultStatusGroup.pfa.text, + textFill: model.style.FaultStatusGroup.pfa.defaultColor, textAlign: model.style.textStyle.textAlign, textVerticalAlign: model.style.textStyle.textVerticalAlign } @@ -75,13 +75,13 @@ export default class EDeviceStatus extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.x + model.style.Station.deviceStatus.distance * 4, + x: model.x + model.style.FaultStatusGroup.distance * 4, y: model.y, fontWeight: model.style.textStyle.fontWeight, - fontSize: model.style.Station.deviceStatus.fontSize, + fontSize: model.style.FaultStatusGroup.fontSize, fontFamily: model.style.fontFamily, - text: model.style.Station.deviceStatus.pfb.text, - textFill: model.style.Station.deviceStatus.pfb.defaultColor, + text: model.style.FaultStatusGroup.pfb.text, + textFill: model.style.FaultStatusGroup.pfb.defaultColor, textAlign: model.style.textStyle.textAlign, textVerticalAlign: model.style.textStyle.textVerticalAlign } diff --git a/src/jmapNew/shape/SaidLamp/EFoldbackMode.js b/src/jmapNew/shape/SaidLamp/EFoldbackMode.js new file mode 100644 index 000000000..f74c838dd --- /dev/null +++ b/src/jmapNew/shape/SaidLamp/EFoldbackMode.js @@ -0,0 +1,127 @@ +import Group from 'zrender/src/container/Group'; +import Rect from 'zrender/src/graphic/shape/Rect'; +import Line from 'zrender/src/graphic/shape/Line'; + +export default class EFoldbackMode extends Group { + constructor(model) { + super(); + this.model = model; + this.zlevel = model.zlevel; + this._subType = model._subType; + this.z = model.z; + this.onmouseover = model.mouseover; + this.onmouseout = model.mouseout; + this.create(model); + } + create(model) { + const style = model.style; + this.lateralLinePriorityRect = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: model.x, + y: model.y, + width: model.width, + height:model.width + }, + style: { + lineWidth: style.ReturnModeGroup.lineWidth, + stroke: style.ReturnModeGroup.strokeColor, + fill: style.ReturnModeGroup.fillColor + } + }); + this.lateralLinePriority1 = new Line({ + zlevel: model.zlevel, + z: model.z, + shape: { + x1: model.x + model.style.ReturnModeGroup.insideDistance, + y1: model.y + model.style.ReturnModeGroup.insideDistance, + x2: model.x + model.width - style.ReturnModeGroup.insideDistance, + y2: model.y + model.width - style.ReturnModeGroup.insideDistance + }, + style: { + lineWidth: model.style.ReturnModeGroup.lineWidth, + stroke: model.style.ReturnModeGroup.strokeColor + } + }); + this.lateralLinePriority2 = new Line({ + zlevel: model.zlevel, + z: model.z, + shape: { + x1: model.x + model.width - style.ReturnModeGroup.insideDistance, + y1: model.y + style.ReturnModeGroup.insideDistance, + x2: model.x + style.ReturnModeGroup.insideDistance, + y2: model.y + model.width - style.ReturnModeGroup.insideDistance + }, + style: { + lineWidth: style.ReturnModeGroup.lineWidth, + stroke: style.ReturnModeGroup.strokeColor + } + }); + this.add(this.lateralLinePriorityRect); + this.add(this.lateralLinePriority1); + this.add(this.lateralLinePriority2); + this.linearFoldbackRect = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: model.x + model.width + style.ReturnModeGroup.outsideDistance, + y: model.y, + width: model.width, + height:model.width + }, + style: { + lineWidth: style.ReturnModeGroup.lineWidth, + stroke: style.ReturnModeGroup.strokeColor, + fill: style.ReturnModeGroup.fillColor + } + }); + this.linearFoldback = new Line({ + zlevel: model.zlevel, + z: model.z, + shape: { + x1: model.x + model.width + style.ReturnModeGroup.outsideDistance + style.ReturnModeGroup.insideDistance, + y1: model.y + model.width / 2, + x2: model.x + model.width * 2 + style.ReturnModeGroup.outsideDistance - style.ReturnModeGroup.insideDistance, + y2: model.y + model.width / 2 + }, + style: { + lineWidth: style.ReturnModeGroup.lineWidth, + stroke: style.ReturnModeGroup.strokeColor + } + }); + this.add(this.linearFoldbackRect); + this.add(this.linearFoldback); + this.lateralLineRect = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: model.x + model.width * 2 + style.ReturnModeGroup.outsideDistance * 2, + y: model.y, + width: model.width, + height:model.width + }, + style: { + lineWidth: style.ReturnModeGroup.lineWidth, + stroke: style.ReturnModeGroup.strokeColor, + fill: style.ReturnModeGroup.fillColor + } + }); + this.lateralLine = new Line({ + zlevel: model.zlevel, + z: model.z, + shape: { + x1: model.x + model.width * 2 + style.ReturnModeGroup.outsideDistance * 2 + style.ReturnModeGroup.insideDistance, + y1: model.y + model.width - style.ReturnModeGroup.insideDistance, + x2: model.x + model.width * 3 + style.ReturnModeGroup.outsideDistance * 2 - style.ReturnModeGroup.insideDistance, + y2: model.y + style.ReturnModeGroup.insideDistance + }, + style: { + lineWidth: style.ReturnModeGroup.lineWidth, + stroke: style.ReturnModeGroup.strokeColor + } + }); + this.add(this.lateralLineRect); + this.add(this.lateralLine); + } +} diff --git a/src/jmapNew/shape/Station/ELampFilament.js b/src/jmapNew/shape/SaidLamp/ELampFilament.js similarity index 100% rename from src/jmapNew/shape/Station/ELampFilament.js rename to src/jmapNew/shape/SaidLamp/ELampFilament.js diff --git a/src/jmapNew/shape/SaidLamp/EModeStatus.js b/src/jmapNew/shape/SaidLamp/EModeStatus.js new file mode 100644 index 000000000..3d44b2bcf --- /dev/null +++ b/src/jmapNew/shape/SaidLamp/EModeStatus.js @@ -0,0 +1,80 @@ +import Group from 'zrender/src/container/Group'; +import Text from 'zrender/src/graphic/Text'; + +export default class EDeviceStatus extends Group { + constructor(model) { + super(); + this.model = model; + this.zlevel = model.zlevel; + this._subType = model._subType; + this.z = model.z; + this.create(model); + } + create(model) { + const style = this.model.style; + this.routeMode = new Text({ + zlevel: this.zlevel, + z: this.z, + style: { + x: model.x, + y: model.y, + fontWeight: style.textStyle.fontWeight, + fontSize: style.ModeStatusGroup.fontSize, + fontFamily: style.fontFamily, + text: style.ModeStatusGroup.routeMode.defaultText, + textFill: style.ModeStatusGroup.routeMode.defaultColor, + textAlign: style.textStyle.textAlign, + textVerticalAlign: style.textStyle.textVerticalAlign + } + }); + this.stationControlMode = new Text({ + zlevle: this.zlevle, + z: this.z, + style: { + x: model.x + style.ModeStatusGroup.distance, + y: model.y, + fontWeight: style.textStyle.fontWeight, + fontSize: style.ModeStatusGroup.fontSize, + fontFamily: style.fontFamily, + text: style.ModeStatusGroup.stationControlMode.defaultText, + textFill: style.ModeStatusGroup.stationControlMode.defaultColor, + textAlign: style.textStyle.textAlign, + textVerticalAlign: style.textStyle.textVerticalAlign + } + }); + this.stationCommunication = new Text({ + zlevel: this.zlevel, + z: this.z, + style: { + x: model.x + style.ModeStatusGroup.distance * 2, + y: model.y, + fontWeight: style.textStyle.fontWeight, + fontSize: style.ModeStatusGroup.fontSize, + fontFamily: style.fontFamily, + text: style.ModeStatusGroup.stationCommunication.defaultText, + textFill: style.ModeStatusGroup.stationControlMode.defaultColor, + textAlign: style.textStyle.textAlign, + textVerticalAlign: style.textStyle.textVerticalAlign + } + }); + this.verifyBypass = new Text({ + zlevel: this.zlevel, + z: this.z, + style: { + x: model.x + style.ModeStatusGroup.distance * 3, + y: model.y, + fontWeight: style.textStyle.fontWeight, + fontSize: style.ModeStatusGroup.fontSize, + fontFamily: style.fontFamily, + text: style.ModeStatusGroup.verifyBypass.defaultText, + textFill: style.ModeStatusGroup.verifyBypass.defaultColor, + textAlign: style.textStyle.textAlign, + textVerticalAlign: style.textStyle.textVerticalAlign + } + }); + this.add(this.routeMode); + this.add(this.stationControlMode); + this.add(this.stationCommunication); + this.add(this.verifyBypass); + } +} diff --git a/src/jmapNew/shape/Station/EUnmanned.js b/src/jmapNew/shape/SaidLamp/EUnmanned.js similarity index 100% rename from src/jmapNew/shape/Station/EUnmanned.js rename to src/jmapNew/shape/SaidLamp/EUnmanned.js diff --git a/src/jmapNew/shape/SaidLamp/index.js b/src/jmapNew/shape/SaidLamp/index.js index 69a0c618a..d4b59b9d5 100644 --- a/src/jmapNew/shape/SaidLamp/index.js +++ b/src/jmapNew/shape/SaidLamp/index.js @@ -3,6 +3,13 @@ import EControl from '../element/EControl'; import EMouse from './EMouse'; import {isShowThePrdType} from '../../utils/handlePath'; import deviceType from '../../constant/deviceType'; +import ELampFilament from './ELampFilament'; +import EControlSwitch from './EControlSwitch'; +import EFoldbackMode from './EFoldbackMode'; +import EDeviceStatus from './EDeviceStatus'; +import EModeStatus from './EModeStatus'; +import EUnmanned from './EUnmanned'; +import EAxle from './EAxle'; export default class SaidLamp extends Group { constructor(model, style) { @@ -14,6 +21,7 @@ export default class SaidLamp extends Group { this.model = model; this.style = style; this.deviceStyle = style[model._type]; + if (!this.deviceStyle) { return; } this.isShowShape = true; if (isShowThePrdType(model.prdType, this.deviceStyle.displayCondition) || model.previewOrMapDraw) { this.create(); @@ -27,35 +35,138 @@ export default class SaidLamp extends Group { create() { const model = this.model; - this.control = new EControl({ - zlevel: this.zlevel, - z: this.z, - arc: { - shape: { - cx: model.position.x, - cy: model.position.y, - r: this.deviceStyle.lamp.radiusR + const lampDevice = ['LeuControl', 'IntersiteControl', 'CenterCommunication', 'AtsControl', 'LocalControl', 'ChainControl', 'Maintain', 'PowerSupply', 'MaintenanceLamps', 'ZcCommunication']; + if (lampDevice.includes(this._type)) { + this.control = new EControl({ + zlevel: this.zlevel, + z: this.z, + arc: { + shape: { + cx: model.position.x, + cy: model.position.y, + r: this.deviceStyle.lamp.radiusR + }, + subType: 'Control', + lineWidth: 0, + fill: this.deviceStyle.lamp.controlColor }, - subType: 'Control', - lineWidth: 0, - fill: this.deviceStyle.lamp.controlColor - }, - text: { - position: [0, 0], + text: { + position: [0, 0], + x: model.position.x, + y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance, + fontWeight: this.deviceStyle.text.fontWeight, + fontSize: this.deviceStyle.text.fontSize, + fontFamily: this.style.fontFamily, + text: model.name, + textFill: '#fff', + textAlign: 'middle', + textVerticalAlign: 'top' + }, + style: this.style + }); + this.add(this.control); + } else if (this._type === 'LampFilament') { + this.control = new ELampFilament({ + zlevel: this.zlevel, + z: this.z, x: model.position.x, - y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance, - fontWeight: this.deviceStyle.text.fontWeight, - fontSize: this.deviceStyle.text.fontSize, - fontFamily: this.style.fontFamily, - text: model.name, - textFill: '#fff', - textAlign: 'middle', - textVerticalAlign: 'top' - }, - style: this.style - }); - - this.add(this.control); + y: model.position.y, + _subType: 'LampFilament', + width: this.deviceStyle.width, + fill: this.deviceStyle.defaultColor + }); + this.add(this.control); + } else if (this._type === 'ControlSwitch') { + this.control = new EControlSwitch({ + zlevel: this.zlevel, + z: this.z, + x: model.position.x, + y: model.position.y, + _subType: 'ControlSwitch', + width: this.deviceStyle.width, + fill: this.deviceStyle.defaultColor + }); + this.add(this.control); + } else if (this._type === 'FaultStatusGroup') { + this.control = new EDeviceStatus({ + zlevel: this.zlevel, + z: this.z, + x: model.position.x, + y: model.position.y, + style: this.style + }); + this.add(this.control); + } else if (this._type === 'ReturnModeGroup') { + this.control = new EFoldbackMode({ + zlevel: this.zlevel, + z: this.z, + x: model.position.x, + y: model.position.y, + width: this.deviceStyle.rectWidth, + style: this.style + }); + this.add(this.control); + } else if (this._type === 'ModeStatusGroup') { + this.control = new EModeStatus({ + zlevel: this.zlevel, + z: this.z, + x: model.position.x, + y: model.position.y, + style: this.style + }); + this.add(this.control); + } else if (this._type === 'Axle') { + this.control = new EAxle({ + zlevel: this.zlevel, + z: this.z, + x: model.position.x, + y: model.position.y, + style: this.style + }); + this.add(this.control); + } else if (this._type === 'NoOneReturn') { + if (this.deviceStyle.showShape === 'Unmanned') { + this.control = new EUnmanned({ + zlevel: this.zlevel, + z: this.z, + x: model.unmannedPosition.x, + y: model.unmannedPosition.y, + _subType: 'Unmanned', + width: this.style.NoOneReturn.width, + fill: this.style.NoOneReturn.defaultColor + }); + this.add(this.control); + } else { + this.control = new EControl({ + zlevel: this.zlevel, + z: this.z, + arc: { + shape: { + cx: model.position.x, + cy: model.position.y, + r: this.deviceStyle.lamp.radiusR + }, + subType: 'Control', + lineWidth: 0, + fill: this.deviceStyle.lamp.controlColor + }, + text: { + position: [0, 0], + x: model.position.x, + y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance, + fontWeight: this.deviceStyle.text.fontWeight, + fontSize: this.deviceStyle.text.fontSize, + fontFamily: this.style.fontFamily, + text: model.name, + textFill: '#fff', + textAlign: 'middle', + textVerticalAlign: 'top' + }, + style: this.style + }); + this.add(this.control); + } + } } // 设置状态 diff --git a/src/jmapNew/shape/Station/EFoldbackMode.js b/src/jmapNew/shape/Station/EFoldbackMode.js deleted file mode 100644 index 060ab916f..000000000 --- a/src/jmapNew/shape/Station/EFoldbackMode.js +++ /dev/null @@ -1,127 +0,0 @@ -import Group from 'zrender/src/container/Group'; -import Rect from 'zrender/src/graphic/shape/Rect'; -import Line from 'zrender/src/graphic/shape/Line'; - -export default class EFoldbackMode extends Group { - constructor(model) { - super(); - this.model = model; - this.zlevel = model.zlevel; - this._subType = model._subType; - this.z = model.z; - this.onmouseover = model.mouseover; - this.onmouseout = model.mouseout; - this.create(model); - } - create(model) { - const style = model.style; - this.lateralLinePriorityRect = new Rect({ - zlevel: this.zlevel, - z: this.z, - shape: { - x: model.x, - y: model.y, - width: model.width, - height:model.width - }, - style: { - lineWidth: style.Station.foldbackMode.lineWidth, - stroke: style.Station.foldbackMode.strokeColor, - fill: style.Station.foldbackMode.fillColor - } - }); - this.lateralLinePriority1 = new Line({ - zlevel: model.zlevel, - z: model.z, - shape: { - x1: model.x + model.style.Station.foldbackMode.insideDistance, - y1: model.y + model.style.Station.foldbackMode.insideDistance, - x2: model.x + model.width - style.Station.foldbackMode.insideDistance, - y2: model.y + model.width - style.Station.foldbackMode.insideDistance - }, - style: { - lineWidth: model.style.Station.foldbackMode.lineWidth, - stroke: model.style.Station.foldbackMode.strokeColor - } - }); - this.lateralLinePriority2 = new Line({ - zlevel: model.zlevel, - z: model.z, - shape: { - x1: model.x + model.width - style.Station.foldbackMode.insideDistance, - y1: model.y + style.Station.foldbackMode.insideDistance, - x2: model.x + style.Station.foldbackMode.insideDistance, - y2: model.y + model.width - style.Station.foldbackMode.insideDistance - }, - style: { - lineWidth: style.Station.foldbackMode.lineWidth, - stroke: style.Station.foldbackMode.strokeColor - } - }); - this.add(this.lateralLinePriorityRect); - this.add(this.lateralLinePriority1); - this.add(this.lateralLinePriority2); - this.linearFoldbackRect = new Rect({ - zlevel: this.zlevel, - z: this.z, - shape: { - x: model.x + model.width + style.Station.foldbackMode.outsideDistance, - y: model.y, - width: model.width, - height:model.width - }, - style: { - lineWidth: style.Station.foldbackMode.lineWidth, - stroke: style.Station.foldbackMode.strokeColor, - fill: style.Station.foldbackMode.fillColor - } - }); - this.linearFoldback = new Line({ - zlevel: model.zlevel, - z: model.z, - shape: { - x1: model.x + model.width + style.Station.foldbackMode.outsideDistance + style.Station.foldbackMode.insideDistance, - y1: model.y + model.width / 2, - x2: model.x + model.width * 2 + style.Station.foldbackMode.outsideDistance - style.Station.foldbackMode.insideDistance, - y2: model.y + model.width / 2 - }, - style: { - lineWidth: style.Station.foldbackMode.lineWidth, - stroke: style.Station.foldbackMode.strokeColor - } - }); - this.add(this.linearFoldbackRect); - this.add(this.linearFoldback); - this.lateralLineRect = new Rect({ - zlevel: this.zlevel, - z: this.z, - shape: { - x: model.x + model.width * 2 + style.Station.foldbackMode.outsideDistance * 2, - y: model.y, - width: model.width, - height:model.width - }, - style: { - lineWidth: style.Station.foldbackMode.lineWidth, - stroke: style.Station.foldbackMode.strokeColor, - fill: style.Station.foldbackMode.fillColor - } - }); - this.lateralLine = new Line({ - zlevel: model.zlevel, - z: model.z, - shape: { - x1: model.x + model.width * 2 + style.Station.foldbackMode.outsideDistance * 2 + style.Station.foldbackMode.insideDistance, - y1: model.y + model.width - style.Station.foldbackMode.insideDistance, - x2: model.x + model.width * 3 + style.Station.foldbackMode.outsideDistance * 2 - style.Station.foldbackMode.insideDistance, - y2: model.y + style.Station.foldbackMode.insideDistance - }, - style: { - lineWidth: this.model.lineWidth, - stroke: this.model.fillColor - } - }); - this.add(this.lateralLineRect); - this.add(this.lateralLine); - } -} diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index b5a9dff8c..259bcbdb9 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -10,13 +10,7 @@ import EArrow from './EArrow'; import { arrow } from '../utils/ShapePoints'; import Rect from 'zrender/src/graphic/shape/Rect'; import BoundingRect from 'zrender/src/core/BoundingRect'; -import EUnmanned from './EUnmanned'; -import ELampFilament from './ELampFilament'; -import EControlSwitch from './EControlSwitch'; -import EAxle from './EAxle'; // import {isShowThePrdType} from '../../utils/handlePath'; -import EFoldbackMode from './EFoldbackMode'; -import EDeviceStatus from './EDeviceStatus'; import Text from 'zrender/src/graphic/Text'; export default class Station extends Group { @@ -32,7 +26,6 @@ export default class Station extends Group { this.create(); this.createTurnBack(); // 创建按图折返 this.createControlMode(); - this.createTextControlMode(); this.setState(model); this.checkIsDrawMap(); } @@ -62,73 +55,6 @@ export default class Station extends Group { this.stationText.setStyle('textBorderColor', model.nameFontColor); this.stationText.setStyle('textBorderWidth', 1); } - if (style.Station.unmanned && model.showUnmanned) { - this.unmanned = new EUnmanned({ - zlevel: this.zlevel, - z: this.z, - x: model.unmannedPosition.x, - y: model.unmannedPosition.y, - _subType: 'Unmanned', - width: style.Station.unmanned.width, - fill: style.Station.unmanned.defaultColor - }); - this.add(this.unmanned); - } - if (style.Station.lampFilament && model.showLampFilament) { - this.lampFilament = new ELampFilament({ - zlevel: this.zlevel, - z: this.z, - x: model.lampFilamentPosition.x, - y: model.lampFilamentPosition.y, - _subType: 'LampFilament', - width: style.Station.lampFilament.width, - fill: style.Station.lampFilament.defaultColor - }); - this.add(this.lampFilament); - } - if (style.Station.controlSwitch && model.showControlSwitch) { - this.controlSwitch = new EControlSwitch({ - zlevel: this.zlevel, - z: this.z, - x: model.controlSwitchPosition.x, - y: model.controlSwitchPosition.y, - _subType: 'ControlSwitch', - width: style.Station.controlSwitch.width, - fill: style.Station.controlSwitch.defaultColor - }); - this.add(this.controlSwitch); - } - if (style.Station.foldbackMode && model.showFoldbackMode) { - this.foldbackMode = new EFoldbackMode({ - zlevel: this.zlevel, - z: this.z, - x: model.foldbackModePosition.x, - y: model.foldbackModePosition.y, - width: style.Station.foldbackMode.rectWidth, - style: style - }); - this.add(this.foldbackMode); - } - if (style.Station.axle && model.showAxle) { - this.axle = new EAxle({ - zlevel: this.zlevel, - z: this.z, - x: model.axlePosition.x, - y: model.axlePosition.y, - style: style - }); - this.add(this.axle); - } - if (style.Station.deviceStatus && model.showDeviceStatus) { - this.deviceStatus = new EDeviceStatus({ - zlevel: this.zlevel, - z: this.z, - x: model.deviceStatusPosition.x, - y: model.deviceStatusPosition.y, - style: style - }); - this.add(this.deviceStatus); - } const path = window.location.href; if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示 @@ -217,77 +143,6 @@ export default class Station extends Group { this.turnBacks.forEach(lamp => { this.add(lamp); }); } } - // 创建文字控制模式组(西安二号线-(进路模式, 车站控制模式, 车站通信状态, 验证旁路)) - createTextControlMode() { - const model = this.model; - const style = this.style; - if (model.visible && model.textControlMode && style.Station.controlMode) { - this.routeMode = new Text({ - zlevel: this.zlevel, - z: this.z, - style: { - x: model.textControlModePosition.x, - y: model.textControlModePosition.y, - fontWeight: style.textStyle.fontWeight, - fontSize: style.Station.controlMode.fontSize, - fontFamily: style.fontFamily, - text: style.Station.controlMode.routeMode.defaultText, - textFill: style.Station.controlMode.routeMode.defaultColor, - textAlign: style.textStyle.textAlign, - textVerticalAlign: style.textStyle.textVerticalAlign - } - }); - this.stationControlMode = new Text({ - zlevle: this.zlevle, - z: this.z, - style: { - x: model.textControlModePosition.x + style.Station.controlMode.distance, - y: model.textControlModePosition.y, - fontWeight: style.textStyle.fontWeight, - fontSize: style.Station.controlMode.fontSize, - fontFamily: style.fontFamily, - text: style.Station.controlMode.stationControlMode.defaultText, - textFill: style.Station.controlMode.stationControlMode.defaultColor, - textAlign: style.textStyle.textAlign, - textVerticalAlign: style.textStyle.textVerticalAlign - } - }); - this.stationCommunication = new Text({ - zlevel: this.zlevel, - z: this.z, - style: { - x: model.textControlModePosition.x + style.Station.controlMode.distance * 2, - y: model.textControlModePosition.y, - fontWeight: style.textStyle.fontWeight, - fontSize: style.Station.controlMode.fontSize, - fontFamily: style.fontFamily, - text: style.Station.controlMode.stationCommunication.defaultText, - textFill: style.Station.controlMode.stationControlMode.defaultColor, - textAlign: style.textStyle.textAlign, - textVerticalAlign: style.textStyle.textVerticalAlign - } - }); - this.verifyBypass = new Text({ - zlevel: this.zlevel, - z: this.z, - style: { - x: model.textControlModePosition.x + style.Station.controlMode.distance * 3, - y: model.textControlModePosition.y, - fontWeight: style.textStyle.fontWeight, - fontSize: style.Station.controlMode.fontSize, - fontFamily: style.fontFamily, - text: style.Station.controlMode.verifyBypass.defaultText, - textFill: style.Station.controlMode.verifyBypass.defaultColor, - textAlign: style.textStyle.textAlign, - textVerticalAlign: style.textStyle.textVerticalAlign - } - }); - this.add(this.routeMode); - this.add(this.stationControlMode); - this.add(this.stationCommunication); - this.add(this.verifyBypass); - } - } // 创建控制模式 createControlMode() { const model = this.model; diff --git a/src/jmapNew/shape/factory.js b/src/jmapNew/shape/factory.js index 088fcae27..1bccf2338 100644 --- a/src/jmapNew/shape/factory.js +++ b/src/jmapNew/shape/factory.js @@ -58,6 +58,12 @@ mapShape[deviceType.PowerSupply] = SaidLamp; mapShape[deviceType.NoOneReturn] = SaidLamp; mapShape[deviceType.MaintenanceLamps] = SaidLamp; mapShape[deviceType.ZcCommunication] = SaidLamp; +mapShape[deviceType.ControlSwitch] = SaidLamp; +mapShape[deviceType.LampFilament] = SaidLamp; +mapShape[deviceType.ModeStatusGroup] = SaidLamp; +mapShape[deviceType.FaultStatusGroup] = SaidLamp; +mapShape[deviceType.ReturnModeGroup] = SaidLamp; +mapShape[deviceType.Axle] = SaidLamp; function shapefactory(device, jmap) { const type = device._type; diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index deeb34c7a..669adb89b 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -171,6 +171,12 @@ export function parser(data, skinCode, showConfig) { case 'ZcCommunication': mapDevice[elem.code] = createDevice(deviceType.ZcCommunication, elem, propConvert, showConfig); break; + case 'FaultStatusGroup': + mapDevice[elem.code] = createDevice(deviceType.FaultStatusGroup, elem, propConvert, showConfig); + break; + case 'Axle': + mapDevice[elem.code] = createDevice(deviceType.Axle, elem, propConvert, showConfig); + break; } }, this); @@ -283,6 +289,12 @@ export function updateMapData(state, model) { case deviceType.NoOneReturn: updateForList(model, state, 'indicatorLightList'); break; case deviceType.MaintenanceLamps: updateForList(model, state, 'indicatorLightList'); break; case deviceType.ZcCommunication: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.FaultStatusGroup: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.ModeStatusGroup: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.LampFilament: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.ReturnModeGroup: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.ControlSwitch: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.Axle: updateForList(model, state, 'indicatorLightList'); break; } } } diff --git a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue index b0a6ffdef..df05a0611 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue @@ -174,7 +174,7 @@ export default { }; }, isHiddenAutomaticRoute() { - return this.editModel.type == 'AutomaticRoute'; + return this.editModel.type === 'AutomaticRoute'; }, isHiddenMapCycleButtonVO() { return this.editModel.type == 'AutoTurnBack'; diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index 1cdd2bc0f..ce210146a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -1,6 +1,6 @@