diff --git a/src/api/jmap/map.js b/src/api/jmap/map.js index f3026cbf5..28ab6b000 100644 --- a/src/api/jmap/map.js +++ b/src/api/jmap/map.js @@ -264,3 +264,10 @@ export function getSectionListByStationCode(id, stationCode) { method: 'get' }); } +/** 查询地图下所有的区段 */ +export function getSectionListByMapId(id) { + return request({ + url: `/api/map/${id}/sections`, + method: 'get' + }); +} diff --git a/src/api/simulation.js b/src/api/simulation.js index 9b81181df..a02097d8a 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -221,9 +221,9 @@ export function executeScriptNew(group) { } /** 处理ibp盘事件 */ -export function handlerIbpEvent(group, button, stationCode) { +export function handlerIbpEvent(group, button, stationCode, buttonCode) { return request({ - url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}`, + url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}&buttonCode=${buttonCode}`, method: 'put' }); } diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index cf5d1a42a..10db168cc 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -495,6 +495,7 @@ export default class Station extends Group { 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.controlPreReset && this.controlPreReset.setColor(this.style.Station.StationControl.lamp.grayColor); this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); @@ -522,6 +523,7 @@ export default class Station extends Group { // }); // // // } + model.preResetValidDuration && this.handlePreResetLamp(); model.controller && this.handleComplexControl(model.controller); if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller) && model.centralized) { model.chargeStationCodeList.forEach(item => { @@ -544,7 +546,9 @@ export default class Station extends Group { }); } } - + handlePreResetLamp() { + this.controlPreReset && this.controlPreReset.setColor('#f00'); + } handleComplexControl(controller) { const memberData = store.state.training.memberData; if (memberData[controller].userId) { diff --git a/src/jmapNew/shape/StationTurnBack/index.js b/src/jmapNew/shape/StationTurnBack/index.js index 4ae460803..e7cc18eab 100644 --- a/src/jmapNew/shape/StationTurnBack/index.js +++ b/src/jmapNew/shape/StationTurnBack/index.js @@ -13,11 +13,11 @@ export default class StationTurnBack extends Group { this.zlevel = model.zlevel; this.z = 40; this.model = model; - this.style = style; - this.lineCode = lineCode; + this.style = style; + this.lineCode = lineCode; this.isShowShape = true; this.create(); - this.createMouseEvent(); + this.createMouseEvent(); this.setState(model); this.setShowMode(); } @@ -75,7 +75,7 @@ export default class StationTurnBack extends Group { textVerticalAlign: 'bottom' } }); - this.add(this.text); + this.add(this.text); } let turnName = '按计划执行'; if (this.lineCode == '03') { @@ -114,11 +114,11 @@ export default class StationTurnBack extends Group { } } - createMouseEvent() { + createMouseEvent() { if (this.style.LcControl.mouseOverStyle) { - this.mouseEvent = new EMouse(this); + this.mouseEvent = new EMouse(this); this.add(this.mouseEvent); - this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); + this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); } } @@ -158,28 +158,28 @@ export default class StationTurnBack extends Group { } } - setAshShow() { - this.control && this.control.setStyle({fill:'#FFF'}); - } + setAshShow() { + this.control && this.control.setStyle({fill:'#FFF'}); + } // 设置状态 setState(model, tbStrategyId = null) { if (!this.isShowShape) return; - this.recover(); + this.recover(); - // 只响应前端自定义类型的状态变化 - if (model._free) { - this.setAshShow() - } else { - if (tbStrategyId) { - model.tbStrategyId = tbStrategyId; - model.optionList.forEach(item => { - if (item.id == tbStrategyId) { - this.handleStatus(item.label); - } - }); - } - } + // 只响应前端自定义类型的状态变化 + if (model._free) { + this.setAshShow(); + } else { + if (tbStrategyId) { + model.tbStrategyId = tbStrategyId; + model.optionList.forEach(item => { + if (item.id == tbStrategyId) { + this.handleStatus(item.label); + } + }); + } + } } getShapeTipPoint() { const rect = this.control.getBoundingRect(); @@ -213,7 +213,11 @@ export default class StationTurnBack extends Group { return this.model.position; } - getBoundingRect() { - return this.strategyText.getBoundingRect()||this.control.getBoundingRect(); + getBoundingRect() { + if (this.strategyText && this.strategyText.getBoundingRect()) { + return this.strategyText.getBoundingRect(); + } else if (this.control && this.control.getBoundingRect()) { + return this.control.getBoundingRect(); + } } } diff --git a/src/jmapNew/theme/factory.js b/src/jmapNew/theme/factory.js index 9b21255df..b7551865b 100644 --- a/src/jmapNew/theme/factory.js +++ b/src/jmapNew/theme/factory.js @@ -32,7 +32,7 @@ class Theme { '11': 'all', '12': 'all', '13':'all', - '14':'all' + '14':'ecStation' }; } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue b/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue index a157ada12..726f81ac6 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuAutoTrunRoute.vue @@ -87,10 +87,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } if (this.$store.state.training.mode === TrainingMode.NORMAL) { const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const memberData = this.$store.state.training.memberData; @@ -101,6 +97,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } }, doShow(point) { this.clickEvent(); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index aa5402fa0..d60e20c46 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -184,10 +184,6 @@ export default { } else { this.menu = []; } - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') { - this.menu = this.menuForce; - } if (this.$store.state.training.mode === TrainingMode.NORMAL) { const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const memberData = this.$store.state.training.memberData; @@ -198,6 +194,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT && this.selected.type != '04') { + this.menu = this.menuForce; + } }, doShow(point) { this.clickEvent(); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index 5a5e06604..4115724ca 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -231,10 +231,6 @@ export default { }, initMenu() { this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } if (this.$store.state.training.mode === TrainingMode.NORMAL) { const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const memberData = this.$store.state.training.memberData; @@ -245,6 +241,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } }, executeConfirm(operate) { if (operate.operation === OperationEvent.Signal.unlock.confirm.operation) { diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue b/src/jmapNew/theme/ningbo_01/menus/menuStation.vue index fc3d88d1d..4f3813754 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStation.vue @@ -131,10 +131,6 @@ export default { initMenu() { if (this.selected.centralized) { this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } if (this.$store.state.training.mode === TrainingMode.NORMAL) { const memberData = this.$store.state.training.memberData; const userId = this.$store.state.user.id; @@ -144,6 +140,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } } }, doShow(point) { diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationLight.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationLight.vue index 080af2fca..689e94abd 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationLight.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationLight.vue @@ -78,10 +78,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } if (this.$store.state.training.mode === TrainingMode.NORMAL) { const memberData = this.$store.state.training.memberData; const userId = this.$store.state.user.id; @@ -92,6 +88,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } }, doShow(point) { this.clickEvent(); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationPreReset.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationPreReset.vue index 87a35d381..b6ef04548 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationPreReset.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationPreReset.vue @@ -82,10 +82,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } this.getCurrentStateObject(); if (this.$store.state.training.mode === TrainingMode.NORMAL) { const memberData = this.$store.state.training.memberData; @@ -96,6 +92,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } }, doShow(point) { this.clickEvent(); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue index 2ec60a4c3..b71c5840e 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue @@ -185,11 +185,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } if (this.$store.state.training.mode === TrainingMode.NORMAL) { const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const memberData = this.$store.state.training.memberData; @@ -200,6 +195,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } }, doShow(point) { this.clickEvent(); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationTurnBack.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationTurnBack.vue index 86aab4fdb..01dec98f4 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationTurnBack.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationTurnBack.vue @@ -80,11 +80,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } if (this.$store.state.training.mode === TrainingMode.NORMAL) { const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); const memberData = this.$store.state.training.memberData; @@ -95,6 +90,10 @@ export default { }); } } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } }, doShow(point) { this.clickEvent(); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index 542b45a8f..298dc75fe 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -186,6 +186,16 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); + if (this.$store.state.training.mode === TrainingMode.NORMAL) { + const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); + const memberData = this.$store.state.training.memberData; + const userId = this.$store.state.user.id; + if (!station.controller || !memberData[station.controller] || memberData[station.controller].userId != userId) { + this.menu.forEach(item => { + item.disabled = true; + }); + } + } // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { // if (!this.$store.state.scriptRecord.bgSet) { @@ -198,16 +208,6 @@ export default { // this.menu = this.menuForce; // } } - if (this.$store.state.training.mode === TrainingMode.NORMAL) { - const station = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode); - const memberData = this.$store.state.training.memberData; - const userId = this.$store.state.user.id; - if (!station.controller || !memberData[station.controller] || memberData[station.controller].userId != userId) { - this.menu.forEach(item => { - item.disabled = true; - }); - } - } }, doShow(point) { this.clickEvent(); diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index d30a5ab57..de77fb762 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -119,7 +119,8 @@ export const IbpOperation = { XXKM: {operate: '08', event: 'XXKM', name: '下行屏蔽门开门'}, SXKM: {operate: '10', event: 'SXKM', name: '上行屏蔽门开门'}, XXYS: {operate: '09', event: 'XXYS', name: '下行钥匙'}, - SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'} + SXYS: {operate: '11', event: 'SXYS', name: '上行钥匙'}, + PRERESET: {operate: '12', event: 'PRERESET', name: '计轴复位'} }; /** diff --git a/src/views/ibp/ibpDraw/ibpOperate/ibpButton.vue b/src/views/ibp/ibpDraw/ibpOperate/ibpButton.vue index c3c993d63..3e0c93d05 100644 --- a/src/views/ibp/ibpDraw/ibpOperate/ibpButton.vue +++ b/src/views/ibp/ibpDraw/ibpOperate/ibpButton.vue @@ -34,6 +34,16 @@ /> + + + + + {{ buttonText }} {{ $t('global.delete') }} @@ -44,6 +54,7 @@