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 @@ + { if (elem.type === 'separator') { elem.show = true; @@ -536,6 +537,7 @@ export function menuFiltration(menuObj) { if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示 elem.show = false; } + console.log('222222222', elem); elem.defaultDisabled = !elem.auth[status]; } }); diff --git a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/childDialog/noticeInfo.vue b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/childDialog/noticeInfo.vue index 85c64832c..277f503a8 100644 --- a/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/childDialog/noticeInfo.vue +++ b/src/jmapNew/theme/chengdu_03/menus/dialog/childDialog/childDialog/noticeInfo.vue @@ -16,7 +16,7 @@ \ 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 @@ - - - {{message}} - - - - 确定 - - - 取 消 - - - + + + {{ message }} + + + + 确定 + + + 取 消 + + + \ 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 @@ - - - - 在{{stationName}}【{{signalName}}】信号机,信号解锁,确认下达吗? - - - - 确定 - - - 取 消 - - - - - - - \ 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 @@ - - - {{message}} - - - - 确定 - - - 取 消 - - - + + + {{ message }} + + + + 确定 + + + 取 消 + + + \ 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 @@ - - - - {{message}} - - - - - 确定 - - - - + + + + {{ message }} + + + + + 确定 + + + + \ 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 @@ - - - - - 命令信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{message}} - - - 下达({{timeCountCommand}}) - - - 确认1 - - - - 确认2({{timeCountConfirm}}) - - - 中止 - - - 关闭 - - - - - - \ 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 @@ - - - - - 命令信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{message}} - - - 下达({{timeCountCommand}}) - - - 确认1 - - - - 确认2({{timeCountConfirm}}) - - - 中止 - - - 关闭 - - - - - - \ 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 @@ - + 车站名称 道岔 @@ -36,341 +26,224 @@ 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 @@ - + 排列 进路 - + 总 取消 - + 引导 进路 @@ -25,55 +25,55 @@ 总锁 --> - + 总 人解 - + 区 故解 - + 道岔 定操 - + 道岔 反操 - + 道岔 单锁 - + 道岔 解锁 - + 封 锁 - + 解 封 - + 功 @@ -85,13 +85,13 @@ - + 自 动控 - + 人 工控 @@ -108,187 +108,260 @@ \ 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 @@ + + + + + 上行线路设置{{ title }} + + + + {{ scope.row.name }} + + + 正向{{ title }} + 反向{{ title }} + + + 下行线路设置{{ title }} + + + + {{ scope.row.name }} + + + 正向{{ title }} + 反向{{ title }} + + + + + 确定 + + + 取 消 + + + + + + + + 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 @@ - + 集中站 站台 @@ -22,7 +12,7 @@ - + 类型 @@ -70,6 +60,30 @@ + + + 类型 + + + 上行 + + + 下行 + + + + + 功能 + + + 设置 + + + 取消 + + + + 类型 @@ -110,9 +124,11 @@ 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 @@ - + - + @@ -13,439 +13,340 @@ diff --git a/src/jmapNew/theme/ningbo_01/menus/menuTool.vue b/src/jmapNew/theme/ningbo_01/menus/menuTool.vue index d278e2adf..266a43165 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuTool.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuTool.vue @@ -15,129 +15,129 @@ import SystemTime from '@/views/components/systemTime/index'; import logo_ from '@/assets/logo_.png'; export default { - name: 'MenuTool', - components: { - SystemTime - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - logoImg: logo_, - time: '00:0000', - tools: [ - { - title: '服务器1', - operate: '', - src: logo_, - click: this.undeveloped - }, - { - title: '服务器2', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '前置机1', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '前置机2', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '主调', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '调度台1', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '调度台2', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '调度台3', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '大屏', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '维护工作站', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '运行图显示人工站', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '跳停', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '扣车', - operate: '', - src: '', - click: this.undeveloped - }, - { - title: '列车报警', - operate: '', - src: logo_, - click: this.undeveloped - } - ] - }; - }, - computed: { - isShowSystemTime() { - return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode; - } - }, - watch: { - '$store.state.training.initTime': function (initTime) { - const date = new Date(initTime); - this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`; - } - }, - mounted() { - this.initTools(); - }, - methods: { - initTools() { - this.tools = []; - } - } + name: 'MenuTool', + components: { + SystemTime + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + logoImg: logo_, + time: '00:0000', + tools: [ + { + title: '服务器1', + operate: '', + src: logo_, + click: this.undeveloped + }, + { + title: '服务器2', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '前置机1', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '前置机2', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '主调', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '调度台1', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '调度台2', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '调度台3', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '大屏', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '维护工作站', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '运行图显示人工站', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '跳停', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '扣车', + operate: '', + src: '', + click: this.undeveloped + }, + { + title: '列车报警', + operate: '', + src: logo_, + click: this.undeveloped + } + ] + }; + }, + computed: { + isShowSystemTime() { + return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode; + } + }, + watch: { + '$store.state.training.initTime': function (initTime) { + const date = new Date(initTime); + this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`; + } + }, + mounted() { + this.initTools(); + }, + methods: { + initTools() { + this.tools = []; + } + } }; diff --git a/src/mixin/CancelMouseState.js b/src/mixin/CancelMouseState.js new file mode 100644 index 000000000..3e8110957 --- /dev/null +++ b/src/mixin/CancelMouseState.js @@ -0,0 +1,13 @@ + +export default { + methods: { + mouseCancelState(selected) { + const device = this.$jlmap.getDeviceByCode(selected.code); + const instance = (device || {}).instance; + if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { + device['down'] = false; + instance.mouseEvent.mouseout(this.$jlmap.$zr.curEvent); + } + } + } +}; diff --git a/src/router/index.js b/src/router/index.js index 15558845c..802c8d184 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -104,6 +104,7 @@ const UserRulesDetail = () => import('@/views/orderauthor/rules/detail'); const LessonApproval = () => import('@/views/approval/lesson/index'); const ScriptApproval = () => import('@/views/approval/script/index'); const RunPlanApproval = () => import('@/views/approval/runPlan/index'); +const DeviceManage = () => import('@/views/system/deviceManage/index'); import { loginInfo } from '@/scripts/ConstDic'; import { getSessionStorage } from '@/utils/auth'; @@ -264,7 +265,7 @@ export const constantRoutes = [ hidden: true }, { - path: 'gzb', + path: '/gzb', redirect: '/gzb/login', hidden: true }, @@ -838,6 +839,13 @@ export const asyncRouter = [ meta: { i18n: 'router.configLine' } + }, + { + path: 'deviceManage', + component: DeviceManage, + meta: { + i18n: 'router.deviceManage' + } } ] }, diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 1f93bc768..c1946502e 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -126,16 +126,16 @@ export default { ], simulationRole: [ - { label: '行调操作', value: '01' }, - { label: '现地操作', value: '02' } + { label: '行调操作', value: 'Center' }, + { label: '现地操作', value: 'Local' } ], deviceTypeList: [ { label: '区段', value: 'Section' }, { label: '道岔', value: 'Switch' }, { label: '信号机', value: 'Signal' }, - { label: '站台', value: 'StationStand' }, - { label: '控制模式', value: 'ControlConvertMenu' }, + { label: '站台', value: 'Stand' }, + // { label: '控制模式', value: 'ControlConvertMenu' }, { label: '车次窗', value: 'TrainWindow' } ], // 新版的产品类型枚举 diff --git a/src/scripts/cmdPlugin/Command.js b/src/scripts/cmdPlugin/Command.js new file mode 100644 index 000000000..c8286e5fe --- /dev/null +++ b/src/scripts/cmdPlugin/Command.js @@ -0,0 +1,33 @@ +const P_OVER = `over`; +export default class Command { + constructor() { + this.command = {}; + this.id = ''; + this.isError = false; + this.isOver = false; + } + + toFound(definition, wholeParam) { + this.id = definition.id; + (definition.paramList || []).forEach(param => { + if (wholeParam.hasOwnProperty(param.name)) { + this.command[param.name] = wholeParam[param.name]; + } else { + this.isError = true; + return; + } + }); + + if (wholeParam.hasOwnProperty(P_OVER)) { + this.isOver = true; + } + } + + toError() { + this.isError = true; + } + + get() { + return this.command; + } +} diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js new file mode 100644 index 000000000..f7d54a7db --- /dev/null +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -0,0 +1,189 @@ +export default { + Switch: { + /** 设置故障 */ + CMD_SWITCH_ADD_FAULT: {value:'Switch_Add_Fault', label: '设置道岔故障'}, + /** 清除故障 */ + CMD_SWITCH_REMOVE_FAULT: {value:'Switch_Remove_Fault', label: '清除道岔故障'}, + /** 单锁 */ + CMD_SWITCH_SINGLE_LOCK: {value:'Switch_Single_Lock', label: '单锁'}, + /** 单解 */ + CMD_SWITCH_SINGLE_UNLOCK: {value:'Switch_Single_Unlock', label: '单解'}, + /** 封锁 */ + CMD_SWITCH_BLOCK: {value:'Switch_Block', label: '封锁'}, + /** 解封 */ + CMD_SWITCH_UNBLOCK: {value:'Switch_Unblock', label: '解封'}, + /** 切除 */ + CMD_SWITCH_CUT_OFF: {value:'Switch_Cut_Off', label: '切除'}, + /** 激活 */ + CMD_SWITCH_ACTIVE: {value:'Switch_Active', label: '激活'}, + /** 设置临时限速 */ + CMD_SWITCH_SET_LIMIT_SPEED: {value:'Switch_Set_Limit_Speed', label: '设置临时限速'}, + /** 取消临时限速 */ + CMD_SWITCH_CANCEL_LIMIT_SPEED: {value:'Switch_Cancel_Limit_Speed', label: '取消临时限速'}, + /** 计轴预复位 */ + CMD_SWITCH_AXIS_PRE_RESET: {value:'Switch_Axis_Pre_Reset', label: '计轴预复位'}, + /** 故障解锁 */ + CMD_SWITCH_FAULT_UNLOCK: {value:'Switch_Fault_Unlock', label: '故障解锁'}, + /** 转动 */ + CMD_SWITCH_TURN: {value:'Switch_Turn', label: '转动'}, + /** 强扳 */ + CMD_SWITCH_FORCE_TURN: {value:'Switch_Force_Turn', label: '强扳'}, + /** 确认计轴有效 */ + CMD_SWITCH_COMFIRMATION_AXLE:{value:'Switch_Comfirmation_Axle', label: '确认计轴有效'} + }, + + // 控制模式操作 + ControlConvertMenu: { + /** 请求站控 */ + CMD_CM_APPLY_FOR_STATION_CONTROL: {value:'CM_Apply_For_Station_Control', label: '请求站控'}, + /** 请求中控 */ + CMD_CM_APPLY_FOR_CENTER_CONTROL: {value:'CM_Apply_For_Center_Control', label: '请求中控'}, + /** 强制站控 */ + CMD_CM_FORCE_STATION_CONTROL: {value:'CM_Force_Station_Control', label: '强制站控'}, + /** 紧急站控 */ + CMD_CM_EMERGENCY_STATION_CONTROL: {value:'CM_Emergency_Station_Control', label: '紧急站控'}, + /** 回复站控请求(同意/拒绝) */ + CMD_CM_REPLY_STATION_CONTROL: {value:'CM_Reply_Station_Control', label: '回复站控请求'}, + /** 回复中控请求(同意/拒绝) */ + CMD_CM_REPLY_CENTER_CONTROL: {value:'CM_Reply_Center_Control', label: '回复中控请求'} + }, + + // 信号机操作 + Signal: { + /** 设置故障 */ + CMD_SIGNAL_ADD_FAULT: {value:'Signal_Add_Fault', label: '设置信号机故障'}, + /** 清除故障 */ + CMD_SIGNAL_REMOVE_FAULT: {value:'Signal_Remove_Fault', label: '清除信号机故障'}, + /** 封锁 */ + CMD_SIGNAL_BLOCK: {value:'Signal_Block', label: '封锁'}, + /** 解封 */ + CMD_SIGNAL_UNBLOCK: {value:'Signal_Unblock', label: '解封'}, + /** 排列进路 */ + CMD_SIGNAL_SET_ROUTE: {value:'Signal_Set_Route', label: '排列进路'}, + /** 取消进路 */ + CMD_SIGNAL_CANCEL_ROUTE: {value:'Signal_Cancel_Route', label: '取消进路'}, + /** 人解进路 */ + CMD_SIGNAL_HUMAN_RELEASE_ROUTE: {value:'Signal_Human_Release_Route', label: '人解进路'}, + /** 信号关灯 */ + CMD_SIGNAL_CLOSE_SIGNAL: {value:'Signal_Close_Signal', label: '信号关灯'}, + /** 信号重开 */ + CMD_SIGNAL_REOPEN_SIGNAL: {value:'Signal_Reopen_Signal', label: '信号重开'}, + /** 引导进路 */ + CMD_SIGNAL_ROUTE_GUIDE: {value:'Signal_Route_Guide', label: '引导进路'}, + /** 进路自排开 */ + CMD_SIGNAL_OPEN_AUTO_SETTING: {value:'Signal_Open_Auto_Setting', label: '进路自排开'}, + /** 进路自排关 */ + CMD_SIGNAL_CLOSE_AUTO_SETTING: {value:'Signal_Close_Auto_Setting', label: '进路自排关'}, + /** 设置联锁自动进路*/ + CMD_SIGNAL_SET_CI_AUTO: {value:'Signal_Set_CI_Auto', label: '设置联锁自动进路'}, + /** 取消联锁自动进路*/ + CMD_SIGNAL_CANCEL_CI_AUTO: {value:'Signal_Cancel_CI_Auto', label: '取消联锁自动进路'}, + /** 设置联锁自动触发 */ + CMD_SIGNAL_SET_CI_AUTO_TRIGGER: {value:'Signal_Set_CI_Auto_Trigger', label: '设置联锁自动触发'}, + /** 取消联锁自动触发 */ + CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER: {value:'Signal_Cancel_CI_Auto_Trigger', label: '取消联锁自动触发'}, + /** 设置/取消通过模式 */ + CMD_SIGNAL_PASS_MODEL: {value:'Signal_Pass_Model', label: '设置/取消通过模式'}, + /** 设置/取消通过模式 */ + CMD_SIGNAL_DETAIL: {value:'Signal_Detail', label: '查询进路状态'} + }, + + // 物理区段操作 + Section: { + /** 设置故障 */ + CMD_SECTION_ADD_FAULT: {value:'Section_Add_Fault', label: '设置区段故障'}, + /** 清除故障 */ + CMD_SECTION_REMOVE_FAULT: {value:'Section_Remove_Fault', label: '清除区段故障'}, + /** 封锁 */ + CMD_SECTION_BLOCK: {value:'Section_Block', label: '封锁'}, + /** 解封 */ + CMD_SECTION_UNBLOCK: {value:'Section_Unblock', label: '解封'}, + /** 切除 */ + CMD_SECTION_CUT_OFF: {value:'Section_Cut_Off', label: '切除'}, + /** 激活 */ + CMD_SECTION_ACTIVE: {value:'Section_Active', label: '激活'}, + /** 设置临时限速 */ + CMD_SECTION_SET_LIMIT_SPEED: {value:'Section_Set_Limit_Speed', label: '设置临时限速'}, + /** 计轴预复位 */ + CMD_SECTION_AXIS_PRE_RESET: {value:'Section_Axis_Pre_Reset', label: '计轴预复位'}, + /** 故障解锁 */ + CMD_SECTION_FAULT_UNLOCK: {value:'Section_Fault_Unlock', label: '故障解锁'}, + /** 取消临时限速 */ + CMD_SECTION_CANCEL_LIMIT_SPEED:{value:'Section_Cancel_Limit_Speed', label: '取消临时限速'}, + /** 确认计轴有效 */ + CMD_SECTION_COMFIRMATION_AXLE:{value:'Section_Comfirmation_Axle', label: '确认计轴有效'} + }, + + // 站台 + Stand: { + /** 设置故障 */ + CMD_STAND_ADD_FAULT: {value:'Stand_Add_Fault', label: '设置站台故障'}, + /** 清除故障 */ + CMD_STAND_REMOVE_FAULT: {value:'Stand_Remove_Fault', label: '清除站台故障'}, + /** 设置跳停 */ + CMD_STAND_SET_JUMP_STOP: {value:'Stand_Set_Jump_Stop', label: '设置跳停'}, + /** 取消跳停 */ + CMD_STAND_CANCEL_JUMP_STOP: {value:'Stand_Cancel_Jump_Stop', label: '取消跳停'}, + /** 设置扣车 */ + CMD_STAND_SET_HOLD_TRAIN: {value:'Stand_Set_Hold_Train', label: '设置扣车'}, + /** 取消扣车 */ + CMD_STAND_CANCEL_HOLD_TRAIN: {value:'Stand_Cancel_Hold_Train', label: '取消扣车'}, + /** 批量扣车 */ + CMD_STAND_SET_HOLD_TRAIN_ALL: {value:'Stand_Set_Hold_Train_All', label: '批量扣车'}, + /** 批量取消扣车 */ + CMD_STAND_CANCEL_HOLD_TRAIN_ALL: {value:'Stand_Cancel_Hold_Train_All', label: '批量取消扣车'}, + /** 强制取消扣车 */ + CMD_STAND_FORCE_CANCEL_HOLD_TRAIN: {value:'Stand_Force_Cancel_Hold_Train', label: '强制取消扣车'}, + /** 区间列车数量限制 */ + CMD_STAND_SET_HOLD_TRAIN_AUTO: {value:'Stand_Set_Hold_Train_Auto', label: '区间列车数量限制'}, + /** 取消区间列车数量限制 */ + CMD_STAND_CANCEL_HOLD_TRAIN_AUTO: {value:'Stand_Cancel_Hold_Train_Auto', label: '取消区间列车数量限制'}, + /** 全线取消扣车 */ + CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN: {value:'Stand_Whole_Line_Cancel_Hold_Train', label: '全线取消扣车'}, + /** 提前发车 */ + CMD_STAND_EARLY_DEPART: {value:'Stand_Early_Depart', label: '提前发车'}, + /** 设置停站时间 */ + CMD_STAND_SET_PARK_TIME: {value:'Stand_Set_Park_Time', label: '设置停站时间'}, + /** 设置站间运行时间(设置运行等级) */ + CMD_STAND_SET_RUN_TIME: {value:'Stand_Set_Run_Time', label: '设置站间运行时间'}, + /** 设置折返策略 */ + CMD_STAND_SET_REENTRY_STRATEGY: {value:'Stand_Set_Reentry_Strategy', label: '设置折返策略'}, + /** 查看站台状态 */ + CMD_STAND_VIEW_STATUS:{value:'Stand_View_Status', label: '查看站台状态'} + }, + + Station: { + /** 设置故障 */ + CMD_STATION_ADD_FAULT: {value:'Station_Add_Fault', label: '设置车站故障'}, + /** 清除故障 */ + CMD_STATION_REMOVE_FAULT: {value:'Station_Remove_Fault', label: '清除车站故障'}, + /** 全站设置联锁自动触发 */ + CMD_STATION_SET_CI_AUTO_TRIGGER: {value:'Station_Set_CI_Auto_Trigger', label: '全站设置联锁自动触发'}, + /** 全站取消联锁自动触发 */ + CMD_STATION_CANCEL_CI_AUTO_TRIGGER: {value:'Station_Cancel_CI_Auto_Trigger', label: '全站取消联锁自动触发'}, + /** 所有进路自排开 */ + CMD_STATION_OPEN_AUTO_SETTING: {value:'Station_Open_Auto_Setting', label: '所有进路自排开'}, + /** 所有进路自排关 */ + CMD_STATION_CLOSE_AUTO_SETTING: {value:'Station_Close_Auto_Setting', label: '所有进路自排关'} + }, + + // 列车 + Train: { + /** 设置故障 */ + CMD_TRAIN_ADD_FAULT: {value:'Train_Add_Fault', label: '设置列车故障'}, + /** 清除故障 */ + CMD_TRAIN_REMOVE_FAULT: {value:'Train_Remove_Fault', label: '清除列车故障'}, + /** 人工限速行驶 */ + CMD_TRAIN_MANUAL_LIMIT_DRIVE: {value:'Train_Manual_Limit_Drive', label: '人工限速行驶'}, + /** 按进路闭塞法行车 */ + CMD_TRAIN_MANUAL_ROUTE_BLOCKING_DRIVE: {value:'Train_Manual_Route_Blocking_Drive', label: '按进路闭塞法行车'}, + /** 越信号机红灯 */ + CMD_TRAIN_PASS_RED_SIGNAL: {value:'Train_Pass_Red_Signal', label: '越信号机红灯'}, + /** 引导信号行车 */ + CMD_TRAIN_DRIVE_BY_GUIDE_SIGNAL: {value:'Train_Drive_By_Guide_Signal', label: '引导信号行车'} + }, + + LimitControl: { + + } +}; diff --git a/src/scripts/cmdPlugin/CommandHandler.js b/src/scripts/cmdPlugin/CommandHandler.js new file mode 100644 index 000000000..2560fcec1 --- /dev/null +++ b/src/scripts/cmdPlugin/CommandHandler.js @@ -0,0 +1,90 @@ +import { sendCommandNew } from '@/api/jmap/training'; +import router from '@/router'; +import Command from './Command'; +import Handler from './Handler'; + +class CommandHandle { + constructor() { + this.data = []; + this.definitionMap = { + }; + } + + load(list) { + this.definitionMap = { + Center: {}, + Local: {} + }; + (list || []).forEach(definition => { + this.definitionMap[definition.simulationRole][definition.operate] = definition; + }); + } + + getDefinition(cmdType) { + if (cmdType) { + const simulationRole = Handler.getSimulationRole(); + // const simulationRole = 'Center'; + return this.definitionMap[simulationRole][cmdType.value] || null; + } else { + return null; + } + } + + getCommand(cmdType, wholeParam) { + if (cmdType) { + const command = new Command(); + const definition = this.getDefinition(cmdType); + if (definition) { + command.toFound(definition, wholeParam); + return command; + } else { + command.toError(); + return command; + } + } + + return null; + } + + execute(id, command) { + return new Promise((resolve, reject) => { + const group = router.currentRoute.query.group; + sendCommandNew(group, id, command).then((response) => { + resolve(response); + }).catch(error => { + reject(error); + }); + }); + } + + checkDisabled(menu, selected) { + const data = this.getDefinition(menu.cmdType); + if (!data) { + return false; + } else { + let result = false; + if (data.conditionList.length > 0) { + data.conditionList.forEach(val=>{ + switch (val.expression) { + case 'eq': { + result = result || (selected[val.name].toString() == val.value); + break; + } + case 'neq': { + result = result || (selected[val.name].toString() != val.value); + break; + } + default: { + result = result || (selected[val.name].toString() == val.value); + break; + } + } + }); + return !result; + } + return result; + } + } +} + +export default new CommandHandle(); diff --git a/src/scripts/cmdPlugin/Config.js b/src/scripts/cmdPlugin/Config.js new file mode 100644 index 000000000..92761edc6 --- /dev/null +++ b/src/scripts/cmdPlugin/Config.js @@ -0,0 +1,11 @@ +/** 系统类型 */ +export const State2SimulationMap = { + '01': 'Local', // 现地工作站 + '02': 'Center' // 中心调度工作站 +}; + +export const State2ControlMap = { + '01': 'OperateCenterControl', // 中控 + '02': 'LocalStationControl', // 站控 + '03': 'station' +}; diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js new file mode 100644 index 000000000..3e73fce60 --- /dev/null +++ b/src/scripts/cmdPlugin/Handler.js @@ -0,0 +1,155 @@ +import store from '@/store'; +import router from '@/router'; +import CommandHandler from './CommandHandler.js'; +import ValidateHandler from './ValidateHandler.js'; +import { State2SimulationMap } from './Config.js'; +import { sendTrainingNextStep } from '@/api/jmap/training'; +import { getCmdList } from '@/api/management/dictionary'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; + +class Handler { + constructor() { + this.operations = []; + } + + undo(num) { + this.operations = this.operations.slice(0, num); + } + + pop() { + this.operations.pop(); + } + + clear() { + this.operations.splice(0, this.operations.length); + } + + storeOperation(operation) { + if (operation.start === true) { + this.clear(); + } + + this.operations.push(operation); + } + + afterValid(operation, valid) { + const basicInfo = store.getters['training/basicInfo']; + if (basicInfo.id && valid) { + const group = router.currentRoute.query.group; + sendTrainingNextStep({ trainingId: basicInfo.id, operation: operation }, group); + } + + if (!valid) { + this.pop(); + } else if (operation.cancel === true) { + this.clear(); + } + } + + getWholeParam() { + const whole = {}; + (this.operations || {}).forEach(elem => { Object.assign(whole, elem.param || {}); }); + return whole; + } + + getCommand(operation) { + let command = null; + if (operation.cmdType) { + const cmdType = operation.cmdType; + const wholeParam = this.getWholeParam(); + + command = CommandHandler.getCommand(cmdType, wholeParam); + if (command && command.isError) { + this.operations.pop(); + store.dispatch('training/setTempStep', null); + command = null; + } else if (command && command.isOver) { + this.clear(); + store.dispatch('menuOperation/setButtonOperation', null); + } + } else { + if (operation.operation === OperationEvent.Command.cancel.menu.operation || operation.over) { + this.clear(); + } + } + + return command; + } + + execute(cmdType, wholeParam) { + return new Promise((resolve, reject) => { + const command = CommandHandler.getCommand(cmdType, wholeParam); + if (command.isError) { + reject(command); + } else { + CommandHandler.execute(command.id, command.get()).then(response => { + resolve(response); + }).catch(error => { + reject(error); + }); + } + }); + } + + handle(operation) { + return new Promise((resolve, reject) => { + this.storeOperation(operation); + const rtn = { valid: false, response: null }; + const valid = ValidateHandler.vaildate(this.getTrainingMode(), operation); + this.afterValid(operation, valid); + rtn.valid = valid; + + if (operation.cmdType) { + const command = this.getCommand(operation); + if (command) { + CommandHandler.execute(command.id, command.get()).then(response => { + rtn.response = response; + resolve(rtn); + }).catch(error => { + reject(error); + }); + } else { + rtn.response = '获取指令失败,暂无指令,请检查指令字典'; + reject(rtn); + } + } else { + resolve(rtn); + } + }); + } + + notify(lineCode) { + getCmdList(lineCode).then(resp => { + CommandHandler.load(resp.data || []); + }).catch(err => { + CommandHandler.load([]); + console.error(err); + }); + } + + getSteps() { + return store.state.training.steps; + } + + getOrder() { + return store.state.training.order; + } + + getSimulationRole() { + return State2SimulationMap[store.state.training.prdType]; + } + + getTrainingMode () { + return store.state.training.mode; + } + + getTrainingStart() { + return store.state.training.started; + } + + getOperateBreakStatus () { + return store.state.menuOperation.break; + } +} + +export default new Handler(); diff --git a/src/scripts/cmdPlugin/MenuContextHandler.js b/src/scripts/cmdPlugin/MenuContextHandler.js new file mode 100644 index 000000000..fc93b9eec --- /dev/null +++ b/src/scripts/cmdPlugin/MenuContextHandler.js @@ -0,0 +1,181 @@ +import store from '@/store'; +import CommandHandler from './CommandHandler'; +import { State2SimulationMap, State2ControlMap } from './Config'; +import { OperateMode } from '@/scripts/ConstDic'; + +class MenuContextHandler { + constructor() { + this.operates = []; // 操作数据 + this.command = {}; // 命令对象 + } + + getCurrentStateObject() { + return store.getters['menuOperation/selected']; + } + + getStationControl(selected) { + let control; + if (selected._type == 'StationStand') { + control = store.getters['map/getDeviceStationCodeByStationCode'](selected.deviceStationCode); + } else if (selected._type == 'Station') { + control = store.getters['map/getDeviceStationCodeByStationCode'](selected.code); + } else { + control = store.getters['map/getDeviceStationCodeByStationCode'](selected.stationCode); + } + return control; + } + + getPrdType() { + return store.state.training.prdType; + } + + // menuFiltration(menuList) { + // const selected = this.getCurrentStateObject(); + // let menu = []; + // const control = this.getStationControl(selected); + // if (control) { + // if ( this.getPrdType() != '') { + // const type = State2SimulationMap[this.getPrdType()]; + // const status = State2ControlMap[control.status]; + // menu = [...menuList[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; + // } + + // 判断指令是否隐藏 + checkDisabled(data, selected) { + let result = false; + if (data.conditionList.length > 0) { + data.conditionList.forEach(val=>{ + switch (val.expression) { + case 'eq': { + result = result || (selected[val.name].toString() == val.value); + break; + } + case 'neq': { + result = result || (selected[val.name].toString() != val.value); + break; + } + default: { + result = result || (selected[val.name].toString() == val.value); + break; + } + } + }); + result = !result; + } + return result; + } + + covert(menuList) { + const selected = this.getCurrentStateObject(); + let menu = []; + const control = this.getStationControl(selected); + if (control) { + if ( this.getPrdType() != '') { + const type = State2SimulationMap[this.getPrdType()]; + // const status = State2ControlMap[control.status]; // 缺少车站控制模式字段 + const status = State2ControlMap['01']; // 缺少车站控制模式字段 + menu = [...menuList[type]]; + if (menu.constructor === Array) { + menu.forEach(elem => { + if (elem.type === 'separator') { + elem.show = true; + return; + } + const data = CommandHandler.getDefinition(elem.cmdType); + if (data) { + // 判断指令是否显示 + if (data.simulationRole.toUpperCase() == type.toUpperCase() && data.controlMode.indexOf(status) > -1) { + elem.show = true; + elem.disabled = this.checkDisabled(data, selected); + } else { + elem.show = true; + elem.disabled = true; + } + } else { + elem.show = false; + } + + }); + } + } + } + return menu; + + // if (menuList.constructor === Array) { + // menuList.forEach(elem => { + // if (elem.type === 'separator') { + // elem.show = true; + // return; + // } + // elem.disabled = !elem.auth[status]; + // if (!elem.defaultDisabled) { + // const disabled = CommandHandler.checkDisabled(elem, this.getCurrentStateObject()); + // elem.disabled = disabled; + // } + // // if (elem.disabledCallback.constructor === Function) { + // // elem.disabled = elem.defaultDisabled; + // // if (!elem.defaultDisabled) { + // // elem.disabled = elem.disabledCallback(); + // // } + // // } + // }); + // } + // return menuList; + } + + menuBarConvert(menu, mode) { + 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 = () => { }; + } + + if (!item.froce) { + item.show = true; + if (item.children && item.children.length > 0) { + this.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) { + this.menuBarConvert(item.children, mode); + } + }); + } + } + return menu || []; + } +} + +export default new MenuContextHandler(); diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js new file mode 100644 index 000000000..66f62a514 --- /dev/null +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -0,0 +1,1953 @@ +export const OperationEvent = { + // 直接指令 + Command: { + // 取消操作 + cancel: { + menu: { + operation: '000', + domId: '_Tips-Cancel-Menu' + }, + clearMbm: { + operation: '00012', + domId: '_Tips-mbm_clear{TOP}' + } + }, + // 关闭对话框 + close: { + menu: { + operation: '001', + domId: '_Tips-Close-Menu' + }, + password: { + operation: '0011', + domId: '_Tips-Close-Password' + }, + confirm: { + operation: '0012', + domId: '_Tips-Close-Confirm' + }, + alarm: { + operation: '0013', + domId: '_Tips-Close-Alarm' + }, + notice: { + operation: '0014', + domId: '_Tips-Close-Notice' + } + }, + // 菜单 + mBar: { + /** 系统 */ + system: { + operation: '002', + domId: '_Tips-Mbar-0-System' + }, + /** 查看 */ + check: { + operation: '0021', + domId: '_Tips-Mbar-0-Check' + }, + /** 刷新 */ + fresh: { + operation: '0022', + domId: '_Tips-Mbar-0-Fresh' + }, + /** 显示 */ + view: { + operation: '0023', + domId: '_Tips-Mbar-0-View' + }, + /** 控制模式菜单 */ + remoteControl: { + operation: '0024', + domId: '_Tips-Mbar-0-StationControl' + }, + /** 请求区域 */ + requestZone: { + operation: '0025', + domId: '_Tips-Mbar-0-StationControl' + }, + /** 历史查询 */ + historyQuery: { + operation: '0026', + domId: '_Tips-Mbar-0-HistoryQuery' + }, + /** 用户管理 */ + userManage: { + operation: '0027', + domId: '_Tips-Mbar-0-UserManage' + }, + /** 帮助 */ + help: { + operation: '0028', + domId: '_Tips-Mbar-0-Help' + }, + /** 计划车操作 */ + planTrain: { + operation: '0029', + domId: '_Tips-Mbar-0-PlanTrain' + }, + /** 扣车*/ + detainControl: { + operation: '00291', + domId: '_Tips-Mbar-0-detainControl' + } + }, + // 前端视图指令 + view: { + /** 设置列车识别号显示*/ + setTrainIdDisplay: { + operation: '003', + domId: '_Tips-View-SetTrainIdDisplay' + }, + /** 设置名称显示*/ + setNameDisplay: { + operation: '0031', + domId: '_Tips-View-SetNameDisplay' + }, + /** 设置设备显示*/ + setDeviceDisplay: { + operation: '0032', + domId: '_Tips-View-SetDeviceDisplay' + }, + setSection: { + operation: '0033', + domId: '_Tips-View-SetSection' + }, + setSwitch: { + operation: '0034', + domId: '_Tips-View-SetSwitch' + }, + setSignal: { + operation: '0035', + domId: '_Tips-View-SetSignal' + }, + setTrainN: { + operation: '0036', + domId: '_Tips-View-SetTrainN' + }, + setTrainB: { + operation: '0037', + domId: '_Tips-View-SetTrainB' + }, + amplification: { + operation: '0038', + domId: '_Tips-View-Amplification' + }, + dpShowTrainN: { + operation: '0039', + domId: '_Tips-View-DpShowTrainN' + } + }, + // 计划车指令 + planTrain: { + /** 添加计划车*/ + addPlanTrain: { + operation: '004', + domId: '_Tips-PlanTrain-AddPlanTrain' + }, + /** 平移计划车*/ + translatPlanTrain: { + operation: '0041', + domId: '_Tips-PlanTrain-TranslatPlanTrain' + }, + /** 删除计划车*/ + delPlanTrain: { + operation: '0042', + domId: '_Tips-PlanTrain-DelPlanTrain' + } + }, + // 管理指令 + manage: { + /** 用户管理*/ + userManage: { + operation: '005', + domId: '_Tips-Manage-UserManage' + }, + /** 添加用户*/ + addUser: { + operation: '0051', + domId: '_Tips-Manage-AddUser' + }, + /** 修改用户*/ + editUser: { + operation: '0052', + domId: '_Tips-Manage-EditUser' + }, + /** 删除用户*/ + delUser: { + operation: '0053', + domId: '_Tips-Manage-DelUser' + }, + /** 选择用户*/ + chooseUser: { + operation: '0054', + domId: '_Tips-Manage-ChooseUser' + }, + /** 刷新用户*/ + freshUser: { + operation: '0055', + domId: '_Tips-Manage-FreshUser' + } + }, + // 帮助 + help: { + about: { + operation: '006', + domId: '_Tips-Help-About' + } + }, + // 无设备关联的指令 + order: { + choose: { + operation: '007', + domId: '_Tips-Order-Choose' + }, + choose1: { + operation: '0071', + domId: '_Tips-Order-Choose1' + } + } + }, + + // 道岔操作 + Switch: { + // 取消故障 + cancelStoppage: { + menu: { + operation: '199' + } + }, + // 道岔故障 + stoppage: { + menu: { + operation: '100' + } + }, + // 道岔总定/定位操作 + locate: { + button: { + operation: '1010', + domId: '_Tips-Switch-Locate-Mbm{TOP}' + }, + menu: { + operation: '101', + domId: '_Tips-Switch-Locate-Menu' + } + }, + // 道岔总反/反位操作 + reverse: { + button: { + operation: '1020', + domId: '_Tips-Switch-Reverse-Mbm{TOP}' + }, + menu: { + operation: '102', + domId: '_Tips-Switch-Reverse-Menu' + } + }, + // 道岔单锁 + lock: { + button: { + operation: '1030', + domId: '_Tips-Switch-Lock-Mbm{TOP}' + }, + menu: { + operation: '103', + domId: '_Tips-Switch-Lock-Menu' + } + }, + // 道岔解锁 + unlock: { + button: { + operation: '1040', + domId: '_Tips-Switch-Unlock-Mbm{TOP}' + }, + menu: { + operation: '104', + domId: '_Tips-Switch-Unlock-Menu' + }, + order: { + operation: '1041', + domId: '_Tips-Switch-Unlock-Order' + }, + confirm: { + operation: '1042', + domId: '_Tips-Switch-Unlock-Confirm' + }, + confirm1: { + operation: '1043', + domId: '_Tips-Switch-Unlock-Confirm1' + }, + confirm2: { + operation: '1044', + domId: '_Tips-Switch-Unlock-Confirm2' + }, + stop: { + operation: '1045', + domId: '_Tips-Switch-Unlock-Stop' + } + }, + // 道岔封闭 + block: { + menu: { + operation: '105', + domId: '_Tips-Switch-Block-Menu' + }, + confirm: { + operation: '1051', + domId: '_Tips-Switch-Block-Confirm' + } + }, + // 道岔解封 + unblock: { + menu: { + operation: '106', + domId: '_Tips-Switch-Unblock-menu' + }, + order: { + operation: '1061', + domId: '_Tips-Switch-Unblock-Order' + }, + confirm: { + operation: '1062', + domId: '_Tips-Switch-Unblock-Confirm' + }, + confirm1: { + operation: '1063', + domId: '_Tips-Switch-Unblock-Confirm1' + }, + confirm2: { + operation: '1064', + domId: '_Tips-Switch-Unblock-Confirm2' + }, + stop: { + operation: '1065', + domId: '_Tips-Switch-Unblock-Stop' + } + }, + // 转动 + turnout: { + menu: { + operation: '107', + domId: '_Tips-Switch-Turnout-Menu' + } + }, + // 强制扳动 + turnoutForce: { + menu: { + operation: '108', + domId: '_Tips-Switch-TurnoutForce-Menu' + } + }, + // 道岔故障解锁 + fault: { + menu: { + operation: '109', + domId: '_Tips-Switch-Fault-Menu' + }, + order: { + operation: '1091', + domId: '_Tips-Switch-Fault-Order' + }, + confirm: { + operation: '1092', + domId: '_Tips-Switch-Fault-Confirm' + }, + confirm1: { + operation: '1093', + domId: '_Tips-Switch-Fault-Confirm1' + }, + confirm2: { + operation: '1094', + domId: '_Tips-Switch-Fault-Confirm2' + }, + stop: { + operation: '1095', + domId: '_Tips-Switch-Fault-Stop' + } + }, + // 计轴预复位 + axlePreReset: { + menu: { + operation: '110', + domId: '_Tips-Switch-AxlePreReset-Menu' + }, + order: { + operation: '1101', + domId: '_Tips-Switch-AxlePreReset-Order' + }, + confirm: { + operation: '1102', + domId: '_Tips-Switch-AxlePreReset-Confirm' + }, + confirm1: { + operation: '1103', + domId: '_Tips-Switch-AxlePreReset-Confirm1' + }, + confirm2: { + operation: '1104', + domId: '_Tips-Switch-AxlePreReset-Confirm2' + }, + stop: { + operation: '1105', + domId: '_Tips-Switch-AxlePreReset-Stop' + } + }, + // 切除 + split: { + menu: { + operation: '111', + domId: '_Tips-Switch-Split-Menu' + }, + mbar: { + operation: '1111', + domId: '_Tips-Switch-Split-Mbar' + } + }, + // 激活 + active: { + menu: { + operation: '112', + domId: '_Tips-Switch-Active-Menu' + }, + mbar: { + operation: '1121', + domId: '_Tips-Switch-Active-Mbar' + } + }, + // 设置速度 + setSpeed: { + menu: { + operation: '113', + domId: '_Tips-Switch-SetSpeed-Menu' + }, + order: { + operation: '1131', + domId: '_Tips-Switch-SetSpeed-Order' + }, + confirm: { + operation: '1132', + domId: '_Tips-Switch-SetSpeed-Confirm' + }, + confirm1: { + operation: '1133', + domId: '_Tips-Switch-SetSpeed-Confirm1' + }, + confirm2: { + operation: '1134', + domId: '_Tips-Switch-SetSpeed-Confirm2' + }, + stop: { + operation: '1135', + domId: '_Tips-Switch-SetSpeed-Stop' + }, + choose: { + operation: '1136', + domId: '_Tips-Switch-SetSpeed-Choose' + } + }, + // 取消速度 + cancelSpeed: { + menu: { + operation: '114', + domId: '_Tips-Switch-CancelSpeed-Menu' + }, + order: { + operation: '1141', + domId: '_Tips-Switch-CancelSpeed-Order' + }, + confirm: { + operation: '1142', + domId: '_Tips-Switch-CancelSpeed-Confirm' + }, + confirm1: { + operation: '1143', + domId: '_Tips-Switch-CancelSpeed-Confirm1' + }, + confirm2: { + operation: '1144', + domId: '_Tips-Switch-CancelSpeed-Confirm2' + }, + stop: { + operation: '1145', + domId: '_Tips-Switch-CancelSpeed-Stop' + } + }, + // 查询区段详情 + query: { + menu: { + operation: '115', + domId: '_Tips-Switch-Query-Menu' + } + }, + // 设置限速 + setLimitSpeed: { + menu: { + operation: '116', + domId: '_Tips-Switch-SetSpeed-Menu' + } + }, + // 确认计轴有效 + alxeEffective: { + menu: { + operation: '117', + domId: '_Tips-Switch-Alxe-Effective-Menu' + }, + choose1: { + operation: '1171', + domId: '_Tips-Switch-Alxe-Effective-Choose-1' + }, + choose2: { + operation: '1172', + domId: '_Tips-Switch-Alxe-Effective-Choose-2' + }, + confirm1: { + operation: '1173', + domId: '_Tips-Switch-Alxe-Effective-Confirm-1' + }, + confirm2: { + operation: '1174', + domId: '_Tips-Switch-Alxe-Effective-Confirm-2' + } + }, + // 引导总锁 + guideLock: { + button: { + operation: '1180', + domId: '_Tips-Switch-GuideLock-Button{TOP}' + } + } + }, + + // 控制模式操作 + StationControl: { + // 取消故障 + cancelStoppage: { + menu: { + operation: '299' + } + }, + // 故障 + stoppage: { + menu: { + operation: '200' + } + }, + // 紧急站控 + emergencyStationControl: { + menu: { + operation: '201', + domId: '_Tips-Control-Emergency-Menu' + }, + mbar: { + operation: '2011', + domId: '_Tips-Control-Emergency-Mbar' + }, + choose: { + operation: '2012', + domId: '_Tips-Control-Emergency-Choose' + }, + confirm: { + operation: '2013', + domId: '_Tips-Control-Emergency-Confirm' + } + }, + // 请求站控 + requestStationControl: { + menu: { + operation: '202', + domId: '_Tips-Control-Request-Menu' + }, + mbar: { + operation: '2021', + domId: '_Tips-Control-Request-Mbar' + }, + choose: { + operation: '2022', + domId: '_Tips-Control-Request-Choose' + }, + confirm: { + operation: '2023', + domId: '_Tips-Control-Request-Confirm' + } + }, + // 强行站控 + forcedStationControl: { + menu: { + operation: '203', + domId: '_Tips-Control-Forced-Menu' + }, + mbar: { + operation: '2031', + domId: '_Tips-Control-Forced-Mbar' + }, + choose: { + operation: '2032', + domId: '_Tips-Control-Forced-Choose' + }, + confirm: { + operation: '2033', + domId: '_Tips-Control-Forced-Confirm' + }, + password: { + operation: '2034', + domId: '_Tips-Control-Forced-Password' + }, + passwordConfirm: { + operation: '2035', + domId: '_Tips-Control-Forced-PasswordConfirm' + } + }, + // 请求中控 + requestCentralControl: { + menu: { + operation: '204', + domId: '_Tips-Control-Central-Menu' + }, + mbar: { + operation: '2041', + domId: '_Tips-Control-Central-Mbar' + }, + choose: { + operation: '2042', + domId: '_Tips-Control-Central-Choose' + }, + confirm: { + operation: '2043', + domId: '_Tips-Control-Central-Confirm' + } + }, + // 控制模式应答同意 + controlResponse: { + menu: { + operation: '205', + domId: '_Tips-Control-Response-Menu' + }, + choose: { + operation: '2052', + domId: '_Tips-Control-Response-Choose' + }, + agree: { + operation: '2053', + domId: '_Tips-Control-Response-Agree' + }, + refuse: { + operation: '2054', + domId: '_Tips-Control-Response-Refuse' + } + } + }, + + // 信号机操作 + Signal: { + // 取消故障 + cancelStoppage: { + menu: { + operation: '399' + } + }, + // 故障 + stoppage: { + menu: { + operation: '300' + } + }, + // 查询进路 + query: { + }, + // 排列进路 + arrangementRoute: { + button: { + operation: '3010', + domId: '_Tips-Signal-ArrangementRoute-Mbm{TOP}' + }, + menu: { + operation: '301', + domId: '_Tips-Signal-ArrangementRoute-Menu' + }, + choose: { + operation: '3011', + domId: '_Tips-Signal-ArrangementRoute-Choose' + }, + confirm: { + operation: '3012', + domId: '_Tips-Signal-ArrangementRoute-Confirm' + } + }, + // 取消进路 + cancelTrainRoute: { + button: { + operation: '3030', + domId: '_Tips-Signal-CancelTrainRoute-Mbm{TOP}' + }, + menu: { + operation: '303', + domId: '_Tips-Signal-CancelTrainRoute-Menu' + }, + confirm: { + operation: '3031', + domId: '_Tips-Signal-CancelTrainRoute-Confirm' + } + }, + // 信号重开 + reopenSignal: { + button: { + operation: '3040', + domId: '_Tips-Signal-Reopen-Mbm' + }, + menu: { + operation: '304', + domId: '_Tips-Signal-Reopen-Menu' + }, + confirm: { + operation: '3041', + domId: '_Tips-Signal-Reopen-Confirm' + } + }, + // 人解列车进路 (总人解) + humanTrainRoute: { + button: { + operation: '3050', + domId: '_Tips-Signal-HumanTrainRoute-Mbm{TOP}' + }, + menu: { + operation: '305', + domId: '_Tips-Signal-HumanTrainRoute-Menu' + }, + confirm: { + operation: '3051', + domId: '_Tips-Signal-HumanTrainRoute-Confirm' + } + }, + // 封锁 + lock: { + menu: { + operation: '306', + domId: '_Tips-Signal-Lock-Menu' + }, + confirm: { + operation: '3061', + domId: '_Tips-Signal-Lock-Confirm' + } + }, + // 解锁 + unlock: { + menu: { + operation: '307', + domId: '_Tips-Signal-Unlock-Menu' + }, + order: { + operation: '3071', + domId: '_Tips-Signal-Unlock-Order' + }, + confirm: { + operation: '3072', + domId: '_Tips-Signal-Unlock-Confirm' + }, + confirm1: { + operation: '3073', + domId: '_Tips-Signal-Unlock-Confirm1' + }, + confirm2: { + operation: '3074', + domId: '_Tips-Signal-Unlock-Confirm2' + }, + stop: { + operation: '3075', + domId: '_Tips-Signal-Unlock-Stop' + } + }, + // 引导 + guide: { + button: { + operation: '3080', + domId: '_Tips-Signal-Guide-Mbm{TOP}' + }, + menu: { + operation: '308', + domId: '_Tips-Signal-Guide-Menu' + }, + order: { + operation: '3081', + domId: '_Tips-Signal-Guide-Order' + }, + confirm: { + operation: '3082', + domId: '_Tips-Signal-Guide-Confirm' + }, + confirm1: { + operation: '3083', + domId: '_Tips-Signal-Guide-Confirm1' + }, + confirm2: { + operation: '3084', + domId: '_Tips-Signal-Guide-Confirm2' + }, + stop: { // 福州线 关闭弹窗操作 + operation: '3085', + domId: '_Tips-Signal-Guide-Stop' + }, + choose: { + operation: '3086', + domId: '_Tips-Signal-Guide-Choose' + } + }, + // 设置联锁自动进路 + setAutoInterlock: { + button: { + operation: '3090', + domId: '_Tips-Signal-SetAutoInterlock-Mbm' + }, + menu: { + operation: '309', + domId: '_Tips-Signal-SetAutoInterlock-Menu' + } + }, + // 取消联锁自动进路 + cancelAutoInterlock: { + menu: { + operation: '310', + domId: '_Tips-Signal-CancelAutoInterlock-Menu' + } + }, + // 设置联锁自动触发 + setAutoTrigger: { + menu: { + operation: '311', + domId: '_Tips-Signal-SetAutoTrigger-Menu' + } + }, + // 取消联锁自动触发 + cancelAutoTrigger: { + menu: { + operation: '312', + domId: '_Tips-Signal-CancelAutoTrigger-Menu' + } + }, + // 信号关灯 + signalClose: { + menu: { + operation: '313', + domId: '_Tips-Signal-SignalClose-Menu' + }, + confirm: { + operation: '3131', + domId: '_Tips-Signal-SignalClose-Confirm' + } + }, + // 进路交人工控 + humanControl: { + button: { + operation: '3140', + domId: '_Tips-Signal-HumanControl-Button{TOP}' + }, + menu: { + operation: '314', + domId: '_Tips-Signal-HumanControl-Menu' + }, + choose: { + operation: '3141', + domId: '_Tips-Signal-HumanControl-Choose' + }, + confirm: { + operation: '3142', + domId: '_Tips-Signal-HumanControl-Confirm' + } + }, + // 进路交自动控 + atsAutoControl: { + button: { + operation: '3150', + domId: '_Tips-Signal-AtsAutoControl-Button{TOP}' + }, + menu: { + operation: '315', + domId: '_Tips-Signal-AtsAutoControl-Menu' + }, + choose: { + operation: '3151', + domId: '_Tips-Signal-AtsAutoControl-Choose' + }, + confirm: { + operation: '3152', + domId: '_Tips-Signal-AtsAutoControls-Confirm' + } + }, + // 查询进路状态 + detail: { + menu: { + operation: '316', + domId: '_Tips-Signal-Detail-Menu' + } + }, + // 查询进路状态 + singalPassModel: { + menu: { + operation: '317', + domId: '_Tips-Signal-SingalPassModel-Menu' + } + } + }, + + // 物理区段操作 + Section: { + // 取消故障 + cancelStoppage: { + menu: { + operation: '499' + } + }, + // 故障 + stoppage: { + menu: { + operation: '400' + } + }, + // 设置计轴失效 + alxeFailure: { + menu: { + operation: '4001' + } + }, + + // 查询区段详情 + query: { + menu: { + operation: '401', + domId: '_Tips-Section-Query-Menu' + } + }, + // 区故解 + fault: { + button: { + operation: '4020', + domId: '_Tips-Section-Fault-Mbm{TOP}' + }, + menu: { + operation: '402', + domId: '_Tips-Section-Fault-Menu' + }, + prepare: { + operation: '4021', + domId: '_Tips-Section-Fault-Prepare' + }, + select: { + operation: '4022', + domId: '_Tips-Section-Fault-Select' + }, + confirm: { + operation: '4023', + domId: '_Tips-Section-Fault-Confirm' + }, + confirm1: { + operation: '4024', + domId: '_Tips-Section-Fault-Confirm1' + }, + confirm2: { + operation: '4025', + domId: '_Tips-Section-Fault-Confirm2' + }, + order: { + operation: '4026', + domId: '_Tips-Section-Fault-Order' + }, + stop: { + operation: '4027', + domId: '_Tips-Section-Fault-Stop' + } + }, + // 封锁 + lock: { + menu: { + operation: '403', + domId: '_Tips-Section-Lock-Menu' + } + }, + // 解锁 + unlock: { + menu: { + operation: '404', + domId: '_Tips-Section-Unlock-Menu' + }, + order: { + operation: '4041', + domId: '_Tips-Section-Unlock-Order' + }, + confirm: { + operation: '4042', + domId: '_Tips-Section-Unlock-Confirm' + }, + confirm1: { + operation: '4043', + domId: '_Tips-Section-Unlock-Confirm1' + }, + confirm2: { + operation: '4044', + domId: '_Tips-Section-Unlock-Confirm2' + }, + stop: { + operation: '4045', + domId: '_Tips-Section-Unlock-Stop' + } + }, + // 切除 + split: { + menu: { + operation: '405', + domId: '_Tips-Section-split-Menu' + }, + mbar: { + operation: '4051', + domId: '_Tips-Section-split-Mbar' + } + }, + // 激活 + active: { + menu: { + operation: '406', + domId: '_Tips-Section-Active-Menu' + }, + mbar: { + operation: '4061', + domId: '_Tips-Section-Active-mbar' + } + }, + // 设置速度 + setSpeed: { + menu: { + operation: '407', + domId: '_Tips-Section-SetSpeed-Menu' + }, + order: { + operation: '4071', + domId: '_Tips-Section-SetSpeed-Order' + }, + confirm: { + operation: '4072', + domId: '_Tips-Section-SetSpeed-Confirm' + }, + confirm1: { + operation: '4073', + domId: '_Tips-Section-SetSpeed-Confirm1' + }, + confirm2: { + operation: '4074', + domId: '_Tips-Section-SetSpeed-Confirm2' + }, + stop: { + operation: '4075', + domId: '_Tips-Section-SetSpeed-Stop' + }, + choose: { + operation: '4076', + domId: '_Tips-Section-SetSpeed-Choose' + } + }, + // 取消速度 + cancelSpeed: { + menu: { + operation: '408', + domId: '_Tips-Section-CancelSpeed-Menu' + }, + order: { + operation: '4081', + domId: '_Tips-Section-CancelSpeed-Order' + }, + confirm: { + operation: '4082', + domId: '_Tips-Section-CancelSpeed-Confirm' + }, + confirm1: { + operation: '4083', + domId: '_Tips-Section-CancelSpeed-Confirm1' + }, + confirm2: { + operation: '4084', + domId: '_Tips-Section-CancelSpeed-Confirm2' + }, + stop: { + operation: '4085', + domId: '_Tips-Section-CancelSpeed-Stop' + } + }, + // 计轴预复位 + axlePreReset: { + button: { + operation: '4090', + domId: '_Tips-Section-AxlePreReset-Mbm' + }, + menu: { + operation: '409', + domId: '_Tips-Section-AxlePreReset-Menu' + }, + order: { + operation: '4091', + domId: '_Tips-Section-AxlePreReset-Order' + }, + confirm: { + operation: '4092', + domId: '_Tips-Section-AxlePreReset-Confirm' + }, + confirm1: { + operation: '4093', + domId: '_Tips-Section-AxlePreReset-Confirm1' + }, + confirm2: { + operation: '4094', + domId: '_Tips-Section-AxlePreReset-Confirm2' + }, + stop: { + operation: '4095', + domId: '_Tips-Section-AxlePreReset-Stop' + } + }, + // 设备状态 + detail: { + menu: { + operation: '410', + domId: '_Tips-Section-detail-Menu' + } + }, + // 新建列车 + newtrain: { + menu: { + operation: '411', + domId: '_Tips-Section-Newtrain-Menu' + } + }, + // 确认计轴有效 + alxeEffective: { + menu: { + operation: '412', + domId: '_Tips-Section-Alxe-Effective-Menu' + }, + choose1: { + operation: '4121', + domId: '_Tips-Section-Alxe-Effective-Choose-1' + }, + choose2: { + operation: '4122', + domId: '_Tips-Section-Alxe-Effective-Choose-2' + }, + confirm1: { + operation: '4123', + domId: '_Tips-Section-Alxe-Effective-Confirm-1' + }, + confirm2: { + operation: '4124', + domId: '_Tips-Section-Alxe-Effective-Confirm-2' + } + }, + // 设置临时限速 + setLimitSpeed: { + menu: { + operation: '413', + domId: '_Tips-Section-SetLimitSpeed-Menu' + }, + openConversation: { + operation: '4131', + domId: '_Tips-Section-SetLimitSpeed-OpenConversation' + }, + closeConversation: { + operation: '4132', + domId: '_Tips-Section-SetLimitSpeed-CloseConversation' + }, + firstLimitSpeed: { + operation: '4133', + domId: '_Tips-Section-SetLimitSpeed-FirstLimitSpeed{TOP}' + }, + firstStartSection: { + operation: '4134', + domId: '_Tips-Section-SetLimitSpeed-FirstStartSection{TOP}' + }, + firstStartvalue: { + operation: '4135', + domId: '_Tips-Section-SetLimitSpeed-FirstStartvalue' + }, + firstEndSection: { + operation: '4136', + domId: '_Tips-Section-SetLimitSpeed-FirstEndSection{TOP}' + }, + firstEndvalue: { + operation: '4137', + domId: '_Tips-Section-SetLimitSpeed-FirstEndvalue' + }, + firstCheck: { + operation: '4138', + domId: '_Tips-Section-SetLimitSpeed-FirstCheck' + }, + firstComfirm: { + operation: '4139', + domId: '_Tips-Section-SetLimitSpeed-FirstComfirm' + }, + secondLimitSpeed: { + operation: '41310', + domId: '_Tips-Section-SetLimitSpeed-SecondLimitSpeed{TOP}' + }, + secondStartSection: { + operation: '41311', + domId: '_Tips-Section-SetLimitSpeed-SecondStartSection{TOP}' + }, + secondStartvalue: { + operation: '41312', + domId: '_Tips-Section-SetLimitSpeed-SecondStartvalue{TOP}' + }, + secondEndSection: { + operation: '41313', + domId: '_Tips-Section-SetLimitSpeed-SecondEndSection{TOP}' + }, + secondEndvalue: { + operation: '41314', + domId: '_Tips-Section-SetLimitSpeed-SecondEndvalue{TOP}' + }, + secondCheck: { + operation: '41315', + domId: '_Tips-Section-SetLimitSpeed-SecondCheck' + }, + secondComfirm: { + operation: '41316', + domId: '_Tips-Section-SetLimitSpeed-SecondComfirm' + }, + domIdClose: { + operation: '41317', + domId: '_Tips-Section-SetLimitSpeed-DomIdClose' + }, + close: { + operation: '41318', + domId: '_Tips-Section-SetLimitSpeed-close' + } + }, + // 确认临时限速 + confirmLimit: { + menu: { + operation: '414', + domId: '_Tips-Section-Confirm-Limit-Menu' + } + } + }, + + // 站台 + StationStand: { + // 取消故障 + cancelStoppage: { + menu: { + operation: '599' + } + }, + // 故障 + stoppage: { + menu: { + operation: '500' + } + }, + // 提前发车 + earlyDeparture: { + menu: { + operation: '501', + domId: '_Tips-Stand-EarlyDeparture-Menu' + }, + upSelect: { + operation: '5011', + domId: '_Tips-Stand-EarlyDeparture-upSelect' + }, + downSelect: { + operation: '5012', + domId: '_Tips-Stand-EarlyDeparture-downSelect' + } + }, + // 设置跳停 + setJumpStop: { + menu: { + operation: '502', + domId: '_Tips-Stand-SetJumpStop-Menu' + }, + choose: { + operation: '5021', + domId: '_Tips-Stand-SetJumpStop-Choose' + }, + select: { + operation: '5022', + domId: '_Tips-Stand-SetJumpStop-Select' + }, + selfStationStand: { + operation: '5023', + domId: '_Tips-Stand-SetJumpStop-selfStationStand' + }, + otherStationStand: { + operation: '5024', + domId: '_Tips-Stand-SetJumpStop-otherStationStand' + } + }, + // 取消跳停 + cancelJumpStop: { + menu: { + operation: '503', + domId: '_Tips-Stand-CancelJumpStop-Menu' + }, + choose: { + operation: '5031', + domId: '_Tips-Stand-CancelJumpStop-Choose' + }, + select: { + operation: '5032', + domId: '_Tips-Stand-CancelJumpStop-Select' + }, + selfStationStand: { + operation: '5033', + domId: '_Tips-Stand-CancelJumpStop-selfStationStand' + }, + otherStationStand: { + operation: '5034', + domId: '_Tips-Stand-CancelJumpStop-otherStationStand' + } + }, + // 设置扣车 + setDetainTrain: { + menu: { + operation: '504', + domId: '_Tips-Stand-SetDetainTrain-Menu' + } + }, + // 取消扣车 + cancelDetainTrain: { + menu: { + operation: '505', + domId: '_Tips-Stand-CancelDetainTrain-Menu' + }, + choose: { + operation: '5051', + domId: '_Tips-Stand-cancelDetainTrain-Choose' + } + }, + // 强制取消扣车 + cancelDetainTrainForce: { + menu: { + operation: '506', + domId: '_Tips-Stand-CancelDetainTrainForce-Menu' + } + }, + // 站台详细信息 + detail: { + menu: { + operation: '507', + domId: '_Tips-Stand-Detail-Menu' + } + }, + // 全线取消扣车 + cancelDetainTrainAll: { + menu: { + operation: '508', + domId: '_Tips-Stand-CancelDetainTrainAll-Menu' + }, + choose: { + operation: '5081', + domId: '_Tips-Stand-CancelDetainTrainAll-Choose' + }, + mbar: { + operation: '5082', + domId: '_Tips-Stand-CancelDetainTrainAll-Mbar' + }, + confirm: { + operation: '5083', + domId: '_Tips-Stand-CancelDetainTrainAll-Confirm' + } + }, + // 设置停站时间 + setStopTime: { + menu: { + operation: '509', + domId: '_Tips-Stand-SetStopTime-Menu' + }, + confirm: { + operation: '5091', + domId: '_Tips-Stand-SetStopTime-Confirm' + }, + choose1: { + operation: '5092', + domId: '_Tips-Stand-SetStopTime-Choose-1' + }, + choose2: { + operation: '5093', + domId: '_Tips-Stand-SetStopTime-Choose-2' + }, + input: { + operation: '5094', + domId: '_Tips-Stand-SetStopTime-Input' + } + }, + // 设置运行等级 + setRunLevel: { + menu: { + operation: '510', + domId: '_Tips-Stand-SetRunLevel-Menu' + }, + choose: { + operation: '5101', + domId: '_Tips-Stand-SetRunLevel-Choose' + }, + confirm: { + operation: '5102', + domId: '_Tips-Stand-SetRunLevel-confirm' + }, + check: { + operation: '5103', + domId: '_Tips-Stand-SetRunLevel-check' + }, + chooseLevel: { + operation: '5104', + domId: '_Tips-Stand-SetRunLevel-chooseLevel' + }, + chooseTrain: { + operation: '5105', + domId: '_Tips-Stand-SetRunLevel-chooseTrain' + }, + choose1: { + operation: '5106', + domId: '_Tips-Stand-SetRunLevel-Choose-1' + }, + choose2: { + operation: '5107', + domId: '_Tips-Stand-SetRunLevel-Choose-2' + } + }, + // 设置折返策略 + setBackStrategy: { + menu: { + operation: '511', + domId: '_Tips-Stand-SetBackStrategy-Menu' + }, + choose: { + operation: '5111', + domId: '_Tips-Stand-setBackStrategy-Choose' + }, + confirm: { + operation: '5112', + domId: '_Tips-Stand-setBackStrategy-confirm' + } + }, + // 设置全线扣车 + setDetainTrainAll: { + menu: { + operation: '512', + domId: '_Tips-Stand-SetBackStrategy-Menu' + }, + mbar: { + operation: '5121', + domId: '_Tips-Stand-setDetainTrainAll-Mbar' + }, + confirm: { + operation: '5122', + domId: '_Tips-Stand-setDetainTrainAll-confirm' + } + }, + cancelUpDetainTrainAll: { + menu: { + operation: '513', + domId: '_Tips-Stand-SetBackStrategy-Menu' + }, + mbar: { + operation: '5131', + domId: '_Tips-Stand-clearUpCar-Mbar' + }, + confirm: { + operation: '5132', + domId: '_Tips-Stand-clearUpCar-confirm' + } + }, + cancelDownDetainTrainAll: { + menu: { + operation: '514', + domId: '_Tips-Stand-SetBackStrategy-Menu' + }, + mbar: { + operation: '5141', + domId: '_Tips-Stand-clearDownCar-Mbar' + }, + confirm: { + operation: '5142', + domId: '_Tips-Stand-clearDownCar-confirm' + } + }, + // 批量扣车 + setBulkBuckleTrain: { + menu: { + operation: '515', + domId: '_Tips-Stand-setBulkBuckleTrain-Menu' + } + }, + // 批量取消扣车 + cancelBulkBuckleTrain: { + menu: { + operation: '516', + domId: '_Tips-Stand-cancelBulkBuckleTrain-Menu' + } + }, + // 区间列车数量限制 + setDetainTrainAuto: { + menu: { + operation: '515', + domId: '_Tips-Stand-setDetainTrainAuto-Menu' + } + }, + // 取消区间列车数量限制 + cancelDetainTrainAuto: { + menu: { + operation: '516', + domId: '_Tips-Stand-cancelDetainTrainAuto-Menu' + } + } + }, + + Station: { + // 取消故障 + cancelStoppage: { + menu: { + operation: '699' + } + }, + // 故障 + stoppage: { + menu: { + operation: '600' + } + }, + // 全站设置联锁自动触发 + setAutoTrigger: { + menu: { + operation: '601', + domId: '_Tips-Station-SetAutoTrigger-Menu' + } + }, + // 全站取消联锁自动触发 + cancelAutoTrigger: { + menu: { + operation: '602', + domId: '_Tips-Station-CancelAutoTrigger-Menu' + } + }, + // 上电解锁 + powerUnLock: { + menu: { + operation: '603', + domId: '_Tips-Station-PowerUnLock-Menu' + }, + order: { + operation: '6031', + domId: '_Tips-Station-PowerUnLock-Order' + }, + confirm: { + operation: '6032', + domId: '_Tips-Station-PowerUnLock-Confirm' + }, + confirm1: { + operation: '6033', + domId: '_Tips-Station-PowerUnLock-Confirm1' + }, + confirm2: { + operation: '6034', + domId: '_Tips-Station-PowerUnLock-Confirm2' + }, + stop: { + operation: '6035', + domId: '_Tips-Station-PowerUnLock-Stop' + } + }, + // 执行关键操作测试 + execKeyOperationTest: { + menu: { + operation: '604', + domId: '_Tips-Station-ExecKeyOperationTest-Menu' + }, + order: { + operation: '6041', + domId: '_Tips-Station-ExecKeyOperationTest-Order' + }, + confirm: { + operation: '6042', + domId: '_Tips-Station-ExecKeyOperationTest-Confirm' + }, + confirm1: { + operation: '6043', + domId: '_Tips-Station-ExecKeyOperationTest-Confirm1' + }, + confirm2: { + operation: '6044', + domId: '_Tips-Station-ExecKeyOperationTest-Confirm2' + }, + stop: { + operation: '6045', + domId: '_Tips-Station-ExecKeyOperationTest-Stop' + } + }, + // 所有进路自排关 + humanControlALL: { + menu: { + operation: '605', + domId: '_Tips-Station-HumanControlALL-Menu' + } + }, + // 所有进路自排开 + atsAutoControlALL: { + menu: { + operation: '606', + domId: '_Tips-Station-AtsAutoControlALL-Menu' + } + }, + split: { + mbar: { + operation: '6071', + domId: '_Tips-Stand-Split-Mbar' + }, + choose: { + operation: '6072', + domId: '_Tips-Stand-Split-Mbar' + }, + confirm: { + operation: '6073', + domId: '_Tips-Stand-Split-confirm' + } + }, + active: { + mbar: { + operation: '6081', + domId: '_Tips-Stand-Active-Mbar' + }, + choose: { + operation: '6082', + domId: '_Tips-Stand-Split-Mbar' + }, + confirm: { + operation: '6083', + domId: '_Tips-Stand-Active-confirm' + } + } + }, + + // 列车 + Train: { + // 取消故障 + cancelStoppage: { + menu: { + operation: '799' + } + }, + // 故障 + stoppage: { + menu: { + operation: '700' + } + }, + // 添加列车识别号 + addTrainId: { + menu: { + operation: '701', + domId: '_Tips-Train-AddTrainId-Menu' + }, + trainNumberChange: { + operation: '7011', + domId: '_Tips-Train-AddTrainId-TrainNumberChange' + }, + trainTypeChange: { + operation: '7012', + domId: '_Tips-Train-AddTrainId-trainTypeChange' + }, + serverNoChange: { + operation: '7013', + domId: '_Tips-Train-AddTrainId-serverNoChange' + }, + trainNoChange: { + operation: '7014', + domId: '_Tips-Train-AddTrainId-trainNoChange' + }, + targetCodeChange: { + operation: '7015', + domId: '_Tips-Train-AddTrainId-targetCodeChange' + }, + confirm: { + operation: '7016', + domId: '_Tips-Train-AddTrainId-Confirm' + }, + input: { + operation: '7017', + domId: '_Tips-Train-AddTrainId-Input' + } + }, + // 修改列车识别号 + editTrainId: { + menu: { + operation: '702', + domId: '_Tips-Train-EditTrainId-Menu' + }, + trainNumberChange: { + operation: '7021', + domId: '_Tips-Train-EditTrainId-TrainNumberChange' + }, + trainTypeChange: { + operation: '7022', + domId: '_Tips-Train-EditTrainId-trainTypeChange' + }, + serverNoChange: { + operation: '7023', + domId: '_Tips-Train-EditTrainId-serverNoChange' + }, + trainNoChange: { + operation: '7024', + domId: '_Tips-Train-EditTrainId-trainNoChange' + }, + targetCodeChange: { + operation: '7025', + domId: '_Tips-Train-EditTrainId-targetCodeChange' + }, + confirm: { + operation: '7026', + domId: '_Tips-Train-EditTrainId-Confirm' + }, + input: { + operation: '7027', + domId: '_Tips-Train-EditTrainId-Input' + } + }, + // 删除列车识别号 + delTrainId: { + menu: { + operation: '703', + domId: '_Tips-Train-DelTrainId-Menu' + }, + trainNumberChange: { + operation: '7031', + domId: '_Tips-Train-DelTrainId-TrainNumberChange' + }, + confirm: { + operation: '7032', + domId: '_Tips-Train-DelTrainId-Confirm' + }, + input: { + operation: '7033', + domId: '_Tips-Train-DelTrainId-Input' + } + }, + // 移动列车识别号 + moveTrainId: { + menu: { + operation: '704', + domId: '_Tips-Train-MoveTrainId-Menu' + }, + confirm: { + operation: '7041', + domId: '_Tips-Train-MoveTrainId-Confirm' + } + }, + + // 交换列车识别号 + switchTrainId: { + menu: { + operation: '705', + domId: '_Tips-Train-SwitchTrainId-Menu' + }, + confirm: { + operation: '7051', + domId: '_Tips-Train-SwitchTrainId-Confirm' + } + }, + // 修改车组号 + editTrainNo: { + menu: { + operation: '706', + domId: '_Tips-Train-DditTrainNo-Menu' + }, + confirm: { + operation: '7061', + domId: '_Tips-Train-DditTrainNo-Confirm' + } + }, + // 限速行驶 + limitSpeed: { + menu: { + operation: '707', + domId: '_Tips-Train-LimitSpeed-Menu' + } + }, + // 设置计划车 + setPlanTrainId: { + menu: { + operation: '708', + domId: '_Tips-Train-SetPlanTrainId-Menu' + }, + confirm: { + operation: '7081', + domId: '_Tips-Train-SetPlanTrainId-Confirm' + }, + trainSource: { + operation: '7082', + domId: '_Tips-Train-SetPlanTrainId-TrainSource' + } + }, + // 添加计划车 + addPlanTrainId: { + menu: { + operation: '709', + domId: '_Tips-Train-addPlanTrainId-Menu' + }, + confirm: { + operation: '7091', + domId: '_Tips-Train-addPlanTrainId-Confirm' + }, + trainSource: { + operation: '7092', + domId: '_Tips-Train-addPlanTrainId-TrainSource' + } + }, + // 平移计划车 + moveEventlyTrainId: { + menu: { + operation: '70a', + domId: '_Tips-Train-moveEventlyTrainId-Menu' + }, + confirm: { + operation: '70a1', + domId: '_Tips-Train-moveEventlyTrainId-Confirm' + }, + trainSource: { + operation: '70a2', + domId: '_Tips-Train-moveEventlyTrainId-TrainSource' + } + }, + // 删除计划车 + deletePlanTrainId: { + menu: { + operation: '70b', + domId: '_Tips-Train-deletePlanTrainId-Menu' + }, + confirm: { + operation: '70b1', + domId: '_Tips-Train-deletePlanTrainId-Confirm' + }, + trainSource: { + operation: '70b2', + domId: '_Tips-Train-deletePlanTrainId-TrainSource' + } + }, + // 设目的地车 + destinationTrainId: { + menu: { + operation: '70c', + domId: '_Tips-Train-destinationTrainId-Menu' + } + }, + // 设人工车 + artificialTrainId: { + menu: { + operation: '70d', + domId: '_Tips-Train-artificialTrainId-Menu' + } + } + + }, + + // 取消全线临时限速 + LimitControl: { + CancelAllLimit: { + menu: { + operation: '800', + domId: '_Tips-Cancel-Limit-All-Menu' + }, + openMessage: { + operation: '8001', + domId: '_Tips-Cancel-Limit-open-message-Menu' + }, + closeMessage: { + operation: '8002', + domId: '_Tips-Cancel-Limit-close-message-Menu' + }, + confirm1: { + operation: '8003', + domId: '_Tips-Cancel-Limit-close-confirm1-Menu' + }, + confirm2: { + operation: '8004', + domId: '_Tips-Cancel-Limit-close-confirm2-Menu' + }, + confirm: { + operation: '8005', + domId: '_Tips-Cancel-Limit-confirm-Menu' + }, + close: { + operation: '8006', + domId: '_Tips-Cancel-Limit-close-Menu' + } + } + }, + + // 混合指令 + MixinCommand: { + /** 控制模式操作 */ + remoteControl: { + mbar: { + operation: '2999', + domId: '_Tips-Control-StationControl-Mbar' + } + }, + // 封锁 + block: { + button: { + operation: '2991', + domId: '_Tips-Block-Button{TOP}' + } + }, + // 解封 + unblock: { + button: { + operation: '2992', + domId: '_Tips-Unblock-Button{TOP}' + } + }, + // 功能按钮 + functionButton: { + button: { + operation: '2993', + domId: '_Tips-FunctionButton-Button{TOP}' + } + } + } + +}; + +class OperationHandler { + constructor() { + this.domIdOperationRel = {}; + this.generateDomIdOperationRel(); + } + + generateDomIdOperationRel() { + this.domIdOperationRel = {}; + for (const deviceType in OperationEvent) { + for (const op in OperationEvent[deviceType]) { + for (const orderType in OperationEvent[deviceType][op]) { + if (OperationEvent[deviceType][op][orderType].operation) { + this.domIdOperationRel[OperationEvent[deviceType][op][orderType].operation] = OperationEvent[deviceType][op][orderType].domId; + } + } + } + } + } + + getDomIdByOperation(operation) { + if (!this.domIdOperationRel) { + this.domIdOperationRel = this.generateDomIdOperationRel(); + } + + return this.domIdOperationRel[operation]; + } + + checkOperationIsCurrentOperate(operation, op) { + for (const order in op) { + if (op[order] && + op[order].operation === operation) { + return true; + } + } + } +} + +export default new OperationHandler(); diff --git a/src/scripts/cmdPlugin/ParamEnum.js b/src/scripts/cmdPlugin/ParamEnum.js new file mode 100644 index 000000000..327b42704 --- /dev/null +++ b/src/scripts/cmdPlugin/ParamEnum.js @@ -0,0 +1,27 @@ +export default { + P_SECTION_CODE: {label: '区段CODE', value: 'Section_Code' }, + P_SIGNAL_CODE: {label: '信号机CODE', value: 'Signal_Code'}, + P_SWITCH_CODE: {label: '道岔CODE', value: 'Switch_Code'}, + + P_CONTROLMODE_CODE: {label: '控制模式CODE', value: 'ControlMode_Code'}, + + P_STATIONSTAND_CODE: {label: '站台CODE', value: 'StationStand_Code'}, + + P_ROUTE_CODE: {label: '进路CODE', value: 'Route_Code'}, + P_ROUTE_CODE_LIST: {label: '进路CODE列表', value: 'Route_Code_List'}, + + P_STAND_ALWAYS_VALID: {label: '站台一直有效', value: 'Stand_AlwaysValid'}, + P_STAND_STOP_CONTROL: {label: '站台控制方式', value: 'Stand_StopControl'}, + P_STAND_RUNLEVEL: {label: '站台运行等级', value: 'Stand_RunLevel'}, + P_STAND_STOPTIME: {label: '站台停站时间', value: 'Stand_StopTime'}, + P_STAND_REENTRY_STRATEGY: {label: '站台控制策略', value: 'Stand_ReentryStrategy'}, + P_STAND_ALLLINE: {label: '站台全线', value: 'Stand_AllLine'}, + P_STAND_SPEED_LIMIT_VALUE: {label: '临时限速值', value: 'SpeedLimit_Value'}, + P_STAND_CHECK_CONFLICT: {label: '站台检查冲突', value: 'CheckConflict'}, + P_STAND_JUMPSTOP_RANGE: {label: '列车跳停范围', value: 'Stand_JumpStop_Range'}, + P_REPLY_COMMAND_ID: {label: '回复指令ID', value: 'Reply_Command_Id'}, + P_CONTROLMODE_REPLY: {label: '控制模式转换回复', value: 'ControlMode_Reply'}, + P_Train_GroupNo: {label: '车组号', value: 'Train_GroupNo'}, + P_STAND_STOPTIME_MODE: {label: '站台停战时间模式(自动/全人工)', value: 'Stand_StopTime_Mode'} +}; + diff --git a/src/scripts/cmdPlugin/ValidateHandler.js b/src/scripts/cmdPlugin/ValidateHandler.js new file mode 100644 index 000000000..8451c307b --- /dev/null +++ b/src/scripts/cmdPlugin/ValidateHandler.js @@ -0,0 +1,70 @@ +import store from '@/store'; +import LangStorage from '@/utils/lang'; +import Handler from './Handler.js'; +import { TrainingMode } from '@/scripts/ConstDic'; +import { Message } from 'element-ui'; + +class ValidateHandler { + vaildate(mode, operate) { + switch (mode) { + case TrainingMode.EDIT: // 编辑制作模式 + return this.vaildate_edit(operate); + case TrainingMode.PRACTICE: // 练习模式 + return this.vaildate_tips(operate); + case TrainingMode.TEACH: // 教学模式 + return this.vaildate_tips(operate); + } + + return true; + } + + vaildate_edit(operate) { + let vaild = true; + if (Handler.getOperateBreakStatus()) { + const tip = LangStorage.getLang() == 'en' ? 'Please enter a hint and click next' : '请输入提示并点击下一步'; + Message.error(tip); + Handler.pop(); + vaild = false; + } + + if (Handler.getTrainingStart()) { + store.dispatch('training/setTempStep', operate); + } + + return vaild; + } + + vaildate_tips(operate) { + let valid = true; + if (Handler.getTrainingStart()) { + valid = this.judge(operate); + } else { + Handler.clear(); + valid = false; + } + + return valid; + } + + /** 判断操作步骤是否正确 */ + judge (operate) { + const steps = Handler.getSteps(); + const order = Handler.getOrder(); + + let valid = false; + if (order < steps.length) { + const standard = steps[order]; + if (operate && standard && + operate.code == standard.code && + operate.operation == standard.operation && + operate.val == standard.val) { + valid = true; + } + } + + return valid; + } + +} + +export default new ValidateHandler(); diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 7e1c3aed6..c87fa964c 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -495,6 +495,22 @@ const map = { }); } + return device; + }, + + // 查询所属车站关联的控制模式 + getDeviceStationCodeByStationCode: (state) => (code) => { + let device = null; + if (code && + state.map && + state.map.stationList && state.map.stationList.length) { + state.map.stationList.forEach(elem => { + if (elem.code == code) { + device = state.mapDevice[elem.code]; + } + }); + } + return device; } }, diff --git a/src/store/modules/training.js b/src/store/modules/training.js index 4fbfc9676..016e35293 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -3,6 +3,7 @@ import { TrainingMode } from '@/scripts/ConstDic'; import OperateHandler from '@/scripts/plugin/OperateHandler'; import deviceType from '../../jmap/constant/deviceType'; import LangStorage from '@/utils/lang'; +import Handler from '@/scripts/cmdPlugin/Handler'; /** * 实训状态数据 @@ -201,6 +202,9 @@ const training = { }, setGroup: (state, group) => { state.group = group; + }, + notifyGetCommandDefinition: (state, lineCode) => { + Handler.notify(lineCode); } }, @@ -252,6 +256,7 @@ const training = { start: ({ commit }) => { // 清空操作组 OperateHandler.cleanOperates(); + Handler.clear(); // 两种方式 // 清空计时器以及得分 commit('stopCountTime'); commit('resetUsedTime'); @@ -372,6 +377,50 @@ const training = { }); }, + /** + * 下一步 + */ + nextNew: ({ commit, state }, operate) => { + return new Promise((resolve, reject) => { + commit('setOperate', operate); + + if (!state.started && !state.mode) { + commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? 'Please click start, start training!' : '请点击开始,开始实训!', color: 'red' }); + return; + } + + try { + // 处理operation + Handler.handle(operate).then(rtn => { + if (state.started) { + // 教学和联系模式需要给出过程步骤提示 + if (TrainingMode.TEACH === state.mode || TrainingMode.PRACTICE === state.mode) { + if (rtn && rtn.valid) { + commit('next'); + commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? "Correct operation! That's great!" : '操作正确!真棒!', color: 'green' }); + commit('tipEventIncrement'); + } else { + if (!operate.repeat) { + commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? 'operation mistake!' : '操作错误!', color: 'red' }); + } + } + } else if (TrainingMode.EXAM === state.mode || TrainingMode.TEST === state.mode) { + // 测试和考试不给提示 + rtn && rtn.valid && commit('next'); + } + } + resolve(rtn); + }).catch(error => { + console.error(error); + reject(error); + }); + } catch (error) { + console.error(error); + reject(error); + } + }); + }, + /** * 提示消息重新加载 */ diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 1e9afea51..5550c465d 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -7,7 +7,7 @@ export function getBaseUrl() { // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - // BASE_API = 'http://192.168.3.82:9000'; // 杜康 + BASE_API = 'http://192.168.3.82:9000'; // 杜康 } else { BASE_API = process.env.VUE_APP_BASE_API; } diff --git a/src/views/display/designIndex.vue b/src/views/display/designIndex.vue index 2fcb3fb20..1d6add39f 100644 --- a/src/views/display/designIndex.vue +++ b/src/views/display/designIndex.vue @@ -237,6 +237,7 @@ export default { }, async beforeDestroy() { await this.clearAllTimer(); + await this.quit(); await this.$store.dispatch('training/reset'); await this.$store.dispatch('map/mapClear'); EventBus.$off('clearCheckLogin'); diff --git a/src/views/display/index.vue b/src/views/display/index.vue index 345de9d23..25c98764b 100644 --- a/src/views/display/index.vue +++ b/src/views/display/index.vue @@ -235,6 +235,7 @@ export default { }, async beforeDestroy() { await this.clearAllTimer(); + await this.quit(); await this.$store.dispatch('training/reset'); await this.$store.dispatch('map/mapClear'); EventBus.$off('clearCheckLogin'); diff --git a/src/views/display/menuDemon.vue b/src/views/display/menuDemon.vue index 71731ad60..d275e359d 100644 --- a/src/views/display/menuDemon.vue +++ b/src/views/display/menuDemon.vue @@ -35,9 +35,9 @@ import { getGoodsTryUse } from '@/api/management/goods'; import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation'; import { PermissionType } from '@/scripts/ConstDic'; import { getCountTime } from '@/utils/index'; -import { runDiagramIsStart, quitScript } from '@/api/simulation'; +import { runDiagramIsStart, runDiagramQuit, quitScript } from '@/api/simulation'; import { timeFormat } from '@/utils/date'; -import { getToken } from '@/utils/auth'; +// import { getToken } from '@/utils/auth'; export default { name: 'MenuDemon', @@ -189,7 +189,8 @@ export default { this.$messageBox(this.$t('display.demon.exitTaskFail')); }); }, - back() { + async back() { + await runDiagramQuit(this.group); this.$store.dispatch('training/over').then(() => { history.go(-1); Notification.closeAll(); diff --git a/src/views/display/menuExam.vue b/src/views/display/menuExam.vue index e872c4ee2..9d44b1690 100644 --- a/src/views/display/menuExam.vue +++ b/src/views/display/menuExam.vue @@ -139,7 +139,7 @@ export default { }).catch(error => { // 如果时50009则表示考试已完成,不能再次进行y if (error.code === 500009) { - this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: {subSystem: this.$route.query.subSystem} }); + this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem, mapId:this.$route.query.mapId } }); } else { this.$messageBox(this.$t('display.exam.refreshListError')); } diff --git a/src/views/display/tipExamList.vue b/src/views/display/tipExamList.vue index 16945466f..91f83f6b9 100644 --- a/src/views/display/tipExamList.vue +++ b/src/views/display/tipExamList.vue @@ -93,7 +93,7 @@ export default { name: '', remarks: '' }, - isShrink: false, + isShrink: true, examName: '', courseModel: { id: '', @@ -197,13 +197,12 @@ export default { }).catch(error => { // 如果时50009则表示考试已完成,不能再次进行y if (error.code === 500009) { - this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem } }); + this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem, mapId:this.$route.query.mapId } }); } else { this.$messageBox(this.$t('display.exam.refreshListError')); } }); - this.shrink(); }, scanCommit() { this.clearScanCommit(); @@ -281,7 +280,7 @@ export default { submit() { this.$store.dispatch('exam/over').then(() => { this.$store.dispatch('trainingList/clearTrainingList'); - this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} }); + this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: { subSystem: this.$route.query.subSystem, mapId:this.$route.query.mapId } }); }); }, shrink() { diff --git a/src/views/display/tipTrainingDetail.vue b/src/views/display/tipTrainingDetail.vue index 4ec3b1363..23edcf08d 100644 --- a/src/views/display/tipTrainingDetail.vue +++ b/src/views/display/tipTrainingDetail.vue @@ -117,8 +117,6 @@ export default { this.$message.error(this.$t('display.training.getCourseInformationFail') + ':' + error.message); }); } - - this.shrink(); }, jump(obj) { const query = { diff --git a/src/views/exam/result.vue b/src/views/exam/result.vue index dc48a3382..5f3589a6d 100644 --- a/src/views/exam/result.vue +++ b/src/views/exam/result.vue @@ -108,7 +108,7 @@ export default { }, back() { const examId = this.resultModel.examId; - this.$router.push({path: `${UrlConfig.trainingPlatform.examDetail}/${examId}`, query: { subSystem: this.$route.query.subSystem }}); + this.$router.push({path: `${UrlConfig.trainingPlatform.examDetail}/${examId}`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId }}); } } }; diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue index a8054c892..14d11f9fb 100644 --- a/src/views/jlmap/index.vue +++ b/src/views/jlmap/index.vue @@ -23,12 +23,12 @@ import Vue from 'vue'; import localStore from 'storejs'; import Jlmap from '@/jmap/map'; -// import JlmapNew from '@/jmapNew/map'; import ZoomBox from './zoom/zoom'; import ProgressBar from '@/views/components/progressBar/index'; import { mapGetters } from 'vuex'; import { TrainingMode } from '@/scripts/ConstDic'; import { EventBus } from '@/scripts/event-bus'; +import Theme from '@/jmap/theme/factory'; export default { name: 'JlmapVisual', @@ -142,47 +142,26 @@ export default { if (path.includes('design/userlist/map/draw')) { mouseWheelFlag = true; } - if (this.$store.state.config.switchMap === 'new') { - Vue.prototype.$jlmap = new Jlmap({ - dom: document.getElementById(this.canvasId), - config: { - renderer: 'canvas', - width: this.width, - height: this.height - }, - options: { - scaleRate: 1, - offsetX: 0, - offsetY: 0, - zoomOnMouseWheel: mouseWheelFlag - }, - methods: { - dataLoaded: this.handleDataLoaded, - viewLoaded: this.handleViewLoaded, - stateLoaded: this.handleStateLoaded - } - }); - } else { - Vue.prototype.$jlmap = new Jlmap({ - dom: document.getElementById(this.canvasId), - config: { - renderer: 'canvas', - width: this.width, - height: this.height - }, - options: { - scaleRate: 1, - offsetX: 0, - offsetY: 0, - zoomOnMouseWheel: mouseWheelFlag - }, - methods: { - dataLoaded: this.handleDataLoaded, - viewLoaded: this.handleViewLoaded, - stateLoaded: this.handleStateLoaded - } - }); - } + Vue.prototype.$theme = new Theme(); + Vue.prototype.$jlmap = new Jlmap({ + dom: document.getElementById(this.canvasId), + config: { + renderer: 'canvas', + width: this.width, + height: this.height + }, + options: { + scaleRate: 1, + offsetX: 0, + offsetY: 0, + zoomOnMouseWheel: mouseWheelFlag + }, + methods: { + dataLoaded: this.handleDataLoaded, + viewLoaded: this.handleViewLoaded, + stateLoaded: this.handleStateLoaded + } + }); this.$jlmap.on('dataZoom', this.onDataZoom, this); this.$jlmap.on('selected', this.onSelected, this); diff --git a/src/views/jointTraining/menuDemon.vue b/src/views/jointTraining/menuDemon.vue index 8dc49bf5c..b3fa9a1cc 100644 --- a/src/views/jointTraining/menuDemon.vue +++ b/src/views/jointTraining/menuDemon.vue @@ -2,6 +2,7 @@ + 设置真实设备 {{ $t('joinTraining.driverPerspective') }} {{ $t('joinTraining.drivingByPlan') }} @@ -12,6 +13,7 @@ + @@ -23,12 +25,15 @@ import { exitFullscreen } from '@/utils/screen'; import { putJointTrainingSimulationUser } from '@/api/chat'; import { timeFormat } from '@/utils/date'; import { EventBus } from '@/scripts/event-bus'; +import { getSessionStorage } from '@/utils/auth'; +import RealDevice from './menuDraft/realDevice'; export default { name: 'MenuDemonJoint', components: { QrCode, - SetTime + SetTime, + RealDevice }, props: { group: { @@ -83,6 +88,9 @@ export default { }, isBigScreen() { return this.userRole == 'BigScreen'; + }, + isProject() { + return getSessionStorage('project').endsWith('gzb'); } }, watch: { @@ -308,6 +316,9 @@ export default { }, jumpjlmap3d() { this.$emit('hidepanel'); + }, + setRelDevice() { + this.$refs.realDevice.doShow(); } } }; diff --git a/src/views/jointTraining/menuDraft/realDevice.vue b/src/views/jointTraining/menuDraft/realDevice.vue new file mode 100644 index 000000000..ff799591e --- /dev/null +++ b/src/views/jointTraining/menuDraft/realDevice.vue @@ -0,0 +1,247 @@ + + + + + + {{ handleDeviceTitle(node) }} + + + + + + + + + + + + + + + + {{ $t('global.confirm') }} + {{ $t('global.cancel') }} + + + + + + + diff --git a/src/views/newMap/displayNew/designIndex.vue b/src/views/newMap/displayNew/designIndex.vue index 315381c4c..4b40228f0 100644 --- a/src/views/newMap/displayNew/designIndex.vue +++ b/src/views/newMap/displayNew/designIndex.vue @@ -234,6 +234,7 @@ export default { }, async beforeDestroy() { await this.clearAllTimer(); + await this.quit(); await this.$store.dispatch('training/reset'); await this.$store.dispatch('map/mapClear'); EventBus.$off('clearCheckLogin'); diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index 36efab200..47b6027e0 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -240,6 +240,7 @@ export default { }, async beforeDestroy() { await this.clearAllTimer(); + await this.quit(); await this.$store.dispatch('training/reset'); await this.$store.dispatch('map/mapClear'); EventBus.$off('clearCheckLogin'); diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 6a3074fff..00414cc84 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -35,9 +35,9 @@ import { getGoodsTryUse } from '@/api/management/goods'; import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation'; import { PermissionType } from '@/scripts/ConstDic'; import { getCountTime } from '@/utils/index'; -import { runDiagramIsStart, quitScript } from '@/api/simulation'; -import { timeFormat } from '@/utils/date'; -import { getToken } from '@/utils/auth'; +import { runDiagramIsStart, runDiagramQuit, quitScript } from '@/api/simulation'; +// import { timeFormat } from '@/utils/date'; +// import { getToken } from '@/utils/auth'; export default { name: 'MenuDemon', @@ -189,7 +189,8 @@ export default { this.$messageBox(this.$t('display.demon.exitTaskFail')); }); }, - back() { + async back() { + await runDiagramQuit(this.group); this.$store.dispatch('training/over').then(() => { history.go(-1); Notification.closeAll(); diff --git a/src/views/newMap/displayNew/menuExam.vue b/src/views/newMap/displayNew/menuExam.vue index e872c4ee2..9d44b1690 100644 --- a/src/views/newMap/displayNew/menuExam.vue +++ b/src/views/newMap/displayNew/menuExam.vue @@ -139,7 +139,7 @@ export default { }).catch(error => { // 如果时50009则表示考试已完成,不能再次进行y if (error.code === 500009) { - this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: {subSystem: this.$route.query.subSystem} }); + this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem, mapId:this.$route.query.mapId } }); } else { this.$messageBox(this.$t('display.exam.refreshListError')); } diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index 8d5ba0cb3..4a4962bbf 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -34,7 +34,7 @@ import AddQuest from './demon/addQuest'; import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; import { getStationList, queryRunPlan } from '@/api/runplan'; -import { getEveryDayRunPlanData } from '@/api/simulation'; +import { getEveryDayRunPlanNew } from '@/api/simulation'; import {getRpDetailByUserMapId} from '@/api/designPlatform'; // 右上角操作 @@ -134,7 +134,7 @@ export default { } } else { - // getEveryDayRunPlanData(this.group).then(resp => { + // getEveryDayRunPlanNew(this.group).then(resp => { // this.$store.dispatch('runPlan/setPlanData', resp.data); // this.viewDisabled = false; // }).catch(error => { diff --git a/src/views/newMap/displayNew/tipExamList.vue b/src/views/newMap/displayNew/tipExamList.vue index 16945466f..91f83f6b9 100644 --- a/src/views/newMap/displayNew/tipExamList.vue +++ b/src/views/newMap/displayNew/tipExamList.vue @@ -93,7 +93,7 @@ export default { name: '', remarks: '' }, - isShrink: false, + isShrink: true, examName: '', courseModel: { id: '', @@ -197,13 +197,12 @@ export default { }).catch(error => { // 如果时50009则表示考试已完成,不能再次进行y if (error.code === 500009) { - this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem } }); + this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem, mapId:this.$route.query.mapId } }); } else { this.$messageBox(this.$t('display.exam.refreshListError')); } }); - this.shrink(); }, scanCommit() { this.clearScanCommit(); @@ -281,7 +280,7 @@ export default { submit() { this.$store.dispatch('exam/over').then(() => { this.$store.dispatch('trainingList/clearTrainingList'); - this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} }); + this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: { subSystem: this.$route.query.subSystem, mapId:this.$route.query.mapId } }); }); }, shrink() { diff --git a/src/views/newMap/displayNew/tipTrainingDetail.vue b/src/views/newMap/displayNew/tipTrainingDetail.vue index 4ec3b1363..23edcf08d 100644 --- a/src/views/newMap/displayNew/tipTrainingDetail.vue +++ b/src/views/newMap/displayNew/tipTrainingDetail.vue @@ -117,8 +117,6 @@ export default { this.$message.error(this.$t('display.training.getCourseInformationFail') + ':' + error.message); }); } - - this.shrink(); }, jump(obj) { const query = { diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index 54c25ea0c..a57b10750 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -37,6 +37,7 @@ import ProgressBar from '@/views/components/progressBar/index'; import { mapGetters } from 'vuex'; import { TrainingMode } from '@/scripts/ConstDic'; import { EventBus } from '@/scripts/event-bus'; +import Theme from '@/jmapNew/theme/factory'; export default { name: 'JlmapVisual', @@ -152,6 +153,7 @@ export default { mouseWheelFlag = true; } + Vue.prototype.$theme = new Theme(); Vue.prototype.$jlmap = new Jlmap({ dom: document.getElementById(this.canvasId), config: { diff --git a/src/views/newMap/mapsystemNew/common/index.vue b/src/views/newMap/mapsystemNew/common/index.vue index f38d367b9..e94a7b2e2 100644 --- a/src/views/newMap/mapsystemNew/common/index.vue +++ b/src/views/newMap/mapsystemNew/common/index.vue @@ -49,6 +49,7 @@ export default { const lineCode = this.$jlmap.lineCode; if (lineCode) { this.menus = this.$theme.loadMenuComponent(lineCode); + this.$store.commit('training/notifyGetCommandDefinition', lineCode); } } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index ad8b8ae25..e5f9f2c58 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -483,6 +483,8 @@ export default { }, handleOtherSectionChange(model) { // 处理该区段改变导致的相关区段的变化 const models = []; + const pointModel = []; + const slope1 = (this.oldPoint[this.oldPoint.length - 1].y - this.oldPoint[0].y) / (this.oldPoint[this.oldPoint.length - 1].x - this.oldPoint[0].x); this.sectionList.forEach(section => { if (section.parentCode === model.code) { const copySection = deepAssign({}, section); @@ -491,16 +493,6 @@ export default { } else if (model.code !== section.code && (section.type === '01' || section.type === '03')) { const copySection = deepAssign({}, section); let updataFlag = false; - if (this.checkPointsCoincide(this.oldPoint[0], section.points[section.points.length - 1])) { - copySection.points[copySection.points.length - 1].x = model.points[0].x; - copySection.points[copySection.points.length - 1].y = model.points[0].y; - updataFlag = true; - } - if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], section.points[0])) { - copySection.points[0].x = model.points[model.points.length - 1].x; - copySection.points[0].y = model.points[model.points.length - 1].y; - updataFlag = true; - } if (model.leftSectionCode !== this.oldLeftSectionCode) { if (copySection.code === model.leftSectionCode) { copySection.rightSectionCode = model.code; @@ -520,11 +512,35 @@ export default { } } + if (this.checkPointsCoincide(this.oldPoint[0], section.points[section.points.length - 1])) { + pointModel.push(copySection); + } + if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], section.points[0])) { + pointModel.push(copySection); + } if (updataFlag) { models.push(copySection); } } }); + pointModel.forEach(item => { + const slope2 = (item.points[item.points.length - 1].y - item.points[0].y) / (item.points[item.points.length - 1].x - item.points[0].x); + // console.log(slope1, slope2, pointModel, '-----斜率----'); + if (this.checkPointsCoincide(this.oldPoint[0], item.points[item.points.length - 1])) { + if ((slope1 >= 0 && slope2 >= 0) || (slope1 <= 0 && slope2 <= 0)) { + item.points[item.points.length - 1].x = model.points[0].x; + item.points[item.points.length - 1].y = model.points[0].y; + } + } + if (this.checkPointsCoincide(this.oldPoint[this.oldPoint.length - 1], item.points[0])) { + if ((slope1 >= 0 && slope2 >= 0) || (slope1 <= 0 && slope2 <= 0)) { + item.points[0].x = model.points[model.points.length - 1].x; + item.points[0].y = model.points[model.points.length - 1].y; + } + } + models.push(item); + }); + return models; }, getSectionByCode(code) { // 根据sectionCode 获取深拷贝的section对象 diff --git a/src/views/orderauthor/author/index.vue b/src/views/orderauthor/author/index.vue index 47ad1c2a3..cdc282d36 100644 --- a/src/views/orderauthor/author/index.vue +++ b/src/views/orderauthor/author/index.vue @@ -104,7 +104,7 @@ export default { }, { title: this.$t('orderAuthor.founder'), - prop: 'creatorUserName' + prop: 'creatorNickname' }, { title: this.$t('orderAuthor.describtion'), diff --git a/src/views/orderauthor/permission/index.vue b/src/views/orderauthor/permission/index.vue index fc4ad1e85..f8f412623 100644 --- a/src/views/orderauthor/permission/index.vue +++ b/src/views/orderauthor/permission/index.vue @@ -74,7 +74,7 @@ export default { }, { title: this.$t('orderAuthor.founder'), - prop: 'userName' + prop: 'userNickname' }, { title: this.$t('orderAuthor.publicOrPrivate'), diff --git a/src/views/orderauthor/rules/index.vue b/src/views/orderauthor/rules/index.vue index 6f390b298..aa634c300 100644 --- a/src/views/orderauthor/rules/index.vue +++ b/src/views/orderauthor/rules/index.vue @@ -91,7 +91,7 @@ export default { { title: this.$t('permission.nickName'), width: '200', - prop: 'userNickName' + prop: 'userNickname' }, { title: this.$t('permission.permissionName'), diff --git a/src/views/package/index.vue b/src/views/package/index.vue index fb824ae6b..e936838e5 100644 --- a/src/views/package/index.vue +++ b/src/views/package/index.vue @@ -21,7 +21,6 @@ export default { param: '', WhetherTypeList: [], // EffectiveTypeList: [], - PermissionTypeList: [], pagerConfig: { pageSize: 'pageSize', pageIndex: 'pageNum' @@ -50,13 +49,6 @@ export default { width: '210', prop: 'permissionName' }, - { - title: this.$t('permission.permissionType'), - prop: 'permissionType', - type: 'tag', - columnValue: (row) => { return this.$convertField(row.permissionType ? row.permissionType : '', this.PermissionTypeList, ['value', 'label']); }, - tagType: (row) => { return ''; } - }, { title: this.$t('permission.permissionUseType'), prop: 'canDistribute', @@ -129,35 +121,6 @@ export default { }, loadInitData() { this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList; - this.$Dictionary.permissionType().then(list => { - if (LangStorage.getLang() === 'en') { - list.forEach(elem => { - elem.value = elem.code; - switch (elem.value) { - case '01': - elem.label = 'Teaching system'; - break; - case '02': - elem.label = 'Exam system'; - break; - case '03': - elem.label = 'Simulation system'; - break; - case '04': - elem.label = elem.name; - break; - } - }); - list.push({value: '', label: 'Omnipotent permission'}); - } else { - list.forEach(elem => { - elem.value = elem.code; - elem.label = elem.name; - }); - list.push({value: '', label: '万能权限'}); - } - this.PermissionTypeList = list; - }); }, formatterDate(row, porpInfo) { return row[porpInfo.property] ? row[porpInfo.property] : this.$t('global.perpetual'); diff --git a/src/views/publish/examRule/draft/examFrom.vue b/src/views/publish/examRule/draft/examFrom.vue index 3aef4c25c..5528e74b7 100644 --- a/src/views/publish/examRule/draft/examFrom.vue +++ b/src/views/publish/examRule/draft/examFrom.vue @@ -231,8 +231,12 @@ export default { submitForm() { this.$refs['form'].validate((valid) => { if (valid) { - this.form.startDate = this.getDate(this.form.startDate); - this.form.endDate = this.getDate(this.form.endDate); + if (this.form.startDate) { + this.form.startDate = this.getDate(this.form.startDate); + } + if (this.form.endDate) { + this.form.endDate = this.getDate(this.form.endDate); + } this.form['trial'] = this.trial; this.$store.dispatch('exam/setCourseDetail', this.form); this.$emit('definition', this.form); diff --git a/src/views/publish/examRule/index.vue b/src/views/publish/examRule/index.vue index db422efe9..38ec37f30 100644 --- a/src/views/publish/examRule/index.vue +++ b/src/views/publish/examRule/index.vue @@ -72,7 +72,7 @@ export default { }, { title: this.$t('publish.creator'), - prop: 'creatorName' + prop: 'creatorNickname' }, { title: this.$t('global.isTry'), diff --git a/src/views/system/commandDictionary/edit.vue b/src/views/system/commandDictionary/edit.vue index 184bad629..06116e109 100644 --- a/src/views/system/commandDictionary/edit.vue +++ b/src/views/system/commandDictionary/edit.vue @@ -51,7 +51,7 @@ import { createCommand, editCommand, getCommandDetail } from '@/api/management/d import CommandEdit from './editParam'; import { getLineCodeList } from '@/api/management/mapline'; import EditCondition from './editCondition'; -import CommandEnum from '@/scripts/plugin/CommandEnum'; +import CommandEnum from '@/scripts/cmdPlugin/CommandEnum'; export default { name: 'DictionaryEdit', diff --git a/src/views/system/commandDictionary/index.vue b/src/views/system/commandDictionary/index.vue index 6215e2460..ec5a52116 100644 --- a/src/views/system/commandDictionary/index.vue +++ b/src/views/system/commandDictionary/index.vue @@ -9,7 +9,7 @@ import { getCommandList, delCommand } from '@/api/management/dictionary'; import { getLineCodeList } from '@/api/management/mapline'; import ShowCondition from './showCondition'; -import CommandEnum from '@/scripts/plugin/CommandEnum'; +import CommandEnum from '@/scripts/cmdPlugin/CommandEnum'; export default { name: 'CommandDictionary', diff --git a/src/views/system/deviceManage/add.vue b/src/views/system/deviceManage/add.vue new file mode 100644 index 000000000..b94e6edf2 --- /dev/null +++ b/src/views/system/deviceManage/add.vue @@ -0,0 +1,108 @@ + + + + + {{ $t('global.confirm') }} + {{ $t('global.cancel') }} + + + + + diff --git a/src/views/system/deviceManage/editConfig.vue b/src/views/system/deviceManage/editConfig.vue new file mode 100644 index 000000000..df70113f4 --- /dev/null +++ b/src/views/system/deviceManage/editConfig.vue @@ -0,0 +1,405 @@ + + + + + + + + 输入配置: + + + + + + + + + + 输出配置: + + + + + + + + + {{ $t('global.confirm') }} + {{ $t('global.cancel') }} + + + + + diff --git a/src/views/system/deviceManage/index.vue b/src/views/system/deviceManage/index.vue new file mode 100644 index 000000000..24aa7c4d2 --- /dev/null +++ b/src/views/system/deviceManage/index.vue @@ -0,0 +1,176 @@ + + + + + + + + + diff --git a/src/views/system/userExam/index.vue b/src/views/system/userExam/index.vue index 9274c1fe9..c1a5f3ac2 100644 --- a/src/views/system/userExam/index.vue +++ b/src/views/system/userExam/index.vue @@ -10,129 +10,129 @@ import { getPublishExam, delPublishExam } from '@/api/management/userexam'; import PublishExamEdit from './edit'; export default { - name: 'PublishExam', - components: { - PublishExamEdit - }, - data() { - return { - examResultList: [], - pagerConfig: { - pageSize: 'pageSize', - pageIndex: 'pageNum' - }, - queryForm: { - labelWidth: '150px', - reset: true, - queryObject: { - examName: { - type: 'text', - label: this.$t('system.examName') - }, - userName: { - type: 'text', - label: this.$t('system.examUser') - }, - result: { - type: 'select', - label: this.$t('system.examResult'), - config: { - data: this.$ConstSelect.examResultList - } - } - } + name: 'PublishExam', + components: { + PublishExamEdit + }, + data() { + return { + examResultList: [], + pagerConfig: { + pageSize: 'pageSize', + pageIndex: 'pageNum' + }, + queryForm: { + labelWidth: '150px', + reset: true, + queryObject: { + examName: { + type: 'text', + label: this.$t('system.examName') + }, + userName: { + type: 'text', + label: this.$t('system.examUser') + }, + result: { + type: 'select', + label: this.$t('system.examResult'), + config: { + data: this.$ConstSelect.examResultList + } + } + } - }, - queryList: { - query: getPublishExam, - selectCheckShow: false, - indexShow: true, - columns: [ - { - title: this.$t('system.examName'), - prop: 'examName' - }, - { - title: this.$t('system.examResult'), - prop: 'result', - type: 'tag', - columnValue: (row) => { return this.$convertField(row.result, this.$ConstSelect.examResultList, ['value', 'label']); }, - tagType: (row) => { - switch (row.result) { - case '01': return 'warning'; - case '02': return 'success'; - case '03': return 'danger'; - case '04': return 'danger'; - } - } - }, - { - title: this.$t('system.examScore'), - prop: 'score' - }, - { - title: this.$t('system.examUser'), - prop: 'userName' - }, - { - title: this.$t('global.mobile'), - prop: 'userMobile' - }, - { - type: 'button', - title: this.$t('global.operate'), - width: '250', - buttons: [ - { - name: this.$t('global.edit'), - handleClick: this.edit - }, - { - name: this.$t('global.delete'), - handleClick: this.handleDelete, - type: 'danger' - } - ] - } - ] - }, + }, + queryList: { + query: getPublishExam, + selectCheckShow: false, + indexShow: true, + columns: [ + { + title: this.$t('system.examName'), + prop: 'examName' + }, + { + title: this.$t('system.examResult'), + prop: 'result', + type: 'tag', + columnValue: (row) => { return this.$convertField(row.result, this.$ConstSelect.examResultList, ['value', 'label']); }, + tagType: (row) => { + switch (row.result) { + case '01': return 'warning'; + case '02': return 'success'; + case '03': return 'danger'; + case '04': return 'danger'; + } + } + }, + { + title: this.$t('system.examScore'), + prop: 'score' + }, + { + title: this.$t('system.examUser'), + prop: 'userNickname' + }, + { + title: this.$t('global.mobile'), + prop: 'userMobile' + }, + { + type: 'button', + title: this.$t('global.operate'), + width: '250', + buttons: [ + { + name: this.$t('global.edit'), + handleClick: this.edit + }, + { + name: this.$t('global.delete'), + handleClick: this.handleDelete, + type: 'danger' + } + ] + } + ] + }, - currentModel: {} - }; - }, - created() { - this.loadInitData(); - }, - methods: { - loadInitData() { + currentModel: {} + }; + }, + created() { + this.loadInitData(); + }, + methods: { + loadInitData() { - }, + }, - // 编辑 - edit(index, row) { - this.$refs.edit.show(row); - }, + // 编辑 + edit(index, row) { + this.$refs.edit.show(row); + }, - // 删除 - handleDelete(index, row) { - this.$confirm(this.$t('system.wellDelExamResult'), this.$t('global.tips'), { - confirmButtonText: this.$t('global.confirm'), - cancelButtonText: this.$t('global.cancel'), - type: 'warning' - }).then(() => { - delPublishExam(row.id).then(response => { - this.$message.success(this.$t('system.deleteSuccess')); - this.reloadTable(); - }).catch(() => { - this.reloadTable(); - this.$messageBox(this.$t('error.deleteFailed')); - }); - }); - }, + // 删除 + handleDelete(index, row) { + this.$confirm(this.$t('system.wellDelExamResult'), this.$t('global.tips'), { + confirmButtonText: this.$t('global.confirm'), + cancelButtonText: this.$t('global.cancel'), + type: 'warning' + }).then(() => { + delPublishExam(row.id).then(response => { + this.$message.success(this.$t('system.deleteSuccess')); + this.reloadTable(); + }).catch(() => { + this.reloadTable(); + this.$messageBox(this.$t('error.deleteFailed')); + }); + }); + }, - reloadTable() { - this.queryList.reload(); - } - } + reloadTable() { + this.queryList.reload(); + } + } }; diff --git a/src/views/system/userSimulation/index.vue b/src/views/system/userSimulation/index.vue index a523ebaf1..7ecfac0a5 100644 --- a/src/views/system/userSimulation/index.vue +++ b/src/views/system/userSimulation/index.vue @@ -46,7 +46,7 @@ export default { columns: [ { title: this.$t('system.userName'), - prop: 'userName' + prop: 'userNickname' }, { title: this.$t('global.mobile'), diff --git a/src/views/system/userTraining/index.vue b/src/views/system/userTraining/index.vue index 727a9443b..b5815f11d 100644 --- a/src/views/system/userTraining/index.vue +++ b/src/views/system/userTraining/index.vue @@ -45,7 +45,7 @@ export default { columns: [ { title: this.$t('system.userName'), - prop: 'userName' + prop: 'userNickname' }, { title: this.$t('global.mobile'), diff --git a/src/views/trainRoom/e-roles.vue b/src/views/trainRoom/e-roles.vue index 1be30c355..89d0b41b7 100644 --- a/src/views/trainRoom/e-roles.vue +++ b/src/views/trainRoom/e-roles.vue @@ -75,6 +75,7 @@ @delUser="handleDelUser" />