调度命令调整
This commit is contained in:
parent
6d9ae082ec
commit
d921acf107
@ -210,7 +210,7 @@ export default {
|
||||
}
|
||||
},
|
||||
dispatchCommandState(obj) {
|
||||
Object.values(obj.cpStateMap).forEach(item => {
|
||||
obj && Object.values(obj.cpStateMap).forEach(item => {
|
||||
if (item.cpId) {
|
||||
if (!this.queryResData.companyStateMap) {
|
||||
this.queryResData.companyStateMap = {};
|
||||
@ -218,6 +218,9 @@ export default {
|
||||
this.$set(this.queryResData.companyStateMap, item.cpId, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
'$store.state.socket.simulationReset':function(val) {
|
||||
this.cmdTableData = [];
|
||||
}
|
||||
},
|
||||
beforeDestroy() {},
|
||||
|
@ -604,6 +604,9 @@ const socket = {
|
||||
setDispatchCommandMsg: ({ commit }, data) => {
|
||||
commit('setDispatchCommandMsg', data);
|
||||
},
|
||||
clearDispatchCommandMsg: ({ commit }, data) => {
|
||||
commit('clearDispatchCommandMsg');
|
||||
},
|
||||
setDispatchCommandState: ({ commit }, data) => {
|
||||
commit('setDispatchCommandState', data);
|
||||
},
|
||||
|
@ -79,10 +79,12 @@ export function creatSubscribe(topic, header, callbackFun) {
|
||||
if (!Vue.prototype.$stomp) {
|
||||
Vue.prototype.$stomp = new StompClient();
|
||||
}
|
||||
if (!Vue.prototype.$stomp.subscribeMap[topic]) {
|
||||
if (!Vue.prototype.$stomp.subscribeMap.has(topic)) {
|
||||
Vue.prototype.$stomp.subscribe(topic, callbackFun || callback, header);
|
||||
} else {
|
||||
Vue.prototype.$stomp.subscribeMap[topic].count++;
|
||||
// Vue.prototype.$stomp.subscribeMap[topic].count++;
|
||||
const obj = Vue.prototype.$stomp.subscribeMap.get(topic);
|
||||
obj.count++;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('websocket订阅失败', error, topic, header);
|
||||
|
@ -636,7 +636,7 @@ export default {
|
||||
this.DisStationId = obj.deviceCode ? obj.deviceCode : 'DisStation1986';
|
||||
},
|
||||
dispatchCommandState(obj) {
|
||||
Object.values(obj.cpStateMap).forEach(item => {
|
||||
obj && Object.values(obj.cpStateMap).forEach(item => {
|
||||
if (item.cpId) {
|
||||
if (!this.queryResData.companyStateMap) {
|
||||
this.queryResData.companyStateMap = {};
|
||||
|
@ -111,6 +111,7 @@ export default {
|
||||
exitSimulation(this.group);
|
||||
}
|
||||
this.$store.dispatch('socket/resetRailCtcRunplanInitMsg'); // 清除阶段计划
|
||||
this.$store.dispatch('socket/clearDispatchCommandMsg'); // 清除调度命令
|
||||
},
|
||||
methods:{
|
||||
overallTranslation(flag) {
|
||||
|
@ -224,6 +224,7 @@ export default {
|
||||
this.$store.dispatch('map/resetActiveTrainList', false);
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$store.dispatch('map/initSimulationButton');
|
||||
this.$store.dispatch('socket/clearDispatchCommandMsg'); // 清除调度命令
|
||||
});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
|
@ -620,7 +620,7 @@ export default {
|
||||
this.allographRow = null;
|
||||
},
|
||||
dispatchCommandState(obj) {
|
||||
Object.values(obj.cpStateMap).forEach(item => {
|
||||
obj && Object.values(obj.cpStateMap).forEach(item => {
|
||||
if (item.cpId) {
|
||||
if (!this.queryResData.companyStateMap) {
|
||||
this.queryResData.companyStateMap = {};
|
||||
@ -636,6 +636,7 @@ export default {
|
||||
},
|
||||
'$store.state.socket.simulationReset': function (val) {
|
||||
this.queryResData = {};
|
||||
this.$store.dispatch('socket/setDispatchCommandState', null);
|
||||
}
|
||||
},
|
||||
beforeDestroy() {},
|
||||
|
Loading…
Reference in New Issue
Block a user