From deece104b17565ca4484f78d4d11dca09b2d0009 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 18 Jul 2022 17:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E9=93=81=E9=A1=B9=E7=9B=AE=20ctc=20?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20=E6=94=B9=E5=AE=8C=E9=80=9A=E8=BF=87=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=8B=89=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/runplan.js | 8 +++++ .../theme/datie_02/menus/runplanPane.vue | 15 +++++++++ src/store/modules/socket.js | 33 +++++++++++++------ 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/api/runplan.js b/src/api/runplan.js index 91211d454..1e89dc72e 100644 --- a/src/api/runplan.js +++ b/src/api/runplan.js @@ -521,3 +521,11 @@ export function getRunplanInRailway(group) { method: 'get' }); } + +// 大铁 获取 ctc 车站 运行日志 +export function getRunplanInStation(group) { + return request({ + url: `/api/simulation/${group}/ctc/station/runPlan/list`, + method: 'get' + }); +} diff --git a/src/jmapNew/theme/datie_02/menus/runplanPane.vue b/src/jmapNew/theme/datie_02/menus/runplanPane.vue index 38993e9e9..f199bf5ad 100644 --- a/src/jmapNew/theme/datie_02/menus/runplanPane.vue +++ b/src/jmapNew/theme/datie_02/menus/runplanPane.vue @@ -592,6 +592,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO import { copyAssign } from '@/utils/index'; import { mapGetters } from 'vuex'; import { transfiniteList } from '@/scripts/ConstDic'; +import {getRunplanInStation} from '@/api/runplan'; export default { name:'RunplanPane', components: { @@ -670,9 +671,23 @@ export default { '$store.state.socket.simulationReset': function (val) { this.$store.dispatch('socket/resetRailCtcRunplanInitMsg'); this.loadData(); + }, + // 地图加载完成 + '$store.state.map.mapDataLoadedCount': function (val) { // 地图数据加载完成 + this.getRunplanInStationData(); } }, + mounted() { + this.group = this.$route.query.group; + }, methods:{ + getRunplanInStationData() { + getRunplanInStation(this.group).then(response => { + // debugger; + this.$store.dispatch('socket/initRailCtcRunplanInitMsg', response.data || []); + }).catch(()=>{ + }); + }, initDate(date) { this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}:${prefixIntrger(date.getSeconds(), 2)}`; const years = date.getFullYear() + ''; diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 9f5a079d8..45e573def 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -203,16 +203,16 @@ function handle(state, data) { state.railCtcStatusMsg = msg; break; // 大铁项目 ctc 运行图初始化信息 - case 'SIMULATION_CTC_RUN_PLAN_INIT': - msg.forEach(element => { - const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber; - const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber; - if (tripNumberDe) { parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; } - if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; } - const code = element.stationCode + '' + element.code; - state.railCtcRunplanInitMsg[code] = element; - }); - break; + // case 'SIMULATION_CTC_RUN_PLAN_INIT': + // msg.forEach(element => { + // const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber; + // const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber; + // if (tripNumberDe) { parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; } + // if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; } + // const code = element.stationCode + '' + element.code; + // state.railCtcRunplanInitMsg[code] = element; + // }); + // break; // 大铁项目 ctc 运行图改变信息 case 'SIMULATION_CTC_RUN_PLAN_CHANGE': msg.forEach(element => { @@ -558,6 +558,16 @@ const socket = { }, resetRailCtcRunplanInitMsg: (state) => { state.railCtcRunplanInitMsg = {}; + }, + initRailCtcRunplanInitMsg: (state, list) => { + list.forEach(element => { + const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber; + const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.tripNumber; + if (tripNumberDe) { parseInt(tripNumberDe[tripNumberDe.length - 1]) % 2 == 0 ? element.departRunPlan.up = tripNumberDe : element.departRunPlan.down = tripNumberDe; } + if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; } + const code = element.stationCode + '' + element.code; + state.railCtcRunplanInitMsg[code] = element; + }); } }, @@ -658,6 +668,9 @@ const socket = { }, resetRailCtcRunplanInitMsg:({ commit }) => { commit('resetRailCtcRunplanInitMsg'); + }, + initRailCtcRunplanInitMsg:({ commit }, list) => { + commit('initRailCtcRunplanInitMsg', list); } } };