Merge branch 'yly' into test

This commit is contained in:
Yuan 2022-09-16 14:28:40 +08:00
commit d506294b40
6 changed files with 102 additions and 40 deletions

View File

@ -491,9 +491,20 @@ const socket = {
trainingOverCount: 0, // 新实训结束计数器
trainingReloadCount: 0,
whTrainInfo: null,
trainingStepFinishCount: 0
trainingStepFinishCount: 0,
// railwaySimulationRpMsg:{}, // 大铁项目 调度台 调度台
// railwaySimulationRpChange:0 // 大铁项目 调度台 运行图信息变化
// railwaySimulationRpChange:0, // 大铁项目 调度台 运行图信息变化
standPisState: {
stationName: '',
firstTrainRemain: '',
firstEndStationName: '',
secondTrainRemain: '',
secondEndStationName: '',
},
onboardPisState: {
nextStationName: '',
endStationName: '',
},
},
getters: {
},
@ -580,6 +591,12 @@ const socket = {
setIscsStatePisMessages: (state, speed) => {
state.iscsStatePisMessages = speed;
},
setStandPisMessages: (state, payload) => {
state.standPisState = payload
},
setOnboardPisMessages: (state, payload) => {
state.onboardPisState = payload
},
deleteRailwaySimulationRunplan: (state, stationCode) => {
delete state.railwaySimulationRunplanSendMap[stationCode];
state.railwaySimulationRunplanSendChange++;
@ -700,6 +717,12 @@ const socket = {
handleIscsPisState:({ commit }, state) => {
commit('setIscsStatePisMessages', state);
},
handleStandPisState: ({ commit }, payload) => {
commit('setStandPisMessages', payload);
},
handleOnboardPisState: ({ commit }, payload) => {
commit('setOnboardPisMessages', payload);
},
deleteRailwaySimulationRunplan:({ commit }, stationCode) => {
commit('deleteRailwaySimulationRunplan', stationCode);
},

View File

@ -25,7 +25,7 @@ export function handlerUrl(data) {
// const data = null;
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.3.90:9100'; // 周寅
// BASE_API = 'http://192.168.3.94:9000'; // 旭强

View File

@ -10,7 +10,7 @@ export const jl3dTopic = '/user/queue/simulation/jl3d'; // 三维topic
export const LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
// export const iscsTopic = '/topic/simulation/iscs'; // iscs topic
export function getTopic(type, group, stationCode) {
export function getTopic(type, group, param) {
let topic = '';
switch (type) {
case 'SYSTIME':
@ -23,7 +23,7 @@ export function getTopic(type, group, stationCode) {
topic = `/queue/simulation/${group}/state`;
break;
case 'ISCSPSD':
topic = `/queue/simulation/${group}/iscs/psd/${stationCode}`;
topic = `/queue/simulation/${group}/iscs/psd/${param.stationCode}`;
break;
case 'ISCSPA':
topic = `/queue/simulation/${group}/iscs/pa`;
@ -31,6 +31,12 @@ export function getTopic(type, group, stationCode) {
case 'ISCSPIS':
topic = `/queue/simulation/${group}/iscs/pis`;
break;
case 'PIS_STAND':
topic = `/queue/simulation/${group}/standPis/${param.standCode}`;
break;
case 'PIS_TRAIN':
topic = `/queue/simulation/${group}/onboardPis/${param.groupNumber}`;
break;
case 'CTC':
topic = `/user/queue/simulation/${group}/ctc`;
break;
@ -75,6 +81,10 @@ function callback(Response) {
store.dispatch('socket/handleIscsPaState', JSON.parse(Response.body));
} else if (Response.headers.destination.includes('iscs/pis')) {
store.dispatch('socket/handleIscsPisState', JSON.parse(Response.body));
} else if (Response.headers.destination.includes('standPis')) {
store.dispatch('socket/handleStandPisState', JSON.parse(Response.body))
} else if (Response.headers.destination.includes('onboardPis')) {
store.dispatch('socket/handleOnboardPisState', JSON.parse(Response.body))
} else {
const data = JSON.parse(Response.body);
store.dispatch('socket/setStomp', data);

View File

@ -75,11 +75,11 @@ export default {
subscribe(stationCode) {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(getTopic('ISCSPSD', this.$route.query.group, stationCode ), header);
creatSubscribe(getTopic('ISCSPSD', this.$route.query.group, {stationCode} ), header);
this.$store.dispatch('app/animationsClose');
},
clearSubscribe(stationCode) {
clearSubscribe(getTopic('ISCSPSD', this.$route.query.group, stationCode));
clearSubscribe(getTopic('ISCSPSD', this.$route.query.group, {stationCode}));
}
}
};

View File

@ -476,7 +476,6 @@ export default {
type: this.$route.query.type
};
setSessionStorage('projectDevice', JSON.stringify(res.data.deviceVO));
if (this.$route.query.type == 'LSW') {
const config = JSON.parse(res.data.deviceVO.config);
if (config.quadrant == '99') {
@ -552,8 +551,9 @@ export default {
this.$router.push({ path: `/jlmap3d/sandbox`, query: sandboxQuery });
} else if (this.$route.query.type === 'ILW') {
this.$router.push({ path: `/jointTrainingNew`, query: query });
} else if (this.$route.query.type === 'PIS_STAND' || this.$route.query.type === 'PIS_TRAIN'){
this.$router.push({ path: `/pis`, query})
} else if (this.$route.query.type === 'PIS_STAND' || this.$route.query.type === 'PIS_TRAIN') {
const config = JSON.parse(res.data.deviceVO.config)
this.$router.push({ path: `/pis`, query: {...query, ...config}})
} else {
this.$router.push({ path: `/jointTrainingNew`, query: query });
}

View File

@ -1,7 +1,6 @@
<template>
<div class="screen">
<el-button @click="changeView" style="position:fixed; top: 0; right: 0">{{ this.view }}</el-button>
<div v-if="view === 'station'" class="station">
<div v-if="view === 'stand'" class="station">
<div class="datetime">
<div class="logo">LOGO</div>
<div>
@ -12,24 +11,24 @@
<div class="traininfo">
<div class="currentStation">
<div>本站 This Station</div>
<div class="text-center bigger">{{ standPisStatus.stationName }}</div>
<div class="text-center">{{ standPisStatus.stationNameEn }}</div>
<div class="text-center bigger">{{ standPisState.stationName }}</div>
<div class="text-center">{{ standPisState.stationNameEn }}</div>
</div>
<div class="devide"></div>
<div class="nextTrain">
<div>第一班列车 1st</div>
<div class="text-center yellow">
<span class="bigger">{{ standPisStatus.firstTrainRemain }} 分钟</span> <span>min</span>
<span class="bigger">{{ standPisState.firstTrainRemain }} 分钟</span> <span>min</span>
</div>
<div>开往 {{ standPisStatus.firstEndStationName }}</div>
<div v-if="standPisStatus.firstEndStationNameEn">TO {{ standPisStatus.firstEndStationNameEn }}</div>
<div>开往 {{ standPisState.firstEndStationName }}</div>
<div v-if="standPisState.firstEndStationNameEn">TO {{ standPisState.firstEndStationNameEn }}</div>
</div>
<div class="devide"></div>
<div class="secondTrain">
<div>第二班列车 2nd</div>
<div class="text-center bigger">{{ standPisStatus.secondTrainRemain }} 分钟 <span>min</span></div>
<div>开往 {{ standPisStatus.secondEndStationName }}</div>
<div v-if="standPisStatus.secondEndStationNameEn">TO {{ standPisStatus.secondEndStationNameEn }}</div>
<div class="text-center bigger">{{ standPisState.secondTrainRemain }} 分钟 <span>min</span></div>
<div>开往 {{ standPisState.secondEndStationName }}</div>
<div v-if="standPisState.secondEndStationNameEn">TO {{ standPisState.secondEndStationNameEn }}</div>
</div>
</div>
<div class="media">
@ -68,15 +67,18 @@
<div>Next Station</div>
</div>
<div class="down">
<div>{{ onboardPisStatus.nextStationName }}</div>
<div>{{ onboardPisStatus.nextStationNameEN }}</div>
<div>{{ onboardPisState.nextStationName }}</div>
<div>{{ onboardPisState.nextStationNameEN }}</div>
</div>
</div>
</div>
</div>
<div class="right">
<div class="dest">
<div>开往: {{ onboardPisStatus.endStationName }}{{ onboardPisStatus.endStationNameEn ? ' / TO: ' + currentTrain.endStationNameEn : '' }}</div>
<div>
开往: {{ onboardPisState.endStationName
}}{{ onboardPisState.endStationNameEn ? ' / TO: ' + currentTrain.endStationNameEn : '' }}
</div>
</div>
<div class="media"></div>
</div>
@ -91,6 +93,8 @@
<script>
let timer
import { creatSubscribe, clearSubscribe, getTopic } from '@/utils/stomp'
import { formatDuring } from '@/utils/date'
export default {
name: 'PIS',
components: {},
@ -109,26 +113,34 @@ export default {
watch: {
'$store.state.socket.simulationTimeSync': function(val) {
console.log(val)
console.log(formatDuring(val))
},
'$store.state.socket.standPisState': function(val) {
this.standPisState = val
},
'$store.state.socket.onboardPisState': function(val) {
this.onboardPisState = val
},
},
data() {
return {
view: 'station',
view: '',
datetime: new Date(),
standPisStatus: {
standPisState: {
standCode: '',
stationName: '科技路',
firstTrainRemain: 3,
firstEndStationName: '航天东路',
secondTrainRemain: 7,
secondEndStationName: '航天新城',
stationName: '',
firstTrainRemain: NaN,
firstEndStationName: '',
secondTrainRemain: NaN,
secondEndStationName: '',
},
bannerText:
'党的十八大提出倡导富强、民主、文明、和谐倡导自由、平等、公正、法治倡导爱国、敬业、诚信、友善积极培育和践行社会主义核心价值观。富强、民主、文明、和谐是国家层面的价值目标自由、平等、公正、法治是社会层面的价值取向爱国、敬业、诚信、友善是公民个人层面的价值准则这24个字是社会主义核心价值观的基本内容。',
onboardPisStatus: {
onboardPisState: {
groupNumber: '',
nextStationName: '丈八一路',
endStationName: '西安国际医学中心',
nextStationName: '',
endStationName: '',
},
}
},
@ -137,19 +149,36 @@ export default {
timer = setInterval(() => {
this.tick()
}, 1000)
this.initPage(this.$route.query)
},
destroyed() {
clearInterval(timer)
timer = null
beforeDestroy() {
this.clearPage()
},
methods: {
changeView() {
if (this.view === 'station') {
initPage(query) {
const { type, group, standCode, groupNumber } = query
this.query = query
if (type === 'PIS_STAND') {
this.view = 'stand'
creatSubscribe(getTopic(type, group, { standCode }))
} else if (type === 'PIS_TRAIN') {
this.view = 'train'
} else {
this.view = 'station'
creatSubscribe(getTopic(type, group, { groupNumber }))
}
creatSubscribe(getTopic('SYSTIME', group))
},
clearPage() {
clearInterval(timer)
timer = null
clearSubscribe(
getTopic(
this.query.type,
this.query.group,
this.view === 'stand' ? { standCode: this.query.standCode } : { groupNumber: this.query.groupNumber }
)
)
clearSubscribe(getTopic('SYSTIME', this.query.group))
},
tick() {
this.datetime = new Date()