diff --git a/src/assets/ctc_icon/rpadd.png b/src/assets/ctc_icon/rpadd.png new file mode 100644 index 000000000..8e1564bdf Binary files /dev/null and b/src/assets/ctc_icon/rpadd.png differ diff --git a/src/directive/dialogDrag/dialogDrag.js b/src/directive/dialogDrag/dialogDrag.js index 36af40898..5443adb03 100644 --- a/src/directive/dialogDrag/dialogDrag.js +++ b/src/directive/dialogDrag/dialogDrag.js @@ -10,10 +10,12 @@ export default { const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null); dialogHeaderEl.onmousedown = (e) => { - e.stopPropagation(); + e.stopPropagation(); /** 鼠标按下,计算当前元素距离可视区的距离*/ const disX = e.clientX - dialogHeaderEl.offsetLeft; const disY = e.clientY - dialogHeaderEl.offsetTop; + const oY = e.offsetY; + const bY = dialogHeaderEl.offsetHeight - e.offsetY; /** 获取到的值带px 正则匹配替换*/ let styL, styT; @@ -31,10 +33,18 @@ export default { } document.onmousemove = function (e) { - e.stopPropagation(); + e.preventDefault(); + e.stopPropagation(); + let cY = e.clientY; + if (cY < oY) { + cY = oY; + } + if (cY > document.body.clientHeight - bY) { + cY = document.body.clientHeight - bY; + } /** 通过事件委托,计算移动的距离*/ const l = e.clientX - disX; - const t = e.clientY - disY; + const t = cY - disY; /** 移动当前元素*/ dragDom.style.left = `${l + styL}px`; @@ -48,7 +58,7 @@ export default { }; document.onmouseup = function () { - e.stopPropagation(); + e.stopPropagation(); document.onmousemove = null; document.onmouseup = null; }; diff --git a/src/jmapNew/config/skinCode/datie_jd1a.js b/src/jmapNew/config/skinCode/datie_jd1a.js index b0ad9d229..e4244837c 100644 --- a/src/jmapNew/config/skinCode/datie_jd1a.js +++ b/src/jmapNew/config/skinCode/datie_jd1a.js @@ -88,8 +88,8 @@ class SkinCode extends defaultStyle { communicationOccupiedColor: '#FF0000', // 区段通信车占用颜色 (红色) unCommunicationOccupiedColor: '#FF0000', // 区段非通讯车占用颜色 (红色) - routeLockColor: '#FFFFFF', // 区段进路锁定颜色 (白色) - faultLockColor: '#006400', // 区段故障锁定颜色 + routeLockColor: '#FFFFFF', // 区段进路锁定颜色 (白色)<------ + faultLockColor: '#FF0000', // 区段故障锁定颜色 <---- undefinedColor: '#0071C1', // 区段未定义颜色 blockColor: '#00FF00', // 区段封锁颜色 @@ -533,7 +533,7 @@ class SkinCode extends defaultStyle { }, jointImg: { // 道岔 A B C D四元素属性配置 trapezoidLength: 8, // 直角梯形元素默认长度 - faultStatus: true, // 挤岔表示 + faultStatus: false, // 挤岔表示 fork: true, // 挤岔专用(如有挤岔操作 变为true) forKColor: 'red' // 挤岔颜色 配合挤岔专用 }, @@ -546,17 +546,22 @@ class SkinCode extends defaultStyle { rectLock: { // 矩形封锁框图形 rectWidth: 18, // 矩形框 宽高 rectBorderColor: '#fff', // 矩形边框颜色 - block: true, // 封锁显示 + block: false, // 封锁显示 blockColor: 'red', // 封锁颜色 followName: true // 位置跟随名称确定 }, arcBlcok: { // 圆形封锁图形 - show: true, // 显示 + show: false, // 显示 shapeR: 10, arcBorderColor: 'red', // 默认边框颜色 locationColor: 'red', // 定位封锁颜色 - inversionColor: 'red' // 反位封锁颜色 - } + inversionColor: 'red' // 反位封锁颜色 + }, + switchDot: { // 岔心小圆点 + show: true, + monoLockColor: '#ff0000', // 单锁 红色 + lockColor: '#0000ff' // 单封 蓝色 + }, }; this[deviceType.LcControl] = { diff --git a/src/jmapNew/constant/deviceType.js b/src/jmapNew/constant/deviceType.js index 9904005df..4d995bb06 100644 --- a/src/jmapNew/constant/deviceType.js +++ b/src/jmapNew/constant/deviceType.js @@ -51,15 +51,15 @@ const deviceType = { DirectionRod: 'DirectionRod', Responder: 'Responder', SignalButton: 'SignalButton', - PickArrow: 'PickArrow', - DepartArrow: 'DepartArrow', - Occlusion: 'Occlusion', - Accident: 'Accident', - Recovery: 'Recovery', - PickAssist: 'PickAssist', - DepartAssist: 'DepartAssist', - TotalAssist: 'TotalAssist', - AssistStatus: 'AssistStatus', - SectionOccupied: 'SectionOccupied' + PickArrow: 'PickArrow', + DepartArrow: 'DepartArrow', + Occlusion: 'Occlusion', + Accident: 'Accident', + Recovery: 'Recovery', + PickAssist: 'PickAssist', + DepartAssist: 'DepartAssist', + TotalAssist: 'TotalAssist', + AssistStatus: 'AssistStatus', + SectionOccupied: 'SectionOccupied' }; export default deviceType; diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 956be2648..d7e2b81c3 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -13,6 +13,7 @@ import { deepAssign } from '@/utils/index'; import * as adapter from '@/jmapNew/utils/adapter'; import store from '@/store/index'; import Vue from 'vue'; +// import {createDevice} from './parser/parser-graph'; const renderer = 'canvas'; const devicePixelRatio = 1; @@ -95,7 +96,12 @@ class Jlmap { return defaultStateDict; } - + updateTransform(scaling, origin) { + this.$options.scaleRate = scaling; + this.$options.offsetX = origin ? origin.x : 0; + this.$options.offsetY = origin ? origin.y : 0; + this.$painter.updateTransform({ scaleRate: scaling, offsetX: origin ? origin.x : 0, offsetY: origin ? origin.y : 0 }); + } setMap(map, mapDevice, logicData) { // 保存皮肤类型 if (map.skinVO) { @@ -406,6 +412,71 @@ class Jlmap { }); this.$painter.$transformHandle.revisibleAll(); } + updatePicture(list = []) { + list.forEach(item => { + const device = this.mapDevice[item]; + if (device && device._type !== deviceType.Switch && device._type !== deviceType.Train) { + const pictureDevice = store.getters['map/getPictureDeviceByCode'](item); + device._dispose = pictureDevice ? pictureDevice.pictureHide : false; + this.$painter.updatePicture(device); + try { + if (device._type === deviceType.Section && device.type === '03') { + this.mapDevice[device.switch.code]._dispose = pictureDevice ? pictureDevice.pictureHide : false; + this.computedSwitch(device.switch); + this.$painter.updatePicture(this.mapDevice[device.switch.code]); + } + } catch (e) { console.error(e); } + } + }); + } + handleResetPoint(points) { + return (points[points.length - 1].x >= points[0].x); + } + computedSwitch(switchDevice) { + const cnodeSection = this.mapDevice[switchDevice.sectionACode]; + const lnodeSection = this.mapDevice[switchDevice.sectionBCode]; + const rnodeSection = this.mapDevice[switchDevice.sectionCCode]; + + if (cnodeSection && lnodeSection && rnodeSection) { + let sectionCStar, sectionCEnd; + const rnodeSectionPoint = rnodeSection.instance ? rnodeSection.instance.computedPoints : rnodeSection.points; + const cnodeSectionPoint = cnodeSection.instance ? cnodeSection.instance.computedPoints : cnodeSection.points; + if (this.handleResetPoint(rnodeSection.points)) { + sectionCStar = rnodeSectionPoint[rnodeSectionPoint.length - 2]; + sectionCEnd = rnodeSectionPoint[1]; + } else { + sectionCStar = rnodeSectionPoint[1]; + sectionCEnd = rnodeSectionPoint[rnodeSectionPoint.length - 2]; + } + let intersectionStar, intersectionEnd; + if (this.handleResetPoint(cnodeSection.points)) { + intersectionStar = cnodeSectionPoint[0]; + intersectionEnd = cnodeSectionPoint[cnodeSectionPoint.length - 1]; + } else { + intersectionStar = cnodeSectionPoint[cnodeSectionPoint.length - 1]; + intersectionEnd = cnodeSectionPoint[0]; + } + if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) { + this.mapDevice[switchDevice.code].intersection = { + x: intersectionStar.x, + y: intersectionStar.y + }; + this.mapDevice[switchDevice.code].skew = { + x: sectionCStar.x, + y: sectionCStar.y + }; + } else if (cnodeSection.points[cnodeSection.points.length - 1].x == lnodeSection.points[0].x && cnodeSection.points[cnodeSection.points.length - 1].y == lnodeSection.points[0].y) { + this.mapDevice[switchDevice.code].intersection = { + x: intersectionEnd.x, + y: intersectionEnd.y + }; + this.mapDevice[switchDevice.code].skew = { + x: sectionCEnd.x, + y: sectionCEnd.y + }; + } + } + } update(list = [], fetch = true) { this.setUpdateMapDevice(list, fetch); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息 diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index d38195a0d..533de5072 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -106,7 +106,6 @@ class MouseController extends Eventful { this._x = e.offsetX; this._y = e.offsetY; - if (e.which == 1) { this._preventDefaultMouseMove && eventTool.stop(e.event); this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); @@ -251,11 +250,12 @@ class MouseController extends Eventful { if (item.instance && item.instance._type == deviceType.Section) { let deviceBoundingRect = {}; if (item.type == '04') { + const rect = item.instance.getNameBoundingRect(); deviceBoundingRect = { - x1: item.namePosition.x, - y1: item.namePosition.y, - x2: item.namePosition.x, - y2: item.namePosition.y + x1: rect.x, + y1: rect.y, + x2: rect.x + rect.width, + y2:rect.y + rect.height }; } else if (item.type == '05') { const rect = item.instance.getBoundingRect(); @@ -267,10 +267,10 @@ class MouseController extends Eventful { }; } else { deviceBoundingRect = { - x1: item.points[0].x, - y1: item.points[0].y, - x2: item.points[item.points.length - 1].x, - y2: item.points[item.points.length - 1].y + x1: item.instance.computedPoints[0].x, + y1: item.instance.computedPoints[0].y, + x2: item.instance.computedPoints[item.points.length - 1].x, + y2: item.instance.computedPoints[item.points.length - 1].y }; } if (this.whetherInclude(boundingRect, deviceBoundingRect )) { @@ -288,25 +288,25 @@ class MouseController extends Eventful { } } else if (item.instance && item.instance._type == deviceType.Signal) { const deviceBoundingRect = { - x1: item.position.x, - y1: item.position.y, - x2: item.position.x, - y2: item.position.y + x1: item.instance.computedPosition.x, + y1: item.instance.computedPosition.y, + x2: item.instance.computedPosition.x, + y2: item.instance.computedPosition.y }; if (this.whetherInclude(boundingRect, deviceBoundingRect )) { includeDeviceList.push(item); } } else if (item.instance && item.instance._type == deviceType.Psd) { const deviceBoundingRect = { - x1: item.position.x, - y1: item.position.y, - x2: item.position.x, - y2: item.position.y + x1: item.instance.computedPosition.x, + y1: item.instance.computedPosition.y, + x2: item.instance.computedPosition.x, + y2: item.instance.computedPosition.y }; if (this.whetherInclude(boundingRect, deviceBoundingRect )) { includeDeviceList.push(item); - } - } else if (item.instance && item.instance._type !== deviceType.TrainWindow && item.instance._type !== deviceType.CheckBox && item.instance._type !== deviceType.Train) { + } // item.instance._type !== deviceType.TrainWindow && + } else if (item.instance && item.instance._type !== deviceType.CheckBox && item.instance._type !== deviceType.Train) { const rect = item.instance.getBoundingRect(); const deviceBoundingRect = { x1: rect.x, diff --git a/src/jmapNew/options.js b/src/jmapNew/options.js index c2b07e786..b8840f9a2 100644 --- a/src/jmapNew/options.js +++ b/src/jmapNew/options.js @@ -2,7 +2,7 @@ class Options { constructor(opts, trigger) { this.scaleIndex = 0; this.scaleList = [ - 0.2, 0.4, 0.6, 0.8, 0.9, + 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js index a642e3474..396e9ae30 100644 --- a/src/jmapNew/painter.js +++ b/src/jmapNew/painter.js @@ -162,7 +162,22 @@ class Painter { this.$transformHandleScreen.transformView(device.instance); } } - + /** 画面更新 */ + updatePicture(device) { + if (device) { + try { + if (device._dispose) { + this.delete(device); + } else { + device.instance && this.mapInstanceLevel[device._type].remove(device.instance); + device.instance = null; + this.add(device); + } + } catch (err) { + console.error(err); + } + } + } /** * 更新视图 * @param {*} device @@ -182,6 +197,7 @@ class Painter { } } catch (err) { console.error(err); + console.log(device, 'device'); } } } diff --git a/src/jmapNew/parser/parser-graph.js b/src/jmapNew/parser/parser-graph.js index ec111bc16..141877f3b 100644 --- a/src/jmapNew/parser/parser-graph.js +++ b/src/jmapNew/parser/parser-graph.js @@ -194,7 +194,6 @@ export function parser(data, skinCode, showConfig) { // y: rnodeSection.points[1].y }; } - const section = mapDevice[cnodeSection.parentCode]; if (section) { mapDevice[elem.code].sectionName = section.name; @@ -350,16 +349,16 @@ export function updateMapData(state, model) { case deviceType.Axle: updateForList(model, state, 'indicatorLightList'); break; case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break; case deviceType.IndicatorLight: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.PickArrow: updateForList(model, state, 'indicatorLightList');break; - case deviceType.DepartArrow: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.Occlusion: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.Accident: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.Recovery: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.PickAssist: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.DepartAssist: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.TotalAssist: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.AssistStatus: updateForList(model, state, 'indicatorLightList'); break; - case deviceType.SectionOccupied: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.PickArrow: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.DepartArrow: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.Occlusion: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.Accident: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.Recovery: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.PickAssist: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.DepartAssist: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.TotalAssist: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.AssistStatus: updateForList(model, state, 'indicatorLightList'); break; + case deviceType.SectionOccupied: updateForList(model, state, 'indicatorLightList'); break; case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break; case deviceType.Arrow: updateForList(model, state, 'arrowList'); break; case deviceType.Power: updateForList(model, state, 'powerLineList'); break; diff --git a/src/jmapNew/shape/graph/Arrow/index.js b/src/jmapNew/shape/graph/Arrow/index.js index 5d30765fe..1a916d3b7 100644 --- a/src/jmapNew/shape/graph/Arrow/index.js +++ b/src/jmapNew/shape/graph/Arrow/index.js @@ -8,6 +8,12 @@ export default class Arrow extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.z = 0; this.model = model; // this.style = style; @@ -22,13 +28,13 @@ export default class Arrow extends Group { z: this.z, shape: { points: [ - [model.position.x, model.position.y], - [model.position.x + model.triangleLength, model.position.y - model.triangleHeight / 2], - [model.position.x + model.triangleLength, model.position.y - model.lineWidth / 2], - [model.position.x + model.length, model.position.y - model.lineWidth / 2], - [model.position.x + model.length, model.position.y + model.lineWidth / 2], - [model.position.x + model.triangleLength, model.position.y + model.lineWidth / 2], - [model.position.x + model.triangleLength, model.position.y + model.triangleHeight / 2] + [this.computedPosition.x, this.computedPosition.y], + [this.computedPosition.x + model.triangleLength, this.computedPosition.y - model.triangleHeight / 2], + [this.computedPosition.x + model.triangleLength, this.computedPosition.y - model.lineWidth / 2], + [this.computedPosition.x + model.length, this.computedPosition.y - model.lineWidth / 2], + [this.computedPosition.x + model.length, this.computedPosition.y + model.lineWidth / 2], + [this.computedPosition.x + model.triangleLength, this.computedPosition.y + model.lineWidth / 2], + [this.computedPosition.x + model.triangleLength, this.computedPosition.y + model.triangleHeight / 2] ] }, style: { diff --git a/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js b/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js index c0eb1a7ac..c1311fac6 100644 --- a/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js +++ b/src/jmapNew/shape/graph/AutoTurnBack/EMouse.js @@ -13,8 +13,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, fontWeight: 'normal', fontSize: this.device.style.LcControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/AutoTurnBack/index.js b/src/jmapNew/shape/graph/AutoTurnBack/index.js index 58e065fce..067a80cc1 100644 --- a/src/jmapNew/shape/graph/AutoTurnBack/index.js +++ b/src/jmapNew/shape/graph/AutoTurnBack/index.js @@ -16,6 +16,12 @@ export default class AutoTurnBack extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.isBigScreen = false; @@ -31,8 +37,8 @@ export default class AutoTurnBack extends Group { zlevel: this.zlevel, z: this.z + 1, shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.style.AutoTurnBack.lamp.radiusR }, style: { @@ -47,8 +53,8 @@ export default class AutoTurnBack extends Group { z: this.z + 1, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.text.distance, fontWeight: this.style.AutoTurnBack.text.fontWeight, fontSize: this.style.AutoTurnBack.text.fontSize, fontFamily: this.style.fontFamily, @@ -66,8 +72,8 @@ export default class AutoTurnBack extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.subtitleText.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.AutoTurnBack.lamp.radiusR + this.style.AutoTurnBack.subtitleText.distance, fontWeight: this.style.AutoTurnBack.subtitleText.fontWeight, fontSize: this.style.AutoTurnBack.subtitleText.fontSize, fontFamily: this.style.fontFamily, @@ -185,6 +191,6 @@ export default class AutoTurnBack extends Group { this.hideMode(); } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js b/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js index 2cf5d2e38..d945a85c3 100644 --- a/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js +++ b/src/jmapNew/shape/graph/AutomacticRoute/EMouse.js @@ -13,8 +13,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, fontWeight: 'normal', fontSize: this.device.style.LcControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/AutomacticRoute/index.js b/src/jmapNew/shape/graph/AutomacticRoute/index.js index 169fd6efe..c768ff9a1 100644 --- a/src/jmapNew/shape/graph/AutomacticRoute/index.js +++ b/src/jmapNew/shape/graph/AutomacticRoute/index.js @@ -15,6 +15,12 @@ export default class AutomacticRoute extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.isShowShape = true; @@ -30,8 +36,8 @@ export default class AutomacticRoute extends Group { zlevel: this.zlevel, z: this.z, shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.style.AutomaticRoute.lamp.radiusR }, style: { @@ -46,8 +52,8 @@ export default class AutomacticRoute extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.text.distance, fontWeight: this.style.AutomaticRoute.text.fontWeight, fontSize: this.style.AutomaticRoute.text.fontSize, fontFamily: this.style.fontFamily, @@ -65,8 +71,8 @@ export default class AutomacticRoute extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.subtitleText.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.AutomaticRoute.lamp.radiusR + this.style.AutomaticRoute.subtitleText.distance, fontWeight: this.style.AutomaticRoute.subtitleText.fontWeight, fontSize: this.style.AutomaticRoute.subtitleText.fontSize, fontFamily: this.style.fontFamily, @@ -140,6 +146,6 @@ export default class AutomacticRoute extends Group { this.subtitleText && this.subtitleText.show(); } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/AxleReset/EMouse.js b/src/jmapNew/shape/graph/AxleReset/EMouse.js index 26a5b406f..3dfd09e38 100644 --- a/src/jmapNew/shape/graph/AxleReset/EMouse.js +++ b/src/jmapNew/shape/graph/AxleReset/EMouse.js @@ -13,8 +13,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, fontWeight: 'normal', fontSize: this.device.style.LcControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/AxleReset/index.js b/src/jmapNew/shape/graph/AxleReset/index.js index 8e4117910..b735bb71f 100644 --- a/src/jmapNew/shape/graph/AxleReset/index.js +++ b/src/jmapNew/shape/graph/AxleReset/index.js @@ -15,6 +15,12 @@ export default class AxleReset extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.isShowShape = true; @@ -30,8 +36,8 @@ export default class AxleReset extends Group { zlevel: this.zlevel, z: this.z, shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.style.AxleReset.lamp.radiusR }, style: { @@ -47,8 +53,8 @@ export default class AxleReset extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.text.distance, fontWeight: this.style.AxleReset.text.fontWeight, fontSize: this.style.AxleReset.text.fontSize, fontFamily: this.style.fontFamily, @@ -66,8 +72,8 @@ export default class AxleReset extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.subtitleText.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.AxleReset.lamp.radiusR + this.style.AxleReset.subtitleText.distance, fontWeight: this.style.AxleReset.subtitleText.fontWeight, fontSize: this.style.AxleReset.subtitleText.fontSize, fontFamily: this.style.fontFamily, @@ -141,6 +147,6 @@ export default class AxleReset extends Group { } } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/DirectionRod/index.js b/src/jmapNew/shape/graph/DirectionRod/index.js index 7bf9589fe..9a86e8206 100644 --- a/src/jmapNew/shape/graph/DirectionRod/index.js +++ b/src/jmapNew/shape/graph/DirectionRod/index.js @@ -10,6 +10,12 @@ export default class DirectionRod extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; // this.isShowShape = true; @@ -23,17 +29,17 @@ export default class DirectionRod extends Group { this.rod = new Polygon({ zlevel: this.zlevel, z: this.z, - origin: [model.position.x + (style.DirectionRod.rodLength / 2), model.position.y], + origin: [this.computedPosition.x + (style.DirectionRod.rodLength / 2), this.computedPosition.y], rotation: model.right ? Math.PI : 0, shape: { points: [ - [model.position.x, model.position.y], - [model.position.x + style.DirectionRod.triangleLength, model.position.y + (style.DirectionRod.triangleHeight / 2)], - [model.position.x + style.DirectionRod.triangleLength, model.position.y + (style.DirectionRod.rodHeight / 2)], - [model.position.x + style.DirectionRod.rodLength, model.position.y + (style.DirectionRod.rodHeight / 2)], - [model.position.x + style.DirectionRod.rodLength, model.position.y - (style.DirectionRod.rodHeight / 2)], - [model.position.x + style.DirectionRod.triangleLength, model.position.y - (style.DirectionRod.rodHeight / 2)], - [model.position.x + style.DirectionRod.triangleLength, model.position.y - (style.DirectionRod.triangleHeight / 2)] + [this.computedPosition.x, this.computedPosition.y], + [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y + (style.DirectionRod.triangleHeight / 2)], + [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y + (style.DirectionRod.rodHeight / 2)], + [this.computedPosition.x + style.DirectionRod.rodLength, this.computedPosition.y + (style.DirectionRod.rodHeight / 2)], + [this.computedPosition.x + style.DirectionRod.rodLength, this.computedPosition.y - (style.DirectionRod.rodHeight / 2)], + [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y - (style.DirectionRod.rodHeight / 2)], + [this.computedPosition.x + style.DirectionRod.triangleLength, this.computedPosition.y - (style.DirectionRod.triangleHeight / 2)] ] }, style: { @@ -44,8 +50,8 @@ export default class DirectionRod extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.position.x + style.DirectionRod.fontOffsetX, - y: model.position.y + style.DirectionRod.fontOffsetY, + x: this.computedPosition.x + style.DirectionRod.fontOffsetX, + y: this.computedPosition.y + style.DirectionRod.fontOffsetY, fontWeight: 'normal', fontSize: style.DirectionRod.fontSize, fontFamily: this.style.fontFamily, diff --git a/src/jmapNew/shape/graph/FloodGate/index.js b/src/jmapNew/shape/graph/FloodGate/index.js index 699031542..7337f3d21 100644 --- a/src/jmapNew/shape/graph/FloodGate/index.js +++ b/src/jmapNew/shape/graph/FloodGate/index.js @@ -12,6 +12,12 @@ export default class FloodGate extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.z = model.z; this.model = model; this.style = style; @@ -26,8 +32,8 @@ export default class FloodGate extends Group { zlevel: this.zlevel, z: this.z, shape: { - x: this.model.position.x, - y: this.model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, width: this.model.width, height: this.model.height }, @@ -55,6 +61,6 @@ export default class FloodGate extends Group { createMouseEvent() { } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/GuideLock/EMouse.js b/src/jmapNew/shape/graph/GuideLock/EMouse.js index 4bdbe8731..3c4551ead 100644 --- a/src/jmapNew/shape/graph/GuideLock/EMouse.js +++ b/src/jmapNew/shape/graph/GuideLock/EMouse.js @@ -13,8 +13,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, fontWeight: 'normal', fontSize: this.device.style.LcControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/GuideLock/index.js b/src/jmapNew/shape/graph/GuideLock/index.js index 7a83cb8e1..909bd6b41 100644 --- a/src/jmapNew/shape/graph/GuideLock/index.js +++ b/src/jmapNew/shape/graph/GuideLock/index.js @@ -15,6 +15,12 @@ export default class GuideLock extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.create(); @@ -29,8 +35,8 @@ export default class GuideLock extends Group { zlevel: this.zlevel, z: this.z, shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.style.GuideLock.lamp.radiusR }, style: { @@ -45,8 +51,8 @@ export default class GuideLock extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.text.distance, fontWeight: this.style.GuideLock.text.fontWeight, fontSize: this.style.GuideLock.text.fontSize, fontFamily: this.style.fontFamily, @@ -64,8 +70,8 @@ export default class GuideLock extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.subtitleText.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.GuideLock.lamp.radiusR + this.style.GuideLock.subtitleText.distance, fontWeight: this.style.GuideLock.subtitleText.fontWeight, fontSize: this.style.GuideLock.subtitleText.fontSize, fontFamily: this.style.fontFamily, @@ -146,6 +152,6 @@ export default class GuideLock extends Group { } } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/LcControl/EMouse.js b/src/jmapNew/shape/graph/LcControl/EMouse.js index 2cf5d2e38..d945a85c3 100644 --- a/src/jmapNew/shape/graph/LcControl/EMouse.js +++ b/src/jmapNew/shape/graph/LcControl/EMouse.js @@ -13,8 +13,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, fontWeight: 'normal', fontSize: this.device.style.LcControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/LcControl/index.js b/src/jmapNew/shape/graph/LcControl/index.js index 015712294..df57ec78f 100644 --- a/src/jmapNew/shape/graph/LcControl/index.js +++ b/src/jmapNew/shape/graph/LcControl/index.js @@ -13,6 +13,12 @@ export default class LcControl extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.create(); @@ -27,8 +33,8 @@ export default class LcControl extends Group { z: this.z, arc: { shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.style.LcControl.lamp.radiusR }, subType: 'Control', @@ -37,8 +43,8 @@ export default class LcControl extends Group { }, text: { position: [0, 0], - x: model.position.x, - y: model.position.y + this.style.LcControl.lamp.radiusR + this.style.LcControl.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.LcControl.lamp.radiusR + this.style.LcControl.text.distance, fontWeight: this.style.LcControl.text.fontWeight, fontSize: this.style.LcControl.text.fontSize, fontFamily: this.style.fontFamily, @@ -91,6 +97,6 @@ export default class LcControl extends Group { return null; } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/LimitControl/EMouse.js b/src/jmapNew/shape/graph/LimitControl/EMouse.js index c4c451e4b..55d1a36de 100644 --- a/src/jmapNew/shape/graph/LimitControl/EMouse.js +++ b/src/jmapNew/shape/graph/LimitControl/EMouse.js @@ -14,8 +14,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.LimitControl.lamp.radiusR + this.device.style.LimitControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.LimitControl.lamp.radiusR + this.device.style.LimitControl.text.distance - 30, fontWeight: this.device.style.LimitControl.mouseOverStyle.fontWeight, fontSize: this.device.style.LimitControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFormat, diff --git a/src/jmapNew/shape/graph/LimitControl/index.js b/src/jmapNew/shape/graph/LimitControl/index.js index d39da72f8..1ebe10266 100644 --- a/src/jmapNew/shape/graph/LimitControl/index.js +++ b/src/jmapNew/shape/graph/LimitControl/index.js @@ -13,6 +13,12 @@ export default class LimitControl extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.z = 20; @@ -27,8 +33,8 @@ export default class LimitControl extends Group { z: this.z, arc: { shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.style.LimitControl.lamp.radiusR }, subType: 'Control', @@ -39,8 +45,8 @@ export default class LimitControl extends Group { }, text: { position: [0, 0], - x: model.position.x, - y: model.position.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.LimitControl.lamp.radiusR + this.style.LimitControl.text.distance, fontWeight: this.style.LimitControl.text.fontWeight, fontSize: this.style.LimitControl.text.fontSize, fontFamily: this.style.fontFamily, @@ -95,6 +101,6 @@ export default class LimitControl extends Group { return null; } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/Line/index.js b/src/jmapNew/shape/graph/Line/index.js index d4a77116e..8403236b4 100644 --- a/src/jmapNew/shape/graph/Line/index.js +++ b/src/jmapNew/shape/graph/Line/index.js @@ -8,6 +8,18 @@ export default class Line2 extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + const points = []; + const offsetX = pictureDevice.position.x - model.points[0].x; + const offsetY = pictureDevice.position.y - model.points[0].y; + model.points.forEach(point => { + points.push({x: point.x + offsetX, y: point.y + offsetY}); + }); + this.computePoints = points; + } else { + this.computePoints = model.points; + } this.z = 0; this.model = model; this.style = style.Line; @@ -17,10 +29,10 @@ export default class Line2 extends Group { create() { const model = this.model; - if (model && model.points.length > 1) { + if (this.computePoints.length > 1) { const points = []; const vicePoints = []; - const modelPoints = model.points; + const modelPoints = this.computePoints; const length = modelPoints.length; const path = window.location.href; if (model.type === '03' && !path.includes('/map/draw')) { diff --git a/src/jmapNew/shape/graph/OutFrame/index.js b/src/jmapNew/shape/graph/OutFrame/index.js index 228388f14..c52c80809 100644 --- a/src/jmapNew/shape/graph/OutFrame/index.js +++ b/src/jmapNew/shape/graph/OutFrame/index.js @@ -9,6 +9,12 @@ export default class OutFrame extends Group { this._type = model._type; this._code = model.code; this.style = style; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.zlevel = model.zlevel; this.isBigScreen = false; this.z = 0; @@ -22,8 +28,8 @@ export default class OutFrame extends Group { zlevel: this.zlevel, z: this.z, shape: { - x: model.position.x - model.width / 2, - y: model.position.y - model.height / 2, + x: this.computedPosition.x - model.width / 2, + y: this.computedPosition.y - model.height / 2, width: model.width, height: model.height }, @@ -55,8 +61,8 @@ export default class OutFrame extends Group { } getAnchorPoint() { return { - x: this.model.position.x - this.model.width / 2, - y: this.model.position.y - this.model.height / 2 + x: this.computedPosition.x - this.model.width / 2, + y: this.computedPosition.y - this.model.height / 2 }; } } diff --git a/src/jmapNew/shape/graph/OverAp/index.js b/src/jmapNew/shape/graph/OverAp/index.js index 7a30f8d92..ea1348341 100644 --- a/src/jmapNew/shape/graph/OverAp/index.js +++ b/src/jmapNew/shape/graph/OverAp/index.js @@ -9,6 +9,12 @@ export default class OverAp extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPoints = pictureDevice.position; + } else { + this.computedPoints = model.position; + } this.model = model; this.style = style; this.z = 6; @@ -19,14 +25,14 @@ export default class OverAp extends Group { create() { const model = this.model; const style = this.style; - if (model.points && style && style.Section) { + if (this.computedPoints && style && style.Section) { this.text = new ETextName({ zlevel: this.zlevel, z: this.z + 2, style: this.style, silent: false, - x: model.points.x + 30, - y: model.points.y - style.Section.line.width * 2, + x: this.computedPoints.x + 30, + y: this.computedPoints.y - style.Section.line.width * 2, fontWeight: style.Section.name.fontWeight, text: model.remainTime || 30, textPosition: style.Section.name.textPosition, @@ -59,8 +65,8 @@ export default class OverAp extends Group { this.text && this.text.attr({ style: { text: model.remainTime, - x: model.points.x + offset, - y: model.points.y - this.style.Section.line.width * 2 + x: this.computedPoints.x + offset, + y: this.computedPoints.y - this.style.Section.line.width * 2 } }); } diff --git a/src/jmapNew/shape/graph/Power/index.js b/src/jmapNew/shape/graph/Power/index.js index 508962d17..23c8c374f 100644 --- a/src/jmapNew/shape/graph/Power/index.js +++ b/src/jmapNew/shape/graph/Power/index.js @@ -10,6 +10,18 @@ export default class Line2 extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + const points = []; + const offsetX = pictureDevice.position.x - model.points[0].x; + const offsetY = pictureDevice.position.y - model.points[0].y; + model.points.forEach(point => { + points.push({x: point.x + offsetX, y: point.y + offsetY}); + }); + this.computPoints = points; + } else { + this.computPoints = model.points; + } this.z = 0; this.model = model; this.style = style; @@ -22,10 +34,10 @@ export default class Line2 extends Group { create() { const model = this.model; const style = this.style; - if (model && model.points.length > 1) { + if (this.computPoints > 1) { const points = []; - for (let i = 0; i < model.points.length; i++) { - points.push([model.points[i].x, model.points[i].y]); + for (let i = 0; i < this.computPoints.length; i++) { + points.push([this.computPoints[i].x, this.computPoints[i].y]); } this.line = new Polyline({ zlevel: this.zlevel, @@ -47,7 +59,7 @@ export default class Line2 extends Group { const model = this.model; const style = this.style; if (model && model.leftTerminal) { // 左端点 - const traingle = new JTriangle(model.points[0], model.points[1]); + const traingle = new JTriangle(this.computPoints[0], this.computPoints[1]); this.leftTerminal = new ESeparator({ style: style, zlevel: this.zlevel, @@ -56,14 +68,14 @@ export default class Line2 extends Group { width: model.width, stroke: style.Power.noElectricStrokeColor, point: { - x: model.points[0].x, - y: model.points[0].y + x: this.computPoints[0].x, + y: this.computPoints[0].y } }); this.add(this.leftTerminal); } if (model && model.rightTerminal) { // 右端点 - const traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]); + const traingle = new JTriangle(this.computPoints[this.computPoints.length - 2], this.computPoints[this.computPoints.length - 1]); this.rightTerminal = new ESeparator({ style: style, zlevel: this.zlevel, @@ -72,8 +84,8 @@ export default class Line2 extends Group { width: model.width, stroke: style.Power.noElectricStrokeColor, point: { - x: model.points[model.points.length - 1].x, - y: model.points[model.points.length - 1].y + x: this.computPoints[this.computPoints.length - 1].x, + y: this.computPoints[this.computPoints.length - 1].y } }); this.add(this.rightTerminal); diff --git a/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js b/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js index fcf71c13c..33cff02aa 100644 --- a/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js +++ b/src/jmapNew/shape/graph/Psd/EHorizontal2Door.js @@ -20,8 +20,8 @@ class EHorizontal2Door extends Group { zlevel: this.model.zlevel, z: this.model.z, shape: { - x: model.position.x - model.width / 4, - y: model.position.y - (model.height / 2), + x: model.computedPosition.x - model.width / 4, + y: model.computedPosition.y - (model.height / 2), width: model.width / 4 - 2, height: model.height }, @@ -35,8 +35,8 @@ class EHorizontal2Door extends Group { zlevel: this.model.zlevel, z: this.model.z, shape: { - x: model.position.x, - y: model.position.y - (model.height / 2), + x: model.computedPosition.x, + y: model.computedPosition.y - (model.height / 2), width: model.width / 4 - 2, height: model.height }, diff --git a/src/jmapNew/shape/graph/Psd/ERectDoor.js b/src/jmapNew/shape/graph/Psd/ERectDoor.js index b79958014..227cd39f9 100644 --- a/src/jmapNew/shape/graph/Psd/ERectDoor.js +++ b/src/jmapNew/shape/graph/Psd/ERectDoor.js @@ -17,8 +17,8 @@ class ERect2Door extends Group { zlevel: this.model.zlevel, z: this.model.z, shape: { - x: stand.position.x - (stand.width / 2) - 5, - y: stand.position.y - (stand.height / 2) - 5, + x: stand.computedPosition.x - (stand.width / 2) - 5, + y: stand.computedPosition.y - (stand.height / 2) - 5, width: stand.width + 10, height: stand.height + 10 }, diff --git a/src/jmapNew/shape/graph/Psd/ESafeDoor.js b/src/jmapNew/shape/graph/Psd/ESafeDoor.js index 200789551..132163fca 100644 --- a/src/jmapNew/shape/graph/Psd/ESafeDoor.js +++ b/src/jmapNew/shape/graph/Psd/ESafeDoor.js @@ -21,8 +21,8 @@ class ESafeDoor extends Group { zlevel: this.model.zlevel, z: this.model.z, shape: { - x: model.position.x - model.width / 2 - padding, - y: model.position.y - (model.height / 2), + x: model.computedPosition.x - model.width / 2 - padding, + y: model.computedPosition.y - (model.height / 2), width: model.width, height: model.height }, @@ -37,8 +37,8 @@ class ESafeDoor extends Group { zlevel: this.model.zlevel, z: this.model.z + 1, shape: { - x: model.position.x - model.width / 4 - padding, - y: model.position.y - (model.height / 2) - 1, + x: model.computedPosition.x - model.width / 4 - padding, + y: model.computedPosition.y - (model.height / 2) - 1, width: model.width / 2 + padding * 2, height: model.height + 2 }, diff --git a/src/jmapNew/shape/graph/Psd/EVertical2Door.js b/src/jmapNew/shape/graph/Psd/EVertical2Door.js index 31125cd64..0285fdf22 100644 --- a/src/jmapNew/shape/graph/Psd/EVertical2Door.js +++ b/src/jmapNew/shape/graph/Psd/EVertical2Door.js @@ -26,10 +26,10 @@ class EVertical2Door extends Group { zlevel: this.model.zlevel, z: this.model.z, shape: { - x1:model.position.x - model.width / 2, - y1:model.position.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)), - x2:model.position.x + model.width / 2, - y2:model.position.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)) + x1:model.computedPosition.x - model.width / 2, + y1:model.computedPosition.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)), + x2:model.computedPosition.x + model.width / 2, + y2:model.computedPosition.y - (model.height / 2) + (1 + offesetY ) / 2 * (2 + (model.height)) }, style: { lineWidth: (model.height), @@ -42,10 +42,10 @@ class EVertical2Door extends Group { zlevel: this.model.zlevel, z: this.model.z, shape: { - x1:model.position.x - model.width / 2, - y1:model.position.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2), - x2:model.position.x + model.width / 2, - y2:model.position.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2) + x1:model.computedPosition.x - model.width / 2, + y1:model.computedPosition.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2), + x2:model.computedPosition.x + model.width / 2, + y2:model.computedPosition.y - (model.height / 2) + (1 - offesetY) / 2 * ((model.height) + 2) }, style: { lineWidth: (model.height), diff --git a/src/jmapNew/shape/graph/Psd/index.js b/src/jmapNew/shape/graph/Psd/index.js index 5114fea16..99efd2e16 100644 --- a/src/jmapNew/shape/graph/Psd/index.js +++ b/src/jmapNew/shape/graph/Psd/index.js @@ -13,6 +13,12 @@ export default class Line2 extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.z = 1; this.model = model; this.style = style; @@ -24,6 +30,7 @@ export default class Line2 extends Group { create() { /** 屏蔽门*/ const model = this.model; + model.computedPosition = this.computedPosition; const style = this.style; // 站台所有的绘图元素 const elementTypeList = { @@ -85,6 +92,6 @@ export default class Line2 extends Group { } } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/Resource/index.js b/src/jmapNew/shape/graph/Resource/index.js index 4d25ad0fe..07fd11f2c 100644 --- a/src/jmapNew/shape/graph/Resource/index.js +++ b/src/jmapNew/shape/graph/Resource/index.js @@ -11,6 +11,12 @@ export default class Resource extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.z = model.zIndex || 1; @@ -23,14 +29,14 @@ export default class Resource extends Group { zlevel: this.zlevel, z: this.z, origin: { - x: model.position.x, - y: model.position.y + x: this.computedPosition.x, + y: this.computedPosition.y }, rotation: -Math.PI / 180 * model.rotate, style: { image: model.url, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, width: model.width, height: model.height } @@ -55,7 +61,7 @@ export default class Resource extends Group { // 整体图片 transformRotation(item) { if (this.model.rotate) { - const origin = [this.model.position.x, this.model.position.y]; + const origin = [this.computedPosition.x, this.computedPosition.y]; const rotation = -Math.PI / 180 * Number(this.model.rotate); item.origin = origin; item.rotation = rotation; @@ -75,6 +81,6 @@ export default class Resource extends Group { return null; } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/Responder/index.js b/src/jmapNew/shape/graph/Responder/index.js index 77b970297..1f17e3e72 100644 --- a/src/jmapNew/shape/graph/Responder/index.js +++ b/src/jmapNew/shape/graph/Responder/index.js @@ -30,6 +30,12 @@ export default class Responder extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.anchorPoint = {x: 0, y: 0}; @@ -50,8 +56,8 @@ export default class Responder extends Group { const blockWidth = responderStyle.block.width || 5; const blockHeight = responderStyle.block.height || 12; const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#fff'}; - const blockX = model.position.x - blockWidth / 2 - distanceX; - const blockY = model.position.y - blockHeight / 2 - distanceY; + const blockX = this.computedPosition.x - blockWidth / 2 - distanceX; + const blockY = this.computedPosition.y - blockHeight / 2 - distanceY; this.anchorPoint = {x:blockX, y:blockY}; const textRadian = -Math.PI / 180 * Number(180 - model.textRotate); const textDistanceX = model.textOffset.y * Math.sin(textRadian) + model.textOffset.x * Math.cos(textRadian); @@ -60,7 +66,7 @@ export default class Responder extends Group { const textY = blockY + textDistanceY; const textName = `${model.type}-${model.name}`; const textFill = responderStyle.text.textFill; - const origin = [model.position.x, model.position.y]; + const origin = [this.computedPosition.x, this.computedPosition.y]; const deltaFill = responderStyle.delta.fill; const padding = 1.2; diff --git a/src/jmapNew/shape/graph/SaidLamp/EMouse.js b/src/jmapNew/shape/graph/SaidLamp/EMouse.js index 4bd9eb897..6576a040a 100644 --- a/src/jmapNew/shape/graph/SaidLamp/EMouse.js +++ b/src/jmapNew/shape/graph/SaidLamp/EMouse.js @@ -13,8 +13,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.deviceStyle.lamp.radiusR + this.device.deviceStyle.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.deviceStyle.lamp.radiusR + this.device.deviceStyle.text.distance - 30, fontWeight: 'normal', fontSize: this.device.deviceStyle.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/SaidLamp/index.js b/src/jmapNew/shape/graph/SaidLamp/index.js index d5bd1ecb8..512632050 100644 --- a/src/jmapNew/shape/graph/SaidLamp/index.js +++ b/src/jmapNew/shape/graph/SaidLamp/index.js @@ -20,6 +20,12 @@ export default class SaidLamp extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.deviceStyle = style[model._type]; @@ -41,8 +47,8 @@ export default class SaidLamp extends Group { z: this.z, arc: { shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.deviceStyle.lamp.radiusR }, subType: 'Control', @@ -52,8 +58,8 @@ export default class SaidLamp extends Group { }, text: { position: [0, 0], - x: model.position.x, - y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance, fontWeight: this.deviceStyle.text.fontWeight, fontSize: this.deviceStyle.text.fontSize, fontFamily: this.style.fontFamily, @@ -69,8 +75,8 @@ export default class SaidLamp extends Group { this.control = new ELampFilament({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, _subType: 'LampFilament', width: this.deviceStyle.width, fill: this.deviceStyle.defaultColor @@ -80,8 +86,8 @@ export default class SaidLamp extends Group { this.control = new EControlSwitch({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, _subType: 'ControlSwitch', width: this.deviceStyle.width, fill: this.deviceStyle.defaultColor @@ -91,8 +97,8 @@ export default class SaidLamp extends Group { this.control = new EDeviceStatus({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, mfNum: model.mfNum, pfNum: model.pfNum, style: this.style @@ -102,8 +108,8 @@ export default class SaidLamp extends Group { this.control = new EFoldbackMode({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, width: this.deviceStyle.rectWidth, style: this.style }); @@ -112,8 +118,8 @@ export default class SaidLamp extends Group { this.control = new EModeStatus({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, style: this.style }); this.add(this.control); @@ -121,8 +127,8 @@ export default class SaidLamp extends Group { this.control = new EAxle({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, style: this.style }); this.add(this.control); @@ -131,8 +137,8 @@ export default class SaidLamp extends Group { this.control = new EUnmanned({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, _subType: 'Unmanned', width: this.style.NoOneReturn.width, fill: this.style.NoOneReturn.defaultColor @@ -144,8 +150,8 @@ export default class SaidLamp extends Group { z: this.z, arc: { shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.deviceStyle.lamp.radiusR }, subType: 'Control', @@ -154,8 +160,8 @@ export default class SaidLamp extends Group { }, text: { position: [0, 0], - x: model.position.x, - y: model.position.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.deviceStyle.lamp.radiusR + this.deviceStyle.text.distance, fontWeight: this.deviceStyle.text.fontWeight, fontSize: this.deviceStyle.text.fontSize, fontFamily: this.style.fontFamily, @@ -172,19 +178,19 @@ export default class SaidLamp extends Group { this.control = new EIndicatorLight({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, text: model.name, style: this.style, _subType: 'IndicatorLight' }); this.add(this.control); } else if (this._type === 'PickArrow' || this._type === 'DepartArrow') { - this.control = new EPickOrDepartArrow({ + this.control = new EPickOrDepartArrow({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: this.computedPosition.x, + y: this.computedPosition.y, text: model.name, right: model.right, style: this.style, diff --git a/src/jmapNew/shape/graph/Section/EAxle.js b/src/jmapNew/shape/graph/Section/EAxle.js index c21a3ed56..728ddf1f5 100644 --- a/src/jmapNew/shape/graph/Section/EAxle.js +++ b/src/jmapNew/shape/graph/Section/EAxle.js @@ -24,14 +24,14 @@ export default class EAxle extends Group { createAxleLeft() { const model = this.model.modelData; - - const traingle = new JTriangle(model.points[0], model.points[1]); + const computedPoints = this.model.computedPoints; + const traingle = new JTriangle(computedPoints[0], computedPoints[1]); const drictx = 1; const dricty = model.leftAxlePosition === 1 || model.leftAxlePosition === 2 ? 1 : -1; const isSpecial = model.leftAxlePosition === -2 || model.leftAxlePosition === 2; - const difference = model.points[0].y - model.points[1].y; + const difference = computedPoints[0].y - computedPoints[1].y; let point = {}; - point = {x:model.points[0].x, y: model.points[0].y}; + point = {x:computedPoints[0].x, y: computedPoints[0].y}; if (model.leftAxleOffset) { point.x = point.x + model.leftAxleOffset.x || 0; point.y = point.y + model.leftAxleOffset.y || 0; @@ -48,15 +48,16 @@ export default class EAxle extends Group { createAxleRight() { const model = this.model.modelData; - const length = model.points.length; - const traingle = new JTriangle(model.points[length - 2], model.points[length - 1]); + const computedPoints = this.model.computedPoints; + const length = computedPoints.length; + const traingle = new JTriangle(computedPoints[length - 2], computedPoints[length - 1]); const drictx = -1; const dricty = model.rightAxlePosition === 1 || model.rightAxlePosition === 2 ? 1 : -1; const isSpecial = model.rightAxlePosition === -2 || model.rightAxlePosition === 2; - const difference = model.points[length - 2].y - model.points[length - 1].y; + const difference = computedPoints[length - 2].y - computedPoints[length - 1].y; let point = {}; - point = {x:model.points[length - 1].x, y: model.points[length - 1].y}; + point = {x:computedPoints[length - 1].x, y: computedPoints[length - 1].y}; if (model.rightAxleOffset) { point.x = point.x + model.rightAxleOffset.x || 0; point.y = point.y + model.rightAxleOffset.y || 0; diff --git a/src/jmapNew/shape/graph/Section/EBackArrow.js b/src/jmapNew/shape/graph/Section/EBackArrow.js index 43f94edb5..3efa0f499 100644 --- a/src/jmapNew/shape/graph/Section/EBackArrow.js +++ b/src/jmapNew/shape/graph/Section/EBackArrow.js @@ -19,16 +19,16 @@ export default class EBackArrowGroup extends Group { const height = style.Section.line.width * 1; const turnBackDistance = style.Section.shuttleBack.distance + radius * 4; - const points = model.points; + const computedPoints = this.model.computedPoints; let x = -model.drict * width * 1.2; let y = -turnBackDistance; if (model.drict < 0) { - x += points[0].x; - y += points[0].y; + x += computedPoints[0].x; + y += computedPoints[0].y; } else { - x += points[points.length - 1].x; - y += points[points.length - 1].y; + x += computedPoints[computedPoints.length - 1].x; + y += computedPoints[computedPoints.length - 1].y; } this.turnBack = new EBackArrow({ diff --git a/src/jmapNew/shape/graph/Section/EBadShunt.js b/src/jmapNew/shape/graph/Section/EBadShunt.js index c08e970f4..9715e1583 100644 --- a/src/jmapNew/shape/graph/Section/EBadShunt.js +++ b/src/jmapNew/shape/graph/Section/EBadShunt.js @@ -16,9 +16,10 @@ export default class EBadShunt extends Group { // 分路不良 const model = this.model.modelData; const style = this.model.style; + const computedPoints = this.model.computedPoints; /** 创建区段*/ - if (model && model.points.length > 1) { - const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); + if (computedPoints.length > 1) { + const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]); let x = traingle.drictx * (style.Section.badShunt.distance) * traingle.getSinRate(); let y = traingle.dricty * (style.Section.badShunt.distance) * traingle.getCosRate(); if (x == Infinity) { x = 0; } @@ -32,7 +33,7 @@ export default class EBadShunt extends Group { isSwitchSection: model.switchSection, relSwitchCode: model.relSwitchCode, isCurve: model.curve, // 是否曲线 - points: model.points + points: computedPoints }); // 下侧临时限速线 const badShuntRight = this.createLimit({ @@ -42,7 +43,7 @@ export default class EBadShunt extends Group { isSwitchSection: model.switchSection, relSwitchCode: model.relSwitchCode, isCurve: model.curve, // 是否曲线 - points: model.points + points: computedPoints }); badShuntLeft.forEach(item => { this.add(item); diff --git a/src/jmapNew/shape/graph/Section/EDerailer.js b/src/jmapNew/shape/graph/Section/EDerailer.js index 28e06880c..c4b9423f1 100644 --- a/src/jmapNew/shape/graph/Section/EDerailer.js +++ b/src/jmapNew/shape/graph/Section/EDerailer.js @@ -1,85 +1,87 @@ -import Group from "zrender/src/container/Group"; -import Text from "zrender/src/graphic/Text"; -import Polygon from "zrender/src/graphic/shape/Polygon"; +import Group from 'zrender/src/container/Group'; +import Text from 'zrender/src/graphic/Text'; +import Polygon from 'zrender/src/graphic/shape/Polygon'; class EDerailer extends Group { - constructor(model) { - super(); - this.zlevel = model.zlevel; + constructor(model) { + super(); + this.zlevel = model.zlevel; this.z = model.z; - this.style = model.style; - this.model = model; - this.create(); - } + this.style = model.style; + this.model = model; + this.create(); + } - create() { - this.createText(); - this.createSymbol(); - } + create() { + this.createText(); + this.createSymbol(); + } - createText() { - const style = this.model.style; - const model = this.model.modelData; - const length = model.points.length; - const offset = style.Section.derailer.text.offset||{}; - const offsetX = offset.x||0; - const offsetY = offset.y||0; - const positionX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX; - const positionY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY; + createText() { + const style = this.model.style; + // const model = this.model.modelData; + const computedPoints = this.model.computedPoints; + const length = computedPoints.length; + const offset = style.Section.derailer.text.offset || {}; + const offsetX = offset.x || 0; + const offsetY = offset.y || 0; + const positionX = (computedPoints[0].x + computedPoints[length - 1].x) / 2 + offsetX; + const positionY = (computedPoints[0].y + computedPoints[length - 1].y) / 2 + offsetY; - this.text = new Text({ - zlevel: this.zlevel, - z: this.z, - style: { - x: positionX, + this.text = new Text({ + zlevel: this.zlevel, + z: this.z, + style: { + x: positionX, y: positionY, - text: 'T', + text: 'T', fontWeight: style.fontWeight, fontSize: style.fontSize, fontFamily: style.fontFamily, textFill: style.Section.derailer.text.color, - textPosition: 'inside', + textPosition: 'inside', textAlign: 'center', textVerticalAlign: 'center' - } - }) - this.add(this.text); - } + } + }); + this.add(this.text); + } - createSymbol() { - const style = this.model.style; - const model = this.model.modelData; - const length = model.points.length; - const offset = style.Section.derailer.symbol.offset||{}; - const offsetX = offset.x||0; - const offsetY = offset.y||0; - const pointX = (model.points[0].x + model.points[length-1].x) / 2 + offsetX; - const pointY = (model.points[0].y + model.points[length-1].y) / 2 + offsetY; + createSymbol() { + const style = this.model.style; + // const model = this.model.modelData; + const length = this.model.computedPoints.length; + const computedPoints = this.model.computedPoints; + const offset = style.Section.derailer.symbol.offset || {}; + const offsetX = offset.x || 0; + const offsetY = offset.y || 0; + const pointX = (computedPoints[0].x + computedPoints[length - 1].x) / 2 + offsetX; + const pointY = (computedPoints[0].y + computedPoints[length - 1].y) / 2 + offsetY; - this.symbol = new Polygon({ - zlevel: this.zlevel, - z: this.z, - shape: { - points: [ - [pointX-3, pointY], - [pointX, pointY-8], - [pointX+3, pointY] - ] - }, - style: { - fill: style.Section.derailer.symbol.color, - } - }) - this.add(this.symbol); - } + this.symbol = new Polygon({ + zlevel: this.zlevel, + z: this.z, + shape: { + points: [ + [pointX - 3, pointY], + [pointX, pointY - 8], + [pointX + 3, pointY] + ] + }, + style: { + fill: style.Section.derailer.symbol.color + } + }); + this.add(this.symbol); + } - setTextStyle(style) { - this.text && this.text.setStyle(style); - } + setTextStyle(style) { + this.text && this.text.setStyle(style); + } - setSymbolStyle(style) { - this.symbol && this.symbol.setStyle(style); - } + setSymbolStyle(style) { + this.symbol && this.symbol.setStyle(style); + } } export default EDerailer; diff --git a/src/jmapNew/shape/graph/Section/ELimitLines.js b/src/jmapNew/shape/graph/Section/ELimitLines.js index 81095cadb..ab993f658 100644 --- a/src/jmapNew/shape/graph/Section/ELimitLines.js +++ b/src/jmapNew/shape/graph/Section/ELimitLines.js @@ -16,9 +16,10 @@ export default class ELimitLines extends Group { create() { const model = this.model.modelData; const style = this.model.style; + const computedPoints = this.model.computedPoints; /** 创建区段*/ - if (model && model.points.length > 1) { - const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); + if (computedPoints.length > 1) { + const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]); let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate(); let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate(); if (x == Infinity) { x = 0; } @@ -32,7 +33,7 @@ export default class ELimitLines extends Group { isSwitchSection: model.switchSection, relSwitchCode: model.relSwitchCode, isCurve: model.curve, // 是否曲线 - points: model.points + points: computedPoints }); // 下侧临时限速线 const speedLimitRight = this.createLimit({ @@ -42,7 +43,7 @@ export default class ELimitLines extends Group { isSwitchSection: model.switchSection, relSwitchCode: model.relSwitchCode, isCurve: model.curve, // 是否曲线 - points: model.points + points: computedPoints }); speedLimitLeft.forEach(item => { this.add(item); diff --git a/src/jmapNew/shape/graph/Section/ELimitName.js b/src/jmapNew/shape/graph/Section/ELimitName.js index ff300904b..57c97e972 100644 --- a/src/jmapNew/shape/graph/Section/ELimitName.js +++ b/src/jmapNew/shape/graph/Section/ELimitName.js @@ -13,15 +13,15 @@ export default class ELimitName extends Group { create() { /** 创建区段*/ - const model = this.model.modelData; + // const model = this.model.modelData; const style = this.model.style; - + const computedPoints = this.model.computedPoints; const rectW = style.Section.speedLimitName.drogueWidth; const rectH = style.Section.speedLimitName.drogueHeight; - const x1 = model.points[0].x; - const y1 = model.points[0].y + style.Section.speedLimitName.limitValueDistance; - const x2 = model.points[model.points.length - 1].x; - const y2 = model.points[model.points.length - 1].y + style.Section.speedLimitName.limitValueDistance; + const x1 = computedPoints[0].x; + const y1 = computedPoints[0].y + style.Section.speedLimitName.limitValueDistance; + const x2 = computedPoints[computedPoints.length - 1].x; + const y2 = computedPoints[computedPoints.length - 1].y + style.Section.speedLimitName.limitValueDistance; if (style.Section.speedLimitName.leftName) { const leftPoints = style.Section.speedLimitName.nameBackgroundIsRect ? [[x1, y1], [x1 + rectW, y1], diff --git a/src/jmapNew/shape/graph/Section/ELines.js b/src/jmapNew/shape/graph/Section/ELines.js index 88a7c5d8e..bcd07f2f1 100644 --- a/src/jmapNew/shape/graph/Section/ELines.js +++ b/src/jmapNew/shape/graph/Section/ELines.js @@ -35,10 +35,10 @@ export default class ELines extends Group { const relateSectionList = model.relateSectionList; const sectionA = store.getters['map/getDeviceByCode'](relateSectionList[0]); const sectionB = store.getters['map/getDeviceByCode'](relateSectionList[1]); - const endPointA = sectionA.points[sectionA.points.length - 1]; - const startPointA = sectionA.points[0]; - const endPointB = sectionB.points[sectionB.points.length - 1]; - const startPointB = sectionB.points[0]; + const endPointA = sectionA.instance.computedPoints[sectionA.instance.computedPoints.length - 1]; + const startPointA = sectionA.instance.computedPoints[0]; + const endPointB = sectionB.instance.computedPoints[sectionB.instance.computedPoints.length - 1]; + const startPointB = sectionB.instance.computedPoints[0]; const result = segmentsIntr(startPointA, endPointA, startPointB, endPointB); // this.cross = new Polyline({ // zlevel: this.zlevel, @@ -167,10 +167,11 @@ export default class ELines extends Group { createLine() { const model = this.model.modelData; const style = this.model.style; + const computedPoints = this.model.computedPoints; // 30 const Z = model.type == '02' ? this.z + 1 : this.z; - const modelPoints = model.type == '04' ? [model.namePosition, model.namePosition] : model.points; + const modelPoints = model.type == '04' ? [model.namePosition, model.namePosition] : computedPoints; const isCurve = model.curve; /** 创建区段*/ if (model && modelPoints.length > 1) { diff --git a/src/jmapNew/shape/graph/Section/EMouse.js b/src/jmapNew/shape/graph/Section/EMouse.js index aaedfeeef..2d23b0b5b 100644 --- a/src/jmapNew/shape/graph/Section/EMouse.js +++ b/src/jmapNew/shape/graph/Section/EMouse.js @@ -77,23 +77,24 @@ class EMouse extends Group { this.lineBorder.hide(); } } else { - const model = this.device.model; + // const model = this.device.model; + const computedPoints = this.device.computedPoints; let points = []; const pointsReverse = []; - model.points.forEach((ele, index) => { + computedPoints.forEach((ele, index) => { let flag = false; - if (index == model.points.length - 1) { - this.triangle = new JTriangle(model.points[index - 1], ele); + if (index == computedPoints.length - 1) { + this.triangle = new JTriangle(computedPoints[index - 1], ele); } else { - this.triangle = new JTriangle(ele, model.points[index + 1]); + this.triangle = new JTriangle(ele, computedPoints[index + 1]); } const directy = this.triangle.dricty; if (index > 0) { - if (model.points[index - 1].y == ele.y || index < model.points.length - 1 && model.points[index + 1].y == ele.y) { + if (computedPoints[index - 1].y == ele.y || index < computedPoints.length - 1 && computedPoints[index + 1].y == ele.y) { flag = true; } } else { - if (model.points[index + 1].y == ele.y) { + if (computedPoints[index + 1].y == ele.y) { flag = true; } } @@ -152,7 +153,7 @@ class EMouse extends Group { this.TextName && this.TextName.show(); this.sectionTextBorder && this.sectionTextBorder.show(); if (this.device.model.type != '03') { - this.lineBorder && this.lineBorder.show(); + this.lineBorder && this.lineBorder.show(); } const instance = this.getInstanceByCode(this.device.model.trainWindowCode); if (instance && instance.mouseEvent && instance.mouseEvent.mouseEnter) { diff --git a/src/jmapNew/shape/graph/Section/ESeparator.js b/src/jmapNew/shape/graph/Section/ESeparator.js index 854c2c2e0..1dc58543b 100644 --- a/src/jmapNew/shape/graph/Section/ESeparator.js +++ b/src/jmapNew/shape/graph/Section/ESeparator.js @@ -23,15 +23,16 @@ export default class ESeparator extends Group { create() { /** 创建区段*/ const model = this.model.modelData; + const computedPoints = this.model.computedPoints; const style = this.model.style; - if (model && style && model.points && model.points.length > 1) { + if (model && style && computedPoints && computedPoints.length > 1) { /** 创建左侧分隔符*/ - const traingleLeft = new JTriangle(model.points[0], model.points[1]); + const traingleLeft = new JTriangle(computedPoints[0], computedPoints[1]); this.lPartition = this.setType({ traingle: traingleLeft, point: { - x: model.points[0].x, - y: model.points[0].y + x: computedPoints[0].x, + y: computedPoints[0].y }, sepType: model.sepTypeLeft, drict: -1, // 方向 @@ -39,12 +40,12 @@ export default class ESeparator extends Group { }); /** 创建右侧分隔符*/ - const traingleRight = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]); + const traingleRight = new JTriangle(computedPoints[computedPoints.length - 2], computedPoints[computedPoints.length - 1]); this.rPartition = this.setType({ traingle: traingleRight, point: { - x: model.points[model.points.length - 1].x, - y: model.points[model.points.length - 1].y + x: computedPoints[computedPoints.length - 1].x, + y: computedPoints[computedPoints.length - 1].y }, sepType: model.sepTypeRight, drict: 1, // 方向 diff --git a/src/jmapNew/shape/graph/Section/EStopRouteImg.js b/src/jmapNew/shape/graph/Section/EStopRouteImg.js index b2c72a13c..d3ef4fe91 100644 --- a/src/jmapNew/shape/graph/Section/EStopRouteImg.js +++ b/src/jmapNew/shape/graph/Section/EStopRouteImg.js @@ -16,7 +16,7 @@ export default class EStopRouteImg extends Group { create() { const model = this.model.modelData; const style = this.model.style; - const modelPoints = model.points; + const modelPoints = this.model.computedPoints; if (model.type !== '04') { const image = new Image(5, 8); image.src = Stop_Route; diff --git a/src/jmapNew/shape/graph/Section/ETextName.js b/src/jmapNew/shape/graph/Section/ETextName.js index 6f9588dae..ebb8c6738 100644 --- a/src/jmapNew/shape/graph/Section/ETextName.js +++ b/src/jmapNew/shape/graph/Section/ETextName.js @@ -13,15 +13,16 @@ class ETextName extends Group { create() { const model = this.model.modelData; const styleModel = this.model.style.Section[this.model.type]; + const computedPoints = this.model.computedPoints; let styleX = ''; let styleY = ''; let styleName = ''; let isCreate = false; // 计算区段坐标位置 - const x = Math.min(model.points[0].x, model.points[model.points.length - 1].x) + Math.abs(model.points[model.points.length - 1].x - model.points[0].x) / 2; - const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2; - const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]); + const x = Math.min(computedPoints[0].x, computedPoints[computedPoints.length - 1].x) + Math.abs(computedPoints[computedPoints.length - 1].x - computedPoints[0].x) / 2; + const y = Math.min(computedPoints[0].y, computedPoints[computedPoints.length - 1].y) + Math.abs(computedPoints[computedPoints.length - 1].y - computedPoints[0].y) / 2; + const traingle = new JTriangle(computedPoints[0], computedPoints[computedPoints.length - 1]); const drict = model.trainPosType != '01' ? 1 : -1; if (this.model.type == 'name') { if (model.type == '01' && !model.parentCode) { // 物理区段名称 diff --git a/src/jmapNew/shape/graph/Section/EblockLines.js b/src/jmapNew/shape/graph/Section/EblockLines.js index b3b2b12f9..faf44bd12 100644 --- a/src/jmapNew/shape/graph/Section/EblockLines.js +++ b/src/jmapNew/shape/graph/Section/EblockLines.js @@ -26,20 +26,20 @@ export default class ELines extends Group { /** 创建区段*/ const model = this.model.modelData; const style = this.model.style; - + const computedPoints = this.model.computedPoints; const isCurve = model.curve; - if (model && model.points.length > 1) { + if (computedPoints.length > 1) { if (isCurve) { // 曲线 用贝塞尔曲线绘图 封锁 必须4个点来绘图 const shape = {}; - for (let i = 1; i < (model.points.length - 1); i++) { - shape[`cpx${i}`] = model.points[i].x; - shape[`cpy${i}`] = model.points[i].y; + for (let i = 1; i < (computedPoints.length - 1); i++) { + shape[`cpx${i}`] = computedPoints[i].x; + shape[`cpy${i}`] = computedPoints[i].y; } - shape[`x1`] = model.points[0].x; - shape[`y1`] = model.points[0].y; - shape[`x2`] = model.points[model.points.length - 1].x; - shape[`y2`] = model.points[model.points.length - 1].y; + shape[`x1`] = computedPoints[0].x; + shape[`y1`] = computedPoints[0].y; + shape[`x2`] = computedPoints[computedPoints.length - 1].x; + shape[`y2`] = computedPoints[computedPoints.length - 1].y; this.section = new BezierCurve({ isLine: true, zlevel: this.zlevel, @@ -55,19 +55,19 @@ export default class ELines extends Group { }); this.add(this.section); } else { - if (model.points.length == 2) { - const spaceX = (model.points[1].x - model.points[0].x) / 3; - const spaceY = (model.points[1].y - model.points[0].y) / 3; + if (computedPoints.length == 2) { + const spaceX = (computedPoints[1].x - computedPoints[0].x) / 3; + const spaceY = (computedPoints[1].y - computedPoints[0].y) / 3; this.sectionM = new Line({ isLine: true, zlevel: this.zlevel, progressive: model.progressive, z: this.z, shape: { - x1: model.points[0].x + spaceX, - y1: model.points[0].y + spaceY, - x2: model.points[0].x + spaceX + spaceX, - y2: model.points[0].y + spaceY + spaceY + x1: computedPoints[0].x + spaceX, + y1: computedPoints[0].y + spaceY, + x2: computedPoints[0].x + spaceX + spaceX, + y2: computedPoints[0].y + spaceY + spaceY }, style: { lineWidth: style.Section.line.width, diff --git a/src/jmapNew/shape/graph/Section/index.js b/src/jmapNew/shape/graph/Section/index.js index 3d6e78c40..164cbda03 100644 --- a/src/jmapNew/shape/graph/Section/index.js +++ b/src/jmapNew/shape/graph/Section/index.js @@ -58,8 +58,19 @@ export default class Section extends Group { this._type = model._type; this.zlevel = model.zlevel; const amendData = store.getters['map/amendPoints'](this._code); + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); if (amendData) { - model.points = amendData.points; + this.computedPoints = amendData.points; + } else if (pictureDevice) { + const points = []; + const offsetX = pictureDevice.position.x - model.points[0].x; + const offsetY = pictureDevice.position.y - model.points[0].y; + model.points.forEach(point => { + points.push({x: point.x + offsetX, y: point.y + offsetY}); + }); + this.computedPoints = points; + } else { + this.computedPoints = model.points; } this.z = 5 + parseInt(model.layer || 0); this.model = model; @@ -116,6 +127,7 @@ export default class Section extends Group { z: this.z + elementZ, style: style, type: element, + computedPoints: this.computedPoints, modelData: model }); this.add(this[element]); @@ -530,8 +542,8 @@ export default class Section extends Group { } } // 分路不良 - // model.shuntingTypeList.length > 0 && - model.badShunt&& this.badShuntStatus(); + // model.shuntingTypeList.length > 0 && + model.badShunt && this.badShuntStatus(); } } @@ -557,7 +569,11 @@ export default class Section extends Group { return this.name.getBoundingRect(); } } - + getNameBoundingRect() { + if (this.name && this.name.getBoundingRect()) { + return this.name.getBoundingRect(); + } else { return {}; } + } createMouseEvent() { // 鼠标事件 if (this.style.Section.mouseOverStyle) { this.mouseEvent = new EMouse(this, this.model.relSwitchCode); diff --git a/src/jmapNew/shape/graph/Signal/index.js b/src/jmapNew/shape/graph/Signal/index.js index 93ceec109..ac8967111 100644 --- a/src/jmapNew/shape/graph/Signal/index.js +++ b/src/jmapNew/shape/graph/Signal/index.js @@ -190,9 +190,14 @@ class Signal extends Group { this._code = model.code; this._type = model._type; const amendData = store.getters['map/amendPoints'](this._code); + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); if (amendData) { - model.position = amendData.position; model.rotate = amendData.rotate; + this.computedPosition = amendData.position; + } else if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; } this.model = model; this.mapDevice = mapDevice; @@ -223,18 +228,19 @@ class Signal extends Group { create() { const model = this.model; const style = this.style; + const computedPosition = this.computedPosition; const drict = this.model.showRight ? 1 : -1; // 朝向 左:右 const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下 // 信号机高柱矮柱 (信号机底座) - const sigPostY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR); + const sigPostY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR); this.sigPost = new ESigPost({ zlevel: this.zlevel, z: this.z, style: style, drict: drict, type: model.lampPostType, - x: model.position.x + model.positionPoint.x, + x: computedPosition.x + model.positionPoint.x, y: sigPostY }); if (style.Signal.ciConfirm) { @@ -245,7 +251,7 @@ class Signal extends Group { silent: false, _subType: 'enabled', // 标识 style: { - x: model.position.x + model.positionPoint.x - drict * 25, + x: computedPosition.x + model.positionPoint.x - drict * 25, y: sigPostY + posit * 11, fontSize: style.Signal.ciConfirm.fontSize, text: style.Signal.ciConfirm.defaultText, @@ -271,8 +277,8 @@ class Signal extends Group { drict: drict, x: endPoint.x + i * drict * style.Signal.lamp.radiusR * 2.3, y: endPoint.y, - originX: model.position.x + model.positionPoint.x, - originY: model.position.y + model.positionPoint.y + originX: computedPosition.x + model.positionPoint.x, + originY: computedPosition.y + model.positionPoint.y }); this.lamps.push(lamp); } @@ -348,8 +354,8 @@ class Signal extends Group { this.sigBack.hide(); } // 信号机名称 - const sigNameX = model.position.x + model.positionPoint.x - drict * (style.Signal.post.standardVerticalWidth) + model.namePosition.x; - const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); + const sigNameX = computedPosition.x + model.positionPoint.x - drict * (style.Signal.post.standardVerticalWidth) + model.namePosition.x; + const sigNameY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.showRight ? 'left' : 'right'; const textVerticalAlign = posit == 1 ? 'top' : 'bottom'; this.sigName = new ESigName({ @@ -368,7 +374,7 @@ class Signal extends Group { textVerticalAlign: textVerticalAlign }); - const timeNameY = model.position.y + model.positionPoint.y - posit * 15; + const timeNameY = computedPosition.y + model.positionPoint.y - posit * 15; this.remainTimeName = new ESigName({ zlevel: this.zlevel, z: this.z, @@ -475,8 +481,8 @@ class Signal extends Group { drict: drict, x: endPoint.x, y: endPoint.y, - originX: model.position.x + model.positionPoint.x, - originY: model.position.y + model.positionPoint.y + originX: computedPosition.x + model.positionPoint.x, + originY: computedPosition.y + model.positionPoint.y }); this.add(this.virtualSignal); // 虚拟信号机 (哈尔滨线路) } else { @@ -486,12 +492,13 @@ class Signal extends Group { createTransmission() { const model = this.model; const style = this.style; + const computedPosition = this.computedPosition; const drict = this.model.showRight ? 1 : -1; // 朝向 左:右 const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下 // 信号机名称 const actual = this.mapDevice[model.linkSignalCode]; - const sigNameX = model.position.x + model.positionPoint.x + drict * 0.433 * style.Signal.transmission.sideLength + model.namePosition.x; - const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); + const sigNameX = computedPosition.x + model.positionPoint.x + drict * 0.433 * style.Signal.transmission.sideLength + model.namePosition.x; + const sigNameY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.showRight ? 'left' : 'right'; const textVerticalAlign = posit == 1 ? 'top' : 'bottom'; const fillColor = actual.virtual ? style.Signal.transmission.fillColorVirtual : style.Signal.transmission.fillColor; @@ -511,15 +518,15 @@ class Signal extends Group { textVerticalAlign: textVerticalAlign }); if (style.Signal.transmission) { - const sigPostY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR); + const sigPostY = computedPosition.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR); this.transmission = new Polygon({ zlevel: this.zlevel, z: this.z, shape: { points: [ - [model.position.x + model.positionPoint.x, sigPostY + style.Signal.transmission.sideLength / 2], - [model.position.x + model.positionPoint.x, sigPostY - style.Signal.transmission.sideLength / 2], - [model.position.x + model.positionPoint.x + drict * 0.866 * style.Signal.transmission.sideLength, sigPostY] + [computedPosition.x + model.positionPoint.x, sigPostY + style.Signal.transmission.sideLength / 2], + [computedPosition.x + model.positionPoint.x, sigPostY - style.Signal.transmission.sideLength / 2], + [computedPosition.x + model.positionPoint.x + drict * 0.866 * style.Signal.transmission.sideLength, sigPostY] ] }, style: { @@ -549,7 +556,7 @@ class Signal extends Group { this.transformRotation(item); } else if (item) { if (item._subType !== 'SignalName' || this.model.nameRotated) { - item.origin = [this.model.position.x + this.model.positionPoint.x, this.model.position.y + this.model.positionPoint.y]; + item.origin = [this.computedPosition.x + this.model.positionPoint.x, this.computedPosition.y + this.model.positionPoint.y]; item.rotation = -Math.PI / 180 * Number(this.model.rotate); item.dirty(); } @@ -698,11 +705,11 @@ class Signal extends Group { } } // 双黄灯 - doubleYellow() { - this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); - this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); + doubleYellow() { + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor); + this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); } - redWhite() { + redWhite() { this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor); this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.redColor); } @@ -944,7 +951,7 @@ class Signal extends Group { recover() { this.sigName && this.sigName.show(); this.sigName && this.sigName.setAnimationEnd(); - this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); item.setBorderColor(this.style.Signal.lamp.borderColor) }); + this.lamps && this.lamps.forEach(item=> { item.show(); item.setGuideSectorShowHide(false); item.setBorderColor(this.style.Signal.lamp.borderColor); }); this.sigName.setStyle({ textBorderWidth: 0 }); this.sigName.setColor(this.style.Signal.text.defaultColor); this.remainTimeName && this.remainTimeName.hide(); @@ -1023,46 +1030,46 @@ class Signal extends Group { /** 设置灯的颜色 */ switch (model.aspect) { - // 红 - case 'R': { - this.close(model.logicLight); // 信号关闭 - break; - } - // 绿 - case 'G': { - this.openPositive(model.logicLight); // 信号正向开放 - break; - } - // 黄 - case 'Y': { - this.openLateral(model.logicLight); // 信号侧向开放 - break; - } - // 红黄 - case 'RY': { - this.guid(); // 引导信号显示 - break; - } - case 'W': { - this.lampWhite(); - break; - } - case 'B': { - this.lampBlue(); - break; - } - case 'YY': { - this.doubleYellow(); - break; - } - case 'RW': { - this.redWhite(); - break; - } - default: { - this.close(model.logicLight); // 信号关闭 - break; - } + // 红 + case 'R': { + this.close(model.logicLight); // 信号关闭 + break; + } + // 绿 + case 'G': { + this.openPositive(model.logicLight); // 信号正向开放 + break; + } + // 黄 + case 'Y': { + this.openLateral(model.logicLight); // 信号侧向开放 + break; + } + // 红黄 + case 'RY': { + this.guid(); // 引导信号显示 + break; + } + case 'W': { + this.lampWhite(); + break; + } + case 'B': { + this.lampBlue(); + break; + } + case 'YY': { + this.doubleYellow(); + break; + } + case 'RW': { + this.redWhite(); + break; + } + default: { + this.close(model.logicLight); // 信号关闭 + break; + } } if (model.remainTime) { @@ -1287,8 +1294,8 @@ class Signal extends Group { } getAnchorPoint() { return { - x:this.model.position.x + this.model.positionPoint.x, - y:this.model.position.y + this.model.positionPoint.y + x:this.computedPosition.x + this.model.positionPoint.x, + y:this.computedPosition.y + this.model.positionPoint.y }; } } diff --git a/src/jmapNew/shape/graph/SignalButton/index.js b/src/jmapNew/shape/graph/SignalButton/index.js index a533eafb0..4ef5a048e 100644 --- a/src/jmapNew/shape/graph/SignalButton/index.js +++ b/src/jmapNew/shape/graph/SignalButton/index.js @@ -11,6 +11,12 @@ export default class SignalButton extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.z = 0; this.model = model; this.style = style; @@ -21,55 +27,56 @@ export default class SignalButton extends Group { create() { const model = this.model; + const computedPosition = this.computedPosition; const fillColor = this.getTypeColor(); const queryList = window.location.search.substring(1).split('&'); const queryCtc = queryList.find(item => { - return item.includes('ctc'); - }); + return item.includes('ctc'); + }); const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST']; - if (queryCtc && ctcArcList.includes(model.type)){ - this.arcShape = new Arc({ - zlevel: this.zlevel, - z: this.z, - shape: { - cx: this.model.position.x + 7, - cy: this.model.position.y + 7, - r: 7 - }, - style: { - stroke: '#69666E', - lineWidth: 1, - fill: fillColor - } - }); - this.add(this.arcShape); - } else { - this.rectButton = new Rect({ - zlevel: this.zlevel, - z: this.z, - shape: { - x: model.position.x, - y: model.position.y, - width: 14, - height: 14 - }, - style: { - lineDash: null, - stroke: '#69666E', - lineWidth:1, - fill: fillColor - } - }); - this.add(this.rectButton); - } + if (queryCtc && ctcArcList.includes(model.type)) { + this.arcShape = new Arc({ + zlevel: this.zlevel, + z: this.z, + shape: { + cx: computedPosition.x + 7, + cy: computedPosition.y + 7, + r: 7 + }, + style: { + stroke: '#69666E', + lineWidth: 1, + fill: fillColor + } + }); + this.add(this.arcShape); + } else { + this.rectButton = new Rect({ + zlevel: this.zlevel, + z: this.z, + shape: { + x: computedPosition.x, + y: computedPosition.y, + width: 14, + height: 14 + }, + style: { + lineDash: null, + stroke: '#69666E', + lineWidth:1, + fill: fillColor + } + }); + this.add(this.rectButton); + } this.leftLine = new Line({ zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x + 1, - y1: model.position.y + 1, - x2: model.position.x + 13, - y2: model.position.y + 13 + x1: computedPosition.x + 1, + y1: computedPosition.y + 1, + x2: computedPosition.x + 13, + y2: computedPosition.y + 13 }, style: { lineWidth: 2, @@ -82,10 +89,10 @@ export default class SignalButton extends Group { zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x + 13, - y1: model.position.y + 1, - x2: model.position.x + 1, - y2: model.position.y + 13 + x1: computedPosition.x + 13, + y1: computedPosition.y + 1, + x2: computedPosition.x + 1, + y2: computedPosition.y + 13 }, style: { lineWidth: 2, @@ -98,10 +105,10 @@ export default class SignalButton extends Group { zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x - 1, - y1: model.position.y - 1, - x2: model.position.x - 1, - y2: model.position.y + 15 + x1: computedPosition.x - 1, + y1: computedPosition.y - 1, + x2: computedPosition.x - 1, + y2: computedPosition.y + 15 }, style: { lineWidth: 2, @@ -114,10 +121,10 @@ export default class SignalButton extends Group { zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x - 1, - y1: model.position.y - 1, - x2: model.position.x + 15, - y2: model.position.y - 1 + x1: computedPosition.x - 1, + y1: computedPosition.y - 1, + x2: computedPosition.x + 15, + y2: computedPosition.y - 1 }, style: { lineWidth: 2, @@ -130,10 +137,10 @@ export default class SignalButton extends Group { zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x + 15, - y1: model.position.y - 1, - x2: model.position.x + 15, - y2: model.position.y + 15 + x1: computedPosition.x + 15, + y1: computedPosition.y - 1, + x2: computedPosition.x + 15, + y2: computedPosition.y + 15 }, style: { lineWidth: 2, @@ -146,10 +153,10 @@ export default class SignalButton extends Group { zlevel: this.zlevel, z: this.z + 1, shape: { - x1: model.position.x - 1, - y1: model.position.y + 15, - x2: model.position.x + 15, - y2: model.position.y + 15 + x1: computedPosition.x - 1, + y1: computedPosition.y + 15, + x2: computedPosition.x + 15, + y2: computedPosition.y + 15 }, style: { lineWidth: 2, @@ -164,8 +171,8 @@ export default class SignalButton extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.position.x + model.nameOffset.x, - y: model.position.y + model.nameOffset.y, + x: computedPosition.x + model.nameOffset.x, + y: computedPosition.y + model.nameOffset.y, fontWeight: '400', fontSize: 10, fontFamily: '', @@ -214,7 +221,7 @@ export default class SignalButton extends Group { } else if (this.model.type === 'GUIDE') { color = '#5050E1'; } else if (list.includes(this.model.type)) { - color = '#ccc'; + color = '#ccc'; } else { color = '#008000'; } @@ -223,11 +230,11 @@ export default class SignalButton extends Group { recover() { this.stopAnimation(); this.rectButton && this.rectButton.setStyle({ fill:this.getTypeColor() }); - this.arcShape && this.arcShape.setStyle({ fill:this.getTypeColor() }); + this.arcShape && this.arcShape.setStyle({ fill:this.getTypeColor() }); this.rightLine && this.rightLine.hide(); this.leftLine && this.leftLine.hide(); this.rectButton && this.rectButton.show(); - this.arcShape && this.arcShape.show(); + this.arcShape && this.arcShape.show(); this.buttonText && this.buttonText.show(); this.leftBoard && this.leftBoard.hide(); this.rightBoard && this.rightBoard.hide(); diff --git a/src/jmapNew/shape/graph/SplitStation/index.js b/src/jmapNew/shape/graph/SplitStation/index.js index 341e67332..b5a79ceaf 100644 --- a/src/jmapNew/shape/graph/SplitStation/index.js +++ b/src/jmapNew/shape/graph/SplitStation/index.js @@ -11,6 +11,12 @@ export default class SplitStation extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.isBigScreen = false; this.style = style; @@ -19,6 +25,7 @@ export default class SplitStation extends Group { create() { const model = this.model; const style = this.style; + const computedPosition = this.computedPosition; if (!style.SplitStation) { return; } @@ -26,10 +33,10 @@ export default class SplitStation extends Group { zlevel: this.zlevel, z: this.z, shape: { - x1: model.position.x, - y1: model.position.y, - x2: model.position.x, - y2: model.position.y + style.SplitStation.height + x1: computedPosition.x, + y1: computedPosition.y, + x2: computedPosition.x, + y2: computedPosition.y + style.SplitStation.height }, style: { lineWidth: style.SplitStation.lineWidth, @@ -41,17 +48,17 @@ export default class SplitStation extends Group { z: this.z, shape: { points: [ - [model.position.x, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2], - [model.position.x - style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance], - [model.position.x - style.SplitStation.horizontalDistance, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], - [model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], - [model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], - [model.position.x - style.SplitStation.horizontalDistance, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], - [model.position.x - style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height] + [computedPosition.x, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2], + [computedPosition.x - style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance], + [computedPosition.x - style.SplitStation.horizontalDistance, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], + [computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], + [computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], + [computedPosition.x - style.SplitStation.horizontalDistance, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], + [computedPosition.x - style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height] ] }, style: { @@ -63,17 +70,17 @@ export default class SplitStation extends Group { z: this.z, shape: { points: [ - [model.position.x, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2], - [model.position.x + style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance], - [model.position.x + style.SplitStation.horizontalDistance, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], - [model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], - [model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], - [model.position.x + style.SplitStation.horizontalDistance, - model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], - [model.position.x + style.SplitStation.horizontalDistance, model.position.y + style.SplitStation.height] + [computedPosition.x, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2], + [computedPosition.x + style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance], + [computedPosition.x + style.SplitStation.horizontalDistance, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], + [computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 - style.SplitStation.lineWidth / 2], + [computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], + [computedPosition.x + style.SplitStation.horizontalDistance, + computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2 + style.SplitStation.lineWidth / 2], + [computedPosition.x + style.SplitStation.horizontalDistance, computedPosition.y + style.SplitStation.height] ] }, style: { @@ -85,7 +92,7 @@ export default class SplitStation extends Group { z: this.z, style: { x: model.x, - y: model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2, + y: computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2, fontWeight: style.textStyle.fontWeight, fontSize: style.SplitStation.fontSize, fontFamily: style.fontFamily, @@ -99,8 +106,8 @@ export default class SplitStation extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength, - y: model.position.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2, + x: computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength, + y: computedPosition.y + style.SplitStation.height - style.SplitStation.verticalDistance / 2, fontWeight: style.textStyle.fontWeight, fontSize: style.SplitStation.fontSize, fontFamily: style.fontFamily, @@ -112,8 +119,8 @@ export default class SplitStation extends Group { }); const leftTextWidth = this.leftText.getBoundingRect().width; const rightTextWidth = this.rightText.getBoundingRect().width; - this.leftText.setStyle('x', model.position.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength - leftTextWidth / 2); - this.rightText.setStyle('x', model.position.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength + rightTextWidth / 2); + this.leftText.setStyle('x', computedPosition.x - style.SplitStation.horizontalDistance - style.SplitStation.lineLength - leftTextWidth / 2); + this.rightText.setStyle('x', computedPosition.x + style.SplitStation.horizontalDistance + style.SplitStation.lineLength + rightTextWidth / 2); this.add(this.verticalLine); this.add(this.arrowLeft); this.add(this.arrowRight); @@ -145,6 +152,6 @@ export default class SplitStation extends Group { }); } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/Station/EMouse.js b/src/jmapNew/shape/graph/Station/EMouse.js index 156122f5c..2dbf894d3 100644 --- a/src/jmapNew/shape/graph/Station/EMouse.js +++ b/src/jmapNew/shape/graph/Station/EMouse.js @@ -15,7 +15,7 @@ export default class EMouse extends Group { position: [0, 0], style: { x: 0, - y: this.device.model.position.y + this.device.style.Station.StationControl.lamp.radiusR + this.device.style.Station.StationControl.text.distance - 25, + y: this.device.computedPosition.y + this.device.style.Station.StationControl.lamp.radiusR + this.device.style.Station.StationControl.text.distance - 25, fontWeight: this.device.style.Station.StationControl.mouseOverStyle.fontWeight, fontSize: this.device.style.Station.StationControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, @@ -32,7 +32,7 @@ export default class EMouse extends Group { if (e.target && e.target.type == 'text' && e.target._subType == 'ControlSignal') { - this.text.setStyle({x: e.target.style.x}); + this.text.setStyle({x: e.target.style.x}); this.text.show(); } } diff --git a/src/jmapNew/shape/graph/Station/EStationText.js b/src/jmapNew/shape/graph/Station/EStationText.js index 9350b2f67..672c8922d 100644 --- a/src/jmapNew/shape/graph/Station/EStationText.js +++ b/src/jmapNew/shape/graph/Station/EStationText.js @@ -18,8 +18,8 @@ class EStationText extends Group { z: this.model.z, silent: !model.visible || false, style: { - x: model.position.x, - y: model.position.y, + x: model.computedPosition.x, + y: model.computedPosition.y, fontWeight: style.Station.stationText.fontWeight, fontSize: isNaN(Number(model.nameFont)) ? 20 : Number(model.nameFont), fontFamily: style.fontFamily, diff --git a/src/jmapNew/shape/graph/Station/EThreeLamp.js b/src/jmapNew/shape/graph/Station/EThreeLamp.js index ea80858a0..01bb41bbf 100644 --- a/src/jmapNew/shape/graph/Station/EThreeLamp.js +++ b/src/jmapNew/shape/graph/Station/EThreeLamp.js @@ -42,41 +42,41 @@ export default class EThreeLamp extends Group { } }); this.control2 = new Arc({ - pop: model.pop, - _subType: _subType, - _nameType: _nameType, - _val: _val, - zlevel: this.zlevel, - z: this.z, - shape: { - cx: model.point.x, - cy: model.point.y, - r: model.style.Station.StationControl.lamp.radiusR - }, - style: { - lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0, - fill: model.style.Station.StationControl.lamp.grayColor, - stroke: model.style.Station.StationControl.lamp.strokeColor - } - }); + pop: model.pop, + _subType: _subType, + _nameType: _nameType, + _val: _val, + zlevel: this.zlevel, + z: this.z, + shape: { + cx: model.point.x, + cy: model.point.y, + r: model.style.Station.StationControl.lamp.radiusR + }, + style: { + lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0, + fill: model.style.Station.StationControl.lamp.grayColor, + stroke: model.style.Station.StationControl.lamp.strokeColor + } + }); this.control3 = new Arc({ - pop: model.pop, - _subType: _subType, - _nameType: _nameType, - _val: _val, - zlevel: this.zlevel, - z: this.z, - shape: { - cx: model.point.x + model.style.Station.StationControl.lamp.radiusR * 3, - cy: model.point.y, - r: model.style.Station.StationControl.lamp.radiusR - }, - style: { - lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0, - fill: model.style.Station.StationControl.lamp.grayColor, - stroke: model.style.Station.StationControl.lamp.strokeColor - } - }); + pop: model.pop, + _subType: _subType, + _nameType: _nameType, + _val: _val, + zlevel: this.zlevel, + z: this.z, + shape: { + cx: model.point.x + model.style.Station.StationControl.lamp.radiusR * 3, + cy: model.point.y, + r: model.style.Station.StationControl.lamp.radiusR + }, + style: { + lineWidth: model.style.Station.StationControl.lamp.lineWidth || 0, + fill: model.style.Station.StationControl.lamp.grayColor, + stroke: model.style.Station.StationControl.lamp.strokeColor + } + }); this.text = new Text({ pop: model.pop, diff --git a/src/jmapNew/shape/graph/Station/index.js b/src/jmapNew/shape/graph/Station/index.js index cd309652e..db0d891f6 100644 --- a/src/jmapNew/shape/graph/Station/index.js +++ b/src/jmapNew/shape/graph/Station/index.js @@ -25,6 +25,18 @@ export default class Station extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + const offsetX = pictureDevice.position.x - model.position.x; + const offsetY = pictureDevice.position.y - model.position.y; + this.computedPosition = pictureDevice.position; + this.computedTurnBackPoint = { x: model.turnBackPoint ? model.turnBackPoint.x + offsetX : 0, y: model.turnBackPoint ? model.turnBackPoint.y + offsetY : 0 }; + this.computedControlModePoint = { x: model.controlModePoint.x + offsetX, y: model.controlModePoint.y + offsetY }; + } else { + this.computedPosition = model.position; + this.computedTurnBackPoint = model.turnBackPoint; + this.computedControlModePoint = model.controlModePoint; + } this.z = 40; this.model = model; this.style = style; @@ -44,11 +56,12 @@ export default class Station extends Group { const elementTypeList = { 'stationText': EStationText // 车站名称 (普通站台样式) }; - + model.computedPosition = this.computedPosition; // 遍历当前线路下的绘图元素 组合模式 traverseLineElements(style.Station, elementTypeList, model, style, this); const path = window.location.href; + const computedPosition = this.computedPosition; if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示 let direction = 1; if (this.style.Station.kilometerPosition == 'up') { @@ -63,8 +76,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, position: [0, 0], - x: model.position.x + offset.x, - y: model.position.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y, + x: computedPosition.x + offset.x, + y: computedPosition.y + ((parseInt(model.nameFont) + 2) * direction) + offset.y, fontWeight: model.fontWeight, fontSize: model.kmPostFont || 18, fontFamily: style.fontFamily, @@ -87,6 +100,7 @@ export default class Station extends Group { } createTurnBack() { // 创建按图折返 const model = this.model; + const computedTurnBackPoint = this.computedTurnBackPoint; const style = this.style; if (model.visible && model.createTurnBack) { this.turnBacks = []; @@ -96,8 +110,8 @@ export default class Station extends Group { z: this.z, position: [0, 0], style: { - x: model.turnBackPoint.x, - y: model.turnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance, + x: computedTurnBackPoint.x, + y: computedTurnBackPoint.y - style.Station.lamp.radiusR - style.Station.turnBack.toptextDistance, fontWeight: style.Station.text.fontWeight, fontSize: style.Station.text.fontSize, fontFamily: style.fontFamily, @@ -115,8 +129,8 @@ export default class Station extends Group { z: this.z, arc: { shape: { - cx: model.turnBackPoint.x + style.Station.turnBack.lampSpace * index, - cy: model.turnBackPoint.y, + cx: computedTurnBackPoint.x + style.Station.turnBack.lampSpace * index, + cy: computedTurnBackPoint.y, r: style.Station.lamp.radiusR }, lineWidth: 0, @@ -125,8 +139,8 @@ export default class Station extends Group { }, text: { position: [0, 0], - x: model.turnBackPoint.x + style.Station.turnBack.lampSpace * index, - y: model.turnBackPoint.y + style.Station.lamp.radiusR + style.Station.StationControl.text.distance, + x: computedTurnBackPoint.x + style.Station.turnBack.lampSpace * index, + y: computedTurnBackPoint.y + style.Station.lamp.radiusR + style.Station.StationControl.text.distance, fontWeight: style.Station.text.fontWeight, fontSize: style.Station.text.fontSize, fontFamily: style.fontFamily, @@ -176,8 +190,9 @@ export default class Station extends Group { this.setState(model); } createCtcControlMode() { // 大铁 - // 非常站控 - const model = this.model; + // 非常站控 + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; // 分散自律 this.selfDisciplineThree = new EThreeLamp({ _subType: 'veryControl', @@ -185,8 +200,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.selfDisciplineThree.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineThree.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.selfDisciplineThree.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineThree.offset.y }, context: this.style.Station.StationControl.selfDisciplineThree.text, pop: false @@ -199,8 +214,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.veryControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.veryControl.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.veryControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.veryControl.offset.y }, context: this.style.Station.StationControl.veryControl.text, pop: false @@ -213,8 +228,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.graphRoad.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.graphRoad.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.graphRoad.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.graphRoad.offset.y }, context: this.style.Station.StationControl.graphRoad.text, pop: false @@ -227,8 +242,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.planControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.planControl.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.planControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.planControl.offset.y }, context: this.style.Station.StationControl.planControl.text, pop: false @@ -241,8 +256,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.centerCommunication.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.centerCommunication.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.centerCommunication.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.centerCommunication.offset.y }, context: this.style.Station.StationControl.centerCommunication.text, pop: false @@ -255,8 +270,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.selfDisciplineCommunication.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineCommunication.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.selfDisciplineCommunication.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineCommunication.offset.y }, context: this.style.Station.StationControl.selfDisciplineCommunication.text, pop: false @@ -269,8 +284,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.allowedTurnBack.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.allowedTurnBack.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 / 3 + this.style.Station.StationControl.allowedTurnBack.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.allowedTurnBack.offset.y }, context: this.style.Station.StationControl.allowedTurnBack.text, pop: false @@ -283,8 +298,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.trainControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.trainControl.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.trainControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.trainControl.offset.y }, context: this.style.Station.StationControl.trainControl.text, pop: false @@ -292,13 +307,14 @@ export default class Station extends Group { this.add(this.trainControl); } createControlModeAU() { // 西安二 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; this.stationControlAU = new Text({ zlevel: this.zlevel, z: this.z, style: { - x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * -1, - y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY, + x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * -1, + y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY, fontWeight: this.style.Station.StationControl.text.fontWeight, fontSize: this.style.Station.StationControl.text.fontSize, fontFamily: this.style.fontFamily, @@ -311,15 +327,16 @@ export default class Station extends Group { this.add(this.stationControlAU); } createTroButton() { - const model = this.model; + // const model = this.model; + const computedPosition = this.computedPosition; const rect = this.stationText.getBoundingRect(); this.troButton = new Rect({ zlevel: this.zlevel, z: this.z, _subType: 'troButton', shape: { - x: model.position.x + rect.width / 2 + 5, - y: model.position.y, + x: computedPosition.x + rect.width / 2 + 5, + y: computedPosition.y, width: 25, height: 25 }, @@ -332,13 +349,14 @@ export default class Station extends Group { this.add(this.troButton); } createControlModeCC() { // 西安二 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; this.stationControlCC = new Text({ zlevel: this.zlevel, z: this.z, style: { - x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 0, - y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY, + x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 0, + y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY, fontWeight: this.style.Station.StationControl.text.fontWeight, fontSize: this.style.Station.StationControl.text.fontSize, fontFamily: this.style.fontFamily, @@ -352,13 +370,14 @@ export default class Station extends Group { } createControlModeCL() { // 西安二 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; this.stationControlCL = new Text({ zlevel: this.zlevel, z: this.z, style: { - x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 1, - y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY, + x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 1, + y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY, fontWeight: this.style.Station.StationControl.text.fontWeight, fontSize: this.style.Station.StationControl.text.fontSize, fontFamily: this.style.fontFamily, @@ -372,13 +391,14 @@ export default class Station extends Group { } createControlModeVA() { // 西安二 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; this.stationControlVA = new Text({ zlevel: this.zlevel, z: this.z, style: { - x: model.controlModePoint.x + this.style.Station.StationControl.text.offsetX * 2, - y: model.controlModePoint.y + this.style.Station.StationControl.text.offsetY, + x: computedControlModePoint.x + this.style.Station.StationControl.text.offsetX * 2, + y: computedControlModePoint.y + this.style.Station.StationControl.text.offsetY, fontWeight: this.style.Station.StationControl.text.fontWeight, fontSize: this.style.Station.StationControl.text.fontSize, fontFamily: this.style.fontFamily, @@ -392,7 +412,8 @@ export default class Station extends Group { } createEmergencyControl() { // 紧急站控 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; if (this.style.Station.StationControl.emergencyControl.show) { this.emergencyControl = new ESingleControl({ _subType: 'emergency', @@ -400,16 +421,16 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y }, context: this.style.Station.StationControl.emergencyControl.text, pop: false }); this.add(this.emergencyControl); if (this.style.Station.StationControl.emergencyControl.arrowShow) { - const x = model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.emergencyControl.offset.x; - const y = model.controlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y; + const x = computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 2 + this.style.Station.StationControl.emergencyControl.offset.x; + const y = computedControlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y; const point = arrow(x, y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8); this.emergencyArrowsControl = new EArrow({ zlevel: this.zlevel, @@ -418,8 +439,8 @@ export default class Station extends Group { count: this.count, drict: 1, point: point, - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y, + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y, fill: this.style.Station.StationControl.emergencyControl.grayColor, lineWidth: 1, stroke: this.style.sidelineColor @@ -429,63 +450,65 @@ export default class Station extends Group { } } createSelfDiscipline() { - const model = this.model; - if (this.style.Station.StationControl.selfDiscipline) { - this.selfDiscipline = new ESingleControl({ + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; + if (this.style.Station.StationControl.selfDiscipline) { + this.selfDiscipline = new ESingleControl({ _subType: 'self_discipline', style: this.style, zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.selfDiscipline.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.selfDiscipline.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.selfDiscipline.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.selfDiscipline.offset.y }, context: this.style.Station.StationControl.selfDiscipline.text, pop: false }); - this.add(this.selfDiscipline); + this.add(this.selfDiscipline); } - if (this.style.Station.StationControl.selfDisciplineControl) { - this.selfDisciplineControl = new ESingleControl({ + if (this.style.Station.StationControl.selfDisciplineControl) { + this.selfDisciplineControl = new ESingleControl({ _subType: 'self_discipline_control', style: this.style, zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.selfDisciplineControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.selfDisciplineControl.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.selfDisciplineControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.selfDisciplineControl.offset.y }, context: this.style.Station.StationControl.selfDisciplineControl.text, pop: false }); - this.add(this.selfDisciplineControl); + this.add(this.selfDisciplineControl); } } createVeryControl() { - const model = this.model; - if (this.style.Station.StationControl.veryControl) { - this.veryControl = new ESingleControl({ + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; + if (this.style.Station.StationControl.veryControl) { + this.veryControl = new ESingleControl({ _subType: 'very', style: this.style, zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.veryControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.centerControl.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.veryControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.centerControl.offset.y }, context: this.style.Station.StationControl.veryControl.text, pop: false }); - this.add(this.veryControl); + this.add(this.veryControl); } - if (this.style.Station.StationControl.veryControlButton) { - this.veryControlButton = new Rect({ + if (this.style.Station.StationControl.veryControlButton) { + this.veryControlButton = new Rect({ zlevel: this.zlevel, z: this.z, _subType: 'veryControlButton', shape: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.x - this.style.Station.StationControl.lamp.radiusR, - y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y - this.style.Station.StationControl.lamp.radiusR, + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.x - this.style.Station.StationControl.lamp.radiusR, + y: computedControlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y - this.style.Station.StationControl.lamp.radiusR, width: this.style.Station.StationControl.lamp.radiusR * 2, height: this.style.Station.StationControl.lamp.radiusR * 2 }, @@ -495,15 +518,15 @@ export default class Station extends Group { fill: this.style.Station.StationControl.veryControlButton.defaultColor } }); - this.add(this.veryControlButton); - this.veryControlButtonText = new Text({ + this.add(this.veryControlButton); + this.veryControlButtonText = new Text({ zlevel: this.zlevel, z: this.z, _subType: 'veryControlButtonText', position: [0, 0], style: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.y, - y: model.controlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y + this.style.Station.StationControl.lamp.radiusR + this.style.Station.StationControl.text.distance, + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.veryControlButton.offset.y, + y: computedControlModePoint.y + this.style.Station.StationControl.veryControlButton.offset.y + this.style.Station.StationControl.lamp.radiusR + this.style.Station.StationControl.text.distance, fontWeight: this.style.Station.StationControl.text.fontWeight, fontSize: this.style.Station.StationControl.text.fontSize, fontFamily: this.style.fontFamily, @@ -514,11 +537,12 @@ export default class Station extends Group { }, pop: false }); - this.add(this.veryControlButtonText); + this.add(this.veryControlButtonText); } } createCenterControl() { // 中控按钮 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; if (this.style.Station.StationControl.centerControl.show) { this.centerControl = new ESingleControl({ _subType: 'center', @@ -526,16 +550,16 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.centerControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.centerControl.offset.y + x: computedControlModePoint.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.centerControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.centerControl.offset.y }, context: this.style.Station.StationControl.centerControl.text, pop: false }); this.add(this.centerControl); if (this.style.Station.StationControl.centerControl.arrowShow) { - const x = model.controlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x; - const y = model.controlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y; + const x = computedControlModePoint.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.emergencyControl.offset.x; + const y = computedControlModePoint.y + this.style.Station.StationControl.emergencyControl.offset.y; const point = arrow(x, y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8); this.centerArrowsControl = new EArrow({ zlevel: this.zlevel, @@ -544,8 +568,8 @@ export default class Station extends Group { count: this.count, drict: 1, point: point, - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y, + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y, fill: this.style.Station.StationControl.centerControl.grayColor, lineWidth: 1, stroke: this.style.sidelineColor @@ -561,8 +585,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z + 1, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y }, context: this.style.Station.StationControl.centerControl.buttonText, pop: false @@ -589,8 +613,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z + 1, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 9 / 2 + this.style.Station.StationControl.lamp.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 9 / 2 + this.style.Station.StationControl.lamp.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y }, context: this.style.Station.StationControl.centerControl.lightText, pop: false @@ -617,8 +641,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z + 1, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 + this.style.Station.StationControl.lamp.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 + this.style.Station.StationControl.lamp.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.lamp.offset.y }, context: this.style.Station.StationControl.centerControl.preResetText, pop: false @@ -641,7 +665,8 @@ export default class Station extends Group { } createSubstationControl() { // 站控按钮 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; if (this.style.Station.StationControl.substationControl.show) { this.substationControl = new ESingleControl({ _subType: 'substation', @@ -649,16 +674,16 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.substationControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.substationControl.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.substationControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.substationControl.offset.y }, context: this.style.Station.StationControl.substationControl.text, pop: false }); this.add(this.substationControl); if (this.style.Station.StationControl.substationControl.arrowShow) { - const x = this.model.controlModePoint.x + this.style.Station.StationControl.substationControl.offset.x; - const y = this.model.controlModePoint.y + this.style.Station.StationControl.substationControl.offset.y; + const x = computedControlModePoint.x + this.style.Station.StationControl.substationControl.offset.x; + const y = computedControlModePoint.y + this.style.Station.StationControl.substationControl.offset.y; const point = arrow(x, y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8); this.substationArrowsControl = new EArrow({ zlevel: this.zlevel, @@ -667,8 +692,8 @@ export default class Station extends Group { count: this.count, drict: 1, point: point, - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y, + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y, fill: this.style.Station.StationControl.substationControl.grayColor, lineWidth: 1, stroke: this.style.sidelineColor @@ -679,7 +704,8 @@ export default class Station extends Group { } createInterconnectedControl() { // 联锁控 - const model = this.model; + // const model = this.model; + const computedControlModePoint = this.computedControlModePoint; if (this.style.Station.StationControl.interconnectedControl.show) { // 成都三会显示 this.interconnectedControl = new ESingleControl({ _subType: 'interconnected', @@ -687,8 +713,8 @@ export default class Station extends Group { zlevel: this.zlevel, z: this.z, point: { - x: model.controlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.interconnectedControl.offset.x, - y: model.controlModePoint.y + this.style.Station.StationControl.interconnectedControl.offset.y + x: computedControlModePoint.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.interconnectedControl.offset.x, + y: computedControlModePoint.y + this.style.Station.StationControl.interconnectedControl.offset.y }, context: this.style.Station.StationControl.interconnectedControl.text || '联锁控', pop: false @@ -821,7 +847,7 @@ export default class Station extends Group { } else if (!store.getters['map/checkDeviceShow'](this._code)) { this.eachChild(item => { item.hide(); }); } else { - store.getters['map/checkStationGuideMaster'](this._code, model.sguideMasterLock, model.xguideMasterLock); + store.getters['map/checkStationGuideMaster'](this._code, model.sguideMasterLock, model.xguideMasterLock); model.controlMode && this['handle' + model.controlMode](); model.preResetValidDuration && this.handlePreResetLamp(); model.controller && this.handleComplexControl(model.controller); @@ -1003,6 +1029,6 @@ export default class Station extends Group { } } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/StationCounter/index.js b/src/jmapNew/shape/graph/StationCounter/index.js index be05d40c6..6acb4d869 100644 --- a/src/jmapNew/shape/graph/StationCounter/index.js +++ b/src/jmapNew/shape/graph/StationCounter/index.js @@ -11,6 +11,12 @@ export default class StationCounter extends Group { super(); this._code = model.code; this._type = model._type; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.zlevel = model.zlevel; @@ -21,14 +27,15 @@ export default class StationCounter extends Group { create() { const model = this.model; + const computedPosition = this.computedPosition; const style = this.style; this.counter = new Text({ zlevel: this.zlevel, z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y, + x: computedPosition.x, + y: computedPosition.y, fontWeight: 'normal', fontSize: style.textFontSize, fontFamily: style.fontFamily, @@ -64,8 +71,8 @@ export default class StationCounter extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + this.rect.width + this.vPadding + style.textFontSize + style.StationCounter.text.distance, + x: computedPosition.x, + y: computedPosition.y + this.rect.width + this.vPadding + style.textFontSize + style.StationCounter.text.distance, fontWeight: 'bold', fontSize: style.textFontSize, fontFamily: style.fontFamily, @@ -99,7 +106,7 @@ export default class StationCounter extends Group { return null; } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/StationDelayUnlock/index.js b/src/jmapNew/shape/graph/StationDelayUnlock/index.js index 77208e9c4..5d05fdbf6 100644 --- a/src/jmapNew/shape/graph/StationDelayUnlock/index.js +++ b/src/jmapNew/shape/graph/StationDelayUnlock/index.js @@ -11,6 +11,12 @@ export default class StationDelayUnlock extends Group { super(); this._code = model.code; this._type = model._type; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.zlevel = model.zlevel; @@ -21,14 +27,15 @@ export default class StationDelayUnlock extends Group { create() { const model = this.model; + const computedPosition = this.computedPosition; const style = this.style; this.text = new Text({ zlevel: this.zlevel, z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y, + x: computedPosition.x, + y: computedPosition.y, fontWeight: 'normal', fontSize: model.textFont, fontFamily: style.fontFamily, @@ -45,8 +52,8 @@ export default class StationDelayUnlock extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + fontSize + style.StationDelayUnlock.text.distance, + x: computedPosition.x, + y: computedPosition.y + fontSize + style.StationDelayUnlock.text.distance, fontWeight: 'normal', fontSize: model.textFont, fontFamily: style.fontFamily, @@ -69,8 +76,8 @@ export default class StationDelayUnlock extends Group { zlevel: this.zlevel, z: this.z - 1, shape: { - x: model.position.x - this.lPadding, - y: model.position.y - this.vPadding, + x: computedPosition.x - this.lPadding, + y: computedPosition.y - this.vPadding, width: this.rect.width + this.lPadding * 2, height: this.rect.height + this.vPadding * 2 }, @@ -119,6 +126,6 @@ export default class StationDelayUnlock extends Group { this.time && this.time.show(); } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/StationStand/EEarlyStart.js b/src/jmapNew/shape/graph/StationStand/EEarlyStart.js index 351541379..2d312020f 100644 --- a/src/jmapNew/shape/graph/StationStand/EEarlyStart.js +++ b/src/jmapNew/shape/graph/StationStand/EEarlyStart.js @@ -12,13 +12,14 @@ class EEarlyStart extends Group { create(deviceParam) { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; this.isNew = true; /** 提前发车*/ const startD = model.right ? 1 : -1; - const startX = model.position.x - startD * (deviceParam.offset.x - model.width / 2); - const startY = model.position.y + startD * (deviceParam.offset.y - model.height / 2); + const startX = computedPosition.x - startD * (deviceParam.offset.x - model.width / 2); + const startY = computedPosition.y + startD * (deviceParam.offset.y - model.height / 2); this.earlyStart = new Text({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/ELevel.js b/src/jmapNew/shape/graph/StationStand/ELevel.js index 4b35fb63f..f4d5ce315 100644 --- a/src/jmapNew/shape/graph/StationStand/ELevel.js +++ b/src/jmapNew/shape/graph/StationStand/ELevel.js @@ -12,13 +12,14 @@ class ELevel extends Group { create() { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; this.isNew = true; const levelDrict = model.right ? 1 : -1; - const levelX = model.position.x - levelDrict * (style.StationStand.level.offset.x - model.width / 2); - const levelY = model.position.y + levelDrict * (style.StationStand.level.offset.y); + const levelX = computedPosition.x - levelDrict * (style.StationStand.level.offset.x - model.width / 2); + const levelY = computedPosition.y + levelDrict * (style.StationStand.level.offset.y); this.level = new Text({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/EMouse.js b/src/jmapNew/shape/graph/StationStand/EMouse.js index 37955f2e9..f5c7f0d54 100644 --- a/src/jmapNew/shape/graph/StationStand/EMouse.js +++ b/src/jmapNew/shape/graph/StationStand/EMouse.js @@ -15,12 +15,12 @@ export default class EMouse extends Group { silent: true, zlevel: this.zlevel, z: 0, - shape: { - x: 0, - y: 0, - width: 0, - height: 0 - }, + shape: { + x: 0, + y: 0, + width: 0, + height: 0 + }, style: { lineDash: this.style.StationStand.mouseOverStyle.borderLineDash, stroke: this.style.StationStand.mouseOverStyle.borderLineColor, @@ -33,34 +33,34 @@ export default class EMouse extends Group { } mouseover(e) { - const model = this.device.model; - const mapDevice = this.device.mapDevice; - const psdModel = mapDevice[model.psdCode]; - const rect = this.device.getBoundingRect().clone(); + const model = this.device.model; + const mapDevice = this.device.mapDevice; + const psdModel = mapDevice[model.psdCode]; + const rect = this.device.getBoundingRect().clone(); - if (psdModel && psdModel.instance) { - rect.union( psdModel.instance.getBoundingRect()); - } + if (psdModel && psdModel.instance) { + rect.union( psdModel.instance.getBoundingRect()); + } - if (this.style.StationStand.mouseOverStyle.standBackgroundColor) { - this.device.solidStand && this.device.solidStand.removeHover(); - this.device.solidStand && this.device.solidStand.addHover({ - fill: this.device.__over - ? this.style.StationStand.mouseOverStyle.standBackgroundColorOver - : this.style.StationStand.mouseOverStyle.standBackgroundColor - }); - } + if (this.style.StationStand.mouseOverStyle.standBackgroundColor) { + this.device.solidStand && this.device.solidStand.removeHover(); + this.device.solidStand && this.device.solidStand.addHover({ + fill: this.device.__over + ? this.style.StationStand.mouseOverStyle.standBackgroundColorOver + : this.style.StationStand.mouseOverStyle.standBackgroundColor + }); + } - this.border.setShape(rect); + this.border.setShape(rect); this.border.show(); } mouseout(e) { if (!this.device.__down) { - if (this.style.StationStand.mouseOverStyle.standBackgroundColor) { - this.device.solidStand && this.device.solidStand.removeHover(); - } - this.border.hide(); + if (this.style.StationStand.mouseOverStyle.standBackgroundColor) { + this.device.solidStand && this.device.solidStand.removeHover(); + } + this.border.hide(); } } } diff --git a/src/jmapNew/shape/graph/StationStand/EPatternFilter.js b/src/jmapNew/shape/graph/StationStand/EPatternFilter.js index 584c171f8..3efcff38a 100644 --- a/src/jmapNew/shape/graph/StationStand/EPatternFilter.js +++ b/src/jmapNew/shape/graph/StationStand/EPatternFilter.js @@ -10,6 +10,7 @@ class EPatternFilter extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; let direction = -1; if ((model.right && model.inside) || (!model.right && !model.inside)) { @@ -17,17 +18,17 @@ class EPatternFilter extends Group { } const startX = (model.width / 2 + style.StationStand.patternFilter.offset.x); - const startY = model.position.y + (model.height / 2 + style.StationStand.patternFilter.offset.y) * direction + (1 + direction) / 2 * 14; + const startY = computedPosition.y + (model.height / 2 + style.StationStand.patternFilter.offset.y) * direction + (1 + direction) / 2 * 14; this.patternFilter1 = new Polygon({ zlevel: this.model.zlevel, z: this.model.z, shape: { points:[ - [model.position.x - startX, startY], - [model.position.x - startX, startY - 14], - [model.position.x - startX - 14, startY - 14], - [model.position.x - startX - 14 - 10 * 0.866, startY - 7], - [model.position.x - startX - 14, startY] + [computedPosition.x - startX, startY], + [computedPosition.x - startX, startY - 14], + [computedPosition.x - startX - 14, startY - 14], + [computedPosition.x - startX - 14 - 10 * 0.866, startY - 7], + [computedPosition.x - startX - 14, startY] ] }, style: { @@ -39,11 +40,11 @@ class EPatternFilter extends Group { z: this.model.z, shape: { points:[ - [model.position.x + startX, startY], - [model.position.x + startX, startY - 14], - [model.position.x + startX + 14, startY - 14], - [model.position.x + startX + 14 + 10 * 0.866, startY - 7], - [model.position.x + startX + 14, startY] + [computedPosition.x + startX, startY], + [computedPosition.x + startX, startY - 14], + [computedPosition.x + startX + 14, startY - 14], + [computedPosition.x + startX + 14 + 10 * 0.866, startY - 7], + [computedPosition.x + startX + 14, startY] ] }, style: { diff --git a/src/jmapNew/shape/graph/StationStand/EReentry.js b/src/jmapNew/shape/graph/StationStand/EReentry.js index 1d3fa74e5..978df7a9e 100644 --- a/src/jmapNew/shape/graph/StationStand/EReentry.js +++ b/src/jmapNew/shape/graph/StationStand/EReentry.js @@ -12,13 +12,14 @@ class EReentry extends Group { create() { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; this.isNew = true; const reentryH = style.StationStand.reentry.mergentR; const isRight = model.right ? -1 : 1; - const reentryX = model.position.x - (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.x - model.width / 2); - const reentryY = model.position.y + (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.y) + isRight * reentryH; + const reentryX = computedPosition.x - (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.x - model.width / 2); + const reentryY = computedPosition.y + (style.StationStand.reentry.position || isRight) * (style.StationStand.reentry.offset.y) + isRight * reentryH; this.reentry = new Polygon({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/EStationPlatform.js b/src/jmapNew/shape/graph/StationStand/EStationPlatform.js index cd47703c1..cface7ab4 100644 --- a/src/jmapNew/shape/graph/StationStand/EStationPlatform.js +++ b/src/jmapNew/shape/graph/StationStand/EStationPlatform.js @@ -11,13 +11,14 @@ class EStationPlatform extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const buttonD = model.right ? 1 : -1; const platFormOffset = model.inside ? style.StationStand.stationPlatform.insideOffset : style.StationStand.stationPlatform.outsideOffset; - const buttonX = model.position.x - buttonD * ( model.width / 2 - 20); + const buttonX = computedPosition.x - buttonD * ( model.width / 2 - 20); // platFormOffset.x - - const buttonY = model.position.y + buttonD * (platFormOffset.y + buttonD * model.height / 2); + const buttonY = computedPosition.y + buttonD * (platFormOffset.y + buttonD * model.height / 2); this.stationPlatform = new Polygon({ zlevel: this.model.zlevel, z: this.model.z, diff --git a/src/jmapNew/shape/graph/StationStand/ETime.js b/src/jmapNew/shape/graph/StationStand/ETime.js index 7b1ed0a62..ff0265a24 100644 --- a/src/jmapNew/shape/graph/StationStand/ETime.js +++ b/src/jmapNew/shape/graph/StationStand/ETime.js @@ -11,11 +11,12 @@ class ETime extends Group { create() { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const timeDrict = model.right ? 1 : -1; - const timeX = model.position.x + style.StationStand.stopTime.position * timeDrict * (style.StationStand.stopTime.offset.x - model.width / 2); - const timeY = model.position.y + timeDrict * (style.StationStand.stopTime.offset.y - model.height / 2); + const timeX = computedPosition.x + style.StationStand.stopTime.position * timeDrict * (style.StationStand.stopTime.offset.x - model.width / 2); + const timeY = computedPosition.y + timeDrict * (style.StationStand.stopTime.offset.y - model.height / 2); this.isNew = true; this.time = new Text({ diff --git a/src/jmapNew/shape/graph/StationStand/ETrainDepart.js b/src/jmapNew/shape/graph/StationStand/ETrainDepart.js index a3ac22737..9e94ea451 100644 --- a/src/jmapNew/shape/graph/StationStand/ETrainDepart.js +++ b/src/jmapNew/shape/graph/StationStand/ETrainDepart.js @@ -10,12 +10,13 @@ class ETrainDepart extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const trainDepartOffset = model.inside ? style.StationStand.trainDepart.insideOffset : style.StationStand.trainDepart.outsideOffset; const trainDepartH = model.right ? 1 : -1; - const departX = model.position.x + trainDepartH * trainDepartOffset.x; - const departY = model.position.y + trainDepartH * trainDepartOffset.y; + const departX = computedPosition.x + trainDepartH * trainDepartOffset.x; + const departY = computedPosition.y + trainDepartH * trainDepartOffset.y; this.trainDepart = new Text({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js b/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js index 25dc4c2eb..cd9cddf84 100644 --- a/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js +++ b/src/jmapNew/shape/graph/StationStand/ETrainSetButton.js @@ -11,11 +11,12 @@ class ETrainSetButton extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const buttonD = model.right ? 1 : -1; - const buttonX = model.position.x - buttonD * (style.StationStand.trainSetButton.offset.x - model.width / 2); - const buttonY = model.position.y + buttonD * (style.StationStand.trainSetButton.offset.y - model.height / 2); + const buttonX = computedPosition.x - buttonD * (style.StationStand.trainSetButton.offset.x - model.width / 2); + const buttonY = computedPosition.y + buttonD * (style.StationStand.trainSetButton.offset.y - model.height / 2); this.trainSetButton = new Text({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/ETrainStop.js b/src/jmapNew/shape/graph/StationStand/ETrainStop.js index e4271141d..ecd70a621 100644 --- a/src/jmapNew/shape/graph/StationStand/ETrainStop.js +++ b/src/jmapNew/shape/graph/StationStand/ETrainStop.js @@ -11,13 +11,14 @@ class ETrainStop extends Group { create() { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; this.isNew = true; const stopTrainOffset = model.inside ? style.StationStand.trainStop.insideOffset : style.StationStand.trainStop.outsideOffset; const stopTrainH = model.right ? 1 : -1; - const stopX = model.position.x + stopTrainH * stopTrainOffset.x; - const stopY = model.position.y + stopTrainH * stopTrainOffset.y; + const stopX = computedPosition.x + stopTrainH * stopTrainOffset.x; + const stopY = computedPosition.y + stopTrainH * stopTrainOffset.y; this.trainStop = new Arc({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetain.js b/src/jmapNew/shape/graph/StationStand/detain/EDetain.js index 7fd1ff738..ee047da35 100644 --- a/src/jmapNew/shape/graph/StationStand/detain/EDetain.js +++ b/src/jmapNew/shape/graph/StationStand/detain/EDetain.js @@ -12,14 +12,15 @@ class EDetain extends Group { create(deviceParam) { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; this.isNew = true; /** 站台扣车*/ const detainOffset = model.inside ? deviceParam.insideOffset : deviceParam.outsideOffset; const detainD = model.right ? 1 : -1; - const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2); - const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2); + const detainX = computedPosition.x - detainD * (detainOffset.x - model.width / 2); + const detainY = computedPosition.y + detainD * (detainOffset.y - model.height / 2); this.detain = new Text({ zlevel: this.model.zlevel, @@ -43,7 +44,7 @@ class EDetain extends Group { if (deviceParam.special) { //, 'textPadding':[1, 3], 'textBorderColor':'#fff', 'textBorderWidth':1 - this.detain.setStyle({x:model.position.x - detainD * (model.width / 2 + detainOffset.x), y: model.position.y - detainD * 10}); + this.detain.setStyle({x:computedPosition.x - detainD * (model.width / 2 + detainOffset.x), y: computedPosition.y - detainD * 10}); } } } diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js b/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js index 032b756be..46c4dfe8a 100644 --- a/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js +++ b/src/jmapNew/shape/graph/StationStand/detain/EDetainCircle.js @@ -12,11 +12,11 @@ class EDetainCircle extends Group { create() { const model = this.model.modelData; const style = this.model.style; - + const computedPosition = this.model.modelData.computedPosition; const detainD = model.right ? 1 : -1; - const x = model.position.x + (model.width / 2) * detainD + detainD * style.StationStand.detainCircle.offset.x + detainD * style.StationStand.detainCircle.circleWidth / 2; - const y = model.position.y; + const x = computedPosition.x + (model.width / 2) * detainD + detainD * style.StationStand.detainCircle.offset.x + detainD * style.StationStand.detainCircle.circleWidth / 2; + const y = computedPosition.y; const radius = style.StationStand.detainCircle.circleWidth / 2; this.detainCircle = new Circle({ diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js b/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js index c6574d2d3..a33f70fc3 100644 --- a/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js +++ b/src/jmapNew/shape/graph/StationStand/detain/EDetainHollow.js @@ -10,12 +10,13 @@ class EDetainHollow extends EDetain { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; /** 站台扣车*/ const detainOffset = model.inside ? style.StationStand.detainHollow.insideOffset : style.StationStand.detainHollow.outsideOffset; const detainD = model.right ? 1 : -1; - const detainX = model.position.x - detainD * (detainOffset.x - model.width / 2); - const detainY = model.position.y + detainD * (detainOffset.y - model.height / 2); + const detainX = computedPosition.x - detainD * (detainOffset.x - model.width / 2); + const detainY = computedPosition.y + detainD * (detainOffset.y - model.height / 2); if (!this.isNew) { super.create(style.StationStand.detainHollow); const offsetX = model.right ? 8 : -8; diff --git a/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js b/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js index 068ce9e38..30973729e 100644 --- a/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js +++ b/src/jmapNew/shape/graph/StationStand/detain/EDetainRect.js @@ -10,10 +10,11 @@ class EDetainCircle extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; - const standX = model.position.x - model.width / 2; - const standY = model.position.y - model.height / 2; + const standX = computedPosition.x - model.width / 2; + const standY = computedPosition.y - model.height / 2; let y1; let y2; diff --git a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js index 2fd49e6a2..c4c1ae04e 100644 --- a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js +++ b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentArrow.js @@ -13,12 +13,13 @@ class EEmergentArrow extends Group { create() { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const emergentOffset = model.inside ? style.StationStand.emergentArrow.insideOffset : style.StationStand.emergentArrow.outsideOffset; const emergentH = model.right ? 1 : -1; - const emergentX = model.position.x + emergentH * emergentOffset.x; - const emergentY = model.position.y + emergentH * emergentOffset.y; + const emergentX = computedPosition.x + emergentH * emergentOffset.x; + const emergentY = computedPosition.y + emergentH * emergentOffset.y; const rotation = model.right == 1 ? Math.PI / 2 : Math.PI * 3 / 2; this.emergent = new Polygon({ diff --git a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js index 9060d3733..d6d23b3f9 100644 --- a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js +++ b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentCross.js @@ -12,12 +12,13 @@ class EEmergentCross extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const emergentOffset = model.inside ? style.StationStand.emergentCross.insideOffset : style.StationStand.emergentCross.outsideOffset; const emergentH = model.right ? 1 : -1; - const emergentX = model.position.x + emergentH * emergentOffset.x; - const emergentY = model.position.y + emergentH * emergentOffset.y; + const emergentX = computedPosition.x + emergentH * emergentOffset.x; + const emergentY = computedPosition.y + emergentH * emergentOffset.y; model.r = style.StationStand.emergentCross.mergentR; model.n = style.StationStand.emergentCross.mergentN; diff --git a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js index c2ef4c8e6..7210a3111 100644 --- a/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js +++ b/src/jmapNew/shape/graph/StationStand/emergent/EEmergentRhombus.js @@ -11,12 +11,13 @@ class EEmergentRhombus extends Group { create() { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const emergentOffset = model.inside ? style.StationStand.emergentRhombus.insideOffset : style.StationStand.emergentRhombus.outsideOffset; const emergentH = model.right ? 1 : -1; - const emergentX = model.position.x + emergentH * emergentOffset.x; - const emergentY = model.position.y + emergentH * emergentOffset.y; + const emergentX = computedPosition.x + emergentH * emergentOffset.x; + const emergentY = computedPosition.y + emergentH * emergentOffset.y; model.r = style.StationStand.emergentRhombus.mergentR; model.n = style.StationStand.emergentRhombus.mergentN; diff --git a/src/jmapNew/shape/graph/StationStand/index.js b/src/jmapNew/shape/graph/StationStand/index.js index ae6cf1b4a..12c635464 100644 --- a/src/jmapNew/shape/graph/StationStand/index.js +++ b/src/jmapNew/shape/graph/StationStand/index.js @@ -45,6 +45,12 @@ class StationStand extends Group { super(); this._code = model.code; this._type = model._type; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.zlevel = model.zlevel; @@ -59,7 +65,7 @@ class StationStand extends Group { // 加载皮肤控制的元素 const model = this.model; const style = this.style; - + model.computedPosition = this.computedPosition; // // 站台所有的绘图元素 const elementTypeList = { 'solidStand':ESolidStand, // 矩形实心站台 (普通站台样式) @@ -248,7 +254,7 @@ class StationStand extends Group { this.highlight && this.highlight.drawSelected(selected); } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } export default StationStand; diff --git a/src/jmapNew/shape/graph/StationStand/jump/EJump.js b/src/jmapNew/shape/graph/StationStand/jump/EJump.js index 9003befb7..f36b0763b 100644 --- a/src/jmapNew/shape/graph/StationStand/jump/EJump.js +++ b/src/jmapNew/shape/graph/StationStand/jump/EJump.js @@ -10,13 +10,14 @@ class EJump extends Group { create(deviceParam) { if (!this.isNew) { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; this.isNew = true; const jumpDirct = model.right ? -1 : 1; const jumpOffsetY = model.inside ? -1 : 1; - const jumpX = model.position.x - jumpDirct * (deviceParam.offset.x - model.width / 2); - const jumpY = model.position.y + jumpDirct * jumpOffsetY * deviceParam.offset.y; + const jumpX = computedPosition.x - jumpDirct * (deviceParam.offset.x - model.width / 2); + const jumpY = computedPosition.y + jumpDirct * jumpOffsetY * deviceParam.offset.y; if (deviceParam.special) { this.jump = new Text({ @@ -24,7 +25,7 @@ class EJump extends Group { z: this.model.z, style: { x: jumpX, - y: model.position.y + jumpDirct * jumpOffsetY * deviceParam.offset.y, + y: computedPosition.y + jumpDirct * jumpOffsetY * deviceParam.offset.y, fontWeight: deviceParam.fontWeight, fontSize: deviceParam.fontSize, fontFamily: style.fontFamily, diff --git a/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js b/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js index 0b8f47e29..246c4dbc1 100644 --- a/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js +++ b/src/jmapNew/shape/graph/StationStand/jump/EJumpCircle.js @@ -9,11 +9,12 @@ class EJumpCircle extends EJump { } create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; const jumpDirct = model.right ? -1 : 1; - const jumpCX = model.position.x - jumpDirct * (style.StationStand.jumpCircle.offset.x - model.width / 2); - const jumpCY = model.position.y + jumpDirct * style.StationStand.jumpCircle.offset.y; + const jumpCX = computedPosition.x - jumpDirct * (style.StationStand.jumpCircle.offset.x - model.width / 2); + const jumpCY = computedPosition.y + jumpDirct * style.StationStand.jumpCircle.offset.y; if (!this.isNew) { super.create(style.StationStand.jumpCircle); diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js index fa7a409ef..8201de20d 100644 --- a/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js +++ b/src/jmapNew/shape/graph/StationStand/safeStand/EGapStand.js @@ -12,9 +12,10 @@ class EGapStand extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; - const standX = model.position.x - model.width / 2; - const standY = model.position.y - model.height / 2; + const standX = computedPosition.x - model.width / 2; + const standY = computedPosition.y - model.height / 2; this.stand1 = new Rect({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js index 0a918c5c4..a649688f8 100644 --- a/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js +++ b/src/jmapNew/shape/graph/StationStand/safeStand/EHollowStand.js @@ -10,9 +10,10 @@ class EHollowStand extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; - const standX = model.position.x - model.width / 2; - const standY = model.position.y - model.height / 2; + const standX = computedPosition.x - model.width / 2; + const standY = computedPosition.y - model.height / 2; this.stand = new Rect({ zlevel: this.model.zlevel, diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js index c5cabba12..fffa00868 100644 --- a/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js +++ b/src/jmapNew/shape/graph/StationStand/safeStand/ELineStand.js @@ -12,9 +12,10 @@ class ESolidStand extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; - const standX = model.position.x - model.width / 2; - const standY = model.position.y - model.height / 2; + const standX = computedPosition.x - model.width / 2; + const standY = computedPosition.y - model.height / 2; const direction = model.right ? 1 : -1; this.stand = new Polyline({ diff --git a/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js b/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js index 0217ce637..57f8cbd09 100644 --- a/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js +++ b/src/jmapNew/shape/graph/StationStand/safeStand/ESolidStand.js @@ -11,9 +11,10 @@ class ESolidStand extends Group { create() { const model = this.model.modelData; + const computedPosition = this.model.modelData.computedPosition; const style = this.model.style; - const standX = model.position.x - model.width / 2; - const standY = model.position.y - model.height / 2; + const standX = computedPosition.x - model.width / 2; + const standY = computedPosition.y - model.height / 2; this.stand = new Rect({ zlevel: this.model.zlevel, @@ -58,8 +59,8 @@ class ESolidStand extends Group { zlevel: this.model.zlevel, z: this.model.z + 10, style: { - x: model.position.x + 35, - y: model.position.y - 20, + x: computedPosition.x + 35, + y: computedPosition.y - 20, text: `${'站台人数: ' + model.num ? model.num : 0}`, textFill: '#000', textAlign: 'left', diff --git a/src/jmapNew/shape/graph/StationTurnBack/EMouse.js b/src/jmapNew/shape/graph/StationTurnBack/EMouse.js index c0eb1a7ac..c1311fac6 100644 --- a/src/jmapNew/shape/graph/StationTurnBack/EMouse.js +++ b/src/jmapNew/shape/graph/StationTurnBack/EMouse.js @@ -13,8 +13,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.LcControl.lamp.radiusR + this.device.style.LcControl.text.distance - 30, fontWeight: 'normal', fontSize: this.device.style.LcControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/StationTurnBack/index.js b/src/jmapNew/shape/graph/StationTurnBack/index.js index a8ac3da7f..7c3fd90ca 100644 --- a/src/jmapNew/shape/graph/StationTurnBack/index.js +++ b/src/jmapNew/shape/graph/StationTurnBack/index.js @@ -12,6 +12,12 @@ export default class StationTurnBack extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.z = 40; this.model = model; this.style = style; @@ -23,14 +29,15 @@ export default class StationTurnBack extends Group { create() { const model = this.model; const style = this.style; + const computedPosition = this.computedPosition; if (model.show && !style.StationTurnBack.spliceShow) { this.control = new Circle({ zlevel: this.zlevel, z: this.z, shape: { - cx: model.position.x, - cy: model.position.y, + cx: computedPosition.x, + cy: computedPosition.y, r: style.StationTurnBack.lamp.radiusR }, style: { @@ -43,8 +50,8 @@ export default class StationTurnBack extends Group { zlevel: this.zlevel, z: this.z, shape: { - x: model.position.x - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2, - y: model.position.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2, + x: computedPosition.x - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2, + y: computedPosition.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.rect.padding / 2, width: style.StationTurnBack.lamp.radiusR * 2 + style.StationTurnBack.rect.padding, height: style.StationTurnBack.lamp.radiusR * 2 + style.StationTurnBack.rect.padding }, @@ -63,8 +70,8 @@ export default class StationTurnBack extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.text.distance, + x: computedPosition.x, + y: computedPosition.y - style.StationTurnBack.lamp.radiusR - style.StationTurnBack.text.distance, fontWeight: style.StationTurnBack.text.fontWeight, fontSize: style.StationTurnBack.text.fontSize, fontFamily: style.fontFamily, @@ -86,8 +93,8 @@ export default class StationTurnBack extends Group { z: this.z, position: [0, 0], style: { - x: model.position.x, - y: model.position.y + style.StationTurnBack.lamp.radiusR + style.StationTurnBack.text.distance, + x: computedPosition.x, + y: computedPosition.y + style.StationTurnBack.lamp.radiusR + style.StationTurnBack.text.distance, fontWeight: style.StationTurnBack.text.fontWeight, fontSize: style.StationTurnBack.text.fontSize, fontFamily: style.fontFamily, @@ -104,8 +111,8 @@ export default class StationTurnBack extends Group { this.control = new EFoldbackMode({ zlevel: this.zlevel, z: this.z, - x: model.position.x, - y: model.position.y, + x: computedPosition.x, + y: computedPosition.y, width: style.ReturnModeGroup.rectWidth, style: style }); @@ -196,7 +203,7 @@ export default class StationTurnBack extends Group { }; } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } getBoundingRect() { diff --git a/src/jmapNew/shape/graph/Switch/ESwDot.js b/src/jmapNew/shape/graph/Switch/ESwDot.js new file mode 100644 index 000000000..27714b7ae --- /dev/null +++ b/src/jmapNew/shape/graph/Switch/ESwDot.js @@ -0,0 +1,35 @@ +import Group from 'zrender/src/container/Group' +import Circle from 'zrender/src/graphic/shape/Circle' + +class ESwDot extends Group { + constructor(model, drictx, dricty) { + super() + this.model = model + this.dricty = dricty > 0 + this.drictx = drictx > 0 + this.create() + } + create() { + const { model } = this + this.dot = new Circle({ + zlevel: model.zlevel, + z: model.z || 0 + 12, + shape: { + cx: model.intersection.x + (this.drictx ? 12 : -12), + cy: model.intersection.y + (this.dricty ? 8 : -8), + r: 2 + }, + style: { + fill: '#FF0000' + } + }) + this.add(this.dot) + } + setColor(color) { + console.log(this.dot) + console.log(color) + this.dot.setStyle({ fill: color }) + } +} + +export default ESwDot diff --git a/src/jmapNew/shape/graph/Switch/index.js b/src/jmapNew/shape/graph/Switch/index.js index 8c7976b21..c624de3ba 100644 --- a/src/jmapNew/shape/graph/Switch/index.js +++ b/src/jmapNew/shape/graph/Switch/index.js @@ -13,6 +13,7 @@ import EMouse from './EMouse'; import EHighlight from '../element/EHighlight'; import ETriangle from './ETriangle'; import store from '@/store/index'; +import ESwDot from './ESwDot'; export default class Switch extends Group { constructor(model, {style, mapDevice}) { @@ -53,34 +54,36 @@ export default class Switch extends Group { const directx = this.triangle.drictx; const directy = this.triangle.dricty; const switchWidth1 = style.Section.line.width / 2; - let directxA = 1; - let sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]); - let sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.points[1]); - let sectionCTriangle = new JTriangle(sectionCModel.points[0], sectionCModel.points[1]); + const sectionAPoints = sectionAModel.instance ? sectionAModel.instance.computedPoints : sectionAModel.points; + const sectionBPoints = sectionBModel.instance ? sectionBModel.instance.computedPoints : sectionBModel.points; + const sectionCPoints = sectionCModel.instance ? sectionCModel.instance.computedPoints : sectionCModel.points; + let sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]); + let sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]); + let sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]); const sectionAPoint = { x: model.intersection.x, y: model.intersection.y }; - if (sectionAModel.points[0].x == model.intersection.x && sectionAModel.points[0].y == model.intersection.y) { - sectionATriangle = new JTriangle(sectionAModel.points[0], sectionAModel.points[1]); + if (sectionAPoints[0].x == model.intersection.x && sectionAPoints[0].y == model.intersection.y) { + sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]); directxA = 1; } - if (sectionAModel.points[sectionAModel.points.length - 1].x == model.intersection.x && sectionAModel.points[sectionAModel.points.length - 1].y == model.intersection.y) { - sectionATriangle = new JTriangle(sectionAModel.points[sectionAModel.points.length - 2], sectionAModel.points[sectionAModel.points.length - 1]); + if (sectionAPoints[sectionAPoints.length - 1].x == model.intersection.x && sectionAPoints[sectionAPoints.length - 1].y == model.intersection.y) { + sectionATriangle = new JTriangle(sectionAPoints[sectionAPoints.length - 2], sectionAPoints[sectionAPoints.length - 1]); directxA = -1; } - if (sectionBModel.points[0].x == model.intersection.x && sectionBModel.points[0].y == model.intersection.y) { - sectionBTriangle = new JTriangle(sectionBModel.points[0], sectionBModel.points[1]); + if (sectionBPoints[0].x == model.intersection.x && sectionBPoints[0].y == model.intersection.y) { + sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]); } - if (sectionBModel.points[sectionBModel.points.length - 1].x == model.intersection.x && sectionBModel.points[sectionBModel.points.length - 1].y == model.intersection.y) { - sectionBTriangle = new JTriangle(sectionBModel.points[sectionBModel.points.length - 2], sectionBModel.points[sectionBModel.points.length - 1]); + if (sectionBPoints[sectionBPoints.length - 1].x == model.intersection.x && sectionBPoints[sectionBPoints.length - 1].y == model.intersection.y) { + sectionBTriangle = new JTriangle(sectionBPoints[sectionBPoints.length - 2], sectionBPoints[sectionBPoints.length - 1]); } - if (sectionCModel.points[0].x == model.intersection.x && sectionCModel.points[0].y == model.intersection.y) { - sectionCTriangle = new JTriangle(sectionCModel.points[0], sectionCModel.points[1]); + if (sectionCPoints[0].x == model.intersection.x && sectionCPoints[0].y == model.intersection.y) { + sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]); } - if (sectionCModel.points[sectionCModel.points.length - 1].x == model.intersection.x && sectionCModel.points[sectionCModel.points.length - 1].y == model.intersection.y) { - sectionCTriangle = new JTriangle(sectionCModel.points[sectionCModel.points.length - 2], sectionCModel.points[sectionCModel.points.length - 1]); + if (sectionCPoints[sectionCPoints.length - 1].x == model.intersection.x && sectionCPoints[sectionCPoints.length - 1].y == model.intersection.y) { + sectionCTriangle = new JTriangle(sectionCPoints[sectionCPoints.length - 2], sectionCPoints[sectionCPoints.length - 1]); } const swPadding = rateOpen @@ -212,12 +215,19 @@ export default class Switch extends Group { } }); + if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) { + const { drictx, dricty } = this.triangle; + this.dot = new ESwDot(model, drictx, dricty); + this.add(this.dot); + } + this.add(this.shapeModelA); this.add(this.shapeModelB); this.add(this.shapeModelC); this.add(this.shapeBlockCover); this.add(this.name); this.add(this.enabledName); + style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide(); } @@ -343,6 +353,7 @@ export default class Switch extends Group { this.artificialArc && this.artificialArc.hide(); this.name && this.name.show(); this.limitName && this.limitName.show(); + this.dot && this.dot.hide(); } /** 定位*/ @@ -434,28 +445,20 @@ export default class Switch extends Group { .start(); } // N-定位 R-反位 NO-无(失表) EX-挤叉 - setSwitchFault(fault, pos) { - if (this.style.Switch.jointImg.faultStatus && fault && (pos == 'NO' || pos == 'EX') ) { // 宁波线失表状态 - this.setForkAction(fault); // 道岔挤岔 - } else if (this.style.Switch.faultNoHandle ) { - this.shapeModelA.hide(); - this.shapeModelB.hide(); - this.shapeModelC.hide(); - } else { - const faultList = ['SPLIT', 'SQUEEZE', 'NORMAL_SPLIT', 'REVERSE_SPLIT', 'SPLIT_1']; - // (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition)) - if (this.model.switchFaultCode && fault && faultList.includes(fault) ) { - const switchFault = this.mapDevice[this.model.switchFaultCode]; - switchFault.instance.setControlColor('#F00', true); - } else if (this.model.switchFaultCode) { - const switchFault = this.mapDevice[this.model.switchFaultCode]; - switchFault.instance.setControlColor(this.style.backgroundColor, false); - } - // stopAnimation - this.shapeModelB.stopAnimation(false); - this.shapeModelC.stopAnimation(false); - this.shapeModelA.stopAnimation(false); + setSwitchFault(fault) { + const faultList = ['SPLIT', 'SQUEEZE', 'NORMAL_SPLIT', 'REVERSE_SPLIT', 'SPLIT_1']; + // (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition)) + if (this.model.switchFaultCode && fault && faultList.includes(fault) ) { + const switchFault = this.mapDevice[this.model.switchFaultCode]; + switchFault.instance.setControlColor('#F00', true); + } else if (this.model.switchFaultCode) { + const switchFault = this.mapDevice[this.model.switchFaultCode]; + switchFault.instance.setControlColor(this.style.backgroundColor, false); } + // stopAnimation + this.shapeModelB.stopAnimation(false); + this.shapeModelC.stopAnimation(false); + this.shapeModelA.stopAnimation(false); } /** 挤叉*/ setForkAction(fault) { @@ -514,6 +517,10 @@ export default class Switch extends Group { this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.inversionColor }); } } + if (this.style.Switch.switchDot && this.style.Switch.switchDot.show) { + this.dot.show(); + this.dot.setColor(this.style.Switch.switchDot.monoLockColor); + } this.setTextColor(this.style.Switch.text.monolockLocationColor); } @@ -567,6 +574,10 @@ 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.switchDot && this.style.Switch.switchDot.show) { + this.dot.show(); + this.dot.setColor(this.style.Switch.switchDot.lockColor); + } // if (this.style.Switch.coverBlock && this.style.Switch.coverBlock.show) { // this.shapeBlockCover.show(); @@ -706,7 +717,7 @@ export default class Switch extends Group { this.setAshShow(); } } else { - this.setSwitchFault(model.fault, model.pos); + this.setSwitchFault(model.fault); // model.pos == 'NO' || model.pos == 'EX'; // N-定位 R-反位 NO-无(失表) EX-挤叉 @@ -718,14 +729,23 @@ export default class Switch extends Group { this.switchPosition = 'reverse'; this.setInversionAction(model); /** 反位*/ } else if (model.pos == 'NO') { - this.setLossAction(model.fault); // 失去 + // 宁波线失表 + if (this.style.Switch.jointImg.faultStatus && model.fault) { + this.setForkAction(model.fault); + } else if (this.style.Switch.faultNoHandle) { + this.shapeModelA.hide(); + this.shapeModelB.hide(); + this.shapeModelC.hide(); + } else { + this.setLossAction(model.fault); // 失去 + } } else if (model.pos == 'EX') { this.setForkAction(model.fault); // 挤岔 } model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示 model.singleLock && this.setMonolock(model.pos); // 道岔单锁 - model.guideMasterLock && this.setMonolock(model.pos); // 引导总锁 + model.guideMasterLock && this.setMonolock(model.pos); // 引导总锁 model.blockade && this.block(model.pos); // 道岔封锁 model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态 const path = window.location.href; diff --git a/src/jmapNew/shape/graph/Text/index.js b/src/jmapNew/shape/graph/Text/index.js index 48b2f5ef0..4fbf3cab4 100644 --- a/src/jmapNew/shape/graph/Text/index.js +++ b/src/jmapNew/shape/graph/Text/index.js @@ -10,6 +10,12 @@ export default class Text2 extends Group { this._type = model._type; this.name = model.code; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.z = 6; @@ -21,6 +27,7 @@ export default class Text2 extends Group { create() { var model = this.model; + const computedPosition = this.computedPosition; var [direction, content] = model.content.split('::'); if (direction == 'V') { content = content.split('').join('\n'); @@ -32,8 +39,8 @@ export default class Text2 extends Group { zlevel: this.zlevel, z: this.z, style: { - x: model.position.x, - y: model.position.y, + x: computedPosition.x, + y: computedPosition.y, text: content, fontFamily: this.style.fontFamily, fontSize: Number(model.font), @@ -58,7 +65,7 @@ export default class Text2 extends Group { if (this.text) { return this.text.getBoundingRect().clone(); } else { - return new BoundingRect(this.model.position.x, this.model.position.y, 0, 0); + return new BoundingRect(this.computedPosition.x, this.computedPosition.y, 0, 0); } } screenShow() { @@ -70,6 +77,6 @@ export default class Text2 extends Group { } } getAnchorPoint() { - return this.model.position; + return this.computedPosition; } } diff --git a/src/jmapNew/shape/graph/Train/index.js b/src/jmapNew/shape/graph/Train/index.js index 7af64ad8f..882ac0511 100644 --- a/src/jmapNew/shape/graph/Train/index.js +++ b/src/jmapNew/shape/graph/Train/index.js @@ -41,12 +41,12 @@ export default class Train extends Group { if (model.trainWindowModel) { const amendData = store.getters['map/amendPoints'](model.trainWindowModel.code); if (amendData) { - model.trainWindowModel.point = amendData.position; + model.trainWindowModel.instance.computedPoint = amendData.position; model.trainWindowModel.reversal = amendData.reversal; } this.point = { - x: model.trainWindowModel.point.x, - y: model.trainWindowModel.point.y + x: model.trainWindowModel.instance.computedPoint.x, + y: model.trainWindowModel.instance.computedPoint.y }; if (model.right) { this.point.x = this.point.x - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth / 2; @@ -178,8 +178,8 @@ export default class Train extends Group { if (style.Train.directionArrow.hasArrow) { // 列车运行上下方箭头(eg:宁波yi) const arrowPoint = { x: 0, y: 0 }; if (model.trainWindowModel) { - arrowPoint.x = model.trainWindowModel.point.x; - arrowPoint.y = model.right ? model.trainWindowModel.point.y + style.Train.directionArrow.distanceBottom : model.trainWindowModel.point.y - style.Train.directionArrow.distanceTop; + arrowPoint.x = model.trainWindowModel.instance.computedPoint.x; + arrowPoint.y = model.right ? model.trainWindowModel.instance.computedPoint.y + style.Train.directionArrow.distanceBottom : model.trainWindowModel.instance.computedPoint.y - style.Train.directionArrow.distanceTop; } this.directionArrow = new EDirection({ zlevel: this.zlevel, diff --git a/src/jmapNew/shape/graph/TrainWindow/index.js b/src/jmapNew/shape/graph/TrainWindow/index.js index 2e4bdce1e..3329eddc4 100644 --- a/src/jmapNew/shape/graph/TrainWindow/index.js +++ b/src/jmapNew/shape/graph/TrainWindow/index.js @@ -11,9 +11,14 @@ class TrainWindow extends Group { this._type = model._type; this.zlevel = model.zlevel; const amendData = store.getters['map/amendPoints'](this._code); + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); if (amendData) { - model.point = amendData.position; model.reversal = amendData.reversal; + this.computedPoint = amendData.position; + } else if (pictureDevice) { + this.computedPoint = pictureDevice.position; + } else { + this.computedPoint = model.point; } this.model = model; this.style = style; @@ -40,7 +45,7 @@ class TrainWindow extends Group { /** 创建车次窗*/ createTrainWindow() { const model = this.model; - const point = model.point || model.position; + const point = this.computedPoint; this.trainRect = new Polygon({ _subType: 'TrainWindow', zlevel: this.zlevel, @@ -94,7 +99,7 @@ class TrainWindow extends Group { return (store.getters['map/getDeviceByCode'](code) || {}).instance; } getAnchorPoint() { - return this.model.point || this.model.position; + return this.computedPoint; } } diff --git a/src/jmapNew/shape/graph/ZcControl/EMouse.js b/src/jmapNew/shape/graph/ZcControl/EMouse.js index bedc46d8a..ae8bbdb5c 100644 --- a/src/jmapNew/shape/graph/ZcControl/EMouse.js +++ b/src/jmapNew/shape/graph/ZcControl/EMouse.js @@ -14,8 +14,8 @@ export default class EMouse extends Group { z: this.device.z + 1, position: [0, 0], style: { - x: this.device.model.position.x, - y: this.device.model.position.y + this.device.style.ZcControl.lamp.radiusR + this.device.style.ZcControl.text.distance - 30, + x: this.device.computedPosition.x, + y: this.device.computedPosition.y + this.device.style.ZcControl.lamp.radiusR + this.device.style.ZcControl.text.distance - 30, fontWeight: this.device.style.ZcControl.mouseOverStyle.fontWeight, fontSize: this.device.style.ZcControl.mouseOverStyle.fontSize, fontFamily: this.device.style.fontFamily, diff --git a/src/jmapNew/shape/graph/ZcControl/index.js b/src/jmapNew/shape/graph/ZcControl/index.js index 52701ef89..4f4f0fb80 100644 --- a/src/jmapNew/shape/graph/ZcControl/index.js +++ b/src/jmapNew/shape/graph/ZcControl/index.js @@ -13,6 +13,12 @@ export default class ZcControl extends Group { this._code = model.code; this._type = model._type; this.zlevel = model.zlevel; + const pictureDevice = store.getters['map/getPictureDeviceByCode'](model.code); + if (pictureDevice) { + this.computedPosition = pictureDevice.position; + } else { + this.computedPosition = model.position; + } this.model = model; this.style = style; this.isShowShape = true; @@ -29,8 +35,8 @@ export default class ZcControl extends Group { z: this.z, arc: { shape: { - cx: model.position.x, - cy: model.position.y, + cx: this.computedPosition.x, + cy: this.computedPosition.y, r: this.style.ZcControl.lamp.radiusR }, subType: 'Control', @@ -41,8 +47,8 @@ export default class ZcControl extends Group { }, text: { position: [0, 0], - x: model.position.x, - y: model.position.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance, + x: this.computedPosition.x, + y: this.computedPosition.y + this.style.ZcControl.lamp.radiusR + this.style.ZcControl.text.distance, fontWeight: this.style.ZcControl.text.fontWeight, fontSize: this.style.ZcControl.text.fontSize, fontFamily: this.style.fontFamily, diff --git a/src/jmapNew/shape/graph/checkBox/checkBox.js b/src/jmapNew/shape/graph/checkBox/checkBox.js index 5d4253608..e3742a144 100644 --- a/src/jmapNew/shape/graph/checkBox/checkBox.js +++ b/src/jmapNew/shape/graph/checkBox/checkBox.js @@ -30,4 +30,5 @@ export default class checkBox extends Group { }); this.add(this.box); } + setState() {} } diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index 0755d7f2a..bccfd8a23 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -564,15 +564,45 @@ export const menuOperate = { operation: OperationEvent.CTCCommand.autoTrigger.menu.operation, cmdType: CMD.CTC.CTC_AUTO_TRIGGER }, - // 批量修改股道 - batchModifyTrackSection:{ - operation: OperationEvent.CTCCommand.batchModifyTrackSection.menu.operation, - cmdType: CMD.CTC.CTC_BATCH_MODIFY_RUN_PLAN + // // 批量修改股道 + // batchModifyTrackSection:{ + // operation: OperationEvent.CTCCommand.batchModifyTrackSection.menu.operation, + // cmdType: CMD.CTC.CTC_BATCH_MODIFY_RUN_PLAN + // }, + // 修改股道 + modifyTrackSection:{ + operation: OperationEvent.CTCCommand.modifyTrackSection.menu.operation, + cmdType: CMD.CTC.CTC_MODIFY_SECTION }, - // 移除行车日志 - deleteRunplan:{ - operation: OperationEvent.CTCCommand.deleteRunplan.menu.operation, - cmdType: CMD.CTC.CTC_REMOVE_RUN_PLAN + // 车站发送计划 + stationSendRunplan:{ + operation: OperationEvent.CTCCommand.stationSendRunplan.menu.operation, + cmdType: CMD.CTC.CTC_STATION_SEND_OUT_RUN_PLAN + }, + // 车站取消红闪 + stationCancleTwinkle:{ + operation: OperationEvent.CTCCommand.stationCancleTwinkle.menu.operation, + cmdType: CMD.CTC.CTC_CANCEL_TWINKLE + }, + // // 移除行车日志 + // deleteRunplan:{ + // operation: OperationEvent.CTCCommand.deleteRunplan.menu.operation, + // cmdType: CMD.CTC.CTC_REMOVE_RUN_PLAN + // }, + // 设置删除标识 + setDeleteRunplanLabel:{ + operation: OperationEvent.CTCCommand.setDeleteRunplanLabel.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SET_DELETE_LABEL + }, + // 设置超限 + setTransfinite:{ + operation: OperationEvent.CTCCommand.setTransfinite.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SET_TRANSFINITE + }, + // 行车日志保存运行计划 + logSaveRunplan:{ + operation: OperationEvent.CTCCommand.logSaveRunplan.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SAVE_RUN_PLAN }, // 修改行车计划的邻站信息 modifyAdjacentStation:{ @@ -594,6 +624,47 @@ export const menuOperate = { operation: OperationEvent.CTCCommand.agreeNotcie.menu.operation, cmdType: CMD.CTC.CTC_AGREE_NOTICE }, + // 取消到达 + cancleArrive:{ + operation: OperationEvent.CTCCommand.cancleArrive.menu.operation, + cmdType: CMD.CTC.CTC_LOG_CANCEL_ARRIVE + }, + // 取消出发 + cancleDepature:{ + operation: OperationEvent.CTCCommand.cancleDepature.menu.operation, + cmdType: CMD.CTC.CTC_LOG_CANCEL_DEPARTURE + }, + // 取消闭塞 + cancleBlock:{ + operation: OperationEvent.CTCCommand.cancleBlock.menu.operation, + cmdType: CMD.CTC.CTC_LOG_CANCEL_BLOCK + }, + // 设置重点列车 + setKeyTrains:{ + operation: OperationEvent.CTCCommand.setKeyTrains.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SET_KEY_TRAINS + }, + // 设置允许出入口与基本路径不一致 + setEntryOutDiscordant:{ + operation: OperationEvent.CTCCommand.setEntryOutDiscordant.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SET_ENTRY_OUT_DISCORDANT + }, + // 设置允许股道与基本路径不一致 + setTrackDiscordant:{ + operation: OperationEvent.CTCCommand.setTrackDiscordant.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SET_TRACK_DISCORDANT + }, + // 设置始发 + setStartRunplan:{ + operation: OperationEvent.CTCCommand.setStartRunplan.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SET_START_RUN_PLAN + }, + // 设置终到 + setEndRunplan:{ + operation: OperationEvent.CTCCommand.setEndRunplan.menu.operation, + cmdType: CMD.CTC.CTC_LOG_SET_END_RUN_PLAN + }, + // 增加列车固定径路 addTrainFixedPath:{ operation: OperationEvent.CTCCommand.addTrainFixedPath.menu.operation, @@ -642,6 +713,16 @@ export const menuOperate = { modifyDispatcherLogerRpSection:{ operation: OperationEvent.CTCCommand.modifyDispatcherLogerRpSection.menu.operation, cmdType: CMD.CTC.CTC_ZONE_SAVE_TRACK_SECTION + }, + // 调度台行车计划修改时间 + modifyDispatcherLogerRpPlanTime:{ + operation: OperationEvent.CTCCommand.modifyDispatcherLogerRpSection.menu.operation, + cmdType: CMD.CTC.CTC_ZONE_SAVE_PLAN_TIME + }, + // 调度台行车计划修改出入口 + modifyDispatcherLogerRpDirection:{ + operation: OperationEvent.CTCCommand.modifyDispatcherLogerRpSection.menu.operation, + cmdType: CMD.CTC.CTC_ZONE_SAVE_DIRECTION } }, Rail: { @@ -653,6 +734,10 @@ export const menuOperate = { operation: OperationEvent.RailCommand.railQueryTicket.menu.operation, cmdType: CMD.RAIL.CMD_RAIL_QUERY_TICKET }, + railGiveTicketTo: { + operation: OperationEvent.RailCommand.railGiveTicketTo.menu.operation, + cmdType: CMD.RAIL.CMD_RAIL_GIVE_TICKET_TO + }, railFillInRegister: { operation: OperationEvent.RailCommand.railFillInRegister.menu.operation, cmdType: CMD.RAIL.CMD_RAIL_FILL_IN_REGISTER diff --git a/src/jmapNew/theme/datie_02/menus/bottomTable.vue b/src/jmapNew/theme/datie_02/menus/bottomTable.vue index e5687c866..951aa37af 100644 --- a/src/jmapNew/theme/datie_02/menus/bottomTable.vue +++ b/src/jmapNew/theme/datie_02/menus/bottomTable.vue @@ -157,6 +157,10 @@ export default { const offset = val ? 162 : 0; EventBus.$emit('setMenuButtonPosition', offset); }, + '$store.state.socket.simulationReset': function (val) { + this.sequenceMap = {}; + this.sequenceList = []; + }, '$store.state.socket.railCtcStatusMsg': function (val) { if (val && val.length) { val.forEach(item => { @@ -169,6 +173,11 @@ export default { } }); } + if (item && item.routeSequence && item.routeSequence.deletedLineIds && item.routeSequence.deletedLineIds.length) { + item.routeSequence.deletedLineIds.forEach(elem => { + delete this.sequenceMap[elem]; + }); + } }); this.sequenceList = []; for (const key in this.sequenceMap) { diff --git a/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue b/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue index 0b9134b52..2cddd04cb 100644 --- a/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue +++ b/src/jmapNew/theme/datie_02/menus/dialog/deleteRunplan.vue @@ -46,7 +46,8 @@ export default { return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; }, domIdConfirm() { - return this.dialogShow ? OperationEvent.CTCCommand.deleteRunplan.menu.domId : ''; + // deleteRunplan + return this.dialogShow ? OperationEvent.CTCCommand.setDeleteRunplanLabel.menu.domId : ''; }, title() { return '警告'; @@ -69,7 +70,9 @@ export default { }, commit() { this.loading = true; - commitOperate(menuOperate.CTC.deleteRunplan, this.model, 2).then(({valid})=>{ + // 设置删除标识 + // deleteRunplan; + commitOperate(menuOperate.CTC.setDeleteRunplanLabel, this.model, 2).then(({valid})=>{ this.loading = false; this.$emit('clearRpRow'); if (valid) { diff --git a/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue b/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue index 26e4fb5dd..a56d5f917 100644 --- a/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue +++ b/src/jmapNew/theme/datie_02/menus/dialog/sendRunplan.vue @@ -134,9 +134,9 @@ export default { tableData1:[], tableData2:[], addModel:{ - stationCode:'', - planParamList:[], - force:1 + stationCode:'' + // planParamList:[], + // force:1 } }; }, @@ -148,15 +148,15 @@ export default { return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; }, domIdConfirm() { - return this.dialogShow ? OperationEvent.CTCCommand.batchModifyTrackSection.menu.domId : ''; + return this.dialogShow ? OperationEvent.CTCCommand.stationSendRunplan.menu.domId : ''; }, title() { return '发送计划'; } }, methods:{ - doShow(tableData, activeDepartRunPlan, activeArriveRunPlan, filterSectionList) { - this.addModel.planParamList = []; + doShow(tableData, filterSectionList) { + // this.addModel.planParamList = []; this.tableData1 = []; tableData.forEach(element => { if (element.arriveRunPlan && element.arriveRunPlan.sectionCode) { @@ -171,24 +171,24 @@ export default { }); // filterSectionList this.addModel.stationCode = this.$store.state.training.roleDeviceCode; - const activeDepartRunPlanList = Object.values(activeDepartRunPlan).filter(activeDepart=>{ return activeDepart.changeSectionCode && activeDepart.changeSectionCode != activeDepart.sectionCode; }); - if (activeDepartRunPlanList.length > 0) { - activeDepartRunPlanList.forEach(depart=>{ - this.addModel.planParamList.push({ - runPlanCode:depart.code, - departSectionCode:depart.changeSectionCode - }); - }); - } - const activeArriveRunPlanList = Object.values(activeArriveRunPlan).filter(activeArrive=>{ return activeArrive.changeSectionCode && activeArrive.changeSectionCode != activeArrive.sectionCode; }); - if (activeArriveRunPlanList.length > 0) { - activeArriveRunPlanList.forEach(arrive=>{ - this.addModel.planParamList.push({ - runPlanCode:arrive.code, - arriveSectionCode:arrive.changeSectionCode - }); - }); - } + // const activeDepartRunPlanList = Object.values(activeDepartRunPlan).filter(activeDepart=>{ return activeDepart.changeSectionCode && activeDepart.changeSectionCode != activeDepart.sectionCode; }); + // if (activeDepartRunPlanList.length > 0) { + // activeDepartRunPlanList.forEach(depart=>{ + // this.addModel.planParamList.push({ + // runPlanCode:depart.code, + // departSectionCode:depart.changeSectionCode + // }); + // }); + // } + // const activeArriveRunPlanList = Object.values(activeArriveRunPlan).filter(activeArrive=>{ return activeArrive.changeSectionCode && activeArrive.changeSectionCode != activeArrive.sectionCode; }); + // if (activeArriveRunPlanList.length > 0) { + // activeArriveRunPlanList.forEach(arrive=>{ + // this.addModel.planParamList.push({ + // runPlanCode:arrive.code, + // arriveSectionCode:arrive.changeSectionCode + // }); + // }); + // } this.dialogShow = true; this.$nextTick(function () { this.$store.dispatch('training/emitTipFresh'); @@ -200,21 +200,21 @@ export default { this.$store.dispatch('training/emitTipFresh'); }, commit() { - if (this.addModel.planParamList.length > 0) { - const params = this.addModel; - this.loading = true; - commitOperate(menuOperate.CTC.batchModifyTrackSection, params, 3).then(({valid})=>{ - this.loading = false; - if (valid) { - this.$emit('closeFlash'); - this.doClose(); - } - }).catch(() => { - this.loading = false; + // if (this.addModel.planParamList.length > 0) { + const params = this.addModel; + this.loading = true; + commitOperate(menuOperate.CTC.stationSendRunplan, params, 3).then(({valid})=>{ + this.loading = false; + if (valid) { + // this.$emit('closeFlash'); this.doClose(); - this.$emit('noticeInfo'); - }); - } + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$emit('noticeInfo'); + }); + // } // * @param stationCode 车站编码 // * @param runPlanCode 运行编码 diff --git a/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue b/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue index 6a55e1b49..89b7b22ee 100644 --- a/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue +++ b/src/jmapNew/theme/datie_02/menus/dialog/stageRunplan.vue @@ -53,9 +53,12 @@ width="100" > diff --git a/src/jmapNew/theme/datie_02/menus/dialog/trainRunplan.vue b/src/jmapNew/theme/datie_02/menus/dialog/trainRunplan.vue new file mode 100644 index 000000000..a3aeb7ee7 --- /dev/null +++ b/src/jmapNew/theme/datie_02/menus/dialog/trainRunplan.vue @@ -0,0 +1,446 @@ + + + diff --git a/src/jmapNew/theme/datie_02/menus/index.vue b/src/jmapNew/theme/datie_02/menus/index.vue index 645d03ed7..7cdf1aa18 100644 --- a/src/jmapNew/theme/datie_02/menus/index.vue +++ b/src/jmapNew/theme/datie_02/menus/index.vue @@ -4,8 +4,8 @@
- - + + @@ -140,6 +140,7 @@ export default { data() { return { currentRailwaySimulationRunplan:{}, + showCentralizedStationCode: '', alarmMessages: [ { id: 1, message: '这是告警信息一' }, { id: 2, message: '这是告警信息二' }, @@ -244,6 +245,7 @@ export default { }, beforeDestroy() { window.onclick = function (e) {}; + this.$store.dispatch('map/setPictureDeviceMap', {}); }, methods: { changeSignedStatus(info) { @@ -260,6 +262,41 @@ export default { this.$refs.cmdManage.doShow(); } }, + zhanjiantouming() { + this.$store.dispatch('map/setPictureDeviceMap', {}); + this.showCentralizedStationCode = this.$store.state.map.showCentralizedStationCode || this.showCentralizedStationCode; + const mapDevice = this.$store.state.map.mapDevice; + const list = []; + for (const key in mapDevice) { + list.push(mapDevice[key]); + } + if (this.$store.state.map.map && this.$store.state.map.map.pictureList) { + const picture = this.$store.state.map.map.pictureList.find(picture => picture.stationCode === this.showCentralizedStationCode && picture.type === 'lucency'); + if (picture) { + this.$jlmap.updateShowStation(list, ''); + this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap); + const deviceList = []; + const mapDevice = this.$store.state.map.mapDevice; + for (const deviceCode in mapDevice) { + deviceList.push(deviceCode); + } + this.$jlmap.updatePicture(deviceList); + this.$jlmap.updateTransform(picture.scaling, picture.origin); + } + } + }, + danzhanxianshi() { + this.$store.dispatch('map/setPictureDeviceMap', {}); + const mapDevice = this.$store.state.map.mapDevice; + const map = this.$store.state.map.map; + const list = []; + for (const key in mapDevice) { + list.push(mapDevice[key]); + } + this.$jlmap.updateShowStation(list, this.$store.state.map.showCentralizedStationCode || this.showCentralizedStationCode); + this.$jlmap.setCenter(this.$store.state.map.showCentralizedStationCode || this.showCentralizedStationCode); + this.$jlmap.updateTransform(map.scaling, map.origin); + }, getRailwaySimulationRunplanSend() { const stationCode = this.$store.state.training.roleDeviceCode; const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap; diff --git a/src/jmapNew/theme/datie_02/menus/runplanPane.vue b/src/jmapNew/theme/datie_02/menus/runplanPane.vue index 036da1041..508aa574b 100644 --- a/src/jmapNew/theme/datie_02/menus/runplanPane.vue +++ b/src/jmapNew/theme/datie_02/menus/runplanPane.vue @@ -8,6 +8,9 @@
+
+ +
@@ -49,7 +52,7 @@
阶段记事
-
2020年11月15日22:23:21
+
{{ dateString1 + ' ' + time }}
与中心通信正常
与车站服务器通信正常
@@ -64,9 +67,9 @@
出发(F4)
通过(F11)
邻站(F6)
-
取消接车(Esc)
-
取消闭塞(F6)
-
取消发车(F7)
+
取消接车(Esc)
+
取消闭塞(F6)
+
取消发车(F7)
@@ -77,6 +80,7 @@ border height="695" highlight-current-row + :row-class-name="judgeColor" style="width: 100%;border:1px #ccc solid" @cell-click="selectedTripNumber" @current-change="handleCurrentChange" @@ -88,7 +92,9 @@ width="100" > @@ -98,12 +104,18 @@


 
1
+
+ @@ -112,7 +124,7 @@
3
@@ -127,9 +139,9 @@ placeholder="" size="mini" popper-class="stationSelect" - @focus="focusArriveRunPlan($event,scope.row)" @change="changeArriveRunPlan($event,scope.row,scope.$index)" > + 7
@@ -177,6 +189,11 @@

8
+
@@ -271,12 +288,18 @@


 
19
+ + @@ -291,7 +314,6 @@ placeholder="" size="mini" popper-class="stationSelect" - @focus="focusDepartRunPlan($event,scope.row)" @change="changeDepartRunPlan($event,scope.row,scope.$index)" > 22 @@ -342,7 +364,7 @@
25
@@ -350,6 +372,11 @@

26
+
@@ -396,11 +423,14 @@
31
- + + + + + +
上报到达点
上报出发点
上报通过点
-
为始发车
-
为终到车
+
+ + 为始发车 +
+
+ + 为终到车 +
上报速报信息
修改车次号
修改相关邻站
-
删除
+ +
-
清楚闪烁
+
清除闪烁
全体信息
+
+
修改列车
+
设置取消重点列车
+
设置删除标识
+
+ + 允许股道与基本路径不一致 +
+
+ + 允许出入口与基本路径不一致 +
@@ -483,11 +555,13 @@
- + + + @@ -504,12 +578,16 @@ import Rpsa from '@/assets/ctc_icon/rpsa.png'; import Rpb from '@/assets/ctc_icon/rpb.png'; import Rpwp from '@/assets/ctc_icon/rpwp.png'; import Rph from '@/assets/ctc_icon/rph.png'; +import RpAdd from '@/assets/ctc_icon/rpadd.png'; +import { timeFormat } from '@/utils/date'; +import { prefixIntrger } from '@/utils/date'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import SendRunplan from './dialog/sendRunplan'; import StageRunplan from './dialog/stageRunplan'; import DeleteRunplan from './dialog/deleteRunplan'; import ModifyAdjacentStation from './dialog/modifyAdjacentStation'; import ModifyTripNumber from './dialog/modifyTripNumber'; +import TrainRunplan from './dialog/trainRunplan'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import { copyAssign } from '@/utils/index'; import { mapGetters } from 'vuex'; @@ -521,10 +599,14 @@ export default { DeleteRunplan, ModifyAdjacentStation, ModifyTripNumber, + TrainRunplan, NoticeInfo }, data() { return { + time: '00:00:00', + dateString: '', + dateString1: '', isShow:false, rpMenuPopShow:false, rpMenuPopTop:0, @@ -540,31 +622,94 @@ export default { Rpb:Rpb, Rpwp:Rpwp, Rph:Rph, + RpAdd:RpAdd, tableData:[], filterSectionList:[], - activeDepartRunPlan:{}, - activeArriveRunPlan:{}, + startRunplan:false, + endRunplan:false, + trackDiscordant:false, + entryOutDiscordant:false, + // activeDepartRunPlan:{}, + // activeArriveRunPlan:{}, currentRailwaySimulationRunplan:{}, // radioSelected:'' - currentRow:null + currentRow:null, + transfiniteList:[ + {label:'不超限', value:'NO'}, + {label:'一级超限', value:'TRANSFINITE_ONE_LEVEL'}, + {label:'二级超限', value:'TRANSFINITE_TWO_LEVEL'}, + {label:'超级超限', value:'TRANSFINITE_SUPER'} + ] }; }, computed: { ...mapGetters('map', [ 'sectionList' - ]) + ]), + mapStationDirectionData() { + return this.$store.state.map.mapStationDirectionData; + } }, watch:{ + '$store.state.socket.simulationTimeSync': function (time) { // 仿真时间更新 + this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`)); + const date = new Date(+new Date(`${new Date().toLocaleDateString()} ${timeFormat(time)}`)); + this.initDate(date); + }, '$store.state.socket.railCtcRunplanChange': function (val) { this.loadData(); }, '$store.state.socket.railwaySimulationRunplanSendChange': function (val) { this.getRailwaySimulationRunplanSend(); + }, + '$store.state.socket.changedCtcRunplanMap': function (val) { + this.judgeStationCtcRunplan(); + }, + // 仿真-仿真重置消息 + '$store.state.socket.simulationReset': function (val) { + this.$store.dispatch('socket/resetRailCtcRunplanInitMsg'); + this.loadData(); } - // railwaySimulationRunplanSendMap - // railwaySimulationRunplanSendChange }, methods:{ + initDate(date) { + this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}:${prefixIntrger(date.getSeconds(), 2)}`; + const years = date.getFullYear() + ''; + let months = date.getMonth() + 1 + ''; + let dates = date.getDate() + ''; + if (months.length < 2) { months = '0' + months; } + if (dates.length < 2) { dates = '0' + dates; } + this.dateString = years + months + dates; + this.dateString1 = years + '年' + months + '月' + dates + '日'; + }, + judgeColor({row, rowIndex}) { + if (row.effect) { + if (row.passenger == 'PASSENGER') { + return 'fontRed'; + } else if (row.passenger == 'GOODS_TRAIN') { + return 'fontBlue'; + } else { + return 'fontBlack'; + } + } else { + if (row.passenger == 'PASSENGER') { + return 'fontPink'; + } else if (row.passenger == 'GOODS_TRAIN') { + return 'fontLightBlue'; + } else { + return 'fontBlack'; + } + } + }, + judgeStationCtcRunplan() { + const changedCtcRunplanMap = this.$store.state.socket.changedCtcRunplanMap; + const stationCode = this.$store.state.training.roleDeviceCode; + if (changedCtcRunplanMap[stationCode]) { + document.getElementById('sendRunplan').classList.add('active'); + } else { + this.closeFlash(); + } + }, getRailwaySimulationRunplanSend() { const stationCode = this.$store.state.training.roleDeviceCode; const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap; @@ -573,8 +718,8 @@ export default { document.getElementById('stageRunplan').classList.add('active'); this.currentRailwaySimulationRunplan = railwaySimulationRunplanSendMap; } else { - const sendRunplan = document.getElementById('stageRunplan').className; - document.getElementById('stageRunplan').className = sendRunplan.replace('active', ''); + const stageRunplan = document.getElementById('stageRunplan').className; + document.getElementById('stageRunplan').className = stageRunplan.replace('active', ''); } }, loadData() { @@ -594,8 +739,12 @@ export default { return data.stationCode == this.$store.state.training.roleDeviceCode; }); this.tableData.sort((prev, next)=>{ - const prevPlanTime = prev.departRunPlan ? prev.departRunPlan.planTime : prev.arriveRunPlan ? prev.arriveRunPlan.planTime : '00:00:00'; - const nextPlanTime = next.departRunPlan ? next.departRunPlan.planTime : next.arriveRunPlan ? next.arriveRunPlan.planTime : '00:00:00'; + const prevPlanTime = prev.departRunPlan ? (prev.departRunPlan.actualTime || prev.departRunPlan.planTime) + : prev.arriveRunPlan ? (prev.arriveRunPlan.actualTime || prev.arriveRunPlan.planTime) : '00:00:00'; + const nextPlanTime = next.departRunPlan ? (next.departRunPlan.actualTime || next.departRunPlan.planTime) + : next.arriveRunPlan ? (next.arriveRunPlan.actualTime || next.arriveRunPlan.planTime) : '00:00:00'; + // console.log(prevPlanTime, nextPlanTime, '66666666'); + // const nextPlanTime = next.departRunPlan ? next.departRunPlan.planTime : next.arriveRunPlan ? next.arriveRunPlan.planTime : '00:00:00'; return new Date('2000-06-18 ' + prevPlanTime).getTime() - new Date('2000-06-18 ' + nextPlanTime).getTime(); }); }, @@ -611,6 +760,7 @@ export default { this.loadData(); this.isShow = true; this.getRailwaySimulationRunplanSend(); + this.judgeStationCtcRunplan(); window.addEventListener('keydown', this.handleKeyDown); // arriveRunPlan: Object // code: "00110010" @@ -649,12 +799,16 @@ export default { this.stageRunplan(); break; } + // Esc + // F6 + // F7 } } }, sendRunplan() { if (document.getElementById('sendRunplan').className.includes('active')) { - this.$refs.sendRunplan.doShow(this.tableData, this.activeDepartRunPlan, this.activeArriveRunPlan, this.filterSectionList); + this.$refs.sendRunplan.doShow(this.tableData, this.filterSectionList); + // this.activeDepartRunPlan, this.activeArriveRunPlan, } }, stageRunplan() { @@ -663,28 +817,73 @@ export default { this.$refs.stageRunplan.doShow(this.currentRailwaySimulationRunplan[stationCode]); } }, - focusDepartRunPlan(event, row) { - this.activeDepartRunPlan[row.code] = {sectionCode:event, code:row.code}; + // 设置超限 + changeTransfinite(event, row, index) { + const params = { + stationCode:row.stationCode, + runPlanCode:row.code, + transfinite:row.transfinite + }; + commitOperate(menuOperate.CTC.setTransfinite, params, 3).then(({valid})=>{ + this.loading = false; + if (valid) { + } + }).catch(() => { + this.loading = false; + }); }, - // 发车股道 + // 修改发车股道 changeDepartRunPlan(event, row, index) { - const activeDepart = this.activeDepartRunPlan[row.code]; - if (activeDepart) { - activeDepart.changeSectionCode = event; - document.getElementById('sendRunplan').classList.add('active'); - } + const params = { + stationCode:row.stationCode, + runPlanCode:row.code, + arriveSection:'', + departSection:row.departRunPlan.sectionCode, + force:1 + }; + commitOperate(menuOperate.CTC.modifyTrackSection, params, 3).then(({valid})=>{ + this.loading = false; + if (valid) { + } + }).catch(() => { + this.loading = false; + }); + // const activeDepart = this.activeDepartRunPlan[row.code]; + // if (activeDepart) { + // activeDepart.changeSectionCode = event; + // document.getElementById('sendRunplan').classList.add('active'); + // } // console.log(event, this.tableData[index].departRunPlan.sectionCode, row.departRunPlan.sectionCode, '------'); }, - focusArriveRunPlan(event, row) { - this.activeArriveRunPlan[row.code] = {sectionCode:event, code:row.code}; - }, + // 修改接车股道 changeArriveRunPlan(event, row, index) { - const activeArrive = this.activeArriveRunPlan[row.code]; - if (activeArrive) { - activeArrive.changeSectionCode = event; - // if(activeArrive.changeSectionCode!=) - document.getElementById('sendRunplan').classList.add('active'); - } + const params = { + stationCode:row.stationCode, + runPlanCode:row.code, + arriveSection:row.arriveRunPlan.sectionCode, + departSection:'', + force:1 + }; + // stationCode 车站编码 + // runPlanCode 运行计划 + // arriveSection 到达股道 + // departSection 出发股道 + // force 是否强制 + // element.arriveRunPlan.sectionCode + // element.departRunPlan.sectionCode + commitOperate(menuOperate.CTC.modifyTrackSection, params, 3).then(({valid})=>{ + this.loading = false; + if (valid) { + } + }).catch(() => { + this.loading = false; + }); + // const activeArrive = this.activeArriveRunPlan[row.code]; + // if (activeArrive) { + // activeArrive.changeSectionCode = event; + // // if(activeArrive.changeSectionCode!=) + // document.getElementById('sendRunplan').classList.add('active'); + // } // CTC_MODIFY_TRACK_SECTION // 参数: // * @param stationCode 车站编码 @@ -704,24 +903,28 @@ export default { // force 是否强制 0:不强制。1:强制 }, closeDialog() { - this.closeFlash(); + // this.closeFlash(); this.doClose(); - this.activeDepartRunPlan = {}; - this.activeArriveRunPlan = {}; + // this.activeDepartRunPlan = {}; + // this.activeArriveRunPlan = {}; }, closeFlash() { const sendRunplan = document.getElementById('sendRunplan').className; document.getElementById('sendRunplan').className = sendRunplan.replace('active', ''); }, closeStageFlash() { - const sendRunplan = document.getElementById('stageRunplan').className; - document.getElementById('stageRunplan').className = sendRunplan.replace('active', ''); + const stageRunplan = document.getElementById('stageRunplan').className; + document.getElementById('stageRunplan').className = stageRunplan.replace('active', ''); const stationCode = this.$store.state.training.roleDeviceCode; this.$store.dispatch('socket/deleteRailwaySimulationRunplan', stationCode); }, selectedTripNumber(row, column, cell, event) { if (column.property == 'tripNumber') { if (this.currentRow && this.currentRow.code == row.code) { + this.startRunplan = row.startRunPlan; + this.endRunplan = row.endRunPlan; + this.trackDiscordant = row.trackDiscordant; + this.entryOutDiscordant = row.entryOutDiscordant; this.rpMenuPopShow = true; const offsetTop = cell.offsetTop - document.querySelector('#runplanContentTable .el-table__body-wrapper').scrollTop; this.rpMenuPopTop = offsetTop - 202 > 0 ? offsetTop - 380 > 0 ? offsetTop - 202 + 100 : offsetTop - 202 + 190 : offsetTop + 180; @@ -733,6 +936,10 @@ export default { } else { this.currentRow = null; // this.rpMenuPopShow = false; + this.startRunplan = false; + this.endRunplan = false; + this.trackDiscordant = false; + this.entryOutDiscordant = false; this.$refs.runplanContentTable.setCurrentRow(); } }, @@ -745,6 +952,10 @@ export default { closeRpMenu() { this.clearRpRow(); this.rpMenuPopShow = false; + this.startRunplan = false; + this.endRunplan = false; + this.trackDiscordant = false; + this.entryOutDiscordant = false; }, // 修改车次号 modifyTripNumber(event) { @@ -764,12 +975,144 @@ export default { this.rpMenuPopShow = false; this.$refs.deleteRunplan.doShow(this.currentRow); }, + // 清除闪烁 + clearFlash() { + if (this.currentRow && this.currentRow.twinkle) { + event.stopPropagation(); + this.rpMenuPopShow = false; + commitOperate(menuOperate.CTC.stationCancleTwinkle, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 修改列车计划 + modifyTrainRunplan() { + if (this.currentRow) { + event.stopPropagation(); + this.rpMenuPopShow = false; + const params = copyAssign({}, this.currentRow); + this.$refs.trainRunplan.doShow(params, this.filterSectionList); + } + }, + // 添加列车计划 + addTrainRunplan() { + const stationCode = this.$store.state.training.roleDeviceCode; + this.$refs.trainRunplan.doShow({stationCode:stationCode}, this.filterSectionList); + }, + // 设置重点列车 + setKeyTrains() { + if (this.currentRow) { + event.stopPropagation(); + this.rpMenuPopShow = false; + const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}; + params.status = this.currentRow.keyTrains ? 0 : 1; + commitOperate(menuOperate.CTC.setKeyTrains, params, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 设置允许出入口与基本路径不一致 + setEntryOutDiscordant() { + if (this.currentRow) { + event.stopPropagation(); + this.rpMenuPopShow = false; + const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}; + params.status = this.currentRow.entryOutDiscordant ? 0 : 1; + commitOperate(menuOperate.CTC.setEntryOutDiscordant, params, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 设置允许股道与基本路径不一致 + setTrackDiscordant() { + if (this.currentRow) { + event.stopPropagation(); + this.rpMenuPopShow = false; + const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}; + params.status = this.currentRow.trackDiscordant ? 0 : 1; + commitOperate(menuOperate.CTC.setTrackDiscordant, params, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 设置始发 + setStartRunplan() { + if (this.currentRow) { + event.stopPropagation(); + this.rpMenuPopShow = false; + const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}; + params.status = this.currentRow.startRunPlan ? 0 : 1; + commitOperate(menuOperate.CTC.setStartRunplan, params, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 设置终到 + setEndRunplan() { + if (this.currentRow) { + event.stopPropagation(); + this.rpMenuPopShow = false; + const params = {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}; + params.status = this.currentRow.endRunPlan ? 0 : 1; + commitOperate(menuOperate.CTC.setEndRunplan, params, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, // 发送发车预告 sendNotcie() { // && this.currentRow.departRunPlan && this.currentRow.departRunPlan.adjacentMessage == 0 if (this.currentRow && this.currentRow.departRunPlan) { this.loading = true; - commitOperate(menuOperate.CTC.sendNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 2).then(({valid})=>{ + commitOperate(menuOperate.CTC.sendNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{ this.loading = false; this.clearRpRow(); // if (valid) { @@ -784,10 +1127,64 @@ export default { } }, - // 同意发车预告 - agreeNotcie() { - if (this.currentRow && this.currentRow.arriveRunPlan && this.currentRow.arriveRunPlan.adjacentMessage == 1) { - commitOperate(menuOperate.CTC.agreeNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 2).then(({valid})=>{ + // 取消接车 + cancleArrive() { + if (this.currentRow && this.currentRow.arriveRunPlan) { + // 取消到达 + commitOperate(menuOperate.CTC.cancleArrive, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 取消发车 + cancleDepature() { + if (this.currentRow && this.currentRow.departRunPlan) { + commitOperate(menuOperate.CTC.cancleDepature, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 取消闭塞 + cancleBlock() { + if (this.currentRow && + ( + (this.currentRow.departRunPlan && this.currentRow.departRunPlan.adjacentMessage == 1) || + (this.currentRow.arriveRunPlan && this.currentRow.arriveRunPlan.adjacentMessage == 1) + ) + ) { + commitOperate(menuOperate.CTC.cancleBlock, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{ + this.loading = false; + this.clearRpRow(); + if (valid) { + // this.doClose(); + } + }).catch(() => { + this.loading = false; + this.clearRpRow(); + this.noticeInfo(); + }); + } + }, + // 同意发车预告 + agreeNotcie() { + if (this.currentRow && this.currentRow.arriveRunPlan && this.currentRow.arriveRunPlan.adjacentMessage == 1) { + commitOperate(menuOperate.CTC.agreeNotcie, {stationCode:this.currentRow.stationCode, runPlanCode: this.currentRow.code}, 3).then(({valid})=>{ this.loading = false; this.clearRpRow(); if (valid) { @@ -796,12 +1193,13 @@ export default { }).catch(() => { this.loading = false; this.clearRpRow(); - // this.doClose(); this.noticeInfo(); }); } }, + // startRunplan + // endRunplan noticeInfo() { this.$refs.noticeInfo.doShow(); }, @@ -1028,6 +1426,14 @@ export default { -moz-animation:changeColor 1s infinite; /* Firefox */ -webkit-animation:changeColor 1s infinite; /* Safari and Chrome */ } +.flashTrip{ + animation:flashColor 1s infinite; + -moz-animation:flashColor 1s infinite; /* Firefox */ + -webkit-animation:flashColor 1s infinite; /* Safari and Chrome */ +} +.noChange{ + line-height: 28px; +} @keyframes changeColor { 0% {background:#f0f0f0;} @@ -1046,6 +1452,24 @@ export default { 50% {background:#ff1900;} 100% {background:#f0f0f0;} } +@keyframes flashColor +{ + 0% {background:#fff;} + 50% {background:#ff1900;} + 100% {background:#fff;} +} +@-moz-keyframes flashColor /* Firefox */ +{ + 0% {background:#fff;} + 50% {background:#ff1900;} + 100% {background:#fff;} +} +@-webkit-keyframes flashColor /* Safari and Chrome */ +{ + 0% {background:#fff;} + 50% {background:#ff1900;} + 100% {background:#fff;} +} .eachRpImage{display: inline-block;vertical-align: top;margin-top: 3px;} .eachRpImageIn{height:26px;cursor: pointer;} .rpMenuPop{ @@ -1063,7 +1487,9 @@ export default { top:0; } .eachRpMenu{ - padding: 5px 20px;font-size:14px;cursor: pointer; + padding: 5px 30px; + font-size:14px; + cursor: pointer; } .eachRpMenu:hover{ background:#fff; @@ -1122,4 +1548,21 @@ export default { } .passagerTrain{background:#f00;width: 100%;height: 28px;} .goodTrain{background:#00f;width: 100%;height: 28px;} +.fontRed{color:#f00} +.fontBlue{color:#00f} +.fontBlack{color:#000} +.fontPink{color: #FF1493;} +.fontLightBlue{color: #87CEFA;} +.eachRpMenuSelect{ + display: inline-block; + padding: 3px 5px 0px 5px; + border: 1px #94c0fb solid; + border-radius: 3px; + background: rgba(148,192,251,0.3); + color: #0f1aff; + font-size: 12px; + line-height: 12px; + position: absolute; + left: 10px; +} diff --git a/src/jmapNew/theme/datie_jd1a/menus/bottomTable.vue b/src/jmapNew/theme/datie_jd1a/menus/bottomTable.vue new file mode 100644 index 000000000..e5687c866 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/bottomTable.vue @@ -0,0 +1,292 @@ + + + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/addSpareTrain.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/addSpareTrain.vue new file mode 100644 index 000000000..f2964cbb2 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/addSpareTrain.vue @@ -0,0 +1,210 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmControl.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmControl.vue new file mode 100644 index 000000000..d298f8bc1 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmControl.vue @@ -0,0 +1,141 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmControlSpeed.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmControlSpeed.vue new file mode 100644 index 000000000..d49556383 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmControlSpeed.vue @@ -0,0 +1,156 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmTip.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmTip.vue new file mode 100644 index 000000000..6852074ca --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmTip.vue @@ -0,0 +1,74 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmTrain.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmTrain.vue new file mode 100644 index 000000000..494347b75 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/confirmTrain.vue @@ -0,0 +1,173 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/passwordInputBox.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/passwordInputBox.vue new file mode 100644 index 000000000..eec77511b --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/passwordInputBox.vue @@ -0,0 +1,193 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/popupAlarm.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/popupAlarm.vue new file mode 100644 index 000000000..b6b925622 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/childDialog/popupAlarm.vue @@ -0,0 +1,94 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/defectiveShunting.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/defectiveShunting.vue new file mode 100644 index 000000000..2d2491d3f --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/defectiveShunting.vue @@ -0,0 +1,137 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/deleteRunplan.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/deleteRunplan.vue new file mode 100644 index 000000000..0b9134b52 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/deleteRunplan.vue @@ -0,0 +1,99 @@ + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/drawSelect.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/drawSelect.vue new file mode 100644 index 000000000..10fb5b5cd --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/drawSelect.vue @@ -0,0 +1,163 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/mapVisual.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/mapVisual.vue new file mode 100644 index 000000000..f7e172930 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/mapVisual.vue @@ -0,0 +1,245 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/modifyAdjacentStation.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/modifyAdjacentStation.vue new file mode 100644 index 000000000..53bf85a71 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/modifyAdjacentStation.vue @@ -0,0 +1,154 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/modifyTripNumber.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/modifyTripNumber.vue new file mode 100644 index 000000000..dd92fc91d --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/modifyTripNumber.vue @@ -0,0 +1,224 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/recDep.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/recDep.vue new file mode 100644 index 000000000..1d99ffe15 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/recDep.vue @@ -0,0 +1,136 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/routeDetail.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeDetail.vue new file mode 100644 index 000000000..b7211c025 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeDetail.vue @@ -0,0 +1,196 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/routeGuide.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeGuide.vue new file mode 100644 index 000000000..11cba9131 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeGuide.vue @@ -0,0 +1,278 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeHandControl.vue new file mode 100644 index 000000000..69ce0d572 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeHandControl.vue @@ -0,0 +1,267 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/routeSelection.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeSelection.vue new file mode 100644 index 000000000..12014afb3 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeSelection.vue @@ -0,0 +1,325 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/routeSelection1.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeSelection1.vue new file mode 100644 index 000000000..c34eb1e49 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/routeSelection1.vue @@ -0,0 +1,308 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/sectionDetail.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/sectionDetail.vue new file mode 100644 index 000000000..7e6a03371 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/sectionDetail.vue @@ -0,0 +1,114 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/sendRunplan.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/sendRunplan.vue new file mode 100644 index 000000000..26e4fb5dd --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/sendRunplan.vue @@ -0,0 +1,265 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/shuntRoute.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/shuntRoute.vue new file mode 100644 index 000000000..78727e7cc --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/shuntRoute.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/stageRunplan.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/stageRunplan.vue new file mode 100644 index 000000000..6a55e1b49 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/stageRunplan.vue @@ -0,0 +1,191 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/standControl.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/standControl.vue new file mode 100644 index 000000000..c6c29c830 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/standControl.vue @@ -0,0 +1,603 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/standDetail.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/standDetail.vue new file mode 100644 index 000000000..efe048e52 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/standDetail.vue @@ -0,0 +1,217 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainControl.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainControl.vue new file mode 100644 index 000000000..738d9509e --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainControl.vue @@ -0,0 +1,332 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainCreate.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainCreate.vue new file mode 100644 index 000000000..59f7935b6 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainCreate.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainCreateNumber.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainCreateNumber.vue new file mode 100644 index 000000000..e56f2f80d --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainCreateNumber.vue @@ -0,0 +1,181 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDelete.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDelete.vue new file mode 100644 index 000000000..895d6024c --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDelete.vue @@ -0,0 +1,150 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDeleteNumber.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDeleteNumber.vue new file mode 100644 index 000000000..210e2dc87 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDeleteNumber.vue @@ -0,0 +1,176 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDetailInfo.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDetailInfo.vue new file mode 100644 index 000000000..907727139 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainDetailInfo.vue @@ -0,0 +1,378 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainEditNumber.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainEditNumber.vue new file mode 100644 index 000000000..570e22144 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainEditNumber.vue @@ -0,0 +1,174 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainMove.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainMove.vue new file mode 100644 index 000000000..82c84dc13 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainMove.vue @@ -0,0 +1,200 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainMoveNumber.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainMoveNumber.vue new file mode 100644 index 000000000..7e7635d23 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainMoveNumber.vue @@ -0,0 +1,193 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainRoute.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainRoute.vue new file mode 100644 index 000000000..98e3e4b46 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainRoute.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainSetPlan.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainSetPlan.vue new file mode 100644 index 000000000..17421e391 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainSetPlan.vue @@ -0,0 +1,181 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/trainSwitch.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainSwitch.vue new file mode 100644 index 000000000..583e53d8e --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/trainSwitch.vue @@ -0,0 +1,209 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/dialog/updateTrip.vue b/src/jmapNew/theme/datie_jd1a/menus/dialog/updateTrip.vue new file mode 100644 index 000000000..49a60e088 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/dialog/updateTrip.vue @@ -0,0 +1,155 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/index.vue b/src/jmapNew/theme/datie_jd1a/menus/index.vue index 76b4ba9b6..645d03ed7 100644 --- a/src/jmapNew/theme/datie_jd1a/menus/index.vue +++ b/src/jmapNew/theme/datie_jd1a/menus/index.vue @@ -1,19 +1,133 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuBar.vue b/src/jmapNew/theme/datie_jd1a/menus/menuBar.vue new file mode 100644 index 000000000..d16b8bc18 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuBar.vue @@ -0,0 +1,335 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuButton.vue b/src/jmapNew/theme/datie_jd1a/menus/menuButton.vue new file mode 100644 index 000000000..7e52408dc --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuButton.vue @@ -0,0 +1,878 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuButtonCtc.vue b/src/jmapNew/theme/datie_jd1a/menus/menuButtonCtc.vue new file mode 100644 index 000000000..da166116e --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuButtonCtc.vue @@ -0,0 +1,827 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/twoConfirmation.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/twoConfirmation.vue new file mode 100644 index 000000000..c1f7b93a3 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/twoConfirmation.vue @@ -0,0 +1,133 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userAdd.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userAdd.vue new file mode 100644 index 000000000..6c98c5a53 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userAdd.vue @@ -0,0 +1,157 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userDelete.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userDelete.vue new file mode 100644 index 000000000..e64aa49f3 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userDelete.vue @@ -0,0 +1,129 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userEdit.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userEdit.vue new file mode 100644 index 000000000..b03165a1b --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/childDialog/userEdit.vue @@ -0,0 +1,173 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/helpAbout.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/helpAbout.vue new file mode 100644 index 000000000..4dc26a4ce --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/helpAbout.vue @@ -0,0 +1,126 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/limitSpeed.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/limitSpeed.vue new file mode 100644 index 000000000..e416e68e0 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/limitSpeed.vue @@ -0,0 +1,138 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/manageUser.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/manageUser.vue new file mode 100644 index 000000000..deef68f43 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/manageUser.vue @@ -0,0 +1,285 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/passwordBox.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/passwordBox.vue new file mode 100644 index 000000000..69fa03d70 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/passwordBox.vue @@ -0,0 +1,221 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/routeCancel.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/routeCancel.vue new file mode 100644 index 000000000..8a403be7f --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/routeCancel.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/setLimitSpeed.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/setLimitSpeed.vue new file mode 100644 index 000000000..dfb5821b3 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/setLimitSpeed.vue @@ -0,0 +1,286 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/stationControlConvert.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/stationControlConvert.vue new file mode 100644 index 000000000..046b66327 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/stationControlConvert.vue @@ -0,0 +1,433 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainAdd.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainAdd.vue new file mode 100644 index 000000000..fba049a10 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainAdd.vue @@ -0,0 +1,168 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainDelete.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainDelete.vue new file mode 100644 index 000000000..b1139915a --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainDelete.vue @@ -0,0 +1,151 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainTranstalet.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainTranstalet.vue new file mode 100644 index 000000000..97918ae44 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/trainTranstalet.vue @@ -0,0 +1,158 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuDialog/viewName.vue b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/viewName.vue new file mode 100644 index 000000000..4a32473d5 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuDialog/viewName.vue @@ -0,0 +1,256 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuPanel.vue b/src/jmapNew/theme/datie_jd1a/menus/menuPanel.vue new file mode 100644 index 000000000..bf2c9df6b --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuPanel.vue @@ -0,0 +1,302 @@ + + + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuSection.vue b/src/jmapNew/theme/datie_jd1a/menus/menuSection.vue new file mode 100644 index 000000000..d5d3702f8 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuSection.vue @@ -0,0 +1,260 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuSignal.vue b/src/jmapNew/theme/datie_jd1a/menus/menuSignal.vue index 28a3fa9fe..ed63959c9 100644 --- a/src/jmapNew/theme/datie_jd1a/menus/menuSignal.vue +++ b/src/jmapNew/theme/datie_jd1a/menus/menuSignal.vue @@ -1,20 +1,52 @@ + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuStationStand.vue b/src/jmapNew/theme/datie_jd1a/menus/menuStationStand.vue new file mode 100644 index 000000000..8dafb5bef --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuStationStand.vue @@ -0,0 +1,220 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuSwitch.vue b/src/jmapNew/theme/datie_jd1a/menus/menuSwitch.vue index 54b30f0c8..013b098bb 100644 --- a/src/jmapNew/theme/datie_jd1a/menus/menuSwitch.vue +++ b/src/jmapNew/theme/datie_jd1a/menus/menuSwitch.vue @@ -1,26 +1,46 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuTrain.vue b/src/jmapNew/theme/datie_jd1a/menus/menuTrain.vue new file mode 100644 index 000000000..1df99fa4e --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/menuTrain.vue @@ -0,0 +1,614 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/passiveDialog/alarm.vue b/src/jmapNew/theme/datie_jd1a/menus/passiveDialog/alarm.vue new file mode 100644 index 000000000..afbff9ddc --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/passiveDialog/alarm.vue @@ -0,0 +1,216 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/passiveDialog/timeout.vue b/src/jmapNew/theme/datie_jd1a/menus/passiveDialog/timeout.vue new file mode 100644 index 000000000..e4ef062a6 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/passiveDialog/timeout.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/jmapNew/theme/datie_jd1a/menus/runplanPane.vue b/src/jmapNew/theme/datie_jd1a/menus/runplanPane.vue new file mode 100644 index 000000000..036da1041 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/menus/runplanPane.vue @@ -0,0 +1,1125 @@ + + + + diff --git a/src/jmapNew/theme/datie_jd1a/planConfig.js b/src/jmapNew/theme/datie_jd1a/planConfig.js new file mode 100644 index 000000000..0cb8b8311 --- /dev/null +++ b/src/jmapNew/theme/datie_jd1a/planConfig.js @@ -0,0 +1,74 @@ +import { convertSheetToList } from '../parser/util'; + +export default { + /** 运行图解析方式*/ + type: 'Ratio', + + /** 边缘高度*/ + edge: 600, + + /** 间隔高度*/ + multiple: 1, + + /** 偏移时间*/ + translation: 60 * 60 * 2, + + /** excel解析配置*/ + excelConfig: { + beginRow: 1, + beginCol: 0, + fieldNum: 8, + sepField: '车次', + columns: { + '车站名称': { key: 'stationName', formatter: (val) => { return val; } }, + '到点': { key: 'arriveTime', formatter: (val) => { return val; } }, + '发点': { key: 'departureTime', formatter: (val) => { return val; } } + } + }, + + /** 解析excel数据转换为Json后台数据*/ + importData(Sheet, JsonData) { + var dataList = convertSheetToList(Sheet, false); + var needList = Object.keys(this.excelConfig.columns); + if (dataList && dataList.length) { + for (var rowIndex = this.excelConfig.beginRow; rowIndex < dataList.length; rowIndex += 1) { + for (var colIndex = this.excelConfig.beginCol; colIndex < dataList[this.excelConfig.beginCol].length; colIndex += this.excelConfig.fieldNum + 1) { + var tripNew, tripObj; + var stationObj = {}; + + tripNew = tripObj = { code: '', arrivalList: [] }; + for (var index = 0; index < this.excelConfig.fieldNum; index += 1) { + var title = dataList[0][colIndex + index]; + var value = dataList[rowIndex][colIndex + index]; + + if (title && value) { + var titleStr = `${title}`.trim(); + var valueStr = `${value}`.trim(); + + if (titleStr.includes(this.excelConfig.sepField)) { + tripObj.code = valueStr; + JsonData.forEach(elem => { + if (elem.code == valueStr) { + tripObj = elem; + return; + } + }); + } + + // 取需要的字段 + if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) { + stationObj[this.excelConfig.columns[titleStr].key] = this.excelConfig.columns[titleStr].formatter(valueStr); + } + } + } + + tripObj.arrivalList.push(stationObj); + if (tripObj.code && tripObj == tripNew) { + JsonData.push(tripObj); + } + } + } + } + return JsonData; + } +}; diff --git a/src/jmapNew/transformHandleScreen.js b/src/jmapNew/transformHandleScreen.js index 7de040eda..2f1fab3c1 100644 --- a/src/jmapNew/transformHandleScreen.js +++ b/src/jmapNew/transformHandleScreen.js @@ -8,7 +8,7 @@ class TransformHandle { this.scale = ''; this.scaleIndex = 0; this.scaleList = [ - 0.2, 0.4, 0.6, 0.8, 0.9, + 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, diff --git a/src/router/index.js b/src/router/index.js index 150820229..6762baaca 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -245,6 +245,7 @@ export const projectSrsandbox = '024'; // 上饶沙盘 export const projectJxgm = '025'; // 江西工贸 export const projectSay = '026'; // 江苏安全 export const projectRichorhhcj = '027'; // 红河财经 +export const projectTeaching = '028'; // 教学通用 export const userTrainingPlatform = '016'; // 实训系统 // export const refereePlatform = '017'; // 裁判系统 @@ -1264,7 +1265,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'router.fileManage', - roles: [admin, user] + roles: [admin] }, children: [ { diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index 075ac8ed4..0a5354289 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -672,6 +672,22 @@ export const loginInfo = { navigationLogoWidth: '60px', navigationMarginLeft: '80px', systemType: '011' + }, + teaching: { + title: '教学通用实训平台', + loginPath: '/login?project=teaching', + loginParam: 'TEACHING', + navigationLogoWidth: '40px', + navigationMarginLeft: '60px', + systemType: '028' + }, + designteaching: { + title: '教学通用设计平台', + loginPath: '/design/login?project=teaching', + loginParam: 'TEACHING', + navigationLogoWidth: '40px', + navigationMarginLeft: '60px', + systemType: '028' } }; @@ -735,7 +751,9 @@ export const ProjectIcon = { say: FaviconSay, designsay: FaviconSay, unittecsty: FaviconUnittec, - designunittecsty: FaviconUnittec + designunittecsty: FaviconUnittec, + teaching: Favicon, + designteaching: Favicon }; export const ProjectCode = { @@ -788,7 +806,9 @@ export const ProjectCode = { designsay: 'SAY', xzexam:'SAY', unittecsty: 'UNITTEC_STY', - designunittecsty: 'UNITTEC_STY' + designunittecsty: 'UNITTEC_STY', + teaching: 'TEACHING', + designteaching: 'TEACHING' }; /** 嵌入第三方平台 导航栏右上角 清空 */ export const ThirdLoginList = ['richor', 'designrichor', 'richorygy', 'designrichorygy']; @@ -800,7 +820,7 @@ export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy', 'zzww', 'zzwwtest', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint', 'nologo', 'designnologo', 'srsandbox', 'designsrsandbox', 'designhlsdrts', 'hlsdrts', 'jxgm', 'designjxgm', - 'richorygy', 'designrichorygy', 'say', 'designsay', 'unittecsty', 'designunittecsty', 'richorhhcj', 'designrichorhhcj']; + 'richorygy', 'designrichorygy', 'say', 'designsay', 'unittecsty', 'designunittecsty', 'richorhhcj', 'designrichorhhcj', 'teaching', 'designteaching']; /** 案例展示隐藏的项目 */ export const CaseHideProjectList = ['heb', 'designheb', 'cgy', 'designcgy']; /** 登录页右下角版本开发基于不展示 */ @@ -875,7 +895,9 @@ export const goOtherPlatformMenu = { unittecsty: '/design/login?project=unittecsty', designunittecsty: '/login?project=unittecsty', richorhhcj: '/design/login?project=richorhhcj', - designrichorhhcj: '/login?project=richorhhcj' + designrichorhhcj: '/login?project=richorhhcj', + teaching: '/design/login?project=teaching', + designteaching: '/login?project=teaching' }; export const ProjectList = [ {value:'xty', label:'西铁院'}, @@ -902,7 +924,8 @@ export const ProjectList = [ {value: 'richor_ygy', label: '扬州工业'}, {value: 'say', label: '苏安院'}, {value: 'unittec_sty', label: '众合-陕铁院'}, - {value: 'richor_hhcj', label: '红河财经'} + {value: 'richor_hhcj', label: '红河财经'}, + {value: 'teaching', label: '教学通用'} ]; /** 本地项目打包 */ export const localPackageProject = { diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index f88a38649..8c9dc7a8c 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -395,12 +395,29 @@ export default { CTC_ASSIST_PRESS_BLOCK:{value: 'ASSIST_PRESS_BLOCK', label: '阻塞'}, CTC_ASSIST_PRESS_RESTORE:{value: 'ASSIST_PRESS_RESTORE', label: '复原'}, CTC_ASSIST_PRESS_ACCIDENT:{value: 'ASSIST_PRESS_ACCIDENT', label: '事故'}, - CTC_BATCH_MODIFY_RUN_PLAN:{value: 'CTC_BATCH_MODIFY_RUN_PLAN', label: '批量修改股道'}, - CTC_REMOVE_RUN_PLAN:{value: 'CTC_REMOVE_RUN_PLAN', label: '移除行车日志'}, + + // CTC_BATCH_MODIFY_RUN_PLAN:{value: 'CTC_BATCH_MODIFY_RUN_PLAN', label: '批量修改股道'}, + CTC_MODIFY_SECTION:{value: 'CTC_MODIFY_SECTION', label: '修改股道'}, + CTC_STATION_SEND_OUT_RUN_PLAN:{value: 'CTC_STATION_SEND_OUT_RUN_PLAN', label: '车站发送计划'}, + CTC_CANCEL_TWINKLE:{value: 'CTC_CANCEL_TWINKLE', label: '车站取消红闪'}, + + // CTC_REMOVE_RUN_PLAN:{value: 'CTC_REMOVE_RUN_PLAN', label: '移除行车日志'}, CTC_MODIFY_ADJACENT_STATION:{value: 'CTC_MODIFY_ADJACENT_STATION', label: '修改邻站信息'}, CTC_MODIFY_TRIP_NUMBER:{value: 'CTC_MODIFY_TRIP_NUMBER', label: '修改车次号(大铁CTC)'}, CTC_SEND_NOTICE:{value: 'CTC_SEND_NOTICE', label: '发送发车预告'}, CTC_AGREE_NOTICE:{value: 'CTC_AGREE_NOTICE', label: '同意发车预告'}, + CTC_LOG_CANCEL_ARRIVE:{value: 'CTC_LOG_CANCEL_ARRIVE', label: '取消到达'}, + CTC_LOG_CANCEL_DEPARTURE:{value: 'CTC_LOG_CANCEL_DEPARTURE', label: '取消出发'}, + CTC_LOG_CANCEL_BLOCK:{value: 'CTC_LOG_CANCEL_BLOCK', label: '取消闭塞'}, + CTC_LOG_SET_KEY_TRAINS:{value: 'CTC_LOG_SET_KEY_TRAINS', label: '设置重点列车'}, + CTC_LOG_SET_ENTRY_OUT_DISCORDANT:{value: 'CTC_LOG_SET_ENTRY_OUT_DISCORDANT', label: '设置允许出入口与基本路径不一致'}, + CTC_LOG_SET_TRACK_DISCORDANT:{value: 'CTC_LOG_SET_TRACK_DISCORDANT', label: '设置允许股道与基本路径不一致'}, + CTC_LOG_SET_START_RUN_PLAN:{value: 'CTC_LOG_SET_START_RUN_PLAN', label: '设置始发'}, + CTC_LOG_SET_END_RUN_PLAN:{value: 'CTC_LOG_SET_END_RUN_PLAN', label: '设置终到'}, + CTC_LOG_SET_DELETE_LABEL:{value: 'CTC_LOG_SET_DELETE_LABEL', label: '设置删除标识'}, + CTC_LOG_SET_TRANSFINITE:{value: 'CTC_LOG_SET_TRANSFINITE', label: '设置超限'}, + CTC_LOG_SAVE_RUN_PLAN:{value: 'CTC_LOG_SAVE_RUN_PLAN', label: '保存运行计划'}, + CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA:{value: 'CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA', label: '增加列车固定径路'}, CTC_COVER_RUN_PLAN_LIST_TO_EDIT_AREA:{value: 'CTC_COVER_RUN_PLAN_LIST_TO_EDIT_AREA', label: '导入列车固定径路'}, CTC_REMOVE_RUN_PLAN_FROM_EDIT_AREA:{value: 'CTC_REMOVE_RUN_PLAN_FROM_EDIT_AREA', label: '删除列车固定径路'}, @@ -415,14 +432,16 @@ export default { CTC_ZONE_SAVE_TRACK_SECTION:{value:'CTC_ZONE_SAVE_TRACK_SECTION', label: '调度台行车计划修改股道'}, CTC_ZONE_SAVE_TRIP_NUMBER:{value:'CTC_ZONE_SAVE_TRIP_NUMBER', label: '调度台行车计划修改车次'}, - CTC_ZONE_SAVE_PLAN_TIME:{value:'CTC_ZONE_SAVE_PLAN_TIME', label: '调度台行车计划修改到达计划时间'}, - CTC_ZONE_SAVE_DIRECTION:{value:'CTC_ZONE_SAVE_DIRECTION', label: '调度台行车计划修改到出入口'}, + CTC_ZONE_SAVE_PLAN_TIME:{value:'CTC_ZONE_SAVE_PLAN_TIME', label: '调度台行车计划修改时间'}, + CTC_ZONE_SAVE_DIRECTION:{value:'CTC_ZONE_SAVE_DIRECTION', label: '调度台行车计划修改出入口'}, CTC_ZONE_SAVE_STATION:{value:'CTC_ZONE_SAVE_STATION', label: '调度台行车计划修改到发车站'} + }, RAIL: { CMD_RAIL_FILL_IN_TICKET: {value: 'RAIL_FILL_IN_TICKET', label: '填写票据'}, CMD_RAIL_QUERY_TICKET: {value: 'RAIL_QUERY_TICKET', label: '查询票据'}, CMD_RAIL_FILL_IN_REGISTER: {value: 'RAIL_FILL_IN_REGISTER', label: '填写行车簿册'}, - CMD_RAIL_QUERY_REGISTER: {value: 'RAIL_QUERY_REGISTER', label: '查询行车簿册'} + CMD_RAIL_QUERY_REGISTER: {value: 'RAIL_QUERY_REGISTER', label: '查询行车簿册'}, + CMD_RAIL_GIVE_TICKET_TO: {value: 'RAIL_GIVE_TICKET_TO', label: '给出票据'} } }; diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index 6a3636d19..b1bf034b1 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -3667,20 +3667,27 @@ export const OperationEvent = { domId: '_Tips-CTC-AssistPressAccident-Menu{TOP}' } }, - // 批量修改股道 - batchModifyTrackSection:{ + // // 批量修改股道 + // batchModifyTrackSection:{ + // menu: { + // operation: '1111', + // domId: '_Tips-CTC-batchModifyTrackSection-Menu{TOP}' + // } + // }, + // 修改股道 + modifyTrackSection:{ menu: { operation: '1111', - domId: '_Tips-CTC-batchModifyTrackSection-Menu{TOP}' - } - }, - // 移除行车日志 - deleteRunplan:{ - menu: { - operation: '1112', - domId: '_Tips-CTC-deleteRunplan-Menu{TOP}' + domId: '_Tips-CTC-modifyTrackSection-Menu{TOP}' } }, + // // 移除行车日志 + // deleteRunplan:{ + // menu: { + // operation: '1112', + // domId: '_Tips-CTC-deleteRunplan-Menu{TOP}' + // } + // }, // 修改行车计划的邻站信息 modifyAdjacentStation:{ menu: { @@ -3820,7 +3827,115 @@ export const OperationEvent = { operation: '1132', domId: '_Tips-CTC-modifyDispatcherLogerRpSection-Menu{TOP}' } + }, + // 车站发送计划 + stationSendRunplan:{ + menu: { + operation: '1133', + domId: '_Tips-CTC-stationSendRunplan-Menu{TOP}' + } + }, + // 车站取消红闪 + stationCancleTwinkle:{ + menu: { + operation: '1134', + domId: '_Tips-CTC-stationCancleTwinkle-Menu{TOP}' + } + }, + // 调度台行车计划修改时间 + modifyDispatcherLogerRpPlanTime:{ + menu: { + operation: '1135', + domId: '_Tips-CTC-modifyDispatcherLogerRpPlanTime-Menu{TOP}' + } + }, + // 调度台行车计划修改出入口 + modifyDispatcherLogerRpDirection:{ + menu: { + operation: '1136', + domId: '_Tips-CTC-modifyDispatcherLogerRpDirection-Menu{TOP}' + } + }, + // 取消到达 + cancleArrive:{ + menu: { + operation: '1137', + domId: '_Tips-CTC-cancleArrive-Menu{TOP}' + } + }, + // 取消出发 + cancleDepature:{ + menu: { + operation: '1138', + domId: '_Tips-CTC-cancleDepature-Menu{TOP}' + } + }, + // 取消闭塞 + cancleBlock:{ + menu: { + operation: '1139', + domId: '_Tips-CTC-cancleBlock-Menu{TOP}' + } + }, + // 设置重点列车 + setKeyTrains:{ + menu: { + operation: '1140', + domId: '_Tips-CTC-setKeyTrains-Menu{TOP}' + } + }, + // 设置允许出入口与基本路径不一致 + setEntryOutDiscordant:{ + menu: { + operation: '1141', + domId: '_Tips-CTC-setEntryOutDiscordant-Menu{TOP}' + } + }, + // 设置允许股道与基本路径不一致 + setTrackDiscordant:{ + menu: { + operation: '1142', + domId: '_Tips-CTC-setTrackDiscordant-Menu{TOP}' + } + }, + // 设置始发 + setStartRunplan:{ + menu: { + operation: '1145', + domId: '_Tips-CTC-setTrackDiscordant-Menu{TOP}' + } + }, + // 设置终到 + setEndRunplan:{ + menu: { + operation: '1146', + domId: '_Tips-CTC-setTrackDiscordant-Menu{TOP}' + } + }, + // 设置删除标识 + setDeleteRunplanLabel:{ + menu: { + operation: '1147', + domId: '_Tips-CTC-setDeleteRunplanLabel-Menu{TOP}' + } + }, + // 设置超限 + setTransfinite:{ + menu: { + operation: '1148', + domId: '_Tips-CTC-setTransfinite-Menu{TOP}' + } + }, + // 行车日志保存运行计划 + logSaveRunplan:{ + menu: { + operation: '1149', + domId: '_Tips-CTC-logSaveRunplan-Menu{TOP}' + } } + // + // CTC_ZONE_SAVE_TRIP_NUMBER + // CTC_ZONE_SAVE_STATION }, RailCommand: { railFillInTicket: { @@ -3846,6 +3961,12 @@ export const OperationEvent = { operation: '1204', domId: '_Tips-Rail-railQueryTicket' } + }, + railGiveTicketTo: { + menu: { + operation: '1205', + domId: '_Tips-Rail-railGiveTicketTo' + } } } }; diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 20b7c5897..7cea94ac6 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -253,7 +253,8 @@ const map = { mapDataParseCount: 0, foldLineMap: {}, // 现地折行线map数据 clearButtonCount: 0, // 清除操作按钮计数器 - stationControlMap: {} // 站控显示的map { 当前车站:显示车站列表 } + stationControlMap: {}, // 站控显示的map { 当前车站:显示车站列表 } + pictureDeviceMap: {} // 画面设备修正map }, getters: { @@ -583,6 +584,9 @@ const map = { getDeviceByCode: state => code => { return state.mapDevice[code]; }, + getPictureDeviceByCode: state => code => { + return state.pictureDeviceMap[code]; + }, getApproachSectionByCode: state => code => { return state.signalApproachSectionData[code]; }, @@ -1077,6 +1081,9 @@ const map = { }, clearStepData: state => { state.stepData = []; + }, + setPictureDeviceMap: (state, pictureDeviceMap) => { + state.pictureDeviceMap = pictureDeviceMap; } }, @@ -1347,6 +1354,9 @@ const map = { }, initSimulationButton: ({ commit }) => { commit('initSimulationButton'); + }, + setPictureDeviceMap: ({ commit }, pictureDeviceMap) => { + commit('setPictureDeviceMap', pictureDeviceMap); } } }; diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 0da5e8161..145ccd55d 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,6 +1,6 @@ import { publicAsyncRoute, asyncRouter, constantRoutes, user, projectTrain, projectXian, projectXty, projectGzzb, projectJsxt, projectRichorJoint, projectJyd, projectRichor, projectTky, projectHeb, superAdmin, admin, userTrainingPlatform, JSXT, projectRoute, projectDrts, projectSdy, - projectSrsandbox, projectJxgm, projectSay, projectRichorhhcj } from '@/router/index'; + projectSrsandbox, projectJxgm, projectSay, projectRichorhhcj, projectTeaching } from '@/router/index'; import { loginInfo } from '@/scripts/ProjectConfig'; import { getSessionStorage } from '@/utils/auth'; @@ -38,10 +38,10 @@ function hasPermission(roles, route, parentsRoles) { function resetAsyncRouter({ systemType }) { let list = publicAsyncRoute; const projectList = [projectTrain, projectXian, projectJyd, projectTky, projectDrts, projectRichor]; - const specialProjects = [projectXty, projectGzzb, projectHeb, projectSdy, projectRichorJoint, projectSrsandbox, projectJxgm, projectSay, projectRichorhhcj]; + const specialProjects = [projectXty, projectGzzb, projectHeb, projectSdy, projectRichorJoint, projectSrsandbox, projectJxgm, projectSay, projectRichorhhcj, projectTeaching]; const specialProjectEnum = {[projectXty]:'designxty', [projectGzzb]:'designgzb', [projectHeb]:'designheb', [projectSdy]:'designsdy', [projectRichorJoint]:'designrichorjoint', [projectSrsandbox]: 'designsrsandbox', [projectJxgm]: 'designjxgm', - [projectSay]: 'designsay', [projectRichorhhcj]: 'designrichorhhcj' }; + [projectSay]: 'designsay', [projectRichorhhcj]: 'designrichorhhcj', [projectTeaching]: 'designteaching' }; if (projectList.includes(systemType)) { list = [...list, ...asyncRouter]; } else if (specialProjects.includes(systemType) ) { diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 125128086..9f5a079d8 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -269,6 +269,14 @@ function handle(state, data) { case 'SIMULATION_RAIL_CTC_DISPATCH_COMMAND': state.dispatchCommandMsg = msg; break; + // 车站发送计划信息 + case 'SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND': + state.changedCtcRunplanMap = msg; + break; + case 'SIMULATION_RAIL_TICKET': + state.ticketInfo = msg; + break; + // // // 大铁项目 调度台 运行图信息 初始化消息 // case 'SIMULATION_RAILWAY_RUN_PLAN_INIT': // state.railwaySimulationRpMsg = {}; @@ -400,6 +408,7 @@ const socket = { overConversition: {}, // 仿真会话结束 exitConversition: {}, // 仿真成员退出会话 conversationInfo: {}, // 仿真会话消息 + ticketInfo: {}, // 路票消息 message: {}, // 仿真聊天 msgQueue: [], // 命令请求列表(旧版控制权转移可能在用,新版不用这个) @@ -445,6 +454,7 @@ const socket = { loggedOutMsg: '', railCtcStatusMsg: {}, // 占线板信息 dispatchCommandMsg: {}, // 调度命令信息 + changedCtcRunplanMap:{}, // 大铁项目 ctc 被修改运行计划的车站信息 railCtcRunplanInitMsg:{}, // 大铁项目 ctc 运行图初始化信息 railCtcRunplanChange:0, // 大铁项目 ctc 运行图信息变化 railCtcStationManageRpMsg:{}, // 大铁项目 ctc 车务管理 端运行图信息 @@ -545,6 +555,9 @@ const socket = { }, clearDispatchCommandMsg: (state, data) => { state.dispatchCommandMsg = {}; + }, + resetRailCtcRunplanInitMsg: (state) => { + state.railCtcRunplanInitMsg = {}; } }, @@ -642,6 +655,9 @@ const socket = { }, deleteRailwaySimulationRunplan:({ commit }, stationCode) => { commit('deleteRailwaySimulationRunplan', stationCode); + }, + resetRailCtcRunplanInitMsg:({ commit }) => { + commit('resetRailCtcRunplanInitMsg'); } } }; diff --git a/src/store/modules/training.js b/src/store/modules/training.js index 52966a432..746f36542 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -450,7 +450,6 @@ const training = { rtn && rtn.valid && commit('next'); } } - console.log(rtn, '*********'); resolve(rtn); }).catch(error => { // console.error(error); diff --git a/src/utils/mapList.js b/src/utils/mapList.js index 7074ae0c8..97b3143e0 100644 --- a/src/utils/mapList.js +++ b/src/utils/mapList.js @@ -6,7 +6,7 @@ import { ProjectCode } from '@/scripts/ProjectConfig'; export async function getMapListByProject() { const project = getSessionStorage('project'); let mapList = []; - if (project.endsWith('xty') || project.endsWith('gzb') || project.endsWith('heb')) { + if (project.endsWith('xty') || project.endsWith('gzb') || project.endsWith('heb') || project.endsWith('teaching')) { mapList = await getMapListByProjectCode(ProjectCode[project]); } else { // mapList = await listPublishMap({ 'drawWay': true }); diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 5bce4dc06..d7b8de9d4 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -57,7 +57,7 @@ export default { pmsList: [] }, lineCode:'', - loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts'] + loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts', 'teaching', 'designteaching'] }; }, computed: { diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index a4ea8231a..c63aa55d2 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -49,7 +49,7 @@ export default { node: { }, localParamName: 'publish_cityCode', - loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts'] + loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts', 'teaching', 'designteaching'] }; }, computed: { diff --git a/src/jmapNew/theme/datie_02/menus/dialog/addDispatcherLogerRunplan.vue b/src/views/dispatcherLoger/addDispatcherLogerRunplan.vue similarity index 84% rename from src/jmapNew/theme/datie_02/menus/dialog/addDispatcherLogerRunplan.vue rename to src/views/dispatcherLoger/addDispatcherLogerRunplan.vue index 976daf1f2..7673d25a6 100644 --- a/src/jmapNew/theme/datie_02/menus/dialog/addDispatcherLogerRunplan.vue +++ b/src/views/dispatcherLoger/addDispatcherLogerRunplan.vue @@ -91,13 +91,13 @@ - 始发 + 始发 - 终到 + 终到 电力 @@ -173,7 +173,23 @@ export default { filterDepSectionList:[], filterSectionList:[], trainTypeList:[ - {name:'跨局快速旅客列车', code:'FAST_PASSENGER_TRAIN' } + // 管内列车 + {name:'管内特快旅客列车', code:'LOCAL_EXPRESS_PASSENGER_TRAIN' }, + {name:'管内快速旅客列车', code:'LOCAL_FAST_PASSENGER_TRAIN' }, + {name:'管内普通旅客快车', code:'LOCAL_PASSENGER_TRAIN' }, + {name:'管内普通旅客慢车', code:'LOCAL_SLOW_PASSENGER_TRAIN' }, + {name:'管内临时旅客列车', code:'LOCAL_TEMPORARY_PASSENGER_TRAIN' }, + {name:'管内临时旅游列车', code:'LOCAL_TEMPORARY_TOURIST_TRAIN' }, + // 跨局列车 + {name:'跨局快速旅客列车', code:'FAST_PASSENGER_TRAIN' }, + {name:'跨局临时旅游列车', code:'TEMPORARY_TOURIST_TRAIN' }, + {name:'跨两局普通旅客快车', code:'TWO_PASSENGER_TRAIN' }, + {name:'跨两局普通旅客慢车', code:'TWO_SLOW_PASSENGER_TRAIN' }, + {name:'跨两局临时旅客列车', code:'TWO_TEMPORARY_PASSENGER_TRAIN' }, + {name:'跨三局及其以上普通旅客快车', code:'MORE_PASSENGER_TRAIN' }, + // 其他列车 + {name:'回送出入厂客车底列车', code:'BACK_FACTORY_PASSENGER_TRAIN' }, + {name:'因故折返旅客列车', code:'FAULT_TRUE_BACK_PASSENGER_TRAIN' } ], runTypeList:[ {name:'快速旅客列车', code:'FAST_PASSENGER_TRAIN' } @@ -186,18 +202,20 @@ export default { ], model:{ // runPlanCode:'', // 新增没有 + trainType:'LOCAL_EXPRESS_PASSENGER_TRAIN', // 列车类型 + runType:'FAST_PASSENGER_TRAIN', // 运行类型 stationCode:'', // 车站编码 // groupNumber:'', // 班别:目前没有 arriveSectionCode:'', // 到达股道 arrivePlanTime:'', // 到达计划时间 arriveTripNumber:'', // 到达车次 - arriveStationCode:'', // 到达车站 + // arriveStationCode:'', // 到达车站 arriveDirectionCode:'', // 到达方向编码(到达口) departSectionCode:'', // 发车股道 departPlanTime:'', // 发车计划时间 departTripNumber:'', // 发车车次 - departStationCode:'', // 发车车站 + // departStationCode:'', // 发车车站 departDirectionCode:'', // 发向方向编码(发车口) startRunPlan:false, // 始发计划 true,false @@ -246,8 +264,8 @@ export default { } }, methods: { - doShow({filterSectionList, mapStationDirectionMap}) { - this.mapStationDirectionList = Object.values(mapStationDirectionMap); + doShow({filterSectionList, mapStationDirectionList}) { + this.mapStationDirectionList = mapStationDirectionList; this.filterSectionList = filterSectionList; this.dialogShow = true; this.$nextTick(function () { @@ -260,20 +278,38 @@ export default { this.filterArrSectionList = this.filterSectionList.filter(each=>{ return each.stationCode == stationCode; }); this.filterDepSectionList = this.filterSectionList.filter(each=>{ return each.stationCode == stationCode; }); }, + changeEndRp(data) { + if (data) { + this.model.departSectionCode = ''; + this.model.departPlanTime = ''; + this.model.departTripNumber = ''; + this.model.departDirectionCode = ''; + } + }, + changeStartRp(data) { + if (data) { + this.model.arriveSectionCode = ''; + this.model.arrivePlanTime = ''; + this.model.arriveTripNumber = ''; + this.model.arriveDirectionCode = ''; + } + }, doClose() { this.loading = false; this.dialogShow = false; this.model = { + trainType:'LOCAL_EXPRESS_PASSENGER_TRAIN', // 列车类型 + runType:'FAST_PASSENGER_TRAIN', // 运行类型 stationCode:'', // 车站编码 arriveSectionCode:'', // 到达股道 arrivePlanTime:'', // 到达计划时间 arriveTripNumber:'', // 到达车次 - arriveStationCode:'', // 到达车站 + // arriveStationCode:'', // 到达车站 arriveDirectionCode:'', // 到达方向编码(到达口) departSectionCode:'', // 发车股道 departPlanTime:'', // 发车计划时间 departTripNumber:'', // 发车车次 - departStationCode:'', // 发车车站 + // departStationCode:'', // 发车车站 departDirectionCode:'', // 发向方向编码(发车口) startRunPlan:false, // 始发计划 true,false diff --git a/src/jmapNew/theme/datie_02/menus/dialog/deleteDispatcherLoger.vue b/src/views/dispatcherLoger/deleteDispatcherLoger.vue similarity index 98% rename from src/jmapNew/theme/datie_02/menus/dialog/deleteDispatcherLoger.vue rename to src/views/dispatcherLoger/deleteDispatcherLoger.vue index 413fdc13f..1f357064d 100644 --- a/src/jmapNew/theme/datie_02/menus/dialog/deleteDispatcherLoger.vue +++ b/src/views/dispatcherLoger/deleteDispatcherLoger.vue @@ -46,7 +46,7 @@ export default { return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; }, domIdConfirm() { - return this.dialogShow ? OperationEvent.CTCCommand.deleteRunplan.menu.domId : ''; + return this.dialogShow ? OperationEvent.CTCCommand.deleteDispatcherLogerRp.menu.domId : ''; }, title() { return '警告'; diff --git a/src/jmapNew/theme/datie_02/menus/dispatcherLoger.vue b/src/views/dispatcherLoger/index.vue similarity index 60% rename from src/jmapNew/theme/datie_02/menus/dispatcherLoger.vue rename to src/views/dispatcherLoger/index.vue index e71a5f3f8..11db9a439 100644 --- a/src/jmapNew/theme/datie_02/menus/dispatcherLoger.vue +++ b/src/views/dispatcherLoger/index.vue @@ -33,14 +33,14 @@
{{ scope.row.tripNumber }} {{ scope.row.status==-1?'(删)':'' }}
- + + + @@ -75,32 +90,49 @@ - + - + @@ -154,8 +190,10 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; // import { copyAssign } from '@/utils/index'; import {getRunplanInRailway} from '@/api/runplan'; -import AddDispatcherLogerRunplan from './dialog/addDispatcherLogerRunplan'; -import DeleteDispatcherLoger from './dialog/deleteDispatcherLoger'; +// import AddDispatcherLogerRunplan from '@/jmapNew/theme/datie_02/menus/dialog/addDispatcherLogerRunplan'; +import AddDispatcherLogerRunplan from './addDispatcherLogerRunplan'; +import DeleteDispatcherLoger from './deleteDispatcherLoger'; +// import DeleteDispatcherLoger from '@/jmapNew/theme/datie_02/menus/dialog/deleteDispatcherLoger'; import { mapGetters } from 'vuex'; export default { name:'DispatcherLoger', @@ -169,21 +207,37 @@ export default { isShow:false, height: this.$store.state.app.height - 37, filterSectionList:[], + mapStationDirectionData:[], // filterSectionMap:{}, tableData:[], group:'', currentRow:null, - trainTypeMap:{'FAST_PASSENGER_TRAIN':'跨局快速旅客列车'}, + trainTypeMap:{ + 'LOCAL_EXPRESS_PASSENGER_TRAIN':'管内特快旅客列车', + 'LOCAL_FAST_PASSENGER_TRAIN':'管内快速旅客列车', + 'LOCAL_PASSENGER_TRAIN':'管内普通旅客快车', + 'LOCAL_SLOW_PASSENGER_TRAIN':'管内普通旅客慢车', + 'LOCAL_TEMPORARY_PASSENGER_TRAIN':'管内临时旅客列车', + 'LOCAL_TEMPORARY_TOURIST_TRAIN':'管内临时旅游列车', + + 'FAST_PASSENGER_TRAIN':'跨局快速旅客列车', + 'TEMPORARY_TOURIST_TRAIN':'跨局临时旅游列车', + 'TWO_PASSENGER_TRAIN':'跨两局普通旅客快车', + 'TWO_SLOW_PASSENGER_TRAIN':'跨两局普通旅客慢车', + 'TWO_TEMPORARY_PASSENGER_TRAIN':'跨两局临时旅客列车', + 'MORE_PASSENGER_TRAIN':'跨三局及其以上普通旅客快车', + + 'BACK_FACTORY_PASSENGER_TRAIN':'回送出入厂客车底列车', + 'FAULT_TRUE_BACK_PASSENGER_TRAIN':'因故折返旅客列车' + }, + runTypeMap:{'FAST_PASSENGER_TRAIN':'快速旅客列车'} }; }, computed: { ...mapGetters('map', [ 'sectionList' - ]), - mapStationDirectionData() { - return this.$store.state.map.mapStationDirectionData; - } + ]) }, watch:{ // '$store.state.socket.railwaySimulationRpChange': function (val) { @@ -214,6 +268,7 @@ export default { }, doShow() { this.loadFilterSectionMap(); + this.mapStationDirectionData = Object.values(this.$store.state.map.mapStationDirectionData); // this.tableData = []; // this.loadData(); this.isShow = true; @@ -246,6 +301,55 @@ export default { changeDepartRunPlan(event, row, index) { this.modifyDispatcherLogerRpSection(row, row.departSectionCode, 'D'); }, + // + + changeArrivePlanTime(event, row, index) { + this.modifyDispatcherLogerRpPlanTime(row, row.arrivePlanTime, 'R'); + }, + changeDepartPlanTime(event, row, index) { + this.modifyDispatcherLogerRpPlanTime(row, row.departPlanTime, 'D'); + }, + changeArriveDirectionCode(event, row, index) { + this.modifyDispatcherLogerRpDirection(row, row.arriveDirectionCode, 'R'); + }, + changeDepartDirectionCode(event, row, index) { + this.modifyDispatcherLogerRpDirection(row, row.departDirectionCode, 'D'); + }, + // 调度台行车计划修改出入口 + modifyDispatcherLogerRpDirection(row, directionCode, type) { + const params = {stationCode:row.stationCode, runPlanCode:row.runPlanCode, directionCode:directionCode, model:type}; + commitOperate(menuOperate.CTC.modifyDispatcherLogerRpDirection, params, 3).then(({valid, response})=>{ + if (valid) { + const reslut = response.data; + this.tableData.map(data=>{ + if (data.stationCode == reslut.stationCode && data.runPlanCode == reslut.runPlanCode) { + data.arriveDirectionCode = reslut.arriveDirectionCode; + data.departDirectionCode = reslut.departDirectionCode; + } + }); + } + }).catch(() => { + // this.$message.error('发布失败'); + }); + }, + // 调度台行车计划修改时间 + modifyDispatcherLogerRpPlanTime(row, planTime, type) { + const params = {stationCode:row.stationCode, runPlanCode:row.runPlanCode, planTime:planTime, model:type}; + commitOperate(menuOperate.CTC.modifyDispatcherLogerRpPlanTime, params, 3).then(({valid, response})=>{ + if (valid) { + const reslut = response.data; + this.tableData.map(data=>{ + if (data.stationCode == reslut.stationCode && data.runPlanCode == reslut.runPlanCode) { + data.arrivePlanTime = reslut.arrivePlanTime; + data.departPlanTime = reslut.departPlanTime; + } + }); + } + }).catch(() => { + // this.$message.error('发布失败'); + }); + }, + // 修改发车时间 modifyDispatcherLogerRpSection(row, sectionCode, type) { // stationCode 车站编码 // runPlanCode 运行计划编码 @@ -302,7 +406,7 @@ export default { addRunplan() { this.$refs.addDispatcherLogerRunplan.doShow({ filterSectionList:this.filterSectionList, - mapStationDirectionMap:this.mapStationDirectionData + mapStationDirectionList:this.mapStationDirectionData }); }, selectedTripNumber(row, column, cell, event) { diff --git a/src/views/dispatcherStationManage/cmdManage.vue b/src/views/dispatcherStationManage/cmdManage.vue index dbfb0745c..f925be9f9 100644 --- a/src/views/dispatcherStationManage/cmdManage.vue +++ b/src/views/dispatcherStationManage/cmdManage.vue @@ -26,14 +26,18 @@
收令箱
- + - + + + @@ -153,22 +157,9 @@ export default { }, getTableData() { const receiverList = Object.values(this.currentInfo.receiverInfos || {}); - const mList = []; - receiverList.forEach(ii => { - const obj = this.memberList.find(item => { - return item.id == ii.receiverId; - }); - if (obj) { - mList.push({ - commandId: this.commandId, - ...ii, - ...obj - }); - } - }); const list = []; - mList.forEach(item => { - const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode); + receiverList.forEach(item => { + const device = this.$store.getters['map/getDeviceByCode'](item.receiverId); const obj = { ...this.currentInfo, ...item, @@ -201,6 +192,8 @@ export default { return 'unsigned-row'; }, doShow() { + this.currentInfo = {}; + this.searchCmd(); this.dialogShow = true; this.$store.commit('socket/clearDispatchCommandMsg'); }, @@ -208,10 +201,32 @@ export default { this.dialogShow = false; }, handleCurrentChange(obj) { + if (!obj) { return; } this.currentInfo = obj; + if (!this.getSignInfo(obj.receiverInfos).receivedTime) { + const data = { + commandId: obj.id + }; + sendCommandNew(this.group, 'CTC_READ_DISPATCH_COMMAND', data).then((res) => { + console.log(res, '---res'); + const index = this.cmdTableData.findIndex(item => { + return item.id == obj.id; + }); + if (index >= 0) { + const obj = this.cmdTableData[index]; + const devCode = this.getActiveUser.deviceCode || ''; + if (obj.receiverInfos[devCode]) { + obj.receiverInfos[devCode].receivedTime = parseTime(this.initTime); + this.cmdTableData.splice(index, 1, obj); + } + } + }).catch(error => { + console.log(error, '---已读命令error'); + }); + } }, getSignInfo(info) { - const obj = info[this.getActiveUser.memberId] || {}; + const obj = info[this.getActiveUser.deviceCode] || {}; return obj; }, getSignedBy(info) { @@ -241,20 +256,40 @@ export default { this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${error.message}`); }); }, + changeReadStatus(signInfo) { + const index = this.cmdTableData.findIndex(item => { + return item.id == signInfo.commandId; + }); + if (index >= 0) { + const obj = this.cmdTableData[index]; + const devCode = this.getActiveUser.deviceCode || ''; + if (obj.receiverInfos[devCode]) { + const mId = signInfo.signedBy; + obj.receiverInfos[devCode].signedBy = mId; + obj.receiverInfos[devCode].signedStatus = signInfo.signedStatus; + obj.receiverInfos[devCode].time = parseTime(this.initTime); + this.cmdTableData.splice(index, 1, obj); + } + } + }, changeSignedStatus(signInfo) { const index = this.cmdTableData.findIndex(item => { return item.id == signInfo.commandId; }); if (index >= 0) { const obj = this.cmdTableData[index]; - const mId = signInfo.signedBy; - obj.receiverInfos[mId].signedBy = mId; - obj.receiverInfos[mId].signedStatus = signInfo.signedStatus; - obj.receiverInfos[mId].time = parseTime(this.initTime); - this.cmdTableData.splice(index, 1, obj); + const devCode = this.getActiveUser.deviceCode || ''; + if (obj.receiverInfos[devCode]) { + const mId = signInfo.signedBy; + obj.receiverInfos[devCode].signedBy = mId; + obj.receiverInfos[devCode].signedStatus = signInfo.signedStatus; + obj.receiverInfos[devCode].time = parseTime(this.initTime); + this.cmdTableData.splice(index, 1, obj); + } } }, searchCmd() { + this.cmdTableData = []; sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND').then((res) => { console.log(res, '---res'); if (res.code == 200) { diff --git a/src/views/dispatcherStationManage/dispatchCmd.vue b/src/views/dispatcherStationManage/dispatchCmd.vue index 53b3c352f..85bdd476c 100644 --- a/src/views/dispatcherStationManage/dispatchCmd.vue +++ b/src/views/dispatcherStationManage/dispatchCmd.vue @@ -19,7 +19,132 @@
- 新建调度命令 + +
+ + + + + + 小时 +
+ {{ getSimulationTime }} +
+
+ + 刷新 + 新建调度命令 +
+
+
+
缓存命令
+
+ + +
+
+
+ + + + + + + + + + + + + + +
+
+
+
接受命令
+
+ + +
+
+
+ + + + + + + + + + + + + +
+
+
+
发送命令
+
+ + +
+
+
+ + + + + + + + + + + + + + +
+
+
+
签收完成
+
+ + +
+
+
+ + + + + + + + + + + + + +
@@ -35,22 +160,25 @@
- - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -123,10 +251,10 @@ - +
- +
@@ -139,15 +267,23 @@
- - - + - - + + + + + + + +
@@ -169,6 +305,7 @@ + + diff --git a/src/views/newMap/mapDraftPicture/createPicture.vue b/src/views/newMap/mapDraftPicture/createPicture.vue new file mode 100644 index 000000000..8dc780a8b --- /dev/null +++ b/src/views/newMap/mapDraftPicture/createPicture.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/src/views/newMap/mapDraftPicture/index.vue b/src/views/newMap/mapDraftPicture/index.vue index e08374c54..f2bf01eff 100644 --- a/src/views/newMap/mapDraftPicture/index.vue +++ b/src/views/newMap/mapDraftPicture/index.vue @@ -3,12 +3,12 @@
-
- - 撤销 - 恢复 - -
+ + + + + +
返回 更新坐标 @@ -24,30 +24,38 @@ :selected="selected" :map-saveing="mapSaveing" @saveMapEvent="saveMapEvent" - @updateMapModel="updateMapModel" + @createPicture="createPicture" + @changePicture="changePicture" + @deletePicture="deletePicture" @setCenter="setCenter" />
+ +
- diff --git a/src/views/newMap/newDesignUser/demonList.vue b/src/views/newMap/newDesignUser/demonList.vue index dd19c1b0a..905e1ea36 100644 --- a/src/views/newMap/newDesignUser/demonList.vue +++ b/src/views/newMap/newDesignUser/demonList.vue @@ -77,7 +77,7 @@ export default { }, editModel: {}, lineCode: '', - loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts'] + loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts', 'teaching', 'designteaching'] }; }, computed: { diff --git a/src/views/newMap/newMapdraft/index.vue b/src/views/newMap/newMapdraft/index.vue index ce171e015..b2be54748 100644 --- a/src/views/newMap/newMapdraft/index.vue +++ b/src/views/newMap/newMapdraft/index.vue @@ -31,6 +31,7 @@ @generateCIEvent="generateCIEvent" @updateMapModel="updateMapModel" @generateDepotCiEvent="generateDepotCiEvent" + @setMapFunctionConfig="setMapFunctionConfig" @setCenter="setCenter" @selectView="selectViewDraft" @showMap="showMap" @@ -48,6 +49,7 @@
+ @@ -67,6 +69,7 @@ import CheckConfig from './checkConfig'; import ElementImport from './elementImport'; import PopMenu from '@/components/PopMenu'; import DepotStation from './depotStation'; +import mapFunctionConfig from './mapFunctionConfig'; import ConfigMap from './configMap'; @@ -83,7 +86,8 @@ export default { PopMenu, CheckConfig, ElementImport, - DepotStation + DepotStation, + mapFunctionConfig }, data() { return { @@ -312,6 +316,9 @@ export default { generateDepotCiEvent() { this.$refs.depotStation.doShow(); }, + setMapFunctionConfig() { + this.$refs.mapFunctionConfig.show(); + }, handleSelectControlPage(model) { if (this.$refs.mapOperate) { this.$refs.mapOperate.handleSelectControlPage(model); diff --git a/src/views/newMap/newMapdraft/mapFunctionConfig.vue b/src/views/newMap/newMapdraft/mapFunctionConfig.vue new file mode 100644 index 000000000..f941a635a --- /dev/null +++ b/src/views/newMap/newMapdraft/mapFunctionConfig.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index d93335d52..f0b4dc03c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -17,6 +17,7 @@
现地配置
大屏配置
车辆段配置
+
地图配置
@@ -209,9 +210,9 @@ export default { }, handleSelectControlPage(device) { const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', - 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', - 'ReturnModeGroup', 'ControlSwitch', 'Axle', 'IndicatorLight', 'SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist', 'PickAssist', - 'Recovery', 'Accident', 'Occlusion', 'PickArrow' ,'DepartArrow']; + 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', + 'ReturnModeGroup', 'ControlSwitch', 'Axle', 'IndicatorLight', 'SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist', 'PickAssist', + 'Recovery', 'Accident', 'Occlusion', 'PickArrow', 'DepartArrow']; const type = device._type; if (this.selectDevice) { this.enabledTab = this.selectDevice; @@ -243,6 +244,9 @@ export default { generateCIEvent() { this.$emit('generateCIEvent'); }, + setMapFunctionConfig() { + this.$emit('setMapFunctionConfig'); + }, generateDepotCiEvent() { this.$emit('generateDepotCiEvent'); } diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index 152a857a1..59ae93370 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -107,11 +107,11 @@ export default { { code: 'DEPOT', name: '联段线' }, { code: 'PARKING', name: '库线' } ], - endForFlipRunDirList: [ - { value: 'LEFT', label: '左' }, - { value: 'RIGHT', label: '右' }, - { value: 'NON', label: '无' } - ], + endForFlipRunDirList: [ + { value: 'LEFT', label: '左' }, + { value: 'RIGHT', label: '右' }, + { value: 'NON', label: '无' } + ], editModel: getModel('Section'), oldPoint: [], // 区段未修改前 坐标 field: '', @@ -153,8 +153,8 @@ export default { { prop: 'roadType', label: '线路类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.sectionRoadTypeList, clearable: true, isHidden: !this.isSwitchSectionType || !this.isCrossSectionType, deviceChange: this.roadTypeChange }, { prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'leftSection', buttonShowType: this.isLeftSectionButtonShow, isHidden: !this.hasAssociatedSection }, // 左关联区段 { prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'rightSection', buttonShowType: this.isRightSectionButtonShow, isHidden: !this.hasAssociatedSection }, // 右关联区段 - { prop: 'endForFlipRunDir', label: '方向运行端点:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.endForFlipRunDirList, isHidden: !this.hasAssociatedSection }, - { prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isCrossSectionType, options: this.sectionList, isHidden: !this.isParentCode }, // 所属物理/道岔区段code + { prop: 'endForFlipRunDir', label: '方向运行端点:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.endForFlipRunDirList, isHidden: !this.hasAssociatedSection }, + { prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isCrossSectionType, options: this.sectionList, isHidden: !this.isParentCode }, // 所属物理/道岔区段code { prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType || !this.isCrossSectionType }, { prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType || !this.isCrossSectionType }, { prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint, lastDisabled: true }, @@ -415,7 +415,6 @@ export default { }, deviceSelect(selected) { // 判断是否激活选择站台 - console.log(selected, '****************---'); if (selected && selected._type === 'Section') { if (this.field == 'relatedSection' ) { if (selected.type === '01') { @@ -552,9 +551,9 @@ export default { model.rightStopPointOffset = model.rightStopPointOffset || model.lengthFact - 5; } let changeSectionList = [model]; - if(model.endForFlipRunDir === 'NON') { - changeSectionList = this.handleOtherSectionChange(model); - } + if (model.endForFlipRunDir === 'NON') { + changeSectionList = this.handleOtherSectionChange(model); + } const changeStandList = this.handleRelevanceStand(model); if (model.relCrossSection) { this.crossSectionList.forEach(item => { diff --git a/src/views/newMap/trainTicket/greenLicence.vue b/src/views/newMap/trainTicket/greenLicence.vue index b6caa44d4..74e91c188 100644 --- a/src/views/newMap/trainTicket/greenLicence.vue +++ b/src/views/newMap/trainTicket/greenLicence.vue @@ -20,7 +20,7 @@ 线上发车。
-
{{ showCentralizedStationName }}(站名印)车站值班员(签名)
+
{{ greenLicenseForm.stationSeal }}(站名印)车站值班员(签名)
@@ -31,6 +31,18 @@
日填发
+
+ + + + 给予 +
@@ -46,15 +58,30 @@ export default { type: Boolean, required: true }, - showCentralizedStationName: { - type: String, - required: true + giveMemberList: { + type: Array, + default() { + return []; + } } }, data() { return { - + memberId: '' }; + }, + computed: { + userId() { + return this.$store.state.user ? this.$store.state.user.id : ''; + } + }, + methods: { + giveTicket() { + if (this.memberId) { + this.$emit('giveTicket', { ticketId: this.greenLicenseForm.id, memberId: this.memberId }); + this.memberId = ''; + } + } } }; diff --git a/src/views/newMap/trainTicket/index.vue b/src/views/newMap/trainTicket/index.vue index 114fe6ae0..338b950f4 100644 --- a/src/views/newMap/trainTicket/index.vue +++ b/src/views/newMap/trainTicket/index.vue @@ -25,8 +25,8 @@ - - + +
提交
@@ -34,17 +34,17 @@
@@ -132,6 +132,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO import RailTicket from './trainTicket'; import GreenLicence from './greenLicence'; import RedLicence from './redLicence'; +import { EventBus } from '@/scripts/event-bus'; export default { name: 'Index', components: { @@ -146,13 +147,14 @@ export default { railTicketList: [], greenLicenseList: [], redLicenseList: [], + giveMemberList: [], activeName: 'first', ticketForm: { number: '', tripNumber: '', station: '', nextStation: '', - stationSeal: true, + stationSeal: '', no: '', deputy: false }, @@ -161,7 +163,7 @@ export default { reason: '', tripNumber: '', line: '', - stationSeal: true, + stationSeal: '', signature: '', year: '', moon: '', @@ -183,7 +185,7 @@ export default { noticeHour2: '', noticeMinute2: '', noticeTripNumber2: '', - stationSeal: true, + stationSeal: '', signature: '', year: '', moon: '', @@ -205,21 +207,37 @@ export default { computed: { ...mapGetters('map', [ 'stationList' - ]), - showCentralizedStationName() { - if (this.$store.state.map.showCentralizedStationCode) { - const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode); - if (station) { return station.name; } else { return ''; } - } else { return ''; } + ]) + }, + watch: { + '$store.state.map.showCentralizedStationCode': function (val) { + const station = this.$store.getters['map/getDeviceByCode'](val); + if (station) { + this.ticketForm.station = station.name; + this.ticketForm.stationSeal = station.name; + this.greenLicenseForm.stationSeal = station.name; + this.redLicenseForm.stationSeal = station.name; + } } }, + mounted() { + EventBus.$on('trainTicketMember', (memberList) => { + this.giveMemberList = memberList; + }); + }, methods: { doClose() { this.trainTicketShow = false; }, doShow() { this.trainTicketShow = true; - this.ticketForm.station = this.showCentralizedStationName; + const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode); + if (station) { + this.ticketForm.station = station.name; + this.ticketForm.stationSeal = station.name; + this.greenLicenseForm.stationSeal = station.name; + this.redLicenseForm.stationSeal = station.name; + } }, handleClick() { if (this.activeName === 'second') { @@ -232,11 +250,12 @@ export default { } }, clearData() { - this.ticketForm = {number: '', tripNumber: '', station: '', nextStation: '', stationSeal: true, no: '', deputy: false}; - this.greenLicenseForm = {number: '', reason: '', tripNumber: '', line: '', stationSeal: true, signature: '', year: '', moon: '', day: '' }; + const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode) || {}; + this.ticketForm = {number: '', tripNumber: '', station: station.name, nextStation: '', stationSeal: station.name, no: '', deputy: false}; + this.greenLicenseForm = {number: '', reason: '', tripNumber: '', line: '', stationSeal: station.name, signature: '', year: '', moon: '', day: '' }; this.redLicenseForm = {number: '', licenseReceived: true, licenseTripNumber: '', licenseStation: '', licenseNextStation: '', licenseHour: '', licenseMinute: '', licenseTripNumber2: '', noticeTripNumber: '', noticeHour1: '', noticeMinute1: '', noticeTripNumber1: '', noticeHour2: '', - noticeMinute2: '', noticeTripNumber2: '', stationSeal: true, signature: '', year: '', moon: '', day: ''}; + noticeMinute2: '', noticeTripNumber2: '', stationSeal: station.name, signature: '', year: '', moon: '', day: ''}; }, query() { const params = { type: this.attachmentType }; @@ -255,19 +274,49 @@ export default { }); }, submit() { + let commitFlag = true; const params = { ticket: { type: this.attachmentType }, stationCode: this.$store.state.map.showCentralizedStationCode }; if (this.attachmentType === 'RAIL_TICKET') { - params.ticket = Object.assign(params.ticket, this.ticketForm); + if (!this.ticketForm.number || !this.ticketForm.tripNumber || !this.ticketForm.nextStation || !this.ticketForm.no) { + commitFlag = false; + } else { + params.ticket = Object.assign(params.ticket, this.ticketForm); + } } else if (this.attachmentType === 'GREEN_LICENCE') { - params.ticket = Object.assign(params.ticket, this.greenLicenseForm); + if (!this.greenLicenseForm.number || !this.greenLicenseForm.reason || !this.greenLicenseForm.tripNumber || !this.greenLicenseForm.line || + !this.greenLicenseForm.signature || !this.greenLicenseForm.year || !this.greenLicenseForm.moon || !this.greenLicenseForm) { + commitFlag = false; + } else { + params.ticket = Object.assign(params.ticket, this.greenLicenseForm); + } } else if (this.attachmentType === 'RED_LICENCE') { - params.ticket = Object.assign(params.ticket, this.redLicenseForm); + if (!this.redLicenseForm.number || !this.redLicenseForm.licenseTripNumber || !this.redLicenseForm.licenseStation || !this.redLicenseForm.licenseNextStation || + !this.redLicenseForm.licenseHour || !this.redLicenseForm.licenseMinute || !this.redLicenseForm.licenseTripNumber2 || !this.redLicenseForm.noticeTripNumber || + !this.redLicenseForm.noticeHour1 || !this.redLicenseForm.noticeMinute1 || !this.redLicenseForm.noticeTripNumber2 || !this.redLicenseForm.signature || + !this.redLicenseForm.year || !this.redLicenseForm.moon || !this.redLicenseForm.day) { + commitFlag = false; + } else { + params.ticket = Object.assign(params.ticket, this.redLicenseForm); + } } - commitOperate(menuOperate.Rail.railFillInTicket, params, 3).then(({valid, operate})=>{ - this.clearData(); - this.ticketForm.station = this.showCentralizedStationName; - }).catch(()=>{ - this.$message.error('提交路票失败!'); + if (commitFlag) { + commitOperate(menuOperate.Rail.railFillInTicket, params, 3).then(({valid, operate})=>{ + this.clearData(); + this.$message.success('提交路票成功!'); + }).catch(()=>{ + this.$message.error('提交路票失败!'); + }); + } else { + this.$message.error('信息填写不完整,请检查!'); + } + + }, + giveTicket(params) { + commitOperate(menuOperate.Rail.railGiveTicketTo, params, 3).then(({valid, operate}) => { + this.$message.success('给予路票成功!'); + this.query(); + }).catch(()=> { + this.$message.error('给予路票失败!'); }); } } diff --git a/src/views/newMap/trainTicket/redLicence.vue b/src/views/newMap/trainTicket/redLicence.vue index 79cbc8d72..b7db04b4b 100644 --- a/src/views/newMap/trainTicket/redLicence.vue +++ b/src/views/newMap/trainTicket/redLicence.vue @@ -20,11 +20,11 @@ 分发出的第 次列车,邻站到达通知 - - - - - 收到 + + + + + 收到
通     知     书
@@ -48,7 +48,7 @@ 次列车。
-
{{ showCentralizedStationName }}(站名印)车站值班员(签名)
+
{{ redLicenseForm.stationSeal }}(站名印)车站值班员(签名)
@@ -59,6 +59,18 @@
日填发
+
+ + + + 给予 +
@@ -74,15 +86,30 @@ export default { type: Boolean, required: true }, - showCentralizedStationName: { - type: String, - required: true + giveMemberList: { + type: Array, + default() { + return []; + } } }, data() { return { - + memberId: '' }; + }, + computed: { + userId() { + return this.$store.state.user ? this.$store.state.user.id : ''; + } + }, + methods: { + giveTicket() { + if (this.memberId) { + this.$emit('giveTicket', { ticketId: this.redLicenseForm.id, memberId: this.memberId }); + this.memberId = ''; + } + } } }; diff --git a/src/views/newMap/trainTicket/ticketInfo.vue b/src/views/newMap/trainTicket/ticketInfo.vue new file mode 100644 index 000000000..3cf6d53a3 --- /dev/null +++ b/src/views/newMap/trainTicket/ticketInfo.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/views/newMap/trainTicket/trainTicket.vue b/src/views/newMap/trainTicket/trainTicket.vue index 5f96d4e07..e1f159717 100644 --- a/src/views/newMap/trainTicket/trainTicket.vue +++ b/src/views/newMap/trainTicket/trainTicket.vue @@ -25,14 +25,23 @@
-
{{ ticketForm.station }}(站名印)
+
{{ ticketForm.stationSeal }}(站名印)
编号
-
- +
+ + + + 给予
@@ -52,12 +61,31 @@ export default { stationList: { type: Array, required: true + }, + giveMemberList: { + type: Array, + default() { + return []; + } } }, data() { return { - + memberId: '' }; + }, + computed: { + userId() { + return this.$store.state.user ? this.$store.state.user.id : ''; + } + }, + methods: { + giveTicket() { + if (this.memberId) { + this.$emit('giveTicket', { ticketId: this.ticketForm.id, memberId: this.memberId }); + this.memberId = ''; + } + } } }; diff --git a/src/views/scriptManage/home.vue b/src/views/scriptManage/home.vue index b8b6ea193..1a6e8c285 100644 --- a/src/views/scriptManage/home.vue +++ b/src/views/scriptManage/home.vue @@ -46,7 +46,7 @@ export default { reset: true, show:false }, - loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts'], + loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts', 'teaching', 'designteaching'], queryList: { query: this.queryFunction, selectCheckShow: false, diff --git a/src/views/system/configLine/config.vue b/src/views/system/configLine/config.vue index 8626f4597..58340f5bf 100644 --- a/src/views/system/configLine/config.vue +++ b/src/views/system/configLine/config.vue @@ -116,7 +116,7 @@ export default { 'tripNumberIsUnique', 'standTbStrategyIsInvalid', 'updateTripPlanByServiceNumber', - 'hasCTC' + 'railway' ], selectList: ['runMode', 'singleApproachLockCancelRoute'], generalConfig: [ @@ -166,7 +166,7 @@ export default { 'tripNumberIsUnique', 'standTbStrategyIsInvalid', 'updateTripPlanByServiceNumber', - 'hasCTC' + 'railway' ], rangeList: ['noParkingSM', 'parkingSM'], speedList: ['rmAtpSpeed', 'urmAtpSpeed'], @@ -222,7 +222,7 @@ export default { tripNumberIsUnique: '运行图中车次号是否唯一', standTbStrategyIsInvalid: '站台折返策略不生效', updateTripPlanByServiceNumber: '根据服务号更新车次计划', - hasCTC: '有CTC系统(大铁)' + railway: '大铁线路' } }; }, diff --git a/src/views/system/deviceManage/index.vue b/src/views/system/deviceManage/index.vue index 177d0ec5b..56b6f54bc 100644 --- a/src/views/system/deviceManage/index.vue +++ b/src/views/system/deviceManage/index.vue @@ -43,13 +43,14 @@ export default { {label: '贵州装备', value:'GZB'}, {label: '哈尔滨', value:'HEB'}, {label: '苏电院', value:'SDY'}, - { label: '中航锐创(实训室)', value: 'RICHOR_JOINT' }, + {label: '中航锐创(实训室)', value: 'RICHOR_JOINT'}, {label: '上饶沙盘', value: 'SR_SANDBOX'}, {label: '江西工贸', value: 'JXGM'}, {label: '扬州工业', value: 'RICHOR_YGY'}, {label: '红河财经', value: 'RICHOR_HHCJ'}, {label: '苏安院', value: 'SAY'}, - {label: '众合-陕铁院', value: 'UNITTEC_STY'} + {label: '众合-陕铁院', value: 'UNITTEC_STY'}, + {label: '教学通用', value: 'TEACHING'} ], projectMap: { designxty: 'XTY', @@ -62,7 +63,8 @@ export default { designygy: 'RICHOR_YGY', designsay: 'SAY', designunittecsty: 'UNITTEC_STY', - designrichorhhcj: 'RICHOR_HHCJ' + designrichorhhcj: 'RICHOR_HHCJ', + designteaching: 'TEACHING' }, queryForm: { labelWidth: '120px', diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index 4c9593e54..828a2dd18 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -9,7 +9,7 @@