大铁项目 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'
});
}
// 大铁 获取 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 { 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() + '';

View File

@ -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);
}
}
};