大铁项目 ctc 运行图初始化信息 改完通过接口拉取

This commit is contained in:
joylink_cuiweidong 2022-07-18 17:18:55 +08:00
parent 4b1c1aae49
commit deece104b1
3 changed files with 46 additions and 10 deletions

View File

@ -521,3 +521,11 @@ export function getRunplanInRailway(group) {
method: 'get' method: 'get'
}); });
} }
// 大铁 获取 ctc 车站 运行日志
export function getRunplanInStation(group) {
return request({
url: `/api/simulation/${group}/ctc/station/runPlan/list`,
method: 'get'
});
}

View File

@ -592,6 +592,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO
import { copyAssign } from '@/utils/index'; import { copyAssign } from '@/utils/index';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { transfiniteList } from '@/scripts/ConstDic'; import { transfiniteList } from '@/scripts/ConstDic';
import {getRunplanInStation} from '@/api/runplan';
export default { export default {
name:'RunplanPane', name:'RunplanPane',
components: { components: {
@ -670,9 +671,23 @@ export default {
'$store.state.socket.simulationReset': function (val) { '$store.state.socket.simulationReset': function (val) {
this.$store.dispatch('socket/resetRailCtcRunplanInitMsg'); this.$store.dispatch('socket/resetRailCtcRunplanInitMsg');
this.loadData(); this.loadData();
},
//
'$store.state.map.mapDataLoadedCount': function (val) { //
this.getRunplanInStationData();
} }
}, },
mounted() {
this.group = this.$route.query.group;
},
methods:{ methods:{
getRunplanInStationData() {
getRunplanInStation(this.group).then(response => {
// debugger;
this.$store.dispatch('socket/initRailCtcRunplanInitMsg', response.data || []);
}).catch(()=>{
});
},
initDate(date) { initDate(date) {
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}:${prefixIntrger(date.getSeconds(), 2)}`; this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}:${prefixIntrger(date.getSeconds(), 2)}`;
const years = date.getFullYear() + ''; const years = date.getFullYear() + '';

View File

@ -203,16 +203,16 @@ function handle(state, data) {
state.railCtcStatusMsg = msg; state.railCtcStatusMsg = msg;
break; break;
// 大铁项目 ctc 运行图初始化信息 // 大铁项目 ctc 运行图初始化信息
case 'SIMULATION_CTC_RUN_PLAN_INIT': // case 'SIMULATION_CTC_RUN_PLAN_INIT':
msg.forEach(element => { // msg.forEach(element => {
const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber; // const tripNumberDe = element.departRunPlan && element.departRunPlan.tripNumber;
const tripNumberAr = element.arriveRunPlan && element.arriveRunPlan.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 (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; } // if (tripNumberAr) { parseInt(tripNumberAr[tripNumberAr.length - 1]) % 2 == 0 ? element.arriveRunPlan.up = tripNumberAr : element.arriveRunPlan.down = tripNumberAr; }
const code = element.stationCode + '' + element.code; // const code = element.stationCode + '' + element.code;
state.railCtcRunplanInitMsg[code] = element; // state.railCtcRunplanInitMsg[code] = element;
}); // });
break; // break;
// 大铁项目 ctc 运行图改变信息 // 大铁项目 ctc 运行图改变信息
case 'SIMULATION_CTC_RUN_PLAN_CHANGE': case 'SIMULATION_CTC_RUN_PLAN_CHANGE':
msg.forEach(element => { msg.forEach(element => {
@ -558,6 +558,16 @@ const socket = {
}, },
resetRailCtcRunplanInitMsg: (state) => { resetRailCtcRunplanInitMsg: (state) => {
state.railCtcRunplanInitMsg = {}; 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 }) => { resetRailCtcRunplanInitMsg:({ commit }) => {
commit('resetRailCtcRunplanInitMsg'); commit('resetRailCtcRunplanInitMsg');
},
initRailCtcRunplanInitMsg:({ commit }, list) => {
commit('initRailCtcRunplanInitMsg', list);
} }
} }
}; };