diff --git a/src/api/chat.js b/src/api/chat.js index 0fafefea0..7c0f69385 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -255,3 +255,20 @@ export function getRealDevices(group) { method: 'get' }); } + +// 获取房间真实设备连接关系 +export function getRealDevicesNew(group) { + return request({ + url: `/api/jointTraining/room/${group}/realDevice/connect`, + method: 'get' + }); +} + +// 更新真实设备的连接关系 +export function undateRealDevicesNew(group, data) { + return request({ + url: `/api/jointTraining/room/${group}/realDevice`, + method: 'put', + data: data + }); +} diff --git a/src/api/jmap/training.js b/src/api/jmap/training.js index 5db5a4c4e..276859659 100644 --- a/src/api/jmap/training.js +++ b/src/api/jmap/training.js @@ -120,6 +120,15 @@ export function sendCommand(group, command) { }); } +// 发送新的指令 +export function sendCommandNew(group, commandDefinitionId, command) { + return request({ + url: `/simulation/${group}/operate/${commandDefinitionId}`, + method: 'post', + data: command + }); +} + export function updateLesson(data) { return request({ url: `/api/training/userTraining/${data.id}`, diff --git a/src/api/management/dictionary.js b/src/api/management/dictionary.js index 3d1990051..64170e64d 100644 --- a/src/api/management/dictionary.js +++ b/src/api/management/dictionary.js @@ -104,3 +104,11 @@ export function getCommandDetail(id) { method: 'get' }); } + +// 获取指令列表 +export function getCmdList(lineCode) { + return request({ + url: `/api/cmd/line/${lineCode}`, + method: 'get' + }); +} diff --git a/src/api/project.js b/src/api/project.js new file mode 100644 index 000000000..337853df6 --- /dev/null +++ b/src/api/project.js @@ -0,0 +1,71 @@ +import request from '@/utils/request'; + +/** 新建项目设备*/ +export function createDevice(data) { + return request({ + url: `/api/project/device`, + method: 'post', + data: data + }); +} +/** 项目设备编码是否已存在 */ +export function deviceIsExist(projectCode, code) { + return request({ + url: `/api/project/device/exist/${projectCode}/${code}`, + method: 'get' + }); +} +/** 分页查询项目设备 */ +export function getProjectDeviceList(params) { + return request({ + url: `/api/project/device/paging`, + method: 'get', + params:params + }); +} +/** 删除项目设备 */ +export function deleteProjectDevice(id) { + return request({ + url: `/api/project/device/${id}`, + method: 'delete' + }); +} +/** 获取设备详情 */ +export function getDeviceDetail(id) { + return request({ + url: `/api/project/device/${id}`, + method: 'get' + }); +} +/** 添加/修改屏蔽门设备网关映射配置 */ +export function setPsdConfig(id, data) { + return request({ + url: `/api/project/device/${id}/config/psd`, + method: 'put', + data: data + }); +} +/** 添加/修改信号机设备网关映射配置 */ +export function setSignalConfig(id, data) { + return request({ + url: `/api/project/device/${id}/config/signal`, + method: 'put', + data: data + }); +} +/** 添加/修改信号机设备网关映射配置 */ +export function setSwitchConfig(id, data) { + return request({ + url: `/api/project/device/${id}/config/switch`, + method: 'put', + data: data + }); +} +/** 查询项目下的所有设备 */ +export function getAllDeviceInProject(params) { + return request({ + url: `/api/project/device/project`, + method: 'get', + params + }); +} diff --git a/src/api/simulation.js b/src/api/simulation.js index 2ce57b204..71731e696 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -454,9 +454,18 @@ export function newMapOperate(group, operationId, data) { }); } /** 新版地图根据group获取仿真运行图 */ -export function getRunPlanNew(group) { +export function getEveryDayRunPlanNew(group) { return request({ url: `/simulation/${group}/runPlan`, method: 'get' }); } + +/** 查询进路信息*/ +export function querySignalStatus(group, params) { + return request({ + url: `/api/simulation/${group}/status/signal`, + method: 'get', + params + }); +} diff --git a/src/components/QueryListPage/DataForm.vue b/src/components/QueryListPage/DataForm.vue index 9d1ef4c04..0e67d3636 100644 --- a/src/components/QueryListPage/DataForm.vue +++ b/src/components/QueryListPage/DataForm.vue @@ -53,6 +53,17 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmControlSpeed.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmControlSpeed.vue index 31d4587e0..f7d3c615d 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmControlSpeed.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmControlSpeed.vue @@ -1,148 +1,158 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmSignalUnlock.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmSignalUnlock.vue deleted file mode 100644 index c6f069ffe..000000000 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmSignalUnlock.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTip.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTip.vue index 6917c9a94..9ff15f636 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTip.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTip.vue @@ -1,59 +1,69 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTrain.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTrain.vue index ccfcf9036..bd52f38bd 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTrain.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/confirmTrain.vue @@ -19,7 +19,7 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/popupAlarm.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/popupAlarm.vue index e3375f76f..5694754dd 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/popupAlarm.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/popupAlarm.vue @@ -1,85 +1,95 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/routeControl.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/routeControl.vue index 6af5a13b5..dff94e5ba 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/routeControl.vue @@ -33,280 +33,252 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue index 1450d834a..c9323a246 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/routeDetail.vue @@ -67,89 +67,90 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue index 847ab9fd2..009b1d5db 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/routeGuide.vue @@ -50,189 +50,200 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/stationCmdControl.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/stationCmdControl.vue deleted file mode 100644 index 4680847c6..000000000 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/stationCmdControl.vue +++ /dev/null @@ -1,389 +0,0 @@ - - \ No newline at end of file diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/switchCmdControl.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/switchCmdControl.vue deleted file mode 100644 index ae66d1d28..000000000 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/switchCmdControl.vue +++ /dev/null @@ -1,459 +0,0 @@ - - \ No newline at end of file diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/switchControl.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/switchControl.vue index 911e471b5..1c909ea93 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/switchControl.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/switchControl.vue @@ -1,15 +1,5 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/trainControl.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/trainControl.vue index e4e95d303..c93791038 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/trainControl.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/trainControl.vue @@ -96,8 +96,8 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuBar.vue b/src/jmapNew/theme/chengdu_03/menus/menuBar.vue index 6eda8c025..0a24c55e9 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuBar.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuBar.vue @@ -78,8 +78,10 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue index d361e118e..ba0058a91 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuButton.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuButton.vue @@ -1,18 +1,18 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/menuDialog/childDialog/userDelete.vue b/src/jmapNew/theme/chengdu_03/menus/menuDialog/childDialog/userDelete.vue index 9316bb37b..3e2018158 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuDialog/childDialog/userDelete.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuDialog/childDialog/userDelete.vue @@ -20,7 +20,7 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/menuDialog/viewDevice.vue b/src/jmapNew/theme/chengdu_03/menus/menuDialog/viewDevice.vue index dd4fc2e38..c78c6ca30 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuDialog/viewDevice.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuDialog/viewDevice.vue @@ -38,7 +38,7 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue index 6be66a90a..9aa3b8f94 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue @@ -19,473 +19,442 @@ import RouteHandControl from './dialog/routeHandControl'; import RouteGuide from './dialog/routeGuide'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; -import { mouseCancelState } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import { querySignalStatus } from '@/api/simulation'; export default { - name: 'SignalMenu', - components: { - PopMenu, - RouteControl, - RouteSelection, - RouteHandControl, - RouteDetail, - RouteGuide, - NoticeInfo - }, - props: { - selected: { - type: Object, - default: () => { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [ - { - label: '办理进路', - handler: this.arrangementRoute, - disabledCallback: MenuDisabledState.Signal.arrangementRoute, - auth: { station: true, center: false } - }, - { - label: '办理引导进路', - handler: this.guide, - disabledCallback: MenuDisabledState.Signal.guide, - auth: { station: true, center: false } - }, - { - label: '取消进路', - handler: this.cancelTrainRoute, - disabledCallback: MenuDisabledState.Signal.cancelTrainRoute, - auth: { station: true, center: false } - }, - { - label: '总人解', // 取消引导进路 - handler: this.humanTrainRoute, - disabledCallback: MenuDisabledState.Signal.humanTrainRoute, - auth: { station: true, center: false } - }, - // { - // label: '信号重开', - // handler: this.reopenSignal, - // disabledCallback: MenuDisabledState.Signal.reopenSignal, - // auth: { station: true, center: false } - // }, - // { - // label: '信号封锁', - // handler: this.lock, - // disabledCallback: MenuDisabledState.Signal.lock, - // auth: { station: true, center: false } - // }, - // { - // label: '信号解封', - // handler: this.unlock, - // disabledCallback: MenuDisabledState.Signal.unlock, - // auth: { station: true, center: false } - // }, - { - 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 } - } - ], - central: [ - { - label: '办理进路', - handler: this.arrangementRoute, - disabledCallback: MenuDisabledState.Signal.arrangementRoute, - auth: { station: true, center: false } - }, - { - label: '办理引导进路', - handler: this.guide, - disabledCallback: MenuDisabledState.Signal.guide, - auth: { station: true, center: false } - }, - { - label: '取消进路', - handler: this.cancelTrainRoute, - disabledCallback: MenuDisabledState.Signal.cancelTrainRoute, - auth: { station: true, center: false } - }, - { - label: '总人解', - handler: this.humanTrainRoute, - disabledCallback: MenuDisabledState.Signal.humanTrainRoute, - auth: { station: true, center: false } - }, - { - label: '信号重开', - handler: this.reopenSignal, - disabledCallback: MenuDisabledState.Signal.reopenSignal, - auth: { station: true, center: false } - }, - { - label: '信号封锁', - handler: this.lock, - disabledCallback: MenuDisabledState.Signal.lock, - auth: { station: true, center: false } - }, - { - label: '信号解封', - handler: this.unlock, - disabledCallback: MenuDisabledState.Signal.unlock, - auth: { station: true, center: false } - }, - { - 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 - } - ] - }; - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - 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(); - } - } - }, - 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, + RouteHandControl, + RouteDetail, + RouteGuide, + NoticeInfo + }, + props: { + selected: { + type: Object, + default: () => { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + Local: [ + { + label: '办理进路', + handler: this.arrangementRoute, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE + }, + { + label: '办理引导进路', + handler: this.guide, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE + }, + { + label: '取消进路', + handler: this.cancelTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE + }, + { + label: '总人解', // 取消引导进路 + handler: this.humanTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE + }, + { + label: '进路收人工控', + handler: this.humanControl, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING + }, + { + label: '进路交自动控', + handler: this.atsAutoControl, + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING + } + ], + Center: [ + { + label: '办理进路', + handler: this.arrangementRoute, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE + }, + { + label: '办理引导进路', + handler: this.guide, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE + }, + { + label: '取消进路', + handler: this.cancelTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE + }, + { + label: '总人解', + handler: this.humanTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE + }, + { + label: '信号重开', + handler: this.reopenSignal, + cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL + }, + { + label: '信号封锁', + handler: this.lock, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK + }, + { + label: '信号解封', + handler: this.unlock, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK + }, + { + label: '进路收人工控', + handler: this.humanControl, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING + }, + { + label: '进路交自动控', + handler: this.atsAutoControl, + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING + }, + { + label: '查询进路控制状态', + handler: this.detail, + cmdType: '' + } + ] + }, + menuForce: [ + { + label: '信号关灯', + handler: this.signalClose, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL + }, + { + label: '设置故障', + handler: this.setStoppage, + cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]), + group() { + return this.$route.query.group; + } + }, + 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(); + } + } + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } + }, + 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(); + } + }, + // 信号关灯 + signalClose() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.signalClose.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(step, this.selected); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 设置故障 + setStoppage() { + const step = { + start: true, + code: `${this.selected.code}`, + cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, + operation: OperationEvent.Signal.stoppage.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; - this.menu = menuConvert(this.menu); + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(step); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 取消故障 + cancelStoppage() { + const step = { + start: true, + code: `${this.selected.code}`, + cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, + operation: OperationEvent.Signal.cancelStoppage.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; - }, - 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(); - } - }, - // 信号关灯 - 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); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 设置故障 - 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 - }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(step); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 设置进路 + arrangementRoute() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.arrangementRoute.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; - 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 - }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.routeSelection.doShow(step.operation, this.selected, tempData); + }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 进路引导 + guide() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.guide.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.routeGuide.doShow(step.operation, this.selected, tempData); + }); + } + }); + }, + // 取消进路 + cancelTrainRoute() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$refs.routeControl.doShow(step, this.selected); + } + }); + }, + // 总人解 + humanTrainRoute() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.humanTrainRoute.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$refs.routeControl.doShow(step, this.selected); + } + }); + }, + // 信号重开 + reopenSignal() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.reopenSignal.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(step, this.selected); + } + }); + }, + // 信号封锁 + lock() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.lock.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; - 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); - }); - }, - // 进路引导 - guide() { - const operate = { - start: true, - send: 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, response }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (valid) { - var tempData = null; - if (response) { - tempData = response.data; - } - this.$refs.routeGuide.doShow(operate.operation, this.selected, tempData); - } - }); - }, - // 取消进路 - 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); - } - }); - }, - // 总人解 - humanTrainRoute() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Signal.type, - label: MapDeviceType.Signal.label, - operation: OperationEvent.Signal.humanTrainRoute.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); - } - }); - }, - // 信号重开 - 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); - } - }); - }, - // 信号封锁 - lock() { - const operate = { - start: 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.routeControl.doShow(operate, 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.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/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(step, this.selected); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 信号解封 + unlock() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.unlock.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(step, this.selected); + } + }); + }, + // 进路交人工控 + humanControl() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.humanControl.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.routeHandControl.doShow(step, this.selected, tempData); + }); + } + }); + }, + // 进路交自动控 + atsAutoControl() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.atsAutoControl.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.routeHandControl.doShow(step, this.selected, tempData); + }); + } + }); + }, + // 查询进路状态 + detail() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.detail.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.routeDetail.doShow(step, this.selected, tempData); + }); + } + }); + } + } }; diff --git a/src/jmapNew/theme/chengdu_03/menus/menuStation.vue b/src/jmapNew/theme/chengdu_03/menus/menuStation.vue index f865e6cc3..a3ff53939 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuStation.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuStation.vue @@ -8,149 +8,146 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuStationControl.vue b/src/jmapNew/theme/chengdu_03/menus/menuStationControl.vue index 6e394cecd..63f082d73 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuStationControl.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuStationControl.vue @@ -5,65 +5,65 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue b/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue index 1ca52fccf..6e2a69cca 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuStationStand.vue @@ -13,333 +13,321 @@ import StandControl from './dialog/standControl'; import StandDetail from './dialog/standDetail'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; -import { mouseCancelState } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import Handler from '@/scripts/cmdPlugin/Handler'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { - name: 'StationStandMenu', - components: { - PopMenu, - StandControl, - StandDetail, - NoticeInfo - }, - props: { - selected: { - type: Object, - default: () => { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [ - { - label: '设置跳停', - handler: this.setJumpStop, - disabledCallback: MenuDisabledState.StationStand.setJumpStop, - auth: { station: true, center: true } - }, - { - label: '取消跳停', - handler: this.cancelJumpStop, - disabledCallback: MenuDisabledState.StationStand.cancelJumpStop, - auth: { station: true, center: true } - } - ], - central: [ - { - label: '设置扣车', - handler: this.setDetainTrain, - disabledCallback: MenuDisabledState.StationStand.setDetainTrain, - auth: { station: true, center: true } - }, - { - label: '取消扣车', - handler: this.cancelDetainTrain, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain, - auth: { station: true, center: true } - }, - { - label: '设置跳停', - handler: this.setJumpStop, - disabledCallback: MenuDisabledState.StationStand.setJumpStop, - auth: { station: true, center: true } - }, - { - label: '取消跳停', - handler: this.cancelJumpStop, - disabledCallback: MenuDisabledState.StationStand.cancelJumpStop, - auth: { station: true, center: true } - }, - { - label: '设置停站时间', - handler: this.setStopTime, - disabledCallback: MenuDisabledState.StationStand.setStopTime, - auth: { station: true, center: true } - }, - { - label: '设置站间运行等级', - handler: this.setRunLevel, - disabledCallback: MenuDisabledState.StationStand.setRunLevel, - auth: { station: true, center: true } - }, - { - label: '属性', - handler: this.detail, - disabledCallback: MenuDisabledState.StationStand.detail, - auth: { station: true, center: true } - } - ] - }, - menuForce: [ - { - label: '设置故障', - handler: this.setStoppage, - disabledCallback: MenuDisabledState.StationStand.setStoppage - }, - { - label: '取消故障', - handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.StationStand.cancelStoppage - } - ] - }; - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - watch: { - '$store.state.menuOperation.menuCount': function (val) { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) { - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - 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: 'StationStandMenu', + components: { + PopMenu, + StandControl, + StandDetail, + NoticeInfo + }, + props: { + selected: { + type: Object, + default: () => { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + Local: [ + { + label: '设置跳停', + handler: this.setJumpStop, + cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + { + label: '取消跳停', + handler: this.cancelJumpStop, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + } + ], + Center: [ + { + label: '设置扣车', + handler: this.setDetainTrain, + cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN + }, + { + label: '取消扣车', + handler: this.cancelDetainTrain, + cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + { + label: '设置跳停', + handler: this.setJumpStop, + cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + { + label: '取消跳停', + handler: this.cancelJumpStop, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + }, + { + label: '设置停站时间', + handler: this.setStopTime, + cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME + }, + { + label: '设置站间运行等级', + handler: this.setRunLevel, + cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME + }, + { + label: '属性', + handler: this.detail, + cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS + } + ] + }, + menuForce: [ + { + label: '设置故障', + handler: this.setStoppage, + cmdType: CMD.Stand.CMD_STAND_ADD_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + watch: { + '$store.state.menuOperation.menuCount': function (val) { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) { + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - 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(); - } - }, - // 设置故障 - setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.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 step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.stoppage.menu.operation, + cmdType: CMD.Stand.CMD_STAND_ADD_FAULT, + param: { + StationStand_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(step); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 取消故障 + cancelStoppage() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelStoppage.menu.operation, + cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT, + param: { + StationStand_Code: `${this.selected.code}` + } + }; - 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.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelStoppage.menu.operation - }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(step); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 设置扣车 + setDetainTrain() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } + }; - 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); - }); - }, - // 设置扣车 - setDetainTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation - }; - - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); - } - }); - }, - // 取消扣车 - cancelDetainTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); - } - }); - }, - // 设置跳停 - setJumpStop() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setJumpStop.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); - } - }); - }, - // 取消跳停 - cancelJumpStop() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelJumpStop.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); - } - }); - }, - // 停站时间控制 - setStopTime() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setStopTime.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected, tempDate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 设置运行等级 - setRunLevel() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setRunLevel.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected, tempDate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 查询站台状态 - detail() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.detail.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standDetail.doShow(operate, this.selected, tempDate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - } - } + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.standControl.doShow(step, this.selected); + } + }); + }, + // 取消扣车 + cancelDetainTrain() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.standControl.doShow(step, this.selected); + } + }); + }, + // 设置跳停 + setJumpStop() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.standControl.doShow(step, this.selected); + } + }); + }, + // 取消跳停 + cancelJumpStop() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.standControl.doShow(step, this.selected); + } + }); + }, + // 停站时间控制 + setStopTime() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setStopTime.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.standControl.doShow(step, this.selected, tempData); + }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 设置运行等级 + setRunLevel() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.standControl.doShow(step, this.selected, tempData); + }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 查询站台状态 + detail() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.detail.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.standDetail.doShow(step, this.selected, tempData); + }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + } + } }; diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue b/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue index e12a1e0ce..6a0a78562 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue @@ -12,442 +12,322 @@ import PopMenu from '@/components/PopMenu'; import SectionControl from './dialog/sectionControl'; import SwitchControl from './dialog/switchControl'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import CancelMouseState from '@/mixin/CancelMouseState'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; -import { mouseCancelState } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { - name: 'SwitchMenu', - components: { - PopMenu, - SectionControl, - SwitchControl, - NoticeInfo - }, - props: { - selected: { - type: Object, - default: () => { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [ - // { - // label: '单操到定位', - // handler: this.locate, - // disabledCallback: MenuDisabledState.Switch.locate, - // auth: { station: true, center: true } - // }, - // { - // label: '单操到反位', - // handler: this.reverse, - // disabledCallback: MenuDisabledState.Switch.reverse, - // auth: { station: true, center: true } - // }, - // { - // label: '道岔单锁', - // handler: this.lock, - // disabledCallback: MenuDisabledState.Switch.lock, - // auth: { station: true, center: false } - // }, - // { - // label: '道岔解锁', - // handler: this.unlock, - // disabledCallback: MenuDisabledState.Switch.unlock, - // auth: { station: true, center: true } - // }, - // { - // label: '道岔封锁', - // handler: this.block, - // disabledCallback: MenuDisabledState.Switch.block, - // auth: { station: true, center: true } - // }, - // { - // label: '道岔解封', - // handler: this.unblock, - // disabledCallback: MenuDisabledState.Switch.unblock, - // auth: { station: true, center: true } - // } - ], - central: [ - { - label: '单操到定位', - handler: this.locate, - disabledCallback: MenuDisabledState.Switch.locate, - auth: { station: true, center: true } - }, - { - label: '单操到反位', - handler: this.reverse, - disabledCallback: MenuDisabledState.Switch.reverse, - auth: { station: true, center: true } - }, - { - label: '道岔单锁', - handler: this.lock, - disabledCallback: MenuDisabledState.Switch.lock, - auth: { station: true, center: false } - }, - { - label: '道岔解锁', - handler: this.unlock, - disabledCallback: MenuDisabledState.Switch.unlock, - auth: { station: true, center: true } - }, - { - label: '道岔封锁', - handler: this.block, - disabledCallback: MenuDisabledState.Switch.block, - auth: { station: true, center: true } - }, - { - label: '道岔解封', - handler: this.unblock, - disabledCallback: MenuDisabledState.Switch.unblock, - auth: { station: true, center: true } - }, - { - label: '区故解', - handler: this.fault, - disabledCallback: MenuDisabledState.Switch.fault, - auth: { station: true, center: true } - } - // { - // label: '属性', - // handler: this.undeveloped, - // disabledCallback: MenuDisabledState.Switch.property, - // auth: { station: true, center: true } - // } - ] - }, - menuForce: [ - { - label: '设置故障', - handler: this.setStoppage, - disabledCallback: MenuDisabledState.Switch.setStoppage, - auth: { + name: 'SwitchMenu', + components: { + PopMenu, + SectionControl, + SwitchControl, + NoticeInfo + }, + mixins: [ + CancelMouseState + ], + props: { + selected: { + type: Object, + default: () => { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + Local: [], + Center: [ + { + label: '单操到定位', + handler: this.locate, + cmdType: CMD.Switch.CMD_SWITCH_TURN + }, + { + label: '单操到反位', + handler: this.reverse, + cmdType: CMD.Switch.CMD_SWITCH_TURN + }, + { + label: '道岔单锁', + handler: this.lock, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + }, + { + label: '道岔解锁', + handler: this.unlock, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + }, + { + label: '道岔封锁', + handler: this.block, + cmdType: CMD.Switch.CMD_SWITCH_BLOCK + }, + { + label: '道岔解封', + handler: this.unblock, + cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK + }, + { + label: '区故解', + handler: this.fault, + cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK + } + // { + // label: '属性', + // handler: this.undeveloped, + // auth: { station: true, center: true }, + // cmdType: CMD.Switch. + // } + ] + }, + menuForce: [ + { + label: '设置故障', + handler: this.setStoppage, + cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + watch: { + '$store.state.menuOperation.menuCount': function (val) { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) { + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = MenuContextHandler.covert(this.menuNormal); - } - }, - { - label: '取消故障', - handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Switch.cancelStoppage, - auth: { + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } - } - } - ] - }; - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - watch: { - '$store.state.menuOperation.menuCount': function (val) { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) { - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - 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]; - } + }, + 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, + operation: OperationEvent.Switch.stoppage.menu.operation, + cmdType: CMD.Switch.CMD_STOPPAGE, + param: { + Switch_Code: this.selected.code + } + }; - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } + // mouseCancelState(this.selected); + this.$store.dispatch('training/nextNew', 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, + operation: OperationEvent.Switch.cancelStoppage.menu.operation, + cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE, + param: { + Switch_Code: this.selected.code + } + }; - 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.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.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.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.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); - }); - }, - // 道岔单锁 - lock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.lock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 道岔解封 - unlock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.unlock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 道岔封锁 - block() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.block.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 道岔解封 - unblock() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.unblock.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 道岔强扳 - switchTurnoutForce() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.turnoutForce.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 道岔转动 - switchTurnout() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.turnout.menu.operation - }; - - if (operate.operation) { - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - } - }, - // 道岔故障解锁/ 区故解 - fault() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.fault.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 道岔取消速度 - cancelSpeed() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.cancelSpeed.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - const tempData = response.data; - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.speedCmdControl.doShow(operate, this.selected, tempData); - } - }); - }, - - // 区段切除 - split() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.split.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 区段激活 - active() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.active.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 单操到定位 - locate() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.locate.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - // 单操到反位 - reverse() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.reverse.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); - } - }); - }, - undeveloped() { - this.doClose(); - this.$alert('实现中......', '提示', { - confirmButtonText: '确定', - callback: action => { - } - }); - } - } + // mouseCancelState(this.selected); + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 道岔单锁 + lock() { + const operate = { + start: true, + operation: OperationEvent.Switch.lock.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + // 道岔解锁 + unlock() { + const operate = { + start: true, + operation: OperationEvent.Switch.unlock.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + // 道岔封锁 + block() { + const operate = { + start: true, + operation: OperationEvent.Switch.block.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + // 道岔解封 + unblock() { + const operate = { + start: true, + operation: OperationEvent.Switch.unblock.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + // 道岔故障解锁/ 区故解 + fault() { + const operate = { + start: true, + operation: OperationEvent.Switch.fault.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + // 区段激活 + active() { + const operate = { + start: true, + operation: OperationEvent.Switch.active.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + // 单操到定位 + locate() { + const operate = { + start: true, + operation: OperationEvent.Switch.locate.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + // 单操到反位 + reverse() { + const operate = { + start: true, + operation: OperationEvent.Switch.reverse.menu.operation, + param: { + Switch_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.switchControl.doShow(operate, this.selected); + } + }); + }, + undeveloped() { + this.doClose(); + this.$alert('实现中......', '提示', { + confirmButtonText: '确定', + callback: action => { + } + }); + } + } }; diff --git a/src/jmapNew/theme/chengdu_03/menus/menuTool.vue b/src/jmapNew/theme/chengdu_03/menus/menuTool.vue index 8c96fd532..4048cba5d 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuTool.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuTool.vue @@ -20,136 +20,136 @@ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue b/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue index 0e9da652a..8a6ebf24d 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue @@ -15,390 +15,376 @@ import PopMenu from '@/components/PopMenu'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; import TrainControl from './dialog/trainControl'; -// import TrainDelete from './dialog/trainDelete'; -// import TrainMove from './dialog/trainMove'; -// import TrainSwitch from './dialog/trainSwitch'; import TrainEditNumber from './dialog/trainEditNumber'; import TrainMoveNumber from './dialog/trainMoveNumber'; import TrainCreateNumber from './dialog/trainCreateNumber'; import TrainDeleteNumber from './dialog/trainDeleteNumber'; import TrainDetailInfo from './dialog/trainDetailInfo'; -import { mouseCancelState } from './utils/menuItemStatus'; +import CancelMouseState from '@/mixin/CancelMouseState'; export default { - name: 'MenuTrain', - components: { - PopMenu, - NoticeInfo, - TrainControl, - TrainEditNumber, - TrainMoveNumber, - TrainCreateNumber, - TrainDeleteNumber, - TrainDetailInfo - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [], - central: [ - { - label: '新建车组号', - handler: this.createTrainNo, - disabledCallback: MenuDisabledState.Train.createTrainNo, - auth: { station: true, center: true } - }, - { - label: '移动车组号', - handler: this.moveTrainNo, - disabledCallback: MenuDisabledState.Train.moveTrainNo, - auth: { station: true, center: true } - }, - { - label: '删除车组号', - handler: this.deleteTrainNo, - disabledCallback: MenuDisabledState.Train.deleteTrainNo, - auth: { station: true, center: true } - }, - { - label: '修改车组号', - handler: this.editTrainNo, - disabledCallback: MenuDisabledState.Train.editTrainNo, - auth: { station: true, center: true } - }, - { - label: '设计划车', - handler: this.setPlanTrainId, - disabledCallback: MenuDisabledState.Train.setPlanTrainId, - auth: { station: true, center: true } - }, - { - label: '设目的地', - handler: this.destinationTrainId, - disabledCallback: MenuDisabledState.Train.destinationTrainId, - auth: { station: true, center: true } - }, - { - label: '设人工车', - handler: this.artificialTrainId, - disabledCallback: MenuDisabledState.Train.artificialTrainId, - auth: { station: true, center: true } - }, - { - label: '设特殊人工车', - handler: this.undeveloped, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true} - }, - { - label: '详细列车信息', - handler: this.detailTrainInfo, - disabledCallback: MenuDisabledState.Train.detailTrainInfo, - auth: { station: true, center: true} - }, - { - label: '属性', - handler: this.undeveloped, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true} - } + name: 'MenuTrain', + components: { + PopMenu, + NoticeInfo, + TrainControl, + TrainEditNumber, + TrainMoveNumber, + TrainCreateNumber, + TrainDeleteNumber, + TrainDetailInfo + }, + mixins: [ + CancelMouseState + ], + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + local: [], + central: [ + { + label: '新建车组号', + handler: this.createTrainNo, + disabledCallback: MenuDisabledState.Train.createTrainNo, + auth: { station: true, center: true } + }, + { + label: '移动车组号', + handler: this.moveTrainNo, + disabledCallback: MenuDisabledState.Train.moveTrainNo, + auth: { station: true, center: true } + }, + { + label: '删除车组号', + handler: this.deleteTrainNo, + disabledCallback: MenuDisabledState.Train.deleteTrainNo, + auth: { station: true, center: true } + }, + { + label: '修改车组号', + handler: this.editTrainNo, + disabledCallback: MenuDisabledState.Train.editTrainNo, + auth: { station: true, center: true } + }, + { + label: '设计划车', + handler: this.setPlanTrainId, + disabledCallback: MenuDisabledState.Train.setPlanTrainId, + auth: { station: true, center: true } + }, + { + label: '设目的地', + handler: this.destinationTrainId, + disabledCallback: MenuDisabledState.Train.destinationTrainId, + auth: { station: true, center: true } + }, + { + label: '设人工车', + handler: this.artificialTrainId, + disabledCallback: MenuDisabledState.Train.artificialTrainId, + auth: { station: true, center: true } + }, + { + label: '设特殊人工车', + handler: this.undeveloped, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true} + }, + { + label: '详细列车信息', + handler: this.detailTrainInfo, + disabledCallback: MenuDisabledState.Train.detailTrainInfo, + auth: { station: true, center: true} + }, + { + label: '属性', + handler: this.undeveloped, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true} + } - ] - }, - menuForce: [ - { - label: '设置通信故障', - handler: this.setStoppage, - disabledCallback: MenuDisabledState.Train.setStoppage - }, - { - label: '取消通信故障', - handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Train.cancelStoppage - } - ], - menuSpeed: [ - { - label: '确认运行至前方站', - handler: this.limitSpeed, - disabledCallback: MenuDisabledState.Train.limitSpeed - } - ] - }; - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - watch: { - '$store.state.menuOperation.menuCount': function () { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) { - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - methods: { - clickEvent() { - const self = this; - window.onclick = function (e) { - self.doClose(); - }; - }, - initMenu() { - // 编辑模式菜单列表 - this.menu = trainMenuFiltration(this.menuNormal); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]; - } + ] + }, + menuForce: [ + { + label: '设置通信故障', + handler: this.setStoppage, + disabledCallback: MenuDisabledState.Train.setStoppage + }, + { + label: '取消通信故障', + handler: this.cancelStoppage, + disabledCallback: MenuDisabledState.Train.cancelStoppage + } + ], + menuSpeed: [ + { + label: '确认运行至前方站', + handler: this.limitSpeed, + disabledCallback: MenuDisabledState.Train.limitSpeed + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + watch: { + '$store.state.menuOperation.menuCount': function () { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) { + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = trainMenuFiltration(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = [...this.menuForce, ...this.menuSpeed]; - } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = [...this.menuForce, ...this.menuSpeed]; + } - this.menu = menuConvert(this.menu); - }, - doShow(point) { - this.clickEvent(); - this.initMenu(); + 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.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.stoppage.menu.operation - }; + 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, - 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.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.cancelStoppage.menu.operation - }; + operation: OperationEvent.Train.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); - }); - }, - // 限速行驶 - limitSpeed() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.limitSpeed.menu.operation - }; - 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); - }); - }, - // 设计划车 - setPlanTrainId() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.setPlanTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainControl.doShow(operate, this.selected); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }); - }, - // 设目的地车 - destinationTrainId() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.destinationTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainControl.doShow(operate, this.selected); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }); - }, - // 设人工车 - artificialTrainId() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.artificialTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainControl.doShow(operate, this.selected); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }); - }, - // 详细列车信息 - detailTrainInfo() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.detailTrainInfo.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDetailInfo.doShow(operate, this.selected); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }); - }, - // 创建车组号 - createTrainNo() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.createTrainNo.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainCreateNumber.doShow(operate, this.selected); - } - }); - }, - // 删除车组号 - deleteTrainNo() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.deleteTrainNo.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDeleteNumber.doShow(operate, this.selected); - } - }); - }, - // 修改车组号 - editTrainNo() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainNo.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainEditNumber.doShow(operate, this.selected); - } - }); - }, - // 移动车组号 - moveTrainNo() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.moveTrainNo.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainMoveNumber.doShow(operate, this.selected); - } - }); - }, - undeveloped() { - this.doClose(); - this.$alert('实现中......', '提示', { - confirmButtonText: '确定', - callback: action => { - } - }); - } - } + this.mouseCancelState(this.selected); + this.$store.dispatch('training/nextNew', 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, + + operation: OperationEvent.Train.cancelStoppage.menu.operation + }; + + this.mouseCancelState(this.selected); + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 限速行驶 + limitSpeed() { + const operate = { + start: true, + send: true, + code: this.selected.code, + + operation: OperationEvent.Train.limitSpeed.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 设计划车 + setPlanTrainId() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.setPlanTrainId.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainControl.doShow(operate, this.selected); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }); + }, + // 设目的地车 + destinationTrainId() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.destinationTrainId.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainControl.doShow(operate, this.selected); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }); + }, + // 设人工车 + artificialTrainId() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.artificialTrainId.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainControl.doShow(operate, this.selected); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }); + }, + // 详细列车信息 + detailTrainInfo() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.detailTrainInfo.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainDetailInfo.doShow(operate, this.selected); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }); + }, + // 创建车组号 + createTrainNo() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.createTrainNo.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainCreateNumber.doShow(operate, this.selected); + } + }); + }, + // 删除车组号 + deleteTrainNo() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.deleteTrainNo.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainDeleteNumber.doShow(operate, this.selected); + } + }); + }, + // 修改车组号 + editTrainNo() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.editTrainNo.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainEditNumber.doShow(operate, this.selected); + } + }); + }, + // 移动车组号 + moveTrainNo() { + const operate = { + start: true, + code: this.selected.code, + + operation: OperationEvent.Train.moveTrainNo.menu.operation + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainMoveNumber.doShow(operate, this.selected); + } + }); + }, + undeveloped() { + this.doClose(); + this.$alert('实现中......', '提示', { + confirmButtonText: '确定', + callback: action => { + } + }); + } + } }; diff --git a/src/jmapNew/theme/chengdu_03/menus/passiveDialog/alarm.vue b/src/jmapNew/theme/chengdu_03/menus/passiveDialog/alarm.vue index 268e5011f..593a2079d 100644 --- a/src/jmapNew/theme/chengdu_03/menus/passiveDialog/alarm.vue +++ b/src/jmapNew/theme/chengdu_03/menus/passiveDialog/alarm.vue @@ -77,7 +77,7 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js b/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js index c1f62d7f4..bb63524dd 100644 --- a/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js +++ b/src/jmapNew/theme/chengdu_03/menus/utils/menuItemStatus.js @@ -3,456 +3,456 @@ import deviceState from '@/jmap/constant/deviceState'; import { OperateMode } from '@/scripts/ConstDic'; export function getCurrentStateObject() { - return store.getters['menuOperation/selected']; + return store.getters['menuOperation/selected']; } /** 系统类型 */ -export const SystemType = { - '01': 'local', // 现地工作站 - '02': 'central' // 中心调度工作站 +export const State2SimulationMap = { + '01': 'local', // 现地工作站 + '02': 'central' // 中心调度工作站 }; -export const StationControlType = { - '01': 'center', // 中控 - '02': 'station', // 站控 - '03': 'station' +export const State2ControlMap = { + '01': 'center', // 中控 + '02': 'station', // 站控 + '03': 'station' }; // 控制禁用 export const MenuDisabledState = { - Section: { - // 故障解锁 - fault() { - }, - // 切除 - split() { - const device = getCurrentStateObject(); - if (device && device.cutOff != deviceState.Section.cutOff.Default) { - return true; - } - }, - // 激活 - active() { - const device = getCurrentStateObject(); - if (device && device.cutOff == deviceState.Section.cutOff.Default) { - return true; - } - }, - // 区段封锁 - lock() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.Section.status.State06) { - return true; - } - }, - // 区段解禁 - unlock() { - const device = getCurrentStateObject(); - if (device && device.status != deviceState.Section.status.State06) { - return true; - } - }, - // 区段设置限速 - setSpeed() { - }, - // 区段取消限速 - cancelSpeed() { - const device = getCurrentStateObject(); - if (device && device.speedUpperLimit == deviceState.Section.speedUpperLimit.Default) { - return true; - } - }, - // 新建列车 - newTrain() { - }, - // 计轴预复位 - axlePreReset() { - }, - // 设置计轴有效 - alxeEffective() { - }, - // 设置计轴失效 - alxeFailure() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.Section.status.State13) { - return true; - } - }, - // 设置故障 - setStoppage() { - const device = getCurrentStateObject(); - if (device && device.fault) { - return true; - } - }, - // 取消故障 - cancelStoppage() { - const device = getCurrentStateObject(); - if (device && !device.fault) { - return true; - } - } - }, - Signal: { - // 进路选排 - arrangementRoute() { + Section: { + // 故障解锁 + fault() { + }, + // 切除 + split() { + const device = getCurrentStateObject(); + if (device && device.cutOff != deviceState.Section.cutOff.Default) { + return true; + } + }, + // 激活 + active() { + const device = getCurrentStateObject(); + if (device && device.cutOff == deviceState.Section.cutOff.Default) { + return true; + } + }, + // 区段封锁 + lock() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Section.status.State06) { + return true; + } + }, + // 区段解禁 + unlock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Section.status.State06) { + return true; + } + }, + // 区段设置限速 + setSpeed() { + }, + // 区段取消限速 + cancelSpeed() { + const device = getCurrentStateObject(); + if (device && device.speedUpperLimit == deviceState.Section.speedUpperLimit.Default) { + return true; + } + }, + // 新建列车 + newTrain() { + }, + // 计轴预复位 + axlePreReset() { + }, + // 设置计轴有效 + alxeEffective() { + }, + // 设置计轴失效 + alxeFailure() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Section.status.State13) { + return true; + } + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + Signal: { + // 进路选排 + arrangementRoute() { - }, - // 进路取消 - cancelTrainRoute() { - }, - // 信号封闭 - lock() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.Signal.status.State05) { - return true; - } - }, - // 信号解封 - unlock() { - const device = getCurrentStateObject(); - if (device && device.status != deviceState.Signal.status.State05) { - return true; - } - }, - // 信号重开 - reopenSignal() { - }, - // 进路引导 - guide() { - }, - // 设置联锁自动进路 - setAutoInterlock() { - }, - // 取消联锁自动进路 - cancelAutoInterlock() { - }, - // 设置联锁自动触发 - setAutoTrigger() { - }, - // 取消联锁自动触发 - cancelAutoTrigger() { - }, - // 关灯 - signalClose() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.Signal.status.State01) { - return true; - } - }, - // 总人解 - humanTrainRoute() { - }, - // 人工控 - humanControl() { - }, - // ats自动控 - atsAutoControl() { - }, - // 查询进路状态 - detail() { - }, - // 设置故障 - setStoppage() { - const device = getCurrentStateObject(); - if (device && device.fault) { - return true; - } - }, - // 取消故障 - cancelStoppage() { - const device = getCurrentStateObject(); - if (device && !device.fault) { - return true; - } - } - }, - Station: { - // 全站设置联锁自动触发 - setAutoTrigger() { - }, - // 全站取消联锁自动触发 - cancelAutoTrigger() { - }, - // 上电解锁 - powerUnLock() { - }, - // 执行关键操作测试 - execKeyOperationTest() { - }, - // 所有进路自排开 - atsAutoControlALL() { - }, - // 所有进路自排关 - humanControlALL() { - }, - // 设置ZC故障 - setStoppage() { - const device = getCurrentStateObject(); - if (device && device.fault) { - return true; - } - }, - // 取消ZC故障 - cancelStoppage() { - const device = getCurrentStateObject(); - if (device && !device.fault) { - return true; - } - } - }, - StationControl: { - // 紧急站控 - emergencyStationControl() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.StationControl.status.State03) { - return true; - } - }, - // 请求站控 - requestStationControl() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.StationControl.status.State02) { - return true; - } - }, - // 强行站控 - forcedStationControl() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.StationControl.status.State02) { - return true; - } - }, - // 请求中控 - requestCentralControl() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.StationControl.status.State01) { - return true; - } - }, - // 设置故障 - setStoppage() { - const device = getCurrentStateObject(); - if (device && device.fault) { - return true; - } - }, - // 取消故障 - cancelStoppage() { - const device = getCurrentStateObject(); - if (device && !device.fault) { - return true; - } - } - }, - StationStand: { - // 设置扣车 - setDetainTrain() { - const device = getCurrentStateObject(); - if (device && device.holdStatus != deviceState.StationStand.holdStatus.State01) { - return true; - } - }, - // 取消扣车 - cancelDetainTrain() { - const device = getCurrentStateObject(); - if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) { - return true; - } - }, - // 强制取消扣车 - cancelDetainTrainForce() { - const device = getCurrentStateObject(); - if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) { - return true; - } - }, - // 设置全站扣车 - cancelDetainTrainAll() { - }, - // 设置运行等级 - setRunLevel() { - }, - // 设置停站时间 - setStopTime() { - }, - // 设置跳停 - setJumpStop() { - const device = getCurrentStateObject(); - if (device && device.jumpStopStatus != deviceState.StationStand.jumpStopStatus.State01) { - return true; - } - }, - // 取消跳停 - cancelJumpStop() { - const device = getCurrentStateObject(); - if (device && device.jumpStopStatus == deviceState.StationStand.jumpStopStatus.State01) { - return true; - } - }, - // 提前发车 - earlyDeparture() { - }, - // 站台详细信息 - detail() { - }, - // 设置折返策略 - setBackStrategy() { - }, - // 设置故障 - setStoppage() { - const device = getCurrentStateObject(); - if (device && device.fault) { - return true; - } - }, - // 取消故障 - cancelStoppage() { - const device = getCurrentStateObject(); - if (device && !device.fault) { - return true; - } - } - }, - Switch: { - // 单锁 - lock() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.Switch.status.State10) { - return true; - } - }, - // 解锁 - unlock() { - const device = getCurrentStateObject(); - if (device && device.status != deviceState.Switch.status.State10) { - return true; - } - }, - // 封锁 - block() { - const device = getCurrentStateObject(); - if (device && device.status == deviceState.Switch.status.State14) { - return true; - } - }, - // 解封 - unblock() { - const device = getCurrentStateObject(); - if (device && device.status != deviceState.Switch.status.State14) { - return true; - } - }, - // 强扳 - switchTurnoutForce() { - }, - // 转动 - switchTurnout() { - }, - // 道岔故障解锁 - fault() { - }, - // 计轴预复位 - axlePreReset() { - }, - // 道岔切除 - split() { - }, - // 道岔激活 - active() { - }, - // 道岔设置速度 - setSpeed() { - // const device = getCurrentStateObject(); - }, - // 设置计轴有效 - alxeEffective() { - }, - // 道岔取消速度 - cancelSpeed() { - }, - // 设置故障 - setStoppage() { - const device = getCurrentStateObject(); - if (device && device.fault) { - return true; - } - }, - // 取消故障 - cancelStoppage() { - const device = getCurrentStateObject(); - if (device && !device.fault) { - return true; - } - }, - // 单操到定位 - locate() { - }, - // 单操到反位 - reverse() { - }, - // 属性 - property() { - } - }, - Train: { - // 添加列车识别号 - addTrainId() { - }, - // 删除列车识别号 - delTrainId() { - }, - // 修改列车识别号 - editTrainId() { - }, - // 修改车组号 - editTrainNo() { - }, - // 创建车组号 - createTrainNo() { - }, - // 移动车组号 - moveTrainNo() { - }, - // 删除车组号 - deleteTrainNo() { - }, - // 移动列车识别号 - moveTrainId() { - }, - // 交换列车识别号 - switchTrainId() { - }, - // 设计划车 - setPlanTrainId() { - }, - // 设目的地车 - destinationTrainId() { - }, - // 设人工车 - artificialTrainId() { - }, - // 详细列车信息 - detailTrainInfo() { - }, - // 设置限速 - limitSpeed() { - }, - // 设置通信故障 - setStoppage() { - const device = getCurrentStateObject(); - if (device && device.fault) { - return true; - } - }, - // 取消通信故障 - cancelStoppage() { - const device = getCurrentStateObject(); - if (device && !device.fault) { - return true; - } - } - } + }, + // 进路取消 + cancelTrainRoute() { + }, + // 信号封闭 + lock() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Signal.status.State05) { + return true; + } + }, + // 信号解封 + unlock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Signal.status.State05) { + return true; + } + }, + // 信号重开 + reopenSignal() { + }, + // 进路引导 + guide() { + }, + // 设置联锁自动进路 + setAutoInterlock() { + }, + // 取消联锁自动进路 + cancelAutoInterlock() { + }, + // 设置联锁自动触发 + setAutoTrigger() { + }, + // 取消联锁自动触发 + cancelAutoTrigger() { + }, + // 关灯 + signalClose() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Signal.status.State01) { + return true; + } + }, + // 总人解 + humanTrainRoute() { + }, + // 人工控 + humanControl() { + }, + // ats自动控 + atsAutoControl() { + }, + // 查询进路状态 + detail() { + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + Station: { + // 全站设置联锁自动触发 + setAutoTrigger() { + }, + // 全站取消联锁自动触发 + cancelAutoTrigger() { + }, + // 上电解锁 + powerUnLock() { + }, + // 执行关键操作测试 + execKeyOperationTest() { + }, + // 所有进路自排开 + atsAutoControlALL() { + }, + // 所有进路自排关 + humanControlALL() { + }, + // 设置ZC故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消ZC故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + StationControl: { + // 紧急站控 + emergencyStationControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State03) { + return true; + } + }, + // 请求站控 + requestStationControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State02) { + return true; + } + }, + // 强行站控 + forcedStationControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State02) { + return true; + } + }, + // 请求中控 + requestCentralControl() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.StationControl.status.State01) { + return true; + } + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + StationStand: { + // 设置扣车 + setDetainTrain() { + const device = getCurrentStateObject(); + if (device && device.holdStatus != deviceState.StationStand.holdStatus.State01) { + return true; + } + }, + // 取消扣车 + cancelDetainTrain() { + const device = getCurrentStateObject(); + if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) { + return true; + } + }, + // 强制取消扣车 + cancelDetainTrainForce() { + const device = getCurrentStateObject(); + if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) { + return true; + } + }, + // 设置全站扣车 + cancelDetainTrainAll() { + }, + // 设置运行等级 + setRunLevel() { + }, + // 设置停站时间 + setStopTime() { + }, + // 设置跳停 + setJumpStop() { + const device = getCurrentStateObject(); + if (device && device.jumpStopStatus != deviceState.StationStand.jumpStopStatus.State01) { + return true; + } + }, + // 取消跳停 + cancelJumpStop() { + const device = getCurrentStateObject(); + if (device && device.jumpStopStatus == deviceState.StationStand.jumpStopStatus.State01) { + return true; + } + }, + // 提前发车 + earlyDeparture() { + }, + // 站台详细信息 + detail() { + }, + // 设置折返策略 + setBackStrategy() { + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + }, + Switch: { + // 单锁 + lock() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Switch.status.State10) { + return true; + } + }, + // 解锁 + unlock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Switch.status.State10) { + return true; + } + }, + // 封锁 + block() { + const device = getCurrentStateObject(); + if (device && device.status == deviceState.Switch.status.State14) { + return true; + } + }, + // 解封 + unblock() { + const device = getCurrentStateObject(); + if (device && device.status != deviceState.Switch.status.State14) { + return true; + } + }, + // 强扳 + switchTurnoutForce() { + }, + // 转动 + switchTurnout() { + }, + // 道岔故障解锁 + fault() { + }, + // 计轴预复位 + axlePreReset() { + }, + // 道岔切除 + split() { + }, + // 道岔激活 + active() { + }, + // 道岔设置速度 + setSpeed() { + // const device = getCurrentStateObject(); + }, + // 设置计轴有效 + alxeEffective() { + }, + // 道岔取消速度 + cancelSpeed() { + }, + // 设置故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + }, + // 单操到定位 + locate() { + }, + // 单操到反位 + reverse() { + }, + // 属性 + property() { + } + }, + Train: { + // 添加列车识别号 + addTrainId() { + }, + // 删除列车识别号 + delTrainId() { + }, + // 修改列车识别号 + editTrainId() { + }, + // 修改车组号 + editTrainNo() { + }, + // 创建车组号 + createTrainNo() { + }, + // 移动车组号 + moveTrainNo() { + }, + // 删除车组号 + deleteTrainNo() { + }, + // 移动列车识别号 + moveTrainId() { + }, + // 交换列车识别号 + switchTrainId() { + }, + // 设计划车 + setPlanTrainId() { + }, + // 设目的地车 + destinationTrainId() { + }, + // 设人工车 + artificialTrainId() { + }, + // 详细列车信息 + detailTrainInfo() { + }, + // 设置限速 + limitSpeed() { + }, + // 设置通信故障 + setStoppage() { + const device = getCurrentStateObject(); + if (device && device.fault) { + return true; + } + }, + // 取消通信故障 + cancelStoppage() { + const device = getCurrentStateObject(); + if (device && !device.fault) { + return true; + } + } + } }; /** @@ -460,21 +460,21 @@ export const MenuDisabledState = { * @param {Array} menu */ export function menuConvert(menu) { - if (menu.constructor === Array) { - menu.forEach(elem => { - if (elem.type === 'separator') { - elem.show = true; - return; - } - if (elem.disabledCallback.constructor === Function) { - // elem.disabled = elem.defaultDisabled; - if (!elem.defaultDisabled) { - elem.disabled = elem.disabledCallback(); - } - } - }); - } - return menu; + if (menu.constructor === Array) { + menu.forEach(elem => { + if (elem.type === 'separator') { + elem.show = true; + return; + } + if (elem.disabledCallback.constructor === Function) { + // elem.disabled = elem.defaultDisabled; + if (!elem.defaultDisabled) { + elem.disabled = elem.disabledCallback(); + } + } + }); + } + return menu; } /** @@ -482,39 +482,39 @@ export function menuConvert(menu) { * @param {*} menuObj */ export function menuBarConvert(menu, mode) { - if (menu) { - if (mode === OperateMode.NORMAL) { - menu.forEach(item => { - if (item.type === 'separator') { - item.show = true; - return; - } + if (menu) { + if (mode === OperateMode.NORMAL) { + menu.forEach(item => { + if (item.type === 'separator') { + item.show = true; + return; + } - item.show = false; - if (!item.click) { - item.click = () => { }; - } + item.show = false; + if (!item.click) { + item.click = () => { }; + } - if (!item.froce) { - item.show = true; - if (item.children && item.children.length > 0) { - menuBarConvert(item.children, mode); - } - } - }); - } else if (mode === OperateMode.ADMIN) { - menu.forEach(item => { - item.show = true; - if (!item.click) { - item.click = () => { }; - } - if (item.children && item.children.length > 0) { - menuBarConvert(item.children, mode); - } - }); - } - } - return menu || []; + if (!item.froce) { + item.show = true; + if (item.children && item.children.length > 0) { + menuBarConvert(item.children, mode); + } + } + }); + } else if (mode === OperateMode.ADMIN) { + menu.forEach(item => { + item.show = true; + if (!item.click) { + item.click = () => { }; + } + if (item.children && item.children.length > 0) { + menuBarConvert(item.children, mode); + } + }); + } + } + return menu || []; } /** @@ -522,80 +522,80 @@ export function menuBarConvert(menu, mode) { * @param {Array} menu */ export function menuFiltration(menuObj) { - var selected = getCurrentStateObject(); - var control; - var menu = []; + var selected = getCurrentStateObject(); + var control; + var menu = []; - if (selected._type == 'StationStand') { - control = store.getters['map/getStationControlByStationCode'](selected.deviceStationCode); - } else if (selected._type == 'Station') { - control = store.getters['map/getStationControlByStationCode'](selected.code); - } else { - control = store.getters['map/getStationControlByStationCode'](selected.stationCode); - } + if (selected._type == 'StationStand') { + control = store.getters['map/getStationControlByStationCode'](selected.deviceStationCode); + } else if (selected._type == 'Station') { + control = store.getters['map/getStationControlByStationCode'](selected.code); + } else { + control = store.getters['map/getStationControlByStationCode'](selected.stationCode); + } - if (control) { - if (store.state.training.prdType != '') { - const type = SystemType[store.state.training.prdType]; - const status = StationControlType[control.status]; - menu = [...menuObj[type]]; - if (menu.constructor === Array) { - menu.forEach(elem => { - if (elem.type === 'separator') { - elem.show = true; - return; - } + if (control) { + if (store.state.training.prdType != '') { + const type = State2SimulationMap[store.state.training.prdType]; + const status = State2ControlMap[control.status]; + menu = [...menuObj[type]]; + if (menu.constructor === Array) { + menu.forEach(elem => { + if (elem.type === 'separator') { + elem.show = true; + return; + } - if (elem.auth.constructor === Object) { - elem.show = true; - if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示 - elem.show = false; - } - elem.defaultDisabled = !elem.auth[status]; - } - }); - } - } - } - return menu; + if (elem.auth.constructor === Object) { + elem.show = true; + if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示 + elem.show = false; + } + elem.defaultDisabled = !elem.auth[status]; + } + }); + } + } + } + return menu; } /** * 将train menu的show属性过滤返回 */ export function trainMenuFiltration(menuObj) { - var menu = []; - if (store.state.training.prdType != '') { - var type = SystemType[store.state.training.prdType]; - menu = [...menuObj[type]]; - if (menu.constructor === Array) { - menu.forEach(elem => { - if (elem.type === 'separator') { - elem.show = true; - return; - } + var menu = []; + if (store.state.training.prdType != '') { + var type = State2SimulationMap[store.state.training.prdType]; + menu = [...menuObj[type]]; + if (menu.constructor === Array) { + menu.forEach(elem => { + if (elem.type === 'separator') { + elem.show = true; + return; + } - if (elem.auth.constructor === Object) { - elem.show = true; - if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示 - elem.show = false; - } - } - }); - } - } - return menu; + if (elem.auth.constructor === Object) { + elem.show = true; + if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示 + elem.show = false; + } + } + }); + } + } + return menu; } /** * 离开菜单以及执行完菜单取消选中状态 */ export function mouseCancelState(device) { - // Object.assign(device, { _selected: false }); - // var viewInstance = store.state.map.jlmap.getViewInstanceByDevice({ _type: device._type, _code: device.code }); - // if (viewInstance && viewInstance['mouseleave']) { - // viewInstance['selected'] = false; - // viewInstance['mouseleave'](store.state.map.jlmap._zr.curEvent); - // } + // Object.assign(device, { _selected: false }); + // var viewInstance = store.state.map.jlmap.getViewInstanceByDevice({ _type: device._type, _code: device.code }); + // if (viewInstance && viewInstance['mouseleave']) { + // viewInstance['selected'] = false; + // viewInstance['mouseleave'](store.state.map.jlmap._zr.curEvent); + // } } diff --git a/src/jmapNew/theme/chengdu_03/planConvert.js b/src/jmapNew/theme/chengdu_03/planConvert.js index ab02e8675..eb9d96a3b 100644 --- a/src/jmapNew/theme/chengdu_03/planConvert.js +++ b/src/jmapNew/theme/chengdu_03/planConvert.js @@ -127,7 +127,6 @@ export default { /** 创建一条完成的服务数据*/ opt.name += j; var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle)); - if (model) { models.push(model); opt = { name: '', markPointData: [], data: [] }; diff --git a/src/jmapNew/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue b/src/jmapNew/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue index c85893d53..bc5dd37fc 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/dialog/childDialog/childDialog/noticeInfo.vue @@ -25,7 +25,7 @@ diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue index a5cbb4993..0efa0bfed 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue @@ -15,9 +15,10 @@ import StationHumanControlAll from './dialog/stationHumanControlAll'; import StationSetRouteControlAll from './dialog/stationSetRouteControlAll'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { name: 'StationMenu', @@ -40,63 +41,60 @@ export default { return { menu: [], menuNormal: { - local: [ + Local: [ { label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'), handler: this.setAutoTrigger, - disabledCallback: MenuDisabledState.Station.setAutoTrigger, - auth: { station: true, center: false } + cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER }, { label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'), handler: this.cancelAutoTrigger, - disabledCallback: MenuDisabledState.Station.cancelAutoTrigger, - auth: { station: true, center: false } - }, - { - label: this.$t('menu.menuStation.powerUnLock'), - handler: this.powerUnLock, - disabledCallback: MenuDisabledState.Station.powerUnLock, - auth: { station: true, center: false } - }, - { - label: this.$t('menu.menuStation.execKeyOperationTest'), - handler: this.execKeyOperationTest, - disabledCallback: MenuDisabledState.Station.execKeyOperationTest, - auth: { station: true, center: false } + cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER } + // { + // label: this.$t('menu.menuStation.powerUnLock'), + // handler: this.powerUnLock, + // auth: { station: true, center: false } + // // cmdType: CMD.Station. + // }, + // { + // label: this.$t('menu.menuStation.execKeyOperationTest'), + // handler: this.execKeyOperationTest, + // auth: { station: true, center: false } + // // cmdType: CMD.Station. + // } ], - central: [ + Center: [ { label: this.$t('menu.menuStation.allHumanControl'), handler: this.humanControlALL, - disabledCallback: MenuDisabledState.Station.humanControlALL, - auth: { station: false, center: true } + cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING }, { label: this.$t('menu.menuStation.allATSAutoControl'), handler: this.atsAutoControlALL, - disabledCallback: MenuDisabledState.Station.atsAutoControlALL, - auth: { station: false, center: true } - }, - { - label: this.$t('menu.menuStation.execKeyOperationTest'), - handler: this.execKeyOperationTest, - disabledCallback: MenuDisabledState.Station.execKeyOperationTest, - auth: { station: false, center: true } + cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING } + // { + // label: this.$t('menu.menuStation.execKeyOperationTest'), + // handler: this.execKeyOperationTest, + // auth: { station: false, center: true }, + // cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING + // // cmdType: CMD.Section. + // } ] }, menuForce: [ { label: this.$t('menu.menuStation.setStoppage'), handler: this.setStoppage, - disabledCallback: MenuDisabledState.Station.setStoppage + cmdType: CMD.Station.CMD_STATION_ADD_FAULT }, { label: this.$t('menu.menuStation.cancelStoppage'), handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Station.cancelStoppage + cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT } ] }; @@ -130,7 +128,8 @@ export default { this.menu = []; if (this.selected.concentrateStationCode == this.selected.code) { // 编辑模式菜单列表 - this.menu = menuFiltration(this.menuNormal); + // this.menu = MenuContextHandler.menuFiltration(this.menuNormal); + this.menu = MenuContextHandler.covert(this.menuNormal); if (this.operatemode === OperateMode.ADMIN) { this.menu = [...this.menu, ...this.menuForce]; } @@ -143,7 +142,7 @@ export default { } } - this.menu = menuConvert(this.menu); + // this.menu = MenuContextHandler.covert(this.menu); }, doShow(point) { this.clickEvent(); @@ -159,141 +158,149 @@ export default { }, // 设置故障 setStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.stoppage.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.stoppage.menu.operation, + cmdType: CMD.Station.CMD_STOPPAGE, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.cancelStoppage.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.cancelStoppage.menu.operation, + cmdType: CMD.Station.CMD_CANCEL_STOPPAGE, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 全站设置联锁自动触发 setAutoTrigger() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.setAutoTrigger.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.setAutoTrigger.menu.operation, + cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 全站取消联锁自动触发 cancelAutoTrigger() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.cancelAutoTrigger.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.cancelAutoTrigger.menu.operation, + cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 上电解锁 powerUnLock() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.powerUnLock.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.powerUnLock.menu.operation, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationCmdControl.doShow(operate, this.selected); + this.$refs.stationCmdControl.doShow(step, this.selected); } }); }, // 执行关键操作测试 execKeyOperationTest() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.execKeyOperationTest.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.execKeyOperationTest.menu.operation, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationCmdControl.doShow(operate, this.selected); + this.$refs.stationCmdControl.doShow(step, this.selected); } }); }, // 所有进路自排关 humanControlALL() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.humanControlALL.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.humanControlALL.menu.operation, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationHumanControlAll.doShow(operate); + this.$refs.stationHumanControlAll.doShow(step); } }); }, // 所有进路自排开 atsAutoControlALL() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Station.type, - label: MapDeviceType.Station.label, - operation: OperationEvent.Station.atsAutoControlALL.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.Station.atsAutoControlALL.menu.operation, + param: { + Station_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationSetRouteControlAll.doShow(operate, this.selected); + this.$refs.stationSetRouteControlAll.doShow(step, this.selected); } }); } diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStationControl.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStationControl.vue deleted file mode 100644 index ddecefc8a..000000000 --- a/src/jmapNew/theme/fuzhou_01/menus/menuStationControl.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue index a0c7f8d5b..f96f1ebd0 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue @@ -20,10 +20,12 @@ import StandRunLevel from './dialog/standRunLevel'; import StandStopTime from './dialog/standStopTime'; import StandDetainTrainAll from './dialog/standDetainTrainAll'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; +import Handler from '@/scripts/cmdPlugin/Handler'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { name: 'StationStandMenu', @@ -49,128 +51,103 @@ export default { return { menu: [], menuNormal: { - local: [ + Local: [ { label: this.$t('menu.menuStationStand.detainTrain'), handler: this.setDetainTrain, - disabledCallback: MenuDisabledState.StationStand.setDetainTrain, - auth: { station: true, center: false } + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN }, { label: this.$t('menu.menuStationStand.cancelDetainTrain'), handler: this.cancelDetainTrain, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain, - auth: { station: true, center: false } + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN }, { label: this.$t('menu.menuStationStand.cancelDetainTrainForce'), handler: this.cancelDetainTrainForce, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce, - auth: { station: true, center: false } + cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN }, { label: this.$t('menu.menuStationStand.jumpStop'), handler: this.setJumpStop, - disabledCallback: MenuDisabledState.StationStand.setJumpStop, - auth: { station: true, center: false } + cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP }, { label: this.$t('menu.menuStationStand.cancelJumpStop'), handler: this.cancelJumpStop, - disabledCallback: MenuDisabledState.StationStand.cancelJumpStop, - auth: { station: true, center: false } + cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP }, { label: this.$t('menu.menuStationStand.setRunLevel'), handler: this.setRunLevel, - disabledCallback: MenuDisabledState.StationStand.setRunLevel, - auth: { station: false, center: false } + cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME }, { label: this.$t('menu.menuStationStand.setEarlyDeparture'), handler: this.earlyDeparture, - disabledCallback: MenuDisabledState.StationStand.earlyDeparture, - auth: { station: false, center: false } + cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART }, { label: this.$t('menu.menuStationStand.setBackStrategy'), handler: this.setBackStrategy, - disabledCallback: MenuDisabledState.StationStand.setBackStrategy, - auth: { station: false, center: false } + cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY }, { label: this.$t('menu.menuStationStand.getStationStandStatus'), handler: this.detail, - disabledCallback: MenuDisabledState.StationStand.detail, - auth: { station: true, center: false } + cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS } ], - central: [ + Center: [ { label: this.$t('menu.menuStationStand.detainTrain'), handler: this.setDetainTrain, - disabledCallback: MenuDisabledState.StationStand.setDetainTrain, - auth: { station: false, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN }, { label: this.$t('menu.menuStationStand.cancelDetainTrain'), handler: this.cancelDetainTrain, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain, - auth: { station: false, center: true } - }, - { - label: this.$t('menu.menuStationStand.cancelDetainTrainForce'), - handler: this.cancelDetainTrainForce, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce, - auth: { station: false, center: false } + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN }, { label: this.$t('menu.menuStationStand.cancelDetainTrainAll'), handler: this.cancelDetainTrainAll, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll, - auth: { station: false, center: true } + cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN }, { label: this.$t('menu.menuStationStand.jumpStop'), handler: this.setJumpStop, - disabledCallback: MenuDisabledState.StationStand.setJumpStop, - auth: { station: false, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP }, { label: this.$t('menu.menuStationStand.cancelJumpStop'), handler: this.cancelJumpStop, - disabledCallback: MenuDisabledState.StationStand.cancelJumpStop, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP }, { label: this.$t('menu.menuStationStand.setStopTime'), handler: this.setStopTime, - disabledCallback: MenuDisabledState.StationStand.setStopTime, - auth: { station: false, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME }, { label: this.$t('menu.menuStationStand.setRunLevel'), handler: this.setRunLevel, - disabledCallback: MenuDisabledState.StationStand.setRunLevel, - auth: { station: false, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME }, { label: this.$t('menu.menuStationStand.setEarlyDeparture'), handler: this.earlyDeparture, - disabledCallback: MenuDisabledState.StationStand.earlyDeparture, - auth: { station: false, center: true } + cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART }, { label: this.$t('menu.menuStationStand.setBackStrategy'), handler: this.setBackStrategy, - disabledCallback: MenuDisabledState.StationStand.setBackStrategy, - auth: { station: false, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY }, { label: this.$t('menu.menuStationStand.getStationStandStatus'), handler: this.detail, - disabledCallback: MenuDisabledState.StationStand.detail, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS } ] }, @@ -178,12 +155,12 @@ export default { { label: this.$t('menu.menuStationStand.setFault'), handler: this.setStoppage, - disabledCallback: MenuDisabledState.StationStand.setStoppage + cmdType:CMD.Stand.CMD_STAND_ADD_FAULT }, { label: this.$t('menu.menuStationStand.cancelFault'), handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.StationStand.cancelStoppage + cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT } ] }; @@ -215,7 +192,8 @@ export default { }, initMenu() { // 编辑模式菜单列表 - this.menu = menuFiltration(this.menuNormal); + this.menu = MenuContextHandler.covert(this.menuNormal); + // this.menu = MenuContextHandler.menuFiltration(this.menuNormal); if (this.operatemode === OperateMode.ADMIN) { this.menu = [...this.menu, ...this.menuForce]; } @@ -225,7 +203,7 @@ export default { this.menu = this.menuForce; } - this.menu = menuConvert(this.menu); + // this.menu = MenuContextHandler.covert(this.menu); }, doShow(point) { this.clickEvent(); @@ -241,246 +219,253 @@ export default { }, // 设置故障 setStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.stoppage.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.stoppage.menu.operation, + cmdType: CMD.Stand.CMD_STAND_ADD_FAULT, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelStoppage.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelStoppage.menu.operation, + cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 设置扣车 setDetainTrain() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 取消扣车 cancelDetainTrain() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 强制取消扣车 cancelDetainTrainForce() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 全线取消扣车 cancelDetainTrainAll() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standDetainTrainAll.doShow(operate, this.selected); + this.$refs.standDetainTrainAll.doShow(step, this.selected); } }); }, // 设置跳停 setJumpStop() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setJumpStop.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 取消跳停 cancelJumpStop() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelJumpStop.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 设置停站时间 setStopTime() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setStopTime.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setStopTime.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/next', step).then(({ valid, response }) => { if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standStopTime.doShow(operate, this.selected, tempDate); + Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.standStopTime.doShow(step, this.selected, tempData); + }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 设置运行等级 setRunLevel() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setRunLevel.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/next', step).then(({ valid, response }) => { if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standRunLevel.doShow(operate, this.selected, tempDate); + Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.standRunLevel.doShow(step, this.selected, tempData); + }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 设置提前发车 earlyDeparture() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.earlyDeparture.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 设置折返策略 setBackStrategy() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.setBackStrategy.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setBackStrategy.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/next', step).then(({ valid, response }) => { if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate); + Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.standBackStrategy.doShow(step, this.selected, tempData); + }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 查询站台状态 detail() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.detail.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.detail.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/next', step).then(({ valid, response }) => { if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standDetail.doShow(operate, this.selected, tempDate); + Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + const tempData = resp.data; + this.$refs.standDetail.doShow(step, this.selected, tempData); + }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); } } diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue index 8c18ebee9..a62a42a12 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue @@ -14,10 +14,11 @@ import SwitchControl from './dialog/switchControl'; import SwitchCmdControl from './dialog/switchCmdControl'; import SpeedCmdControl from './dialog/speedCmdControl'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { name: 'SwitchMenu', @@ -40,134 +41,132 @@ export default { return { menu: [], menuNormal: { - local: [ + Local: [ { label: this.$t('menu.menuSwitch.switchLock'), handler: this.lock, - disabledCallback: MenuDisabledState.Switch.lock, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK }, { label: this.$t('menu.menuSwitch.switchUnlock'), handler: this.unlock, - disabledCallback: MenuDisabledState.Switch.unlock, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK }, { label: this.$t('menu.menuSwitch.switchSectionBlockade'), handler: this.block, - disabledCallback: MenuDisabledState.Switch.block, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_BLOCK }, { label: this.$t('menu.menuSwitch.switchSectionUnblock'), handler: this.unblock, - disabledCallback: MenuDisabledState.Switch.unblock, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK }, { label: this.$t('menu.menuSwitch.switchTurnout'), handler: this.switchTurnout, - disabledCallback: MenuDisabledState.Switch.switchTurnout, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_TURN }, { label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'), handler: this.fault, - disabledCallback: MenuDisabledState.Switch.fault, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK }, { label: this.$t('menu.menuSwitch.switchSectionAxisPreReset'), handler: this.axlePreReset, - disabledCallback: MenuDisabledState.Switch.axlePreReset, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET }, { label: this.$t('menu.menuSwitch.sectionResection'), handler: this.split, - disabledCallback: MenuDisabledState.Switch.split, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF }, { label: this.$t('menu.menuSwitch.sectionActive'), handler: this.active, - disabledCallback: MenuDisabledState.Switch.active, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_ACTIVE }, { label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'), handler: this.setSpeed, - disabledCallback: MenuDisabledState.Switch.setSpeed, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED }, { label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'), handler: this.cancelSpeed, - disabledCallback: MenuDisabledState.Switch.cancelSpeed, - auth: { station: true, center: false } + auth: { station: true, center: false }, + cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED } ], - central: [ + Center: [ { label: this.$t('menu.menuSwitch.switchLock'), handler: this.lock, - disabledCallback: MenuDisabledState.Switch.lock, - auth: { station: false, center: true } + auth: { station: false, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK }, { label: this.$t('menu.menuSwitch.switchUnlock'), handler: this.unlock, - disabledCallback: MenuDisabledState.Switch.unlock, - auth: { station: false, center: true } + auth: { station: false, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK }, { label: this.$t('menu.menuSwitch.switchSectionBlockade'), handler: this.block, - disabledCallback: MenuDisabledState.Switch.block, - auth: { station: false, center: true } + auth: { station: false, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_BLOCK }, { label: this.$t('menu.menuSwitch.switchSectionUnblock'), handler: this.unblock, - disabledCallback: MenuDisabledState.Switch.unblock, - auth: { station: false, center: true } + auth: { station: false, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK }, { label: this.$t('menu.menuSwitch.switchTurnout'), handler: this.switchTurnout, - disabledCallback: MenuDisabledState.Switch.switchTurnout, - auth: { station: false, center: true } + auth: { station: false, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_TURN }, { label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'), handler: this.fault, - disabledCallback: MenuDisabledState.Switch.fault, - auth: { station: false, center: true } + auth: { station: false, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK }, { label: this.$t('menu.menuSwitch.sectionResection'), handler: this.split, - disabledCallback: MenuDisabledState.Switch.split, - auth: { station: true, center: true } + auth: { station: true, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF }, { label: this.$t('menu.menuSwitch.sectionActive'), handler: this.active, - disabledCallback: MenuDisabledState.Switch.active, - auth: { station: true, center: true } + auth: { station: true, center: true }, + cmdType:CMD.Switch.CMD_SWITCH_ACTIVE }, { label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'), handler: this.setSpeed, - disabledCallback: MenuDisabledState.Switch.setSpeed, - auth: { station: false, center: true } + cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED }, { label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'), handler: this.cancelSpeed, - disabledCallback: MenuDisabledState.Switch.cancelSpeed, - auth: { station: false, center: true } + cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED } ] }, @@ -175,18 +174,18 @@ export default { { label: this.$t('menu.menuSwitch.setFault'), handler: this.setStoppage, - disabledCallback: MenuDisabledState.Switch.setStoppage, auth: { - } + }, + cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT }, { label: this.$t('menu.menuSwitch.cancelFault'), handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Switch.cancelStoppage, auth: { - } + }, + cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT } ] }; @@ -218,7 +217,8 @@ export default { }, initMenu() { // 编辑模式菜单列表 - this.menu = menuFiltration(this.menuNormal); + this.menu = MenuContextHandler.covert(this.menuNormal); + // this.menu = MenuContextHandler.menuFiltration(this.menuNormal); if (this.operatemode === OperateMode.ADMIN) { this.menu = [...this.menu, ...this.menuForce]; } @@ -228,7 +228,7 @@ export default { this.menu = this.menuForce; } - this.menu = menuConvert(this.menu); + // this.menu = MenuContextHandler.covert(this.menu); }, doShow(point) { this.clickEvent(); @@ -244,242 +244,255 @@ export default { }, // 设置故障 setStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.stoppage.menu.operation + + operation: OperationEvent.Switch.stoppage.menu.operation, + cmdType: CMD.Switch.CMD_STOPPAGE, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.cancelStoppage.menu.operation + + operation: OperationEvent.Switch.cancelStoppage.menu.operation, + cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 道岔单锁 lock() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.lock.menu.operation + + operation: OperationEvent.Switch.lock.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); + this.$refs.switchControl.doShow(step, this.selected); } }); }, // 道岔解封 unlock() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.unlock.menu.operation + + operation: OperationEvent.Switch.unlock.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchCmdControl.doShow(operate, this.selected); + this.$refs.switchCmdControl.doShow(step, this.selected); } }); }, // 道岔封锁 block() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.block.menu.operation + + operation: OperationEvent.Switch.block.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); + this.$refs.switchControl.doShow(step, this.selected); } }); }, // 道岔解封 unblock() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.unblock.menu.operation + + operation: OperationEvent.Switch.unblock.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchCmdControl.doShow(operate, this.selected); + this.$refs.switchCmdControl.doShow(step, this.selected); } }); }, // 道岔强扳 switchTurnoutForce() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.turnoutForce.menu.operation + + operation: OperationEvent.Switch.turnoutForce.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); + this.$refs.switchControl.doShow(step, this.selected); } }); }, // 道岔转动 switchTurnout() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.turnout.menu.operation + + operation: OperationEvent.Switch.turnout.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - if (operate.operation) { - this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (step.operation) { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); + this.$refs.switchControl.doShow(step, this.selected); } }); } }, // 道岔故障解锁 fault() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.fault.menu.operation + + operation: OperationEvent.Switch.fault.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchCmdControl.doShow(operate, this.selected); + this.$refs.switchCmdControl.doShow(step, this.selected); } }); }, // 道岔计轴预复位 axlePreReset() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.axlePreReset.menu.operation + + operation: OperationEvent.Switch.axlePreReset.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchCmdControl.doShow(operate, this.selected); + this.$refs.switchCmdControl.doShow(step, this.selected); } }); }, // 区段切除 split() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.split.menu.operation + + operation: OperationEvent.Switch.split.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); + this.$refs.switchControl.doShow(step, this.selected); } }); }, // 区段激活 active() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.active.menu.operation + + operation: OperationEvent.Switch.active.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.switchControl.doShow(operate, this.selected); + this.$refs.switchControl.doShow(step, this.selected); } }); }, // 道岔设置速度 setSpeed() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.setSpeed.menu.operation + + operation: OperationEvent.Switch.setSpeed.menu.operation, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.speedCmdControl.doShow(operate, this.selected); + this.$refs.speedCmdControl.doShow(step, this.selected); } }); }, // 道岔取消速度 cancelSpeed() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Switch.type, - label: MapDeviceType.Switch.label, - operation: OperationEvent.Switch.cancelSpeed.menu.operation + + operation: OperationEvent.Switch.cancelSpeed.menu.operation, + cmdType: CMD.Switch.CMD_CANCEL_SPEED, + param: { + Switch_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/next', step).then(({ valid, response }) => { if (valid) { const tempData = response.data; this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.speedCmdControl.doShow(operate, this.selected, tempData); + this.$refs.speedCmdControl.doShow(step, this.selected, tempData); } }); } - } }; diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue b/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue index 40679a35d..7f215a543 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue @@ -14,14 +14,15 @@ import PopMenu from '@/components/PopMenu'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; import TrainControl from './dialog/trainControl'; import TrainDelete from './dialog/trainDelete'; import TrainMove from './dialog/trainMove'; import TrainSwitch from './dialog/trainSwitch'; import TrainEditNumber from './dialog/trainEditNumber'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { name: 'MenuTrain', @@ -46,63 +47,63 @@ export default { return { menu: [], menuNormal: { - local: [], - central: [ - { - label: this.$t('menu.menuTrain.addTrainId'), - handler: this.addTrainId, - disabledCallback: MenuDisabledState.Train.addTrainId, - auth: { station: true, center: true } - }, - { - label: this.$t('menu.menuTrain.deleteTrainId'), - handler: this.delTrainId, - disabledCallback: MenuDisabledState.Train.delTrainId, - auth: { station: true, center: true } - }, - { - label: this.$t('menu.menuTrain.editTrainId'), - handler: this.editTrainId, - disabledCallback: MenuDisabledState.Train.editTrainId, - auth: { station: true, center: true } - }, - { - label: this.$t('menu.menuTrain.editTrainNo'), - handler: this.editTrainNo, - disabledCallback: MenuDisabledState.Train.editTrainNo, - auth: { station: true, center: true } - }, - { - label: this.$t('menu.menuTrain.moveTrainId'), - handler: this.moveTrainId, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - }, - { - label: this.$t('menu.menuTrain.switchTrainId'), - handler: this.switchTrainId, - disabledCallback: MenuDisabledState.Train.switchTrainId, - auth: { station: true, center: true } - } + Local: [], + Center: [ + // { + // label: this.$t('menu.menuTrain.addTrainId'), + // handler: this.addTrainId, + // auth: { station: true, center: true }, + // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT + // }, + // { + // label: this.$t('menu.menuTrain.deleteTrainId'), + // handler: this.delTrainId, + // auth: { station: true, center: true }, + // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT + // }, + // { + // label: this.$t('menu.menuTrain.editTrainId'), + // handler: this.editTrainId, + // auth: { station: true, center: true }, + // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT + // }, + // { + // label: this.$t('menu.menuTrain.editTrainNo'), + // handler: this.editTrainNo, + // auth: { station: true, center: true }, + // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT + // }, + // { + // label: this.$t('menu.menuTrain.moveTrainId'), + // handler: this.moveTrainId, + // auth: { station: true, center: true }, + // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT + // }, + // { + // label: this.$t('menu.menuTrain.switchTrainId'), + // handler: this.switchTrainId, + // auth: { station: true, center: true }, + // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT + // } ] }, menuForce: [ { label: this.$t('menu.menuTrain.setCommunicationFault'), handler: this.setStoppage, - disabledCallback: MenuDisabledState.Train.setStoppage + cmdType:CMD.Train.CMD_TRAIN_ADD_FAULT }, { label: this.$t('menu.menuTrain.cancelCommunicationFault'), handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Train.cancelStoppage + cmdType:CMD.Train.CMD_TRAIN_REMOVE_FAULT } ], menuSpeed: [ { label: this.$t('menu.menuTrain.confirmRunToFrontStation'), handler: this.limitSpeed, - disabledCallback: MenuDisabledState.Train.limitSpeed + cmdType:CMD.Train.CMD_TRAIN_MANUAL_LIMIT_DRIVE } ] }; @@ -134,7 +135,8 @@ export default { }, initMenu() { // 编辑模式菜单列表 - this.menu = trainMenuFiltration(this.menuNormal); + // this.menu = MenuContextHandler.menuFiltration(this.menuNormal); + this.menu = MenuContextHandler.covert(this.menuNormal); if (this.operatemode === OperateMode.ADMIN) { this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]; } @@ -144,7 +146,7 @@ export default { this.menu = [...this.menuForce, ...this.menuSpeed]; } - this.menu = menuConvert(this.menu); + // this.menu = MenuContextHandler.covert(this.menu); }, doShow(point) { this.clickEvent(); @@ -162,157 +164,166 @@ export default { }, // 设置故障 setStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.stoppage.menu.operation + + operation: OperationEvent.Train.stoppage.menu.operation, + cmdType: CMD.Train.CMD_STOPPAGE, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.cancelStoppage.menu.operation + + operation: OperationEvent.Train.cancelStoppage.menu.operation, + cmdType: CMD.Train.CMD_CANCEL_STOPPAGE, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 限速行驶 limitSpeed() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.limitSpeed.menu.operation + + operation: OperationEvent.Train.limitSpeed.menu.operation, + cmdType: CMD.Train.CMD_LIMIT_SPEED, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 添加列车识别号 addTrainId() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.addTrainId.menu.operation + + operation: OperationEvent.Train.addTrainId.menu.operation, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainControl.doShow(operate, this.selected); + this.$refs.trainControl.doShow(step, this.selected); } }); }, // 删除列车识别号 delTrainId() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.delTrainId.menu.operation + + operation: OperationEvent.Train.delTrainId.menu.operation, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDelete.doShow(operate, this.selected); + this.$refs.trainDelete.doShow(step, this.selected); } }); }, // 修改列车识别号 editTrainId() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainId.menu.operation + + operation: OperationEvent.Train.editTrainId.menu.operation, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainControl.doShow(operate, this.selected); + this.$refs.trainControl.doShow(step, this.selected); } }); }, // 修改车组号 editTrainNo() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainNo.menu.operation + + operation: OperationEvent.Train.editTrainNo.menu.operation, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainEditNumber.doShow(operate, this.selected); + this.$refs.trainEditNumber.doShow(step, this.selected); } }); }, // 移动列车识别号 moveTrainId() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.moveTrainId.menu.operation + + operation: OperationEvent.Train.moveTrainId.menu.operation, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainMove.doShow(operate, this.selected); + this.$refs.trainMove.doShow(step, this.selected); } }); }, // 交换列车识别号 switchTrainId() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.switchTrainId.menu.operation + + operation: OperationEvent.Train.switchTrainId.menu.operation, + param: { + code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/next', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainSwitch.doShow(operate, this.selected); + this.$refs.trainSwitch.doShow(step, this.selected); } }); } diff --git a/src/jmapNew/theme/fuzhou_01/menus/passiveDialog/alarm.vue b/src/jmapNew/theme/fuzhou_01/menus/passiveDialog/alarm.vue index d1f1124a9..471f03888 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/passiveDialog/alarm.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/passiveDialog/alarm.vue @@ -83,7 +83,7 @@ \ No newline at end of file diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue index 9c068f67b..3d5e6dd50 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue @@ -1,223 +1,245 @@ \ No newline at end of file +}; + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/standBulkBuckleTrain.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/standBulkBuckleTrain.vue new file mode 100644 index 000000000..f88a9c28b --- /dev/null +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/standBulkBuckleTrain.vue @@ -0,0 +1,229 @@ + + + + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue index 45ffac1fc..db49efb1e 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/standControl.vue @@ -1,15 +1,5 @@ diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index a56c603d3..f838cc4ff 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -21,393 +21,283 @@ import TrainCreate from './dialog/trainCreate'; import AlxeEffective from './dialog/alxeEffective'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; import { mouseCancelState } from './utils/menuItemStatus'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; 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, + cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK + }, + { + label: '区段激活', + handler: this.active, + cmdType: CMD.Section.CMD_SECTION_ACTIVE + }, + { + label: '区段切除', + handler: this.split, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF + }, + { + label: '区段封锁', + handler: this.lock, + cmdType: CMD.Section.CMD_SECTION_BLOCK + }, + { + label: '区段解封', + handler: this.unlock, + cmdType: CMD.Section.CMD_SECTION_UNBLOCK + } + ], + Center: [ + { + label: '区段跟踪激活', + handler: this.active, + cmdType: CMD.Section.CMD_SECTION_ACTIVE + }, + { + label: '区段跟踪切除', + handler: this.split, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF + }, + { + label: '确认计轴有效', + handler: this.alxeEffective, + cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE + }, + { + label: '设置临时限速', + handler: this.setSpeed, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED + } + ] + }, + menuForce: [ + { + label: '设置计轴失效', // 设置区段故障 + handler: this.alxeFailure, + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + 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(); + } + } + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = MenuContextHandler.covert(this.menuNormal); - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } + }, + 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, + code: this.selected.code, + operation: OperationEvent.Section.alxeFailure.menu.operation, + param: { + Section_Code: this.selected.code + } + }; - 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/nextNew', 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, + operation: OperationEvent.Section.fault.menu.operation, + param: { + Section_Code: this.selected.code + } + }; - 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/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionCmdControl.doShow(operate, this.selected); + } + }); + }, + // 切除 + split() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Section.split.menu.operation, + param: { + Section_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', 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, + operation: OperationEvent.Section.alxeEffective.menu.operation, + param: { + Section_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', 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, + operation: OperationEvent.Section.active.menu.operation, + param: { + Section_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionControl.doShow(operate, this.selected); + } + }); + }, + // 区段解锁 + lock() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Section.lock.menu.operation, + param: { + Section_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', 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, + operation: OperationEvent.Section.unlock.menu.operation, + param: { + Section_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.sectionCmdControl.doShow(operate, this.selected); + } + }); + }, + // 设置速度 + setSpeed() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Section.setSpeed.menu.operation, + param: { + Section_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.speedLimitControl.doShow(operate, this.selected); + } + }); + } + } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index 94bbeeeee..04e03d9b9 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -20,401 +20,422 @@ import RouteCmdControl from './dialog/routeCmdControl'; import RouteHandControl from './dialog/routeHandControl'; import RouteDetail from './dialog/routeDetail'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; -import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; + import { mouseCancelState } from './utils/menuItemStatus'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import { mapGetters } from 'vuex'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +// import { querySignalStatus } from '@/api/simulation'; 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, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE + }, + { + label: '取消进路', + handler: this.cancelTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE + }, + { + label: '信号重开', + handler: this.reopenSignal, + cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL + }, + { + label: '信号封锁', + handler: this.lock, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK + }, + { + label: '信号解封', + handler: this.unlock, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK + }, + { + label: '进路交人工控', + handler: this.humanControl, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING + }, + { + label: '进路交自动控', + handler: this.atsAutoControl, + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING + }, + { + label: '查询进路控制状态', + handler: this.detail, + cmdType: CMD.Signal.CMD_SIGNAL_DETAIL + } + ], + Center: [ + { + label: '设置进路', + handler: this.arrangementRoute, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE + }, + { + label: '取消列车进路', + handler: this.cancelTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE + }, + { + label: '信号重开', + handler: this.reopenSignal, + cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL + }, + { + label: '进路交人工控', + handler: this.humanControl, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING + }, + { + label: '进路交自动控', + handler: this.atsAutoControl, + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING + }, + { + label: '设置/取消通过模式', + handler: this.singalPassModel, + cmdType: CMD.Signal.CMD_SIGNAL_PASS_MODEL + }, + { + label: '查询进路控制状态', + handler: this.detail, + cmdType: CMD.Signal.CMD_SIGNAL_DETAIL + } + ] + }, + menuForce: [ + { + label: '信号关灯', + handler: this.signalClose, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL + }, + { + label: '设置故障', + handler: this.setStoppage, + cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]), + group() { + return this.$route.query.group; + } + }, + 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(); + } + } + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + this.menu = MenuContextHandler.covert(this.menuNormal); + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = this.menuForce; + } - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = this.menuForce; - } + }, + 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 step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.stoppage.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, + param: { + Signal_Code: `${this.selected.code}` + } + }; + mouseCancelState(this.selected); + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(step); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 取消故障 + cancelStoppage() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.cancelStoppage.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, + param: { + Signal_Code: `${this.selected.code}` + } + }; + mouseCancelState(this.selected); + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(step); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 排列进路 + arrangementRoute() { + const step = { + start: true, + code: `${this.selected.code}`, + operation: OperationEvent.Signal.arrangementRoute.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; - this.menu = menuConvert(this.menu); + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + // querySignalStatus(this.group, {signalCode: this.selected.code}).then(resp => { + // const tempData = resp.data; + const tempData = []; + this.$refs.routeSelection.doShow(step.operation, this.selected, tempData); + // }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); + }); + }, + // 取消进路 + cancelTrainRoute() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, + param: { + Signal_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 信号封锁 + lock() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.lock.menu.operation, + param: { + Signal_Code: this.selected.code + } + }; - }, - 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); - }); - }, - // 设置进路 - 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 }) => { - 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); - } - }); - }, - // 信号关灯 - 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/nextNew', 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, + operation: OperationEvent.Signal.unlock.menu.operation, + param: { + Signal_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', 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, + operation: OperationEvent.Signal.reopenSignal.menu.operation, + param: { + Signal_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', 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}`, + operation: OperationEvent.Signal.signalClose.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 进路交人工控 + humanControl() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.humanControl.menu.operation, + param: { + Signal_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + const tempData = []; + this.$refs.routeHandControl.doShow(operate, this.selected, tempData); + // }); + } + }); + }, + // 进路交自动控 + atsAutoControl() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.atsAutoControl.menu.operation, + param: { + Signal_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + const tempData = []; + this.$refs.routeHandControl.doShow(operate, this.selected, tempData); + // }); + } + }); + }, + // 设置/取消通过模式 + singalPassModel() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.singalPassModel.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.routeControl.doShow(operate, this.selected); + } + }); + }, + // 查询进路状态 + detail() { + const operate = { + start: true, + code: this.selected.code, + operation: OperationEvent.Signal.detail.menu.operation, + param: { + Signal_Code: `${this.selected.code}` + } + }; + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + const tempData = []; + this.$refs.routeDetail.doShow(operate, this.selected, tempData); + // }); + } + }); + } + } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue b/src/jmapNew/theme/ningbo_01/menus/menuStation.vue index 47ddcc29e..b2c22c81b 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue +++ b/src/jmapNew/theme/ningbo_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 } + } + ], + Center: [ + { + 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 + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + 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(); + } + } + }, + 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/jmapNew/theme/ningbo_01/menus/menuStationControl.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue deleted file mode 100644 index 6e394cecd..000000000 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue index 30d6fc27c..6d7bfb588 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationStand.vue @@ -9,6 +9,7 @@ + @@ -20,13 +21,16 @@ import StandBackStrategy from './dialog/standBackStrategy'; import StandDetail from './dialog/standDetail'; import StandRunLevel from './dialog/standRunLevel'; import StandStopTime from './dialog/standStopTime'; +import StandBulkBuckleTrain from './dialog/standBulkBuckleTrain'; import StandDetainTrainAll from './dialog/standDetainTrainAll'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; + +import Handler from '@/scripts/cmdPlugin/Handler'; import { mapGetters } from 'vuex'; -import { OperateMode } from '@/scripts/ConstDic'; -import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; -import { mouseCancelState } from './utils/menuItemStatus'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { name: 'StationStandMenu', @@ -34,6 +38,7 @@ export default { PopMenu, StandControl, StandJumpStopControl, + StandBulkBuckleTrain, StandDetail, StandRunLevel, NoticeInfo, @@ -53,155 +58,88 @@ export default { return { menu: [], menuNormal: { - local: [ + Local: [ { - label: '设置扣车', + label: '扣车', handler: this.setDetainTrain, - disabledCallback: MenuDisabledState.StationStand.setDetainTrain, - auth: { station: true, center: false } + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN }, { label: '取消扣车', handler: this.cancelDetainTrain, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain, - auth: { station: true, center: true } - }, - { - label: '设置跳停', - handler: this.setJumpStop, - disabledCallback: MenuDisabledState.StationStand.setJumpStop, - auth: { station: true, center: false } - }, - { - label: '取消跳停', - handler: this.cancelJumpStop, - disabledCallback: MenuDisabledState.StationStand.cancelJumpStop, - auth: { station: true, center: true } - }, - { - type: 'separator' + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN }, { label: '提前发车', handler: this.earlyDeparture, - disabledCallback: MenuDisabledState.StationStand.earlyDeparture, - auth: { station: true, center: true } - }, - { - label: '设置停站时间', - handler: this.setStopTime, - disabledCallback: MenuDisabledState.StationStand.setStopTime, - auth: { station: true, center: true } - }, - { - type: 'separator' + cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART }, { label: '站台详细信息', handler: this.detail, - disabledCallback: MenuDisabledState.StationStand.detail, - auth: { station: true, center: true } - }, - { - label: '运行时间控制', - handler: this.setRunLevel, - disabledCallback: MenuDisabledState.StationStand.setRunLevel, - auth: { station: false, center: false } - }, - { - label: '设置提前发车', - handler: this.earlyDeparture, - disabledCallback: MenuDisabledState.StationStand.earlyDeparture, - auth: { station: false, center: false } - }, - // { - // label: '人工折返策略设置', - // handler: this.setBackStrategy, - // disabledCallback: MenuDisabledState.StationStand.setBackStrategy, - // auth: { station: false, center: false } - // }, - { - label: '查询站台状态', - handler: this.detail, - disabledCallback: MenuDisabledState.StationStand.detail, - auth: { station: false, center: false } + cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS } ], - central: [ + Center: [ { label: '扣车', handler: this.setDetainTrain, - disabledCallback: MenuDisabledState.StationStand.setDetainTrain, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN }, { label: '取消扣车', handler: this.cancelDetainTrain, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + { + label: '批量扣车', + handler: this.setBulkBuckleTrain, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL + }, + { + label: '批量取消扣车', + handler: this.cancelBulkBuckleTrain, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL }, { label: '提前发车', handler: this.earlyDeparture, - disabledCallback: MenuDisabledState.StationStand.earlyDeparture, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART }, { label: '设置跳停', handler: this.setJumpStop, - disabledCallback: MenuDisabledState.StationStand.setJumpStop, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP }, { label: '取消跳停', handler: this.cancelJumpStop, - disabledCallback: MenuDisabledState.StationStand.cancelJumpStop, - auth: { station: true, center: true } - }, - { - type: 'separator' + cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP }, { label: '设置停站时间', handler: this.setStopTime, - disabledCallback: MenuDisabledState.StationStand.setStopTime, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME }, { label: '设置运行等级', handler: this.setRunLevel, - disabledCallback: MenuDisabledState.StationStand.setRunLevel, - auth: { station: true, center: true } - }, - // { - // label: '变通策略管理', - // handler: this.setBackStrategy, - // disabledCallback: MenuDisabledState.StationStand.setBackStrategy, - // auth: { station: true, center: true } - // }, - { - type: 'separator' + cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME }, { label: '区间列车数量限制', handler: this.setDetainTrainAll, - disabledCallback: MenuDisabledState.StationStand.setDetainTrain, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO }, { label: '取消区间列车数量限制', handler: this.cancelDetainTrainAll, - disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain, - auth: { station: true, center: true } - }, - { - type: 'separator' + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO }, { label: '查看站台信息', handler: this.detail, - disabledCallback: MenuDisabledState.StationStand.detail, - auth: { station: true, center: true } + cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS } ] }, @@ -209,12 +147,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - disabledCallback: MenuDisabledState.StationStand.setStoppage + cmdType:CMD.Stand.CMD_STAND_ADD_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.StationStand.cancelStoppage + cmdType:CMD.Stand.CMD_STAND_REMOVE_FAULT } ] }; @@ -246,17 +184,12 @@ export default { }, initMenu() { // 编辑模式菜单列表 - this.menu = menuFiltration(this.menuNormal); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce]; - } + this.menu = MenuContextHandler.covert(this.menuNormal); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; } - - this.menu = menuConvert(this.menu); }, doShow(point) { this.clickEvent(); @@ -272,268 +205,268 @@ export default { }, // 设置故障 setStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.stoppage.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.stoppage.menu.operation, + cmdType: CMD.Stand.CMD_STAND_ADD_FAULT, + param: { + StationStand_Code: `${this.selected.code}` + } }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelStoppage.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelStoppage.menu.operation, + cmdType: CMD.Stand.CMD_STAND_REMOVE_FAULT, + param: { + StationStand_Code: `${this.selected.code}` + } }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 设置扣车 setDetainTrain() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 取消扣车 cancelDetainTrain() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 区间列车数量限制 setDetainTrainAll() { - const operate = { + const step = { start: true, code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation + operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, // 取消区间列车数量限制 cancelDetainTrainAll() { - const operate = { + const step = { start: true, code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation + operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, - // 强制取消扣车 - cancelDetainTrainForce() { - const operate = { + // 批量扣车 + setBulkBuckleTrain() { + const step = { start: true, code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation + operation: OperationEvent.StationStand.setBulkBuckleTrain.menu.operation, + param: { + StationStand_Code: this.selected.code + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standBulkBuckleTrain.doShow(step, this.selected); + } + }); + }, + // 批量取消扣车 + cancelBulkBuckleTrain() { + const step = { + start: true, + code: this.selected.code, + operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation, + param: { + StationStand_Code: this.selected.code + } + }; + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.standBulkBuckleTrain.doShow(step, this.selected); } }); }, // 设置跳停 setJumpStop() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setJumpStop.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standJumpStopControl.doShow(operate, this.selected); + this.$refs.standJumpStopControl.doShow(step, this.selected); } }); }, // 取消跳停 cancelJumpStop() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.cancelJumpStop.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standJumpStopControl.doShow(operate, this.selected); + this.$refs.standJumpStopControl.doShow(step, this.selected); } }); }, - // 停站时间控制 + // 设置停站时间 setStopTime() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setStopTime.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setStopTime.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standStopTime.doShow(operate, this.selected, tempDate); + // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + const tempData = []; + this.$refs.standStopTime.doShow(step, this.selected, tempData); + // }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); }, // 设置运行等级 setRunLevel() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.setRunLevel.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - console.log(valid, '----') - if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standRunLevel.doShow(operate, this.selected, tempDate); + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` } - }).catch((error) => { - this.$refs.noticeInfo.doShow(operate); + }; + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + const tempData = []; + this.$refs.standRunLevel.doShow(step, this.selected, tempData); + // }); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(step); }); }, // 设置提前发车 earlyDeparture() { - const operate = { + const step = { start: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.earlyDeparture.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standControl.doShow(operate, this.selected); + this.$refs.standControl.doShow(step, this.selected); } }); }, - // 设置折返策略 - // setBackStrategy() { - // const operate = { - // start: true, - // send: true, - // code: this.selected.code, - // type: MapDeviceType.StationStand.type, - // operation: OperationEvent.StationStand.setBackStrategy.menu.operation - // }; - - // this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - // if (valid) { - // let tempDate = null; - // if (response) { - // tempDate = response.data; - // } - // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - // this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate); - // } - // }).catch(() => { - // this.$refs.noticeInfo.doShow(operate); - // }); - // }, // 查询站台状态 detail() { - const operate = { + const step = { start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.StationStand.type, - label: MapDeviceType.StationStand.label, - operation: OperationEvent.StationStand.detail.menu.operation + code: `${this.selected.code}`, + operation: OperationEvent.StationStand.detail.menu.operation, + param: { + StationStand_Code: `${this.selected.code}` + } }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { if (valid) { - let tempDate = null; - if (response) { - tempDate = response.data; - } this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.standDetail.doShow(operate, this.selected, tempDate); + // Handler.execute(CMD.Stand.CMD_STAND_VIEW_STATUS, {StationStand_Code: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + const tempData = []; + this.$refs.standDetail.doShow(step, this.selected, tempData); + // }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(step); }); } } diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index e743bbefb..dddc4058a 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -1,10 +1,10 @@