diff --git a/src/components/QueryListPage/QueryListPage.vue b/src/components/QueryListPage/QueryListPage.vue index 1a5f880f5..4dfe3bd1d 100644 --- a/src/components/QueryListPage/QueryListPage.vue +++ b/src/components/QueryListPage/QueryListPage.vue @@ -291,7 +291,7 @@ export default { self.prepareExportData().then(data => { excel.export_json_to_excel(tHeader, data, self.queryForm.exportConfig.filename); self.enableQuery(); - }).catch(error => { + }).catch((error) => { self.enableQuery(); self.$message.error(`${this.$t('error.exportFailed')}: ${error.message}`); }); @@ -417,7 +417,7 @@ export default { const resultData = response.data; this.$set(this.queryList, 'data', resultData.list); this.$set(this.queryList, 'total', resultData.total); - }).catch(error => { + }).catch((error) => { self.enableQuery(); this.$message.error(`${this.$t('error.getListFailed')}:${error.message}`); }); diff --git a/src/jmap/theme/beijing_01/menus/dialog/alxeEffective.vue b/src/jmap/theme/beijing_01/menus/dialog/alxeEffective.vue index 62c8b4047..f8e3cd1a8 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/alxeEffective.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/alxeEffective.vue @@ -1,414 +1,442 @@ - - - 准备 - - - 车站 - 轨道/计轴 - - - - - - - - - - 确认 - - - - - - - 确认 - - - 车站 - 轨道/计轴 - - - - - - - - - - - - - - - - 确认 - - - - - - 操作倒计时 - - - + + + 准备 + + + 车站 + 轨道/计轴 - - 状态 + + + + + + + + + 确认 + + - - - - - + + + + 确认 + + + 车站 + 轨道/计轴 - - - 关闭 - + + + + + + + + + + + + + 确认 + - - - + + + + 操作倒计时 + + + + + + 状态 + + + + + + + + + 关闭 + + + + + \ No newline at end of file + diff --git a/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue b/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue index a331218ad..e6737e5d2 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue @@ -258,8 +258,6 @@ export default { }; this.$refs.ConfirmTip.doShow(operate); } - }).catch(error => { - console.log(error); }); }, closeMessage() { @@ -278,8 +276,6 @@ export default { this.disabledConfirm2 = false; this.timeCountConfirm = -1; // 倒计时 this.doClose(); - }).catch(error => { - console.log(error); }); } } diff --git a/src/jmap/theme/beijing_01/menus/menuSection.vue b/src/jmap/theme/beijing_01/menus/menuSection.vue index f0caab6ac..df3785d46 100644 --- a/src/jmap/theme/beijing_01/menus/menuSection.vue +++ b/src/jmap/theme/beijing_01/menus/menuSection.vue @@ -27,387 +27,387 @@ import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItem import { mouseCancelState } from './utils/menuItemStatus'; export default { - name: 'SectionMenu', - components: { - PopMenu, - SectionControl, - SectionCmdControl, - SpeedLimitControl, - SpeedCmdControl, - TrainCreate, - AlxeEffective, - NoticeInfo - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [ - { - label: '区段故障解锁', - handler: this.fault, - disabledCallback: MenuDisabledState.Section.fault, - auth: { station: true, center: false } - }, - { - label: '区段激活', - handler: this.active, - disabledCallback: MenuDisabledState.Section.active, - auth: { station: true, center: false } - }, - { - label: '区段切除', - handler: this.split, - disabledCallback: MenuDisabledState.Section.split, - auth: { station: true, center: false } - }, - { - label: '区段计轴预复位', - handler: this.axlePreReset, - disabledCallback: MenuDisabledState.Section.axlePreReset, - auth: { station: true, center: false } - }, - { - label: '区段封锁', - handler: this.lock, - disabledCallback: MenuDisabledState.Section.lock, - auth: { station: true, center: false } - }, - { - label: '区段解封', - handler: this.unlock, - disabledCallback: MenuDisabledState.Section.unlock, - auth: { station: true, center: false } - }, - { - label: '区段设置限速', - handler: this.setSpeed, - disabledCallback: MenuDisabledState.Section.setSpeed, - auth: { station: true, center: false } - } - ], - central: [ - { - label: '轨道激活', - handler: this.active, - disabledCallback: MenuDisabledState.Section.active, - auth: { station: false, center: true } - }, - { - label: '轨道切除', - handler: this.split, - disabledCallback: MenuDisabledState.Section.split, - auth: { station: false, center: true } - }, - { - type: 'separator' - }, - { - label: '确认计轴有效', - handler: this.alxeEffective, - disabledCallback: MenuDisabledState.Section.alxeEffective, - auth: { station: false, center: true } - }, - { - type: 'separator' - }, - { - label: '设置临时限速', - handler: this.setSpeed, - disabledCallback: MenuDisabledState.Section.setSpeed, - auth: { station: false, center: true } - }, - { - type: 'separator' - }, - { - label: '查看站场设备状态', - handler: this.undeveloped, - disabledCallback: MenuDisabledState.Section.setSpeed, - auth: { station: false, center: true } - } - ] - }, - menuTrain: [ - { - label: '新建列车', - handler: this.newTrain, - disabledCallback: MenuDisabledState.Section.newTrain - } - ], - menuForce: [ - { - label: '设置计轴失效', - handler: this.alxeFailure, - disabledCallback: MenuDisabledState.Section.alxeFailure - } - ] - }; - }, - watch: { - '$store.state.menuOperation.menuCount': function (val) { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) { - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - methods: { - clickEvent() { - const self = this; - window.onclick = function (e) { - self.doClose(); - }; - }, - initMenu() { - // 编辑模式菜单列表 - this.menu = menuFiltration(this.menuNormal); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain]; - } + name: 'SectionMenu', + components: { + PopMenu, + SectionControl, + SectionCmdControl, + SpeedLimitControl, + SpeedCmdControl, + TrainCreate, + AlxeEffective, + NoticeInfo + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + local: [ + { + label: '区段故障解锁', + handler: this.fault, + disabledCallback: MenuDisabledState.Section.fault, + auth: { station: true, center: false } + }, + { + label: '区段激活', + handler: this.active, + disabledCallback: MenuDisabledState.Section.active, + auth: { station: true, center: false } + }, + { + label: '区段切除', + handler: this.split, + disabledCallback: MenuDisabledState.Section.split, + auth: { station: true, center: false } + }, + { + label: '区段计轴预复位', + handler: this.axlePreReset, + disabledCallback: MenuDisabledState.Section.axlePreReset, + auth: { station: true, center: false } + }, + { + label: '区段封锁', + handler: this.lock, + disabledCallback: MenuDisabledState.Section.lock, + auth: { station: true, center: false } + }, + { + label: '区段解封', + handler: this.unlock, + disabledCallback: MenuDisabledState.Section.unlock, + auth: { station: true, center: false } + }, + { + label: '区段设置限速', + handler: this.setSpeed, + disabledCallback: MenuDisabledState.Section.setSpeed, + auth: { station: true, center: false } + } + ], + central: [ + { + label: '轨道激活', + handler: this.active, + disabledCallback: MenuDisabledState.Section.active, + auth: { station: false, center: true } + }, + { + label: '轨道切除', + handler: this.split, + disabledCallback: MenuDisabledState.Section.split, + auth: { station: false, center: true } + }, + { + type: 'separator' + }, + { + label: '确认计轴有效', + handler: this.alxeEffective, + disabledCallback: MenuDisabledState.Section.alxeEffective, + auth: { station: false, center: true } + }, + { + type: 'separator' + }, + { + label: '设置临时限速', + handler: this.setSpeed, + disabledCallback: MenuDisabledState.Section.setSpeed, + auth: { station: false, center: true } + }, + { + type: 'separator' + }, + { + label: '查看站场设备状态', + handler: this.undeveloped, + disabledCallback: MenuDisabledState.Section.setSpeed, + auth: { station: false, center: true } + } + ] + }, + menuTrain: [ + { + label: '新建列车', + handler: this.newTrain, + disabledCallback: MenuDisabledState.Section.newTrain + } + ], + menuForce: [ + { + label: '设置计轴失效', + handler: this.alxeFailure, + disabledCallback: MenuDisabledState.Section.alxeFailure + } + ] + }; + }, + watch: { + '$store.state.menuOperation.menuCount': function (val) { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) { + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = menuFiltration(this.menuNormal); + if (this.operatemode === OperateMode.ADMIN) { + this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain]; + } - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } - this.menu = menuConvert(this.menu); - }, - doShow(point) { - this.clickEvent(); - this.initMenu(); - if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { - this.$refs.popMenu.resetShowPosition(point); - } - }, - doClose() { - if (this.$refs && this.$refs.popMenu) { - this.$refs.popMenu.close(); - } - }, - // 设置计轴失效 - alxeFailure() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.alxeFailure.menu.operation - }; + this.menu = menuConvert(this.menu); + }, + doShow(point) { + this.clickEvent(); + this.initMenu(); + if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { + this.$refs.popMenu.resetShowPosition(point); + } + }, + doClose() { + if (this.$refs && this.$refs.popMenu) { + this.$refs.popMenu.close(); + } + }, + // 设置计轴失效 + alxeFailure() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.alxeFailure.menu.operation + }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 故障解锁 - fault() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.fault.menu.operation - }; + mouseCancelState(this.selected); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 故障解锁 + fault() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.fault.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionCmdControl.doShow(operate, this.selected); - } - }); - }, - undeveloped() { - this.doClose(); - this.$alert('实现中......', '提示', { - confirmButtonText: '确定', - callback: action => { - } - }); - }, - // 切除 - split() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.split.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionControl.doShow(operate, this.selected); - } - }); - }, - alxeEffective() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.alxeEffective.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.alxeEffective.doShow(operate, this.selected); - } - }); - }, - // 激活 - active() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.active.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionControl.doShow(operate, this.selected); - } - }); - }, - // 区段计轴预复位 - axlePreReset() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.axlePreReset.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionCmdControl.doShow(operate, this.selected); - } - }); - }, - // 区段解锁 - lock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.lock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionControl.doShow(operate, this.selected); - } - }); - }, - // 区段封锁 - unlock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.unlock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.sectionCmdControl.doShow(operate, this.selected); - } - }); - }, - // 设置速度 - setSpeed() { - // let operate = { - // start: true, - // code: this.selected.code, - // type: MapDeviceType.Section.type, - // label: MapDeviceType.Section.label, - // operation: OperationEvent.Section.setLimitSpeed.menu.operation - // }; - // this.$store.dispatch('training/next', operate).then(({ valid }) => { - // if (valid) { - // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // this.$refs.speedCmdControl.doShow(operate, this.selected); - // } - // }); - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.setSpeed.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.speedLimitControl.doShow(operate, this.selected); - } - }); - }, - // 取消速度 - // cancelSpeed() { - // let operate = { - // start: true, - // send: true, - // code: this.selected.code, - // type: MapDeviceType.Section.type, - // label: MapDeviceType.Section.label, - // operation: OperationEvent.Section.cancelSpeed.menu.operation - // }; - // this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - // if (valid) { - // let tempData = response.data; - // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // this.$refs.speedCmdControl.doShow(operate, this.selected, tempData); - // } - // }); - // }, - // 新建列车 - newTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Section.type, - label: MapDeviceType.Section.label, - operation: OperationEvent.Section.newtrain.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainCreate.doShow(operate, this.selected); - } - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionCmdControl.doShow(operate, this.selected); + } + }); + }, + undeveloped() { + this.doClose(); + this.$alert('实现中......', '提示', { + confirmButtonText: '确定', + callback: action => { + } + }); + }, + // 切除 + split() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.split.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionControl.doShow(operate, this.selected); + } + }); + }, + alxeEffective() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.alxeEffective.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.alxeEffective.doShow(operate, this.selected); + } + }); + }, + // 激活 + active() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.active.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionControl.doShow(operate, this.selected); + } + }); + }, + // 区段计轴预复位 + axlePreReset() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.axlePreReset.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionCmdControl.doShow(operate, this.selected); + } + }); + }, + // 区段解锁 + lock() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.lock.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionControl.doShow(operate, this.selected); + } + }); + }, + // 区段封锁 + unlock() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.unlock.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionCmdControl.doShow(operate, this.selected); + } + }); + }, + // 设置速度 + setSpeed() { + // let operate = { + // start: true, + // code: this.selected.code, + // type: MapDeviceType.Section.type, + // label: MapDeviceType.Section.label, + // operation: OperationEvent.Section.setLimitSpeed.menu.operation + // }; + // this.$store.dispatch('training/next', operate).then(({ valid }) => { + // if (valid) { + // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // this.$refs.speedCmdControl.doShow(operate, this.selected); + // } + // }); + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.setSpeed.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.speedLimitControl.doShow(operate, this.selected); + } + }); + }, + // 取消速度 + // cancelSpeed() { + // let operate = { + // start: true, + // send: true, + // code: this.selected.code, + // type: MapDeviceType.Section.type, + // label: MapDeviceType.Section.label, + // operation: OperationEvent.Section.cancelSpeed.menu.operation + // }; + // this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + // if (valid) { + // let tempData = response.data; + // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // this.$refs.speedCmdControl.doShow(operate, this.selected, tempData); + // } + // }); + // }, + // 新建列车 + newTrain() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Section.type, + label: MapDeviceType.Section.label, + operation: OperationEvent.Section.newtrain.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainCreate.doShow(operate, this.selected); + } + }); + } + } }; diff --git a/src/jmap/theme/beijing_01/menus/menuSignal.vue b/src/jmap/theme/beijing_01/menus/menuSignal.vue index 2e99d9d89..13f74d900 100644 --- a/src/jmap/theme/beijing_01/menus/menuSignal.vue +++ b/src/jmap/theme/beijing_01/menus/menuSignal.vue @@ -27,474 +27,474 @@ import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItem import { mouseCancelState } from './utils/menuItemStatus'; export default { - name: 'SignalMenu', - components: { - PopMenu, - RouteControl, - RouteSelection, - RouteLock, - RouteCmdControl, - RouteHandControl, - RouteDetail, - NoticeInfo - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [ - { - label: '排列进路', - handler: this.arrangementRoute, - disabledCallback: MenuDisabledState.Signal.arrangementRoute, - auth: { station: false, center: true } - }, - { - label: '取消进路', - handler: this.cancelTrainRoute, - disabledCallback: MenuDisabledState.Signal.cancelTrainRoute, - auth: { station: false, center: true } - }, - { - label: '信号重开', - handler: this.reopenSignal, - disabledCallback: MenuDisabledState.Signal.reopenSignal, - auth: { station: false, center: true } - }, - { - type: 'separator' - }, - { - label: '进路交人工控', - handler: this.humanControl, - disabledCallback: MenuDisabledState.Signal.humanControl, - auth: { station: false, center: true } - }, - { - label: '进路交自动控', - handler: this.atsAutoControl, - disabledCallback: MenuDisabledState.Signal.atsAutoControl, - auth: { station: false, center: true } - }, - { - label: '查询进路控制状态', - handler: this.detail, - disabledCallback: MenuDisabledState.Signal.detail, - auth: { station: true, center: true } - } - ], - central: [ - { - label: '排列进路', - handler: this.arrangementRoute, - disabledCallback: MenuDisabledState.Signal.arrangementRoute, - auth: { station: false, center: true } - }, - { - label: '取消进路', - handler: this.cancelTrainRoute, - disabledCallback: MenuDisabledState.Signal.cancelTrainRoute, - auth: { station: false, center: true } - }, - { - label: '信号重开', - handler: this.reopenSignal, - disabledCallback: MenuDisabledState.Signal.reopenSignal, - auth: { station: false, center: true } - }, - { - type: 'separator' - }, - { - label: '进路交人工控', - handler: this.humanControl, - disabledCallback: MenuDisabledState.Signal.humanControl, - auth: { station: false, center: true } - }, - { - label: '进路交自动控', - handler: this.atsAutoControl, - disabledCallback: MenuDisabledState.Signal.atsAutoControl, - auth: { station: false, center: true } - }, - { - label: '查询进路控制状态', - handler: this.detail, - disabledCallback: MenuDisabledState.Signal.detail, - auth: { station: true, center: true } - } - ] - }, - menuForce: [ - { - label: '信号关灯', - handler: this.signalClose, - disabledCallback: '' - }, - { - label: '设置故障', - handler: this.setStoppage, - disabledCallback: MenuDisabledState.Signal.setStoppage - }, - { - label: '取消故障', - handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Signal.cancelStoppage - } - ] - }; - }, - watch: { - '$store.state.menuOperation.menuCount': function (val) { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) { - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - methods: { - clickEvent() { - const self = this; - window.onclick = function (e) { - self.doClose(); - }; - }, - initMenu() { - // 编辑模式菜单列表 - this.menu = menuFiltration(this.menuNormal); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce]; - } + name: 'SignalMenu', + components: { + PopMenu, + RouteControl, + RouteSelection, + RouteLock, + RouteCmdControl, + RouteHandControl, + RouteDetail, + NoticeInfo + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + local: [ + { + label: '排列进路', + handler: this.arrangementRoute, + disabledCallback: MenuDisabledState.Signal.arrangementRoute, + auth: { station: false, center: true } + }, + { + label: '取消进路', + handler: this.cancelTrainRoute, + disabledCallback: MenuDisabledState.Signal.cancelTrainRoute, + auth: { station: false, center: true } + }, + { + label: '信号重开', + handler: this.reopenSignal, + disabledCallback: MenuDisabledState.Signal.reopenSignal, + auth: { station: false, center: true } + }, + { + type: 'separator' + }, + { + label: '进路交人工控', + handler: this.humanControl, + disabledCallback: MenuDisabledState.Signal.humanControl, + auth: { station: false, center: true } + }, + { + label: '进路交自动控', + handler: this.atsAutoControl, + disabledCallback: MenuDisabledState.Signal.atsAutoControl, + auth: { station: false, center: true } + }, + { + label: '查询进路控制状态', + handler: this.detail, + disabledCallback: MenuDisabledState.Signal.detail, + auth: { station: true, center: true } + } + ], + central: [ + { + label: '排列进路', + handler: this.arrangementRoute, + disabledCallback: MenuDisabledState.Signal.arrangementRoute, + auth: { station: false, center: true } + }, + { + label: '取消进路', + handler: this.cancelTrainRoute, + disabledCallback: MenuDisabledState.Signal.cancelTrainRoute, + auth: { station: false, center: true } + }, + { + label: '信号重开', + handler: this.reopenSignal, + disabledCallback: MenuDisabledState.Signal.reopenSignal, + auth: { station: false, center: true } + }, + { + type: 'separator' + }, + { + label: '进路交人工控', + handler: this.humanControl, + disabledCallback: MenuDisabledState.Signal.humanControl, + auth: { station: false, center: true } + }, + { + label: '进路交自动控', + handler: this.atsAutoControl, + disabledCallback: MenuDisabledState.Signal.atsAutoControl, + auth: { station: false, center: true } + }, + { + label: '查询进路控制状态', + handler: this.detail, + disabledCallback: MenuDisabledState.Signal.detail, + auth: { station: true, center: true } + } + ] + }, + menuForce: [ + { + label: '信号关灯', + handler: this.signalClose, + disabledCallback: '' + }, + { + label: '设置故障', + handler: this.setStoppage, + disabledCallback: MenuDisabledState.Signal.setStoppage + }, + { + label: '取消故障', + handler: this.cancelStoppage, + disabledCallback: MenuDisabledState.Signal.cancelStoppage + } + ] + }; + }, + watch: { + '$store.state.menuOperation.menuCount': function (val) { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) { + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = menuFiltration(this.menuNormal); + if (this.operatemode === OperateMode.ADMIN) { + this.menu = [...this.menu, ...this.menuForce]; + } - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } - this.menu = menuConvert(this.menu); + this.menu = menuConvert(this.menu); - }, - doShow(point) { - this.clickEvent(); - this.initMenu(); - if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { - this.$refs.popMenu.resetShowPosition(point); - } - }, - doClose() { - if (this.$refs && this.$refs.popMenu) { - this.$refs.popMenu.close(); - } - }, - // 设置故障 - setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.stoppage.menu.operation - }; + }, + doShow(point) { + this.clickEvent(); + this.initMenu(); + if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { + this.$refs.popMenu.resetShowPosition(point); + } + }, + doClose() { + if (this.$refs && this.$refs.popMenu) { + this.$refs.popMenu.close(); + } + }, + // 设置故障 + setStoppage() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.stoppage.menu.operation + }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 取消故障 - cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.cancelStoppage.menu.operation - }; + mouseCancelState(this.selected); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 取消故障 + cancelStoppage() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.cancelStoppage.menu.operation + }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 设置进路 - arrangementRoute() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.arrangementRoute.menu.operation - }; + mouseCancelState(this.selected); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 设置进路 + arrangementRoute() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.arrangementRoute.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - var tempData = null; - if (response) { - tempData = response.data; - } - this.$refs.routeSelection.doShow(operate.operation, this.selected, tempData); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 取消进路 - cancelTrainRoute() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.cancelTrainRoute.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - }, - // 信号封锁 - lock() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.lock.menu.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + var tempData = null; + if (response) { + tempData = response.data; + } + this.$refs.routeSelection.doShow(operate.operation, this.selected, tempData); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 取消进路 + cancelTrainRoute() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.cancelTrainRoute.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 信号封锁 + lock() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.lock.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeLock.doShow(operate.operation, this.selected); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 信号解封 - unlock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.unlock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeCmdControl.doShow(operate, this.selected); - } - }); - }, - // 信号重开 - reopenSignal() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.reopenSignal.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - }, - // 进路引导 - guide() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.guide.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - this.$refs.routeCmdControl.doShow(operate, this.selected); - } - }); - }, - // 设置联锁自动进路 - setAutoInterlock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.setAutoInterlock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - }, - // 取消联锁自动进路 - cancelAutoInterlock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - }, - // 设置联锁自动触发 - setAutoTrigger() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.setAutoTrigger.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - }, - // 取消联锁自动触发 - cancelAutoTrigger() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - }, - // 信号关灯 - signalClose() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.signalClose.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeControl.doShow(operate, this.selected); - } - }); - }, - // 进路交人工控 - humanControl() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.humanControl.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - let tempData = null; - if (response) { - tempData = response.data; - } - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeHandControl.doShow(operate, this.selected, tempData); - } - }); - }, - // 进路交自动控 - atsAutoControl() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.atsAutoControl.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - let tempData = null; - if (response) { - tempData = response.data; - } - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeHandControl.doShow(operate, this.selected, tempData); - } - }); - }, - // 查询进路状态 - detail() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.detail.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeDetail.doShow(operate, this.selected, response.data); - } - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeLock.doShow(operate.operation, this.selected); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 信号解封 + unlock() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.unlock.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeCmdControl.doShow(operate, this.selected); + } + }); + }, + // 信号重开 + reopenSignal() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.reopenSignal.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 进路引导 + guide() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.guide.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$refs.routeCmdControl.doShow(operate, this.selected); + } + }); + }, + // 设置联锁自动进路 + setAutoInterlock() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.setAutoInterlock.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 取消联锁自动进路 + cancelAutoInterlock() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 设置联锁自动触发 + setAutoTrigger() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.setAutoTrigger.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 取消联锁自动触发 + cancelAutoTrigger() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 信号关灯 + signalClose() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.signalClose.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 进路交人工控 + humanControl() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.humanControl.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + if (valid) { + let tempData = null; + if (response) { + tempData = response.data; + } + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeHandControl.doShow(operate, this.selected, tempData); + } + }); + }, + // 进路交自动控 + atsAutoControl() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.atsAutoControl.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + if (valid) { + let tempData = null; + if (response) { + tempData = response.data; + } + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeHandControl.doShow(operate, this.selected, tempData); + } + }); + }, + // 查询进路状态 + detail() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Signal.type, + label: MapDeviceType.Signal.label, + operation: OperationEvent.Signal.detail.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeDetail.doShow(operate, this.selected, response.data); + } + }); + } + } }; diff --git a/src/jmap/theme/beijing_01/menus/menuStation.vue b/src/jmap/theme/beijing_01/menus/menuStation.vue index 47ddcc29e..9f2bfecb9 100644 --- a/src/jmap/theme/beijing_01/menus/menuStation.vue +++ b/src/jmap/theme/beijing_01/menus/menuStation.vue @@ -21,287 +21,287 @@ import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItem import { mouseCancelState } from './utils/menuItemStatus'; export default { - name: 'StationMenu', - components: { - PopMenu, - StationCmdControl, - StationHumanControlAll, - StationSetRouteControlAll, - NoticeInfo - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [ - { - label: '全站设置联锁自动触发', - handler: this.setAutoTrigger, - disabledCallback: MenuDisabledState.Station.setAutoTrigger, - auth: { station: true, center: false } - }, - { - label: '全站取消联锁自动触发', - handler: this.cancelAutoTrigger, - disabledCallback: MenuDisabledState.Station.cancelAutoTrigger, - auth: { station: true, center: false } - }, - { - label: '上电解锁', - handler: this.powerUnLock, - disabledCallback: MenuDisabledState.Station.powerUnLock, - auth: { station: true, center: false } - }, - { - label: '执行关键操作测试', - handler: this.execKeyOperationTest, - disabledCallback: MenuDisabledState.Station.execKeyOperationTest, - auth: { station: true, center: false } - } - ], - central: [ - { - label: '所有进路自排关', - handler: this.humanControlALL, - disabledCallback: MenuDisabledState.Station.humanControlALL, - auth: { station: false, center: true } - }, - { - label: '所有进路自排开', - handler: this.atsAutoControlALL, - disabledCallback: MenuDisabledState.Station.atsAutoControlALL, - auth: { station: false, center: true } - }, - { - label: '执行关键操作测试', - handler: this.execKeyOperationTest, - disabledCallback: MenuDisabledState.Station.execKeyOperationTest, - auth: { station: false, center: true } - } - ] - }, - menuForce: [ - { - label: '设置ZC故障', - handler: this.setStoppage, - disabledCallback: MenuDisabledState.Station.setStoppage - }, - { - label: '取消ZC故障', - handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Station.cancelStoppage - } - ] - }; - }, - watch: { - '$store.state.menuOperation.menuCount': function (val) { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Station) && !this.buttonOperation) { - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - methods: { - clickEvent() { - const self = this; - window.onclick = function (e) { - self.doClose(); - }; - }, - initMenu() { - this.menu = []; - if (this.selected.concentrateStationCode == this.selected.code) { - // 编辑模式菜单列表 - this.menu = menuFiltration(this.menuNormal); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce]; - } - } + name: 'StationMenu', + components: { + PopMenu, + StationCmdControl, + StationHumanControlAll, + StationSetRouteControlAll, + NoticeInfo + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + local: [ + { + label: '全站设置联锁自动触发', + handler: this.setAutoTrigger, + disabledCallback: MenuDisabledState.Station.setAutoTrigger, + auth: { station: true, center: false } + }, + { + label: '全站取消联锁自动触发', + handler: this.cancelAutoTrigger, + disabledCallback: MenuDisabledState.Station.cancelAutoTrigger, + auth: { station: true, center: false } + }, + { + label: '上电解锁', + handler: this.powerUnLock, + disabledCallback: MenuDisabledState.Station.powerUnLock, + auth: { station: true, center: false } + }, + { + label: '执行关键操作测试', + handler: this.execKeyOperationTest, + disabledCallback: MenuDisabledState.Station.execKeyOperationTest, + auth: { station: true, center: false } + } + ], + central: [ + { + label: '所有进路自排关', + handler: this.humanControlALL, + disabledCallback: MenuDisabledState.Station.humanControlALL, + auth: { station: false, center: true } + }, + { + label: '所有进路自排开', + handler: this.atsAutoControlALL, + disabledCallback: MenuDisabledState.Station.atsAutoControlALL, + auth: { station: false, center: true } + }, + { + label: '执行关键操作测试', + handler: this.execKeyOperationTest, + disabledCallback: MenuDisabledState.Station.execKeyOperationTest, + auth: { station: false, center: true } + } + ] + }, + menuForce: [ + { + label: '设置ZC故障', + handler: this.setStoppage, + disabledCallback: MenuDisabledState.Station.setStoppage + }, + { + label: '取消ZC故障', + handler: this.cancelStoppage, + disabledCallback: MenuDisabledState.Station.cancelStoppage + } + ] + }; + }, + watch: { + '$store.state.menuOperation.menuCount': function (val) { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Station) && !this.buttonOperation) { + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + this.menu = []; + if (this.selected.concentrateStationCode == this.selected.code) { + // 编辑模式菜单列表 + this.menu = menuFiltration(this.menuNormal); + if (this.operatemode === OperateMode.ADMIN) { + this.menu = [...this.menu, ...this.menuForce]; + } + } - if (this.selected.centralized) { - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = [...this.menuForce]; - } - } + if (this.selected.centralized) { + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = [...this.menuForce]; + } + } - this.menu = menuConvert(this.menu); - }, - doShow(point) { - this.clickEvent(); - this.initMenu(); - if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { - this.$refs.popMenu.resetShowPosition(point); - } - }, - doClose() { - if (this.$refs && this.$refs.popMenu) { - this.$refs.popMenu.close(); - } - }, - // 设置故障 - setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.stoppage.menu.operation - }; + this.menu = menuConvert(this.menu); + }, + doShow(point) { + this.clickEvent(); + this.initMenu(); + if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { + this.$refs.popMenu.resetShowPosition(point); + } + }, + doClose() { + if (this.$refs && this.$refs.popMenu) { + this.$refs.popMenu.close(); + } + }, + // 设置故障 + setStoppage() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.stoppage.menu.operation + }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 取消故障 - cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.cancelStoppage.menu.operation - }; + mouseCancelState(this.selected); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 取消故障 + cancelStoppage() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.cancelStoppage.menu.operation + }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 全站设置联锁自动触发 - setAutoTrigger() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.setAutoTrigger.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 全站取消联锁自动触发 - cancelAutoTrigger() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.cancelAutoTrigger.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 上电解锁 - powerUnLock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.powerUnLock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationCmdControl.doShow(operate, this.selected); - } - }); - }, - // 执行关键操作测试 - execKeyOperationTest() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.execKeyOperationTest.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationCmdControl.doShow(operate, this.selected); - } - }); - }, - // 所有进路自排关 - humanControlALL() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.humanControlALL.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationHumanControlAll.doShow(operate, this.selected); - } - }); - }, - // 所有进路自排开 - atsAutoControlALL() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.atsAutoControlALL.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationSetRouteControlAll.doShow(operate, this.selected); - } - }); - } - } + mouseCancelState(this.selected); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 全站设置联锁自动触发 + setAutoTrigger() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.setAutoTrigger.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 全站取消联锁自动触发 + cancelAutoTrigger() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.cancelAutoTrigger.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 上电解锁 + powerUnLock() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.powerUnLock.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.stationCmdControl.doShow(operate, this.selected); + } + }); + }, + // 执行关键操作测试 + execKeyOperationTest() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.execKeyOperationTest.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.stationCmdControl.doShow(operate, this.selected); + } + }); + }, + // 所有进路自排关 + humanControlALL() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.humanControlALL.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.stationHumanControlAll.doShow(operate, this.selected); + } + }); + }, + // 所有进路自排开 + atsAutoControlALL() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Station.type, + label: MapDeviceType.Station.label, + operation: OperationEvent.Station.atsAutoControlALL.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.stationSetRouteControlAll.doShow(operate, this.selected); + } + }); + } + } }; diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 3673c1088..0b1665009 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -232,6 +232,7 @@ const socket = { permissionOver: {}, // 权限结束 roomIsSubscribe:false, // 房间是否订阅 + assistantIsSubscribe:false, // 综合演练仿真聊天是否订阅 isInRoom:false, // 是否己经进入房间 tipOperateCount: 0, // 任务结束提示消息 @@ -294,6 +295,9 @@ const socket = { setRoomSubscribe:(state, roomIsSubscribe)=>{ state.roomIsSubscribe = roomIsSubscribe; }, + setAssistantSubscribe:(state, assistantIsSubscribe)=>{ + state.assistantIsSubscribe = assistantIsSubscribe; + }, setInRoom:(state, isInRoom)=>{ state.isInRoom = isInRoom; } @@ -361,6 +365,9 @@ const socket = { setRoomSubscribe:({ commit }, msg) => { commit('setRoomSubscribe', msg); }, + setAssistantSubscribe:({ commit }, msg) => { + commit('setAssistantSubscribe', msg); + }, setInRoom:({ commit }, msg) => { commit('setInRoom', msg); } diff --git a/src/utils/stomp.js b/src/utils/stomp.js index 2febbf668..b9bd37728 100644 --- a/src/utils/stomp.js +++ b/src/utils/stomp.js @@ -5,6 +5,7 @@ import store from '@/store/index_APP_TARGET'; export const displayTopic = '/user/queue/simulation'; // 其他仿真topic export const perpetualTopic = '/user/topic/message'; // 公用topic export const roomTopic = '/user/queue/room'; // 房间topic +export const assistant = '/user/topic/simulation/assistant';// 房间里仿真聊天topic // 建立连接并订阅地址 export function creatSubscribe(topic, header) { diff --git a/src/views/newMap/jointTrainingNew/chatBox.vue b/src/views/newMap/jointTrainingNew/chatBox.vue index ea530e5fa..5da69efa3 100644 --- a/src/views/newMap/jointTrainingNew/chatBox.vue +++ b/src/views/newMap/jointTrainingNew/chatBox.vue @@ -45,9 +45,11 @@