From b5ebe1599de7a9238d860c10f2183d91ab142c6c Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 22 Dec 2020 18:16:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E9=83=BD=E4=B8=89=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=20=E7=8E=B0=E5=9C=B0=E5=B7=A5=E4=BD=9C=E7=AB=99=20=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E6=93=8D=E4=BD=9C=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/chengdu_03/menus/menuButton.vue | 45 ++++++++++++------- src/utils/mapList.js | 10 ++--- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue index 5f997ff10..db3bcf4df 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue @@ -139,8 +139,7 @@ export default { offset: {}, commandTypeList: [], cmdTypeList: [], - deviceList: [], - routeListFilter: [] + deviceList: [] }; }, computed: { @@ -268,18 +267,28 @@ export default { } }, buttonDown(operation, commandTypeList) { + // 清空当前的选择的设备 this.deviceList = []; if (operation != this.Command.cancel.clearMbm.operation) { const operate = { operation: operation }; - const operationList = [this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, this.Switch.unlock.button.operation, this.MixinCommand.unblock.button.operation, this.Station.guideLock.button.operation, this.MixinCommand.totalCancel.button.operation]; + // 以下 会弹出密码框 (总人解,区故解,道岔解封,解封按钮,总取消,引导总锁) + const operationList = [this.Signal.humanTrainRoute.button.operation, + this.Section.fault.button.operation, + this.Switch.unlock.button.operation, + this.MixinCommand.unblock.button.operation, + this.Station.guideLock.button.operation + // this.MixinCommand.totalCancel.button.operation + ]; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.operation = operation; this.commandTypeList = commandTypeList; this.$store.dispatch('menuOperation/setButtonOperation', operation); // 按钮菜单是否被按下 this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // 判断是否需要 弹窗密码框 if (operationList.includes(operation)) { operate['operateNext'] = this.Command.close.password.operation; this.$refs.password.doShow(operate); @@ -302,27 +311,24 @@ export default { }); } }, - arrangementRouteOperation(deviceList) { // 排列进路 信号重开操作 + // 排列进路 OR 信号重开操作 + arrangementRouteOperation(deviceList) { const operate = { operation: this.$store.state.menuOperation.buttonOperation }; let isArrangementRoute = false; if (deviceList.length === 1) { - this.routeListFilter = []; - this.routeList.forEach(item => { - if (item.startSignalCode === deviceList[0].code) { - this.routeListFilter.push(item); - } - }); - const signal = this.$store.getters['map/getDeviceByCode'](deviceList[0].code); + const signal = deviceList[0]; const sectionModel = this.$store.getters['map/getDeviceByCode'](signal.sectionCode); if (sectionModel) { + // 判断 信号机所在区段的 左右关联区段 是否有锁闭 const sectionLeft = this.$store.getters['map/getDeviceByCode'](sectionModel.leftSectionCode); const sectionRight = this.$store.getters['map/getDeviceByCode'](sectionModel.rightSectionCode); if (sectionLeft.routeLock || sectionRight.routeLock) { isArrangementRoute = true; } } + // 如果该信号机红灯亮 而且 所属区段左右两侧区段锁闭 执行信号重启操作 if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) { // 信号重启 operate.over = true; operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL; @@ -340,8 +346,10 @@ export default { } } else if (deviceList.length === 2) { let flag = false; - this.routeListFilter.forEach(item => { - if (item.endButtonSignalCode === deviceList[1].code) { // 结束信号机按钮对比 + this.routeList.forEach(item => { + // item.endButtonSignalCode + // 起始信号机 和 结束信号机按钮 过滤进路 + if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) { operate.over = true; operate.cmdType = CMD.Signal.CMD_SIGNAL_SET_ROUTE; operate.code = deviceList[1].code; @@ -349,7 +357,6 @@ export default { this.deviceList = []; flag = true; this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => { - this.routeListFilter = []; }).catch(() => { this.$refs.noticeInfo.doShow(); }); @@ -357,12 +364,12 @@ export default { }); if (!flag) { this.deviceList = []; - this.$refs.noticeInfo.doShow('未找到选择进路!'); + this.$refs.noticeInfo.doShow('未找到选择的进路!'); } } }, handelFunctionButton(model, subType) { - debugger; + // debugger; const operate = { over: true, operation: this.$store.state.menuOperation.buttonOperation, @@ -629,7 +636,9 @@ export default { const model = this.$store.state.menuOperation.selected; // 选择设备 const subType = this.$store.state.menuOperation.subType; // 选择设备的子元素 const switchOperation = [this.Switch.lock.button.operation, this.Switch.unlock.button.operation, this.Switch.locate.button.operation, this.Switch.reverse.button.operation]; - + if (!model._type && !model._code) { + return; + } if (buttonOperation && buttonOperation === this.MixinCommand.functionButton.button.operation) { this.handelFunctionButton(model, subType); } else { @@ -638,6 +647,7 @@ export default { if (station.controlMode == 'Local' || station.controlMode == 'Emergency') { if (buttonOperation && this.commandTypeList.includes(model._type)) { this.deviceList.push(model); + // debugger; if (buttonOperation === this.Signal.arrangementRoute.button.operation) { this.arrangementRouteOperation(this.deviceList); } else if (buttonOperation === this.MixinCommand.totalCancel.button.operation) { @@ -664,6 +674,7 @@ export default { } } else { this.clearOperate(); + this.$messageBox('请先切换到站控或紧急站控'); } } } diff --git a/src/utils/mapList.js b/src/utils/mapList.js index 211663807..7074ae0c8 100644 --- a/src/utils/mapList.js +++ b/src/utils/mapList.js @@ -20,15 +20,13 @@ export function getAutoReentryBySignalCode(signalCode, routeList, autoReentryLis const autoReentry = []; routeList.forEach(item => { if (item.startSignalCode === signalCode && item.turnBack) { - route.push(item); + route.push(item.code); } }); autoReentryList.forEach(item => { - route.forEach(it => { - if (item.turnBackRouteCode === it.code || item.turnBackRoute2Code === it.code) { - autoReentry.push(item); - } - }); + if (route.includes(item.turnBackRouteCode) || route.includes(item.turnBackRoute2Code)) { + autoReentry.push(item); + } }); return autoReentry; }