大客流订阅调整

This commit is contained in:
fan 2022-11-07 18:00:26 +08:00
parent 2caebf5d20
commit fe68d15acf
5 changed files with 27 additions and 16 deletions

View File

@ -63,7 +63,6 @@ function handleRoute(to, next, loginPath) {
// 除没有动态改变权限的需求可直接next() 删下方权限判断 // 除没有动态改变权限的需求可直接next() 删下方权限判断
if (to.path === '/404' && to.redirectedFrom === '/') { if (to.path === '/404' && to.redirectedFrom === '/') {
const project = getSessionStorage('project'); const project = getSessionStorage('project');
console.log(localStore.get('trainingPlatformRoute' + store.getters.id + project, '-------------'));
next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform'); next(localStore.get('trainingPlatformRoute' + store.getters.id + project) || '/trainingPlatform');
} else { } else {
next(); next();

View File

@ -56,6 +56,9 @@ export function getTopic(type, group, param) {
case 'COMMON': case 'COMMON':
topic = `/user/queue/simulation/${group}`; topic = `/user/queue/simulation/${group}`;
break; break;
case 'LPF':
topic = `/user/queue/simulation/passenger/${group}`;
break;
} }
return topic; return topic;

View File

@ -138,16 +138,19 @@ export default {
this.flowDataShow = true; this.flowDataShow = true;
this.isDisabled = true; this.isDisabled = true;
const simulationWorkParam = this.$store.state.socket.simulationWorkParam; const simulationWorkParam = this.$store.state.socket.simulationWorkParam;
if (simulationWorkParam && simulationWorkParam.itemMap && simulationWorkParam.itemMap.LPF) { if (this.currentFlowDataName) {
const currentFlowData = this.flowDataList.find(each=>{ return each.id == simulationWorkParam.itemMap.LPF; });
if (currentFlowData) {
this.currentFlowDataId = currentFlowData.id;
this.currentFlowDataName = currentFlowData.name;
}
} else {
const currentFlowData = this.flowDataList.find(each=>{ return each.name == this.currentFlowDataName; }); const currentFlowData = this.flowDataList.find(each=>{ return each.name == this.currentFlowDataName; });
if (currentFlowData) { this.currentFlowDataId = currentFlowData.id; } if (currentFlowData) { this.currentFlowDataId = currentFlowData.id; }
} else {
if (simulationWorkParam && simulationWorkParam.itemMap && simulationWorkParam.itemMap.LPF) {
const currentFlowData = this.flowDataList.find(each=>{ return each.id == simulationWorkParam.itemMap.LPF; });
if (currentFlowData) {
this.currentFlowDataId = currentFlowData.id;
this.currentFlowDataName = currentFlowData.name;
}
}
} }
} }
}, },
clearSubscribe() { clearSubscribe() {

View File

@ -165,6 +165,9 @@ export default {
case 'CTC': case 'CTC':
creatSubscribe(getTopic(type, this.group), header, defaultCallback); creatSubscribe(getTopic(type, this.group), header, defaultCallback);
break; break;
case 'LPF':
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
break;
} }
// creatSubscribe(`${displayTopic}\/${this.group}`, header, defaultCallback); // creatSubscribe(`${displayTopic}\/${this.group}`, header, defaultCallback);
// creatSubscribe(getTopic('STATE', this.group), header, stateCallback); // creatSubscribe(getTopic('STATE', this.group), header, stateCallback);
@ -191,6 +194,8 @@ export default {
this.$nextTick(() => { this.$refs.jl3dDrive.show(this.mapId, this.group); this.mapViewLoaded(true); }); this.$nextTick(() => { this.$refs.jl3dDrive.show(this.mapId, this.group); this.mapViewLoaded(true); });
} else if (val === 'trafficTerminal') { } else if (val === 'trafficTerminal') {
this.$nextTick(() => { this.subscribe('CTC'); }); this.$nextTick(() => { this.subscribe('CTC'); });
} else if (val === 'largePassengerView') {
this.$nextTick(() => { this.subscribe('LPF'); });
} }
this.$nextTick(() => { this.loading = false; }); this.$nextTick(() => { this.loading = false; });
}, },

View File

@ -56,8 +56,8 @@
import echarts from 'echarts'; import echarts from 'echarts';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
// import { clearSimulation } from '@/api/simulation'; // import { clearSimulation } from '@/api/simulation';
import { creatSubscribe, clearSubscribe, LPFTopic} from '@/utils/stomp'; import { clearSubscribe, LPFTopic} from '@/utils/stomp';
import { getToken } from '@/utils/auth'; // import { getToken } from '@/utils/auth';
import { loadMapDataById } from '@/utils/loaddata'; import { loadMapDataById } from '@/utils/loaddata';
export default { export default {
name:'BigLPFStrategy', name:'BigLPFStrategy',
@ -167,7 +167,7 @@ export default {
} }
}); });
this.loadInitData(); this.loadInitData();
this.subscribe(); // this.subscribe();
}, },
'$store.state.socket.standPfiNum':function(val) { '$store.state.socket.standPfiNum':function(val) {
if (val) { if (val) {
@ -199,11 +199,12 @@ export default {
loadMapDataById(this.$route.query.mapId, 'parse'); loadMapDataById(this.$route.query.mapId, 'parse');
}, },
methods:{ methods:{
async subscribe() { // async subscribe() {
this.clearSubscribe(); // this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() }; // const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${LPFTopic}\/${this.$route.query.group}`, header); // creatSubscribe(`${LPFTopic}\/${this.$route.query.group}`, header);
}, // console.log('----------------');
// },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${LPFTopic}\/${this.group}`); clearSubscribe(`${LPFTopic}\/${this.group}`);
}, },