From 6e3dcf6b6569dae6b937581a0c9b0d228c231e41 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Thu, 19 Mar 2020 10:52:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=88=E5=B0=94=E6=BB=A8?= =?UTF-8?q?=E7=BA=BF=E8=B7=AF=20=E5=8C=BA=E6=AE=B5=EF=BC=8C=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E6=9C=BA=E6=93=8D=E4=BD=9C=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E7=82=B9=E5=87=BB=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/bejing_01.js | 1 + src/jmapNew/config/skinCode/chengdu_01.js | 1 + src/jmapNew/config/skinCode/chengdu_03.js | 1 + src/jmapNew/config/skinCode/fuzhou_01.js | 1 + src/jmapNew/config/skinCode/haerbin_01.js | 1 + src/jmapNew/config/skinCode/ningbo_01.js | 1 + src/jmapNew/shape/Signal/index.js | 5 +- .../theme/haerbin_01/menus/menuButton.vue | 88 ++++++++++++++++++- .../theme/haerbin_01/menus/menuSection.vue | 2 +- src/scripts/cmdPlugin/CommandEnum.js | 4 +- 10 files changed, 100 insertions(+), 5 deletions(-) diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index c54cfbb9b..32f2270cd 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -160,6 +160,7 @@ class SkinCode extends defaultStyle { checkColor: '#00FF00' // 信号字体 }, lamp: { + bgShow: false, // 是否被选中 guidName: 'defult', // 默认引导类型 stopWidth: 2, // 禁止线宽度 borderVariable: true, // 信号灯边框可变 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 53e154464..8898d626d 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -160,6 +160,7 @@ class SkinCode extends defaultStyle { checkColor: '#00FF00' // 信号保护区段检查颜色 }, lamp: { + bgShow: false, // 是否被选中 guidName: 'defult', // 默认引导类型 borderVariable: true, // 信号灯边框可变 stopWidth: 2, // 禁止线宽度 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 60e79b999..dfd3ca0b6 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -163,6 +163,7 @@ class SkinCode extends defaultStyle { checkColor: '#00FF00' // 信号保护区段检查颜色 }, lamp: { + bgShow: false, // 是否被选中 guidName: 'chengdu_03', // 成都三号线引导类型 borderVariable: true, // 信号灯边框可变 stopWidth: 2, // 禁止线宽度 diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 3d3602383..b0037b8a9 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -154,6 +154,7 @@ class SkinCode extends defaultStyle { nameBorderShow: true // 信号机名字边框显示 }, lamp: { + bgShow: false, // 是否被选中 guidName: 'defult', // 默认引导类型 stopWidth: 2, // 禁止线宽度 borderWidth: 1, // 信号灯边框线宽度 diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index e28d56634..d78eb4b11 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -155,6 +155,7 @@ class SkinCode extends defaultStyle { nameBorderShow: true // 信号机名字边框显示 }, lamp: { + bgShow: true, // 是否被选中 logicDisplayNone: true, // 逻辑点灯斜线不显示 guidName: 'defult', // 默认引导类型 stopWidth: 2, // 禁止线宽度 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index 4c04cbd03..701f76554 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -161,6 +161,7 @@ class SkinCode extends defaultStyle { checkColor: '#00FF00' // 信号保护区段检查颜色 }, lamp: { + bgShow: false, // 是否被选中 guidName: 'ningbo_01', // 默认引导类型 borderVariable: true, // 信号灯边框可变 stopWidth: 2, // 禁止线宽度 diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 205ccb0ba..c6d74f43b 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -538,7 +538,6 @@ class Signal extends Group { !model.atsControl && this.setArtificialRouteClose(); // 联锁自动进路通过 model.fleetMode && this.setAutoRouteOpen(); - debugger; } getBoundingRect() { @@ -576,6 +575,10 @@ class Signal extends Group { this.on('mouseout', () => { this.highlight.mouseout(); }); this.on('mouseover', () => { this.highlight.mouseover(); }); } + if (this.style.Signal.lamp.bgShow) { + this.highlight = new EHighlight(this); + this.add(this.highlight); + } } drawBatchSelected(selected, type) { diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index 8444252c9..b1d270e75 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -72,6 +72,7 @@ export default { data() { return { tempData: [], + oldDevice: null, // 上一次点击元素 canCommand: true, operate: '', cmdType: '', @@ -109,6 +110,16 @@ export default { { name: '取消联锁', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, operate: OperationEvent.Signal.cancelTrainRoute.menu.operation, show: false }, { name: '引导进路', cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, operate: OperationEvent.Signal.guide.menu.operation, show: false }, { name: '取消引导', cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE, operate: OperationEvent.Signal.humanTrainRoute.menu.operation, show: false } + ], + sectionParamList: [ + { name: '封锁区段', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Section.lock.menu.operation, show: false }, + { name: '解封区段', cmdType: CMD.Section.CMD_SECTION_UNBLOCK, operate: OperationEvent.Section.unlock.menu.operation, show: false }, + { name: '轨区消限', cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, operate: OperationEvent.Section.cancelSpeed.menu.operation, show: false }, + { name: '轨区设限', cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, operate: OperationEvent.Section.setSpeed.menu.operation, show: false }, + { name: '强解区段', cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, operate: OperationEvent.Section.fault.menu.operation, show: false } + ], + stationParamList: [ + { name: '关站信号', cmdType: CMD.Section.CMD_SECTION_BLOCK, operate: OperationEvent.Signal.cancelTrainRoute.menu.operation, show: false } // 流程未处理 ] }; }, @@ -125,6 +136,9 @@ export default { switch (this.selected._type) { case 'Switch': this.handleSwicthMenu(); + this.deviceHighLight(this.oldDevice, false); + this.deviceHighLight(this.selected, true); + this.oldDevice = this.selected; break; case 'Signal': if (this.oldClickObj && this.oldClickObj.code != this.selected.code) { @@ -133,11 +147,46 @@ export default { this.handleSingalMenu(); } break; + case 'Section': + this.handleSectionMenu(); + this.deviceHighLight(this.oldDevice, false); + this.deviceHighLight(this.selected, true); + this.oldDevice = this.selected; + break; + case 'Station': + this.handleStationMenu(); + this.deviceHighLight(this.oldDevice, false); + this.deviceHighLight(this.selected, true); + this.oldDevice = this.selected; + break; } } } }, methods: { + // 高亮设备 + deviceHighLight(device, flag) { + if (device && device.instance && typeof device.instance.drawSelected === 'function' ) { + if (device._type === 'Section' && device.type === '04') { + device.relevanceSectionList.forEach(item => { + const sectionModel = this.$store.getters['map/getDeviceByCode'](item); + sectionModel && sectionModel.instance.drawSelected(flag); + }); + } else if (device._type === 'Section' && device.type === '01' && device.logicSectionCodeList && device.logicSectionCodeList.length) { + device.logicSectionCodeList.forEach(item => { + const sectionModel = this.$store.getters['map/getDeviceByCode'](item); + sectionModel && sectionModel.instance.drawSelected(flag); + }); + } else { + device.instance.drawSelected(flag); + } + } else if (device) { + const model = this.$store.getters['map/getDeviceByCode'](device.code); + if (model.instance) { + model.instance.drawSelected(flag); + } + } + }, clickCommand(row) { this.clearAllMenuShow(); if (this.tempData.length) { @@ -166,6 +215,13 @@ export default { }; }, handleSingalMenu() { + this.deviceHighLight(this.oldDevice, false); + this.deviceHighLight(this.selected, true); + this.oldDevice = this.selected; + if (this.oldClickObj) { // 清除上上次信号机背景 + this.deviceHighLight(this.oldClickObj, false); + } + this.oldClickObj = deepAssign({}, this.selected); this.centralizedStationList = new Array(15).fill({}); this.signalParamList.forEach((swicth, index) => { @@ -198,10 +254,35 @@ export default { }); if (this.route && this.route.code) { this.handleRouteMenu(); + this.deviceHighLight(this.selected, true); + this.oldDevice = this.selected; } else { this.handleSingalMenu(); } }, + handleSectionMenu() { + this.centralizedStationList = new Array(15).fill({}); + this.sectionParamList.forEach((swicth, index) => { + this.centralizedStationList[index] = swicth; + }); + this.tempData = []; + this.tempData.push(this.selected); + this.param = { + sectionCode: this.selected.code, + speedLimitValue: 5 + }; + }, + handleStationMenu() { + this.centralizedStationList = new Array(15).fill({}); + this.stationParamList.forEach((swicth, index) => { + this.centralizedStationList[index] = swicth; + }); + this.tempData = []; + this.tempData.push(this.selected); + this.param = { + sectionCode: this.selected.code + }; + }, handleParam() { if (this.operate == OperationEvent.Signal.cancelTrainRoute.menu.operation || this.operate == OperationEvent.Signal.humanTrainRoute.menu.operation) { this.param = { @@ -217,7 +298,6 @@ export default { operation: this.operate, param: this.param }; - // console.log(step); this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.doClose(); @@ -228,12 +308,16 @@ export default { }); }, doClose() { + this.deviceHighLight(this.selected, false); // 当前选中 this.operate = ''; // 清空指令 this.cmdType = ''; - this.oldClickObj = null; // 清空上次点击信号机 + if (this.oldClickObj) { + this.deviceHighLight(this.oldClickObj, false); + } this.param = {}; this.tempData = []; // 清空执行栏 this.canCommand = true; // 执行变为禁用 + this.oldClickObj = null; // 清空上次点击信号机 this.clearAllMenuShow(); } } diff --git a/src/jmapNew/theme/haerbin_01/menus/menuSection.vue b/src/jmapNew/theme/haerbin_01/menus/menuSection.vue index 6e6cc8781..2a0558985 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuSection.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuSection.vue @@ -283,7 +283,7 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); // Handler.execute(CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, {}).then(resp => { - // const tempData = resp.data; + // const tempData = resp.data; this.$refs.speedCmdControl.doShow(step, this.selected); // }); } diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 1cb8e1d04..32c2bfde9 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -182,7 +182,9 @@ export default { /** 设置引导总锁 */ CMD_STATION_SET_MASTER_GUIDE_LOCK: {value: 'Station_Set_Master_Guide_Lock', label: '设置引导总锁'}, /** 取消引导总锁 */ - CMD_STATION_CANCEL_MASTER_GUIDE_LOCK: {value: 'Station_Cancel_Master_Guide_Lock', label: '取消引导总锁'} + CMD_STATION_CANCEL_MASTER_GUIDE_LOCK: {value: 'Station_Cancel_Master_Guide_Lock', label: '取消引导总锁'}, + /** 封锁车站所有信号机 */ + CMD_STATION_CANCEL_MASTER_GUIDE: {value: 'Station_Cancel_Master_Guide_Lock', label: '封锁集中站信号'} }, // 列车