diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index dc4f28df5..4a0e58e8b 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -409,7 +409,8 @@ class SkinCode extends defaultStyle { grayColor: '#7F7F7F', // 控制模式灰色 greenColor: '#00FF00', // 控制模式绿色 redColor: '#FF0000', // 控制模式红色 - yellowColor: '#FFFF00' // 控制模式黄色 + yellowColor: '#FFFF00', // 控制模式黄色 + purpleColor:'#840084' // 控制模式紫色 }, emergencyControl: { // 紧急站控 show: true, diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 1d4f7427a..2f95d472b 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -302,7 +302,7 @@ class Jlmap { } return false; - } + } setUpdateMapDevice(list = []) { store.commit('map/updateMapDevice', list); @@ -314,7 +314,7 @@ class Jlmap { }); } // 模式选择 -> 更新 - updateShowMode(list=[], showMode=false) { + updateShowMode(list = [], showMode = false) { this.showConfig.showMode = showMode; list.forEach(elem => { const code = elem.code; @@ -328,7 +328,7 @@ class Jlmap { getShowConfig() { return this.showConfig; } - updateShowStation(list=[], stationCode=false) { + updateShowStation(list = [], stationCode = false) { this.stationCode = stationCode; list.forEach(elem => { const code = elem.code; @@ -348,7 +348,11 @@ class Jlmap { } }); this.$painter.$transformHandle.revisibleAll(); - this.$painter.$transformHandle.setStationFlag(stationCode); + if (stationCode) { + this.$painter.$transformHandle.setFoldLines(store.state.map.foldLineMap[stationCode]); + } else { + this.$painter.$transformHandle.setFoldLines([]); + } } showStationHandlePsd(oDevice, stationCode) { const standDevice = this.mapDevice[oDevice.standCode]; @@ -393,16 +397,16 @@ class Jlmap { this.$painter.updateShowMode(oDevice); }); } - update(list=[]) { - this.setUpdateMapDevice(list); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息 - const codeList = []; + update(list = []) { + this.setUpdateMapDevice(list); // 增加一个 前数据 处理 为了在区段中 获取全部的 道岔信息 + const codeList = []; const controlTransferList = []; - const signalDeviceList = []; - const selected = store.state.menuOperation.selected; + const signalDeviceList = []; + const selected = store.state.menuOperation.selected; list.forEach((elem, index) => { const code = elem.code; - const type = elem._type; + const type = elem._type; if (elem.deviceType === 'ROUTE' && this.logicData.routeData) { // 处理进路数据状态 store.dispatch('map/updateRouteState', elem); @@ -458,7 +462,7 @@ class Jlmap { } store.commit('map/mapStationStateUpdate'); } else { - if (elem.deviceType === 'TRAIN') { + if (elem.deviceType === 'TRAIN') { this.isUpdateShowTrainList = true; store.commit('map/updateActiveTrainList', elem); } else if (elem.deviceType === 'STAND') { @@ -469,34 +473,34 @@ class Jlmap { this.$painter.update(psdDevice); } } else if (elem.deviceType == 'SWITCH') { - const oDevice = this.mapDevice[code] - if (oDevice) { - const sectionA = this.mapDevice[oDevice.sectionACode]; - const sectionB = this.mapDevice[oDevice.sectionBCode]; - const sectionC = this.mapDevice[oDevice.sectionCCode]; - if (sectionA && sectionB && sectionC) { - oDevice['cutOff'] = sectionA.cutOff; - } - } + const oDevice = this.mapDevice[code]; + if (oDevice) { + const sectionA = this.mapDevice[oDevice.sectionACode]; + const sectionB = this.mapDevice[oDevice.sectionBCode]; + const sectionC = this.mapDevice[oDevice.sectionCCode]; + if (sectionA && sectionB && sectionC) { + oDevice['cutOff'] = sectionA.cutOff; + } + } - this.$painter.update(oDevice); - } else if (elem.deviceType == 'SECTION') { - const oDevice = this.mapDevice[code] - if (oDevice) { - const sDevice = this.mapDevice[oDevice.relSwitchCode]; - if (sDevice) { - const sectionA = this.mapDevice[sDevice.sectionACode]; - const sectionB = this.mapDevice[sDevice.sectionBCode]; - const sectionC = this.mapDevice[sDevice.sectionCCode]; - if (sectionA && sectionB && sectionC) { - sDevice['cutOff'] = sectionA.cutOff; - } + this.$painter.update(oDevice); + } else if (elem.deviceType == 'SECTION') { + const oDevice = this.mapDevice[code]; + if (oDevice) { + const sDevice = this.mapDevice[oDevice.relSwitchCode]; + if (sDevice) { + const sectionA = this.mapDevice[sDevice.sectionACode]; + const sectionB = this.mapDevice[sDevice.sectionBCode]; + const sectionC = this.mapDevice[sDevice.sectionCCode]; + if (sectionA && sectionB && sectionC) { + sDevice['cutOff'] = sectionA.cutOff; + } - this.$painter.update(sDevice); - codeList.push(sDevice.code); - } - } - } else if (elem.deviceType === 'DIRECTION_ROD' && elem.uniqueCode) { + this.$painter.update(sDevice); + codeList.push(sDevice.code); + } + } + } else if (elem.deviceType === 'DIRECTION_ROD' && elem.uniqueCode) { store.state.map.map.directionRodList.forEach(item => { if (elem.uniqueCode === item.uniqueCode) { const updateRod = this.mapDevice[item.code]; @@ -504,17 +508,17 @@ class Jlmap { this.$painter.update(updateRod); } }); - } + } - const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); + const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); if (elem.dispose) { this.$painter.delete(oDevice); } else { this.$painter.update(oDevice); - } - } + } + } - codeList.push(code); + codeList.push(code); }); if (controlTransferList.length > 0) { @@ -524,11 +528,11 @@ class Jlmap { if (this.isUpdateShowTrainList) { store.dispatch('map/setActiveTrainList'); this.isUpdateShowTrainList = false; - } + } - if (selected && codeList.includes(selected.code)) { - store.commit('menuOperation/setSelected', {device: {...selected}}); - } + if (selected && codeList.includes(selected.code)) { + store.commit('menuOperation/setSelected', {device: {...selected}}); + } this.handleRouteSignalStatus(signalDeviceList); diff --git a/src/jmapNew/shape/Arrow/index.js b/src/jmapNew/shape/Arrow/index.js index 96fa09298..2881442e6 100644 --- a/src/jmapNew/shape/Arrow/index.js +++ b/src/jmapNew/shape/Arrow/index.js @@ -62,4 +62,8 @@ export default class Arrow extends Group { this.isShowShape = false; } } + getAnchorPoint() { + const rect = this.arrow.getBoundingRect(); + return { x:rect.x, y:rect.y }; + } } diff --git a/src/jmapNew/shape/AutoTurnBack/index.js b/src/jmapNew/shape/AutoTurnBack/index.js index 592318814..e39745909 100644 --- a/src/jmapNew/shape/AutoTurnBack/index.js +++ b/src/jmapNew/shape/AutoTurnBack/index.js @@ -207,4 +207,7 @@ export default class AutoTurnBack extends Group { screenShow() { this.hideMode(); } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/AutomacticRoute/index.js b/src/jmapNew/shape/AutomacticRoute/index.js index 218af519b..0611445f9 100644 --- a/src/jmapNew/shape/AutomacticRoute/index.js +++ b/src/jmapNew/shape/AutomacticRoute/index.js @@ -156,4 +156,7 @@ export default class AutomacticRoute extends Group { this.text && this.text.hide(); this.subtitleText && this.subtitleText.hide(); } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/AxleReset/index.js b/src/jmapNew/shape/AxleReset/index.js index ed8361b3f..97b22a44f 100644 --- a/src/jmapNew/shape/AxleReset/index.js +++ b/src/jmapNew/shape/AxleReset/index.js @@ -151,4 +151,7 @@ export default class AxleReset extends Group { this.text && this.text.hide(); this.subtitleText && this.subtitleText.hide(); } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/Cross/index.js b/src/jmapNew/shape/Cross/index.js deleted file mode 100644 index 5ec05182c..000000000 --- a/src/jmapNew/shape/Cross/index.js +++ /dev/null @@ -1,95 +0,0 @@ -import Group from 'zrender/src/container/Group'; -import Polyline from 'zrender/src/graphic/shape/Polyline'; - -export default class Cross extends Group { - // _type: 'Cross', - // code: getUID('Cross', this.crossList), - // position:each.position, - // relatedSwitch:each.relatedSwitch - constructor(model, style) { - super(); - this._code = model.code; - this._type = model._type; - this.zlevel = model.zlevel; - this.z = 0; - this.model = model; - this.style = style; - this.isShowShape = true; - this.create(); - this.setState(model); - } - - create() { - const model = this.model; - // position; - // relatedSwitch; - // model.position.x, - // model.position.y, - // const relatedSwitchList = model.relatedSwitch; - const offset = this.style.Section.line.width / (2 * 0.7071); - const points = [ - [model.position.x, model.position.y + offset], - [model.position.x + offset, model.position.y + offset], - [model.position.x, model.position.y + 2 * offset], - [model.position.x - offset, model.position.y + offset], - [model.position.x, model.position.y + offset] - ]; - this.centerSquare = new Polyline({ - zlevel: this.zlevel, - z:this.z + 1, - shape: { - points:points - }, - style: { - stroke: this.style.Cross.centerSquare.defaultColor, - fill:this.style.Cross.centerSquare.defaultColor - } - }); - this.add(this.centerSquare); - // let relatedSwitchList[0].sectionCCode - // if (model && model.points.length > 1) { - // const points = []; - // const modelPoints = model.points; - // const length = modelPoints.length; - // for (let i = 0; i < length; i++) { - // points.push([modelPoints[i].x, modelPoints[i].y]); - // } - // this.segment = new Polyline({ - // zlevel: this.zlevel, - // z:this.z, - // shape: { - // points:points - // }, - // style: { - // lineWidth: model.width, - // stroke: model.lineColor || this.style.lineColor - // } - // }); - // this.add(this.segment); - // } - } - - setLineType(type) { - switch (type) { - case '01': break; - case '02': - this.segment && this.segment.setStyle('lineDash', this.style.lineDash || [4]); - break; - } - } - - setState(model) { - if (!this.isShowShape) return; - this.setLineType(model.type); - } - setShowStation(stationCode) { - if (!stationCode || this.model.stationCode === stationCode) { - this.segment && this.segment.show(); - this.isShowShape = true; - this.setState(this.model); - } else { - this.segment && this.segment.hide(); - this.isShowShape = false; - } - } -} diff --git a/src/jmapNew/shape/DirectionRod/index.js b/src/jmapNew/shape/DirectionRod/index.js index 1f9e71681..4be0054a1 100644 --- a/src/jmapNew/shape/DirectionRod/index.js +++ b/src/jmapNew/shape/DirectionRod/index.js @@ -114,4 +114,8 @@ export default class DirectionRod extends Group { this.rod && this.rod.hide(); this.tipText && this.tipText.hide(); } + getAnchorPoint() { + const rect = this.rod.getBoundingRect(); + return {x: rect.x, y: rect.y}; + } } diff --git a/src/jmapNew/shape/FloodGate/index.js b/src/jmapNew/shape/FloodGate/index.js index ca2992e10..41a821452 100644 --- a/src/jmapNew/shape/FloodGate/index.js +++ b/src/jmapNew/shape/FloodGate/index.js @@ -76,4 +76,7 @@ export default class FloodGate extends Group { hideMode() { this.floodGate && this.floodGate.hide(); } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/GuideLock/index.js b/src/jmapNew/shape/GuideLock/index.js index 9fee9be78..290f68eda 100644 --- a/src/jmapNew/shape/GuideLock/index.js +++ b/src/jmapNew/shape/GuideLock/index.js @@ -156,4 +156,7 @@ export default class GuideLock extends Group { this.text && this.text.hide(); this.subtitleText && this.subtitleText.hide(); } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/LcControl/index.js b/src/jmapNew/shape/LcControl/index.js index 130afab8e..13f008327 100644 --- a/src/jmapNew/shape/LcControl/index.js +++ b/src/jmapNew/shape/LcControl/index.js @@ -88,4 +88,7 @@ export default class LcControl extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/LimitControl/index.js b/src/jmapNew/shape/LimitControl/index.js index a5577c44d..56f3f845c 100644 --- a/src/jmapNew/shape/LimitControl/index.js +++ b/src/jmapNew/shape/LimitControl/index.js @@ -93,4 +93,7 @@ export default class LimitControl extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/Line/index.js b/src/jmapNew/shape/Line/index.js index 2f62894be..129777580 100644 --- a/src/jmapNew/shape/Line/index.js +++ b/src/jmapNew/shape/Line/index.js @@ -20,23 +20,58 @@ export default class Line2 extends Group { const model = this.model; if (model && model.points.length > 1) { const points = []; + const vicePoints = []; const modelPoints = model.points; const length = modelPoints.length; - for (let i = 0; i < length; i++) { - points.push([modelPoints[i].x, modelPoints[i].y]); - } - this.segment = new Polyline({ - zlevel: this.zlevel, - z:this.z, - shape: { - points:points - }, - style: { - lineWidth: model.width, - stroke: model.lineColor || this.style.lineColor + const path = window.location.href; + if (model.type === '03' && !path.includes('/map/draw')) { + for (let i = 0; i < length; i++) { + points.push([modelPoints[i].x + 10, modelPoints[i].y]); } - }); - this.add(this.segment); + this.segment = new Polyline({ + zlevel: this.zlevel, + z:this.z, + shape: { + points:points + }, + style: { + lineWidth: model.width, + stroke: model.lineColor || this.style.lineColor + } + }); + this.add(this.segment); + for (let i = 0; i < length; i++) { + vicePoints.push([modelPoints[i].x - model.offsetX, modelPoints[i].y + model.offsetY]); + } + this.viceSegment = new Polyline({ + zlevel: this.zlevel, + z:this.z, + shape: { + points:vicePoints + }, + style: { + lineWidth: model.width, + stroke: model.lineColor || this.style.lineColor + } + }); + this.add(this.viceSegment); + } else { + for (let i = 0; i < length; i++) { + points.push([modelPoints[i].x, modelPoints[i].y]); + } + this.segment = new Polyline({ + zlevel: this.zlevel, + z:this.z, + shape: { + points:points + }, + style: { + lineWidth: model.width, + stroke: model.lineColor || this.style.lineColor + } + }); + this.add(this.segment); + } } } @@ -46,6 +81,10 @@ export default class Line2 extends Group { case '02': this.segment && this.segment.setStyle('lineDash', this.style.lineDash || [4]); break; + case '03': + this.segment && this.segment.setStyle('lineDash', this.style.lineDash || [4]); + this.viceSegment && this.viceSegment.setStyle('lineDash', this.style.lineDash || [4]); + break; } } @@ -59,18 +98,30 @@ export default class Line2 extends Group { const showConditions = this.model.showConditions; if (!showConditions || showConditions === '01' || showMode === showConditions) { this.segment && this.segment.show(); + this.viceSegment && this.viceSegment.show(); } else { this.segment && this.segment.hide(); + this.viceSegment && this.viceSegment.hide(); } } setShowStation(stationCode) { if (!stationCode || this.model.stationCode === stationCode) { this.segment && this.segment.show(); + this.viceSegment && this.viceSegment.show(); this.isShowShape = true; this.setState(this.model); } else { this.segment && this.segment.hide(); + this.viceSegment && this.viceSegment.hide(); this.isShowShape = false; } } + getAnchorPoint() { + if (this.segment) { + const rect = this.segment.getBoundingRect(); + return {x:rect.x, y:rect.y}; + } else { + return {x:0, y:0}; + } + } } diff --git a/src/jmapNew/shape/OutFrame/index.js b/src/jmapNew/shape/OutFrame/index.js index 691d66f17..8a575ebf0 100644 --- a/src/jmapNew/shape/OutFrame/index.js +++ b/src/jmapNew/shape/OutFrame/index.js @@ -69,4 +69,10 @@ export default class OutFrame extends Group { screenShow() { this.box && this.box.hide(); } + getAnchorPoint() { + return { + x: this.model.position.x - this.model.width / 2, + y: this.model.position.y - this.model.height / 2 + }; + } } diff --git a/src/jmapNew/shape/OverAp/index.js b/src/jmapNew/shape/OverAp/index.js index a718bf898..12b102742 100644 --- a/src/jmapNew/shape/OverAp/index.js +++ b/src/jmapNew/shape/OverAp/index.js @@ -78,4 +78,8 @@ export default class OverAp extends Group { screenShow() { } + getAnchorPoint() { + const rect = this.getBoundingRect(); + return {x: rect.x, y: rect.y}; + } } diff --git a/src/jmapNew/shape/Power/index.js b/src/jmapNew/shape/Power/index.js index 8cd14cbd9..4d937df4a 100644 --- a/src/jmapNew/shape/Power/index.js +++ b/src/jmapNew/shape/Power/index.js @@ -153,4 +153,8 @@ export default class Line2 extends Group { child.hide(); }); } + getAnchorPoint() { + const rect = this.getBoundingRect(); + return {x: rect.x, y: rect.y}; + } } diff --git a/src/jmapNew/shape/Psd/index.js b/src/jmapNew/shape/Psd/index.js index 818ac3a07..1312fc2c1 100644 --- a/src/jmapNew/shape/Psd/index.js +++ b/src/jmapNew/shape/Psd/index.js @@ -82,4 +82,7 @@ export default class Line2 extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/Resource/index.js b/src/jmapNew/shape/Resource/index.js index c4887e6e0..0568bb018 100644 --- a/src/jmapNew/shape/Resource/index.js +++ b/src/jmapNew/shape/Resource/index.js @@ -79,4 +79,7 @@ export default class Resource extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/Responder/index.js b/src/jmapNew/shape/Responder/index.js index 16d97da9e..f004f86f0 100644 --- a/src/jmapNew/shape/Responder/index.js +++ b/src/jmapNew/shape/Responder/index.js @@ -31,6 +31,7 @@ export default class Responder extends Group { this.model = model; this.style = style; this.isShowShape = true; + this.anchorPoint = {x: 0, y: 0}; this.z = model.z || 19; if (model.previewOrMapDraw) { this.create(); @@ -40,19 +41,20 @@ export default class Responder extends Group { create() { const model = this.model; - const responderStyle = this.style.Responder || defaultStyle; - const radian = -Math.PI / 180 * Number(model.rotate-90); + const responderStyle = this.style.Responder || defaultStyle; + const radian = -Math.PI / 180 * Number(model.rotate - 90); const distanceX = -responderStyle.distance * Math.cos(radian); const distanceY = -responderStyle.distance * Math.sin(radian); 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 textRadian = -Math.PI / 180 * Number(180-model.textRotate); - const textDistanceX = model.textOffset.y * Math.sin(textRadian) + model.textOffset.x * Math.cos(textRadian); - const textDistanceY = model.textOffset.y * Math.cos(textRadian) - model.textOffset.x * Math.sin(textRadian); - const textX = blockX + textDistanceX + blockWidth; + const blockY = model.position.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); + const textDistanceY = model.textOffset.y * Math.cos(textRadian) - model.textOffset.x * Math.sin(textRadian); + const textX = blockX + textDistanceX + blockWidth; const textY = blockY + textDistanceY; const textName = `${model.type}-${model.name}`; const textFill = responderStyle.text.textFill; @@ -106,27 +108,27 @@ export default class Responder extends Group { this.text = this.name = new Text({ zlevel: this.zlevel, - z: this.z + 1, + z: this.z + 1, style: { - x: textX, - y: textY, - text: textName, - fontFamily: this.style.fontFamily, - fontSize: this.style.fontSize, - textFill: textFill, - textAlign: 'left' - } - }); + x: textX, + y: textY, + text: textName, + fontFamily: this.style.fontFamily, + fontSize: this.style.fontSize, + textFill: textFill, + textAlign: 'left' + } + }); if (model.rotate) { - const rotation = -Math.PI / 180 * Number(model.rotate+180); + const rotation = -Math.PI / 180 * Number(model.rotate + 180); [this.block, this.delta1, this.delta2].forEach(el => { this.transformRotation(el, origin, rotation); }); } if (model.textRotate) { - const rotation = -Math.PI / 180 * Number(model.textRotate+180); + const rotation = -Math.PI / 180 * Number(model.textRotate + 180); this.transformRotation(this.text, origin, rotation); } @@ -174,4 +176,7 @@ export default class Responder extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.anchorPoint; + } } diff --git a/src/jmapNew/shape/SaidLamp/index.js b/src/jmapNew/shape/SaidLamp/index.js index d50500d80..c070109e1 100644 --- a/src/jmapNew/shape/SaidLamp/index.js +++ b/src/jmapNew/shape/SaidLamp/index.js @@ -229,6 +229,8 @@ export default class SaidLamp extends Group { .when(2000, { fill: this.style.backgroundColor }) .start(); } - + } + getAnchorPoint() { + return this.model.position; } } diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index 66ed85060..260cc43c8 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -154,9 +154,9 @@ export default class Section extends Group { /** 非通信车占用状态 03*/ unCommunicationOccupied() { - if (this.style.Section.preAxleIgnoreFault && this.model.preReset) { - return ; - } + if (this.style.Section.preAxleIgnoreFault && this.model.preReset) { + return; + } if (this.line) { this.line.setStyle({ @@ -174,9 +174,9 @@ export default class Section extends Group { } /** ARB故障 */ invalid() { - if (this.style.Section.preAxleIgnoreFault && this.model.preReset) { - return ; - } + if (this.style.Section.preAxleIgnoreFault && this.model.preReset) { + return; + } this.line && this.line.setStyle({ stroke: this.style.Section.line.invalidColor, @@ -300,7 +300,7 @@ export default class Section extends Group { if (this.style.Section.sectionMiddle && this.style.Section.sectionMiddle.preResetColor && !blockade) { // 南京二号线 this.sectionMiddle.setStyle({stroke: this.style.Section.sectionMiddle.preResetColor}); this.sectionMiddle.show(); - } + } } // 延时解锁 delayUnlock() { @@ -364,13 +364,13 @@ export default class Section extends Group { setState(model, flag = false) { if (!this.isShowShape) return; this.recover(); - this.handleSwitchSection(model, flag); + this.handleSwitchSection(model, flag); // 顺序代表优先级 /** 道岔保护区段锁闭 */ model.overlapLock && this.protectiveLock(model.lockRight); /** 空闲锁闭或者叫进路锁闭 */ model.routeLock && this.routeLock(model.lockRight); - /** 计轴故障 */ + /** 计轴故障 */ model.invalid && this.invalid(); /** 轨道封锁 */ model.blockade && this.block(model.routeLock); @@ -519,4 +519,11 @@ export default class Section extends Group { this.isShowShape = false; } } + getAnchorPoint() { + const rect = this.getBoundingRect(); + return { + x:rect.x, + y:rect.y + }; + } } diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 89c390695..965e0064a 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -954,6 +954,12 @@ class Signal extends Group { setLowButtonRecover() { this.lowButton && this.lowButton.setLowButtonRecover(); } + getAnchorPoint() { + return { + x:this.model.position.x + this.model.positionPoint.x, + y:this.model.position.y + this.model.positionPoint.y + }; + } } export default Signal; diff --git a/src/jmapNew/shape/SplitStation/index.js b/src/jmapNew/shape/SplitStation/index.js index 56ed27116..78e7db101 100644 --- a/src/jmapNew/shape/SplitStation/index.js +++ b/src/jmapNew/shape/SplitStation/index.js @@ -152,4 +152,7 @@ export default class SplitStation extends Group { child.hide(); }); } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index 4bc8841a8..ba3dfaa88 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -402,6 +402,17 @@ export default class Station extends Group { this.stationText.setColor('#fff'); } + handleInterlock() { // 联锁控 成都三号线 + this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.emergencyControl && this.emergencyControl.setTextColor(this.style.Station.StationControl.lamp.grayColor); + this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.lamp.grayColor); + this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.lamp.grayColor); + this.interconnectedControl && this.interconnectedControl.setColor(this.style.Station.StationControl.lamp.purpleColor); + this.interconnectedControl && this.interconnectedControl.setTextColor(this.style.Station.StationControl.lamp.purpleColor); + } + handleNone() { // 空 if (this.style.Station.stationText.noneModeColor) { this.stationText.setColor(this.style.Station.stationText.noneModeColor); @@ -418,6 +429,8 @@ export default class Station extends Group { this.substationControl && this.substationControl.setTextColor(this.style.Station.StationControl.text.fontColor); this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.centerControl && this.centerControl.setTextColor(this.style.Station.StationControl.text.fontColor); + this.interconnectedControl && this.interconnectedControl.setColor(this.style.Station.StationControl.lamp.grayColor); + this.interconnectedControl && this.interconnectedControl.setTextColor(this.style.Station.StationControl.text.fontColor); this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); @@ -460,27 +473,27 @@ export default class Station extends Group { // } getShapeTipPoint(opts) { - let rect; - switch(opts.subDeviceType) { - case 'button': - rect = this.centerControlButton.getArcBoundingRect(); - break; - case 'center': - rect = this.centerControl.getArcBoundingRect(); - break; - case 'substation': - rect = this.substationControl.getArcBoundingRect(); - break; - case 'emergency': - rect = this.emergencyControl.getArcBoundingRect() - break; - case 'interconnected': - rect = this.interconnectedControl.getArcBoundingRect() - break; - default: - rect = this.stationText.getBoundingRect(); - break; - } + let rect; + switch (opts.subDeviceType) { + case 'button': + rect = this.centerControlButton.getArcBoundingRect(); + break; + case 'center': + rect = this.centerControl.getArcBoundingRect(); + break; + case 'substation': + rect = this.substationControl.getArcBoundingRect(); + break; + case 'emergency': + rect = this.emergencyControl.getArcBoundingRect(); + break; + case 'interconnected': + rect = this.interconnectedControl.getArcBoundingRect(); + break; + default: + rect = this.stationText.getBoundingRect(); + break; + } return { x: rect.x + rect.width, @@ -542,4 +555,7 @@ export default class Station extends Group { this.eachChild(elem => { elem.hide(); }); } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/StationCounter/index.js b/src/jmapNew/shape/StationCounter/index.js index 9f6217d11..b523a4439 100644 --- a/src/jmapNew/shape/StationCounter/index.js +++ b/src/jmapNew/shape/StationCounter/index.js @@ -103,5 +103,8 @@ export default class StationCounter extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/StationDelayUnlock/index.js b/src/jmapNew/shape/StationDelayUnlock/index.js index df90f1276..8fdd0faa8 100644 --- a/src/jmapNew/shape/StationDelayUnlock/index.js +++ b/src/jmapNew/shape/StationDelayUnlock/index.js @@ -121,4 +121,7 @@ export default class StationDelayUnlock extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index 4763a1d15..b49de4e9a 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -184,12 +184,12 @@ class StationStand extends Group { } case 'trainSetButton': { rect = this.trainSetButton.getBoundingRect(); - break; - } - case 'StationPlatform': { - rect = this.stationPlatform.getBoundingRect(); - break - } + break; + } + case 'StationPlatform': { + rect = this.stationPlatform.getBoundingRect(); + break; + } default: { rect = this.getBoundingRect(); break; @@ -238,5 +238,8 @@ class StationStand extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } export default StationStand; diff --git a/src/jmapNew/shape/StationTurnBack/index.js b/src/jmapNew/shape/StationTurnBack/index.js index 2e172d54c..01f0c0624 100644 --- a/src/jmapNew/shape/StationTurnBack/index.js +++ b/src/jmapNew/shape/StationTurnBack/index.js @@ -185,4 +185,7 @@ export default class StationTurnBack extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index a77f492cf..8eb0c563a 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -745,4 +745,7 @@ export default class Switch extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.intersection; + } } diff --git a/src/jmapNew/shape/Text/index.js b/src/jmapNew/shape/Text/index.js index 6200f61ec..a17787a33 100644 --- a/src/jmapNew/shape/Text/index.js +++ b/src/jmapNew/shape/Text/index.js @@ -89,4 +89,7 @@ export default class Text2 extends Group { this.text && this.text.show(); } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/shape/Train/index.js b/src/jmapNew/shape/Train/index.js index 1e8a3d99a..39b2a5005 100644 --- a/src/jmapNew/shape/Train/index.js +++ b/src/jmapNew/shape/Train/index.js @@ -454,4 +454,7 @@ export default class Train extends Group { // // this.text && this.text.hide(); // this.setState(this.model); // } + getAnchorPoint() { + return this.point; + } } diff --git a/src/jmapNew/shape/TrainWindow/index.js b/src/jmapNew/shape/TrainWindow/index.js index 704660992..67322c388 100644 --- a/src/jmapNew/shape/TrainWindow/index.js +++ b/src/jmapNew/shape/TrainWindow/index.js @@ -98,6 +98,9 @@ class TrainWindow extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.point || this.model.position; + } } export default TrainWindow; diff --git a/src/jmapNew/shape/ZcControl/index.js b/src/jmapNew/shape/ZcControl/index.js index 6be973b52..546c799ab 100644 --- a/src/jmapNew/shape/ZcControl/index.js +++ b/src/jmapNew/shape/ZcControl/index.js @@ -112,4 +112,7 @@ export default class ZcControl extends Group { this.isShowShape = false; } } + getAnchorPoint() { + return this.model.position; + } } diff --git a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue index 19eb832ab..bdd19f30a 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue @@ -217,7 +217,7 @@ export default { } }, beforeDestroy() { - this.buttonDown(this.Command.cancel.clearMbm.operation); + this.resetMbmButton(); }, methods: { passWordCommit(data) { @@ -325,6 +325,11 @@ export default { }); } }, + resetMbmButton() { + this.commandTypeList = []; + this.$store.dispatch('menuOperation/setButtonOperation', null); + Handler.clear(); // 清空操作组 + }, // 排列进路 OR 信号重开操作 arrangementRouteOperation(deviceList) { const operate = { @@ -384,7 +389,6 @@ export default { }, // handelFunctionButton(model, subType) { - // debugger; const operate = { over: true, operation: this.$store.state.menuOperation.buttonOperation, @@ -428,17 +432,26 @@ export default { operate.param = {stationCodes: [model.code]}; operate.code = model.code; break; + case 'interconnected': + // operate.cmdType = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL; + delete operate.over; + operate.subType = 'interconnected'; + operate.param = {stationCodes: [model.code]}; + operate.code = model.code; + break; } } this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { // 判断是否需要 弹窗密码框 // const operate = Object.assign({}, operate); - if (subType == 'center' || subType == 'emergency') { + if (subType == 'center ' || subType == 'emergency' || subType == 'interconnected' ) { operate['operateNext'] = operate.operation = this.Command.close.password.operation; if (subType == 'center') { operate['nextCmdType'] = CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL; - } else { + } else if (subType == 'emergency') { operate['nextCmdType'] = CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL; + } else { + operate['nextCmdType'] = CMD.ControlConvertMenu.CMD_CM_INTERLOCK_CONTROL; } this.$refs.password.doShow(operate); } @@ -651,7 +664,9 @@ export default { } else { operate.cmdType = CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK; } - this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => {}).catch((error) => { + this.$store.dispatch('training/nextNew', operate).then(({valid, response}) => { + this.resetMbmButton(); + }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); diff --git a/src/jmapNew/theme/chengdu_03/operationConfig.js b/src/jmapNew/theme/chengdu_03/operationConfig.js index 8fdb9bb75..d233080a4 100644 --- a/src/jmapNew/theme/chengdu_03/operationConfig.js +++ b/src/jmapNew/theme/chengdu_03/operationConfig.js @@ -82,7 +82,7 @@ export default { operateType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL.value, skinCode: '04', trainingName: '请求中控({2})', - trainingRemark: '请求请求中控功能', + trainingRemark: '请求中控功能', trainingType: 'ControlConvertMenu', productTypes: ['01'], stepVOList: [ @@ -91,6 +91,21 @@ export default { { deviceType: '04', orderNum: 3, operateCode: '0011', tip: '输入密码123,点击【确定】按钮' } ] }, + { + maxDuration: 15, + minDuration: 8, + operateType: CMD.ControlConvertMenu.CMD_CM_INTERLOCK_CONTROL.value, + skinCode: '04', + trainingName: '请求联锁控({2})', + trainingRemark: '请求联锁控功能', + trainingType: 'ControlConvertMenu', + productTypes: ['01'], + stepVOList: [ + { deviceType: '04', orderNum: 1, operateCode: '2993', tip: '鼠标左键点击【功能按钮】' }, + { deviceType: '04', orderNum: 2, operateCode: '2993', tip: '鼠标左键点击【联锁控】', codeType:'STATION', subType:'interconnected' }, + { deviceType: '04', orderNum: 3, operateCode: '0011', tip: '输入密码123,点击【确定】按钮' } + ] + }, // 信号机列表 { maxDuration: 15, @@ -878,23 +893,42 @@ export default { ], // 成都三号线 特殊配置 类似于哈尔滨线的 atp/联锁进路 配置 config:{autoCycleBT:true} + }, + /** 引导总锁 */ + { + maxDuration: 15, + minDuration: 8, + operateType: CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK.value, + skinCode: '04', + trainingName: '引导总锁({26})', + trainingRemark: '设置引导总锁', + trainingType: 'Station', + productTypes: ['01'], + stepVOList: [ + { deviceType: '04', orderNum: 1, operateCode: '609', tip: '鼠标左键点击【引导总锁】' }, + { deviceType: '04', orderNum: 2, operateCode: '0011', tip: '输入密码123,点击【确定】按钮' }, + { deviceType: '04', orderNum: 3, operateCode: '609', tip: '鼠标左键点击【{26}】', codeType:'BUTTON' } + ], + config:{guideTotalLockBT:true} + }, + /** 取消引导总锁 */ + { + maxDuration: 15, + minDuration: 8, + operateType: CMD.Station.CMD_STATION_CANCEL_MASTER_GUIDE_LOCK.value, + skinCode: '04', + trainingName: '取消引导总锁({26})', + trainingRemark: '取消引导总锁', + trainingType: 'Station', + productTypes: ['01'], + stepVOList: [ + { deviceType: '04', orderNum: 1, operateCode: '609', tip: '鼠标左键点击【引导总锁】' }, + { deviceType: '04', orderNum: 2, operateCode: '0011', tip: '输入密码123,点击【确定】按钮' }, + { deviceType: '04', orderNum: 3, operateCode: '609', tip: '鼠标左键点击【{26}】', codeType:'BUTTON' } + ], + config:{guideTotalLockBT:true} } - /** 暂时不生成实训 */ - // { - // maxDuration: 15, - // minDuration: 8, - // operateType: CMD.Station.CMD_STATION_SET_MASTER_GUIDE_LOCK.value, - // skinCode: '04', - // trainingName: '引导总锁({3})', - // trainingRemark: '进路办理引导总锁', - // trainingType: 'Station', - // productTypes: ['01'], - // stepVOList: [ - // { deviceType: '04', orderNum: 1, operateCode: '1190', tip: '鼠标左键点击【引导总锁】' }, - // { deviceType: '04', orderNum: 2, operateCode: '0011', tip: '输入密码123,点击【确定】按钮' }, - // { deviceType: '04', orderNum: 3, operateCode: '1190', tip: '鼠标左键点击【{5}】', codeType:'GUIDELOCK' } - // ] - // } - + // totalGuideLock + // ] }; diff --git a/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue b/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue index 5933ed149..ff98f626a 100644 --- a/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue +++ b/src/jmapNew/theme/components/menus/dialog/stationCmdControl.vue @@ -104,7 +104,8 @@ export default { message: '', timeCountCommand: -1, timeCountConfirm: -1, - stationName: '' + stationName: '', + selected: {} }; }, computed: { @@ -232,6 +233,7 @@ export default { methods: { doShow(operate, selected) { if (!this.dialogShow) { + this.selected = selected; this.stationName = ''; if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { this.stationName = selected.name; diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmTip.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmTip.vue index 3c867e6fd..aee04f305 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmTip.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/childDialog/confirmTip.vue @@ -25,13 +25,16 @@