diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index a6daff985..7975f4ee3 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -372,6 +372,9 @@ const socket = { setDispatchCommandMsg: (state, data) => { state.dispatchCommandMsg = data; }, + setDispatchCommandState: (state, data) => { + state.dispatchCommandState = data; + }, setChangedCtcRunplanMap: (state, data) => { state.changedCtcRunplanMap = data; }, @@ -601,6 +604,9 @@ const socket = { setDispatchCommandMsg: ({ commit }, data) => { commit('setDispatchCommandMsg', data); }, + setDispatchCommandState: ({ commit }, data) => { + commit('setDispatchCommandState', data); + }, setChangedCtcRunplanMap: ({ commit }, data) => { commit('setChangedCtcRunplanMap', data); }, diff --git a/src/utils/subscribeCallback.js b/src/utils/subscribeCallback.js index ff573dc64..72bb09480 100644 --- a/src/utils/subscribeCallback.js +++ b/src/utils/subscribeCallback.js @@ -161,9 +161,13 @@ function handle(data) { store.dispatch('socket/removeCtcManagerRunPlanEdit', msg); break; // 调度命令信息 - case 'SIMULATION_RAIL_CTC_DISPATCH_COMMAND': + case 'SIMULATION_RAIL_CTC_DIS_COMMAND_ADD': store.dispatch('socket/setDispatchCommandMsg', msg); break; + // 调度命令状态 + case 'SIMULATION_RAIL_CTC_DIS_COMMAND_SYNC': + store.dispatch('socket/setDispatchCommandState', msg); + break; // 车站发送计划信息 case 'SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND': store.dispatch('socket/setChangedCtcRunplanMap', msg); diff --git a/src/views/newMap/display/terminals/dispatchCmd.vue b/src/views/newMap/display/terminals/dispatchCmd.vue index f370b7b22..514964f09 100644 --- a/src/views/newMap/display/terminals/dispatchCmd.vue +++ b/src/views/newMap/display/terminals/dispatchCmd.vue @@ -422,7 +422,7 @@ import { sendCommandNew } from '@/api/jmap/training'; import { mapState } from 'vuex'; import { parseTime } from '@/utils/index'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; -import {UserOperationType} from "../../../../scripts/ConstDic"; +import {UserOperationType} from '../../../../scripts/ConstDic'; export default { name:'DispatcherCmd', data() { @@ -496,7 +496,7 @@ export default { STATION: 'Station', TRAIN: 'Train' }, - DisStationId: 'DisStation1986', + // DisStationId: 'DisStation1986', allographRow: null, tableChecked: false, active1: true, @@ -610,15 +610,15 @@ export default { }); const activeUser = userInfo || {}; return activeUser; + }, + DisStationId() { + return this.getActiveSender.deviceCode ? this.getActiveSender.deviceCode : ''; } }, watch: { getTableData() { this.allographRow = null; }, - getActiveSender(obj) { - this.DisStationId = obj.deviceCode ? obj.deviceCode : 'DisStation1986'; - }, dispatchCommandState(obj) { Object.values(obj.cpStateMap).forEach(item => { if (item.cpId) { @@ -746,6 +746,9 @@ export default { } }); } + if (state == 'Signed') { + console.log(list, 'list'); + } return list.reverse(); }, findDisCmdObj(obj, val) { diff --git a/src/views/newMap/display/terminals/index.vue b/src/views/newMap/display/terminals/index.vue index 6f789a7cd..a1bef3254 100644 --- a/src/views/newMap/display/terminals/index.vue +++ b/src/views/newMap/display/terminals/index.vue @@ -274,6 +274,8 @@ export default { this.mapViewLoaded(true); } else if (val === 'dispatcherManage') { this.mapViewLoaded(true); + } else if (val === 'dispatchingCommand') { + this.$nextTick(() => { this.subscribe('CTC'); }); } this.$nextTick(() => { this.loading = false; }); },