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

View File

@ -25,7 +25,7 @@ export function handlerUrl(data) {
// const data = null; // const data = null;
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.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://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.3.90:9100'; // 周寅 // BASE_API = 'http://192.168.3.90:9100'; // 周寅
// BASE_API = 'http://192.168.3.94:9000'; // 旭强 // 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 LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
// export const iscsTopic = '/topic/simulation/iscs'; // iscs topic // export const iscsTopic = '/topic/simulation/iscs'; // iscs topic
export function getTopic(type, group, stationCode) { export function getTopic(type, group, param) {
let topic = ''; let topic = '';
switch (type) { switch (type) {
case 'SYSTIME': case 'SYSTIME':
@ -23,7 +23,7 @@ export function getTopic(type, group, stationCode) {
topic = `/queue/simulation/${group}/state`; topic = `/queue/simulation/${group}/state`;
break; break;
case 'ISCSPSD': case 'ISCSPSD':
topic = `/queue/simulation/${group}/iscs/psd/${stationCode}`; topic = `/queue/simulation/${group}/iscs/psd/${param.stationCode}`;
break; break;
case 'ISCSPA': case 'ISCSPA':
topic = `/queue/simulation/${group}/iscs/pa`; topic = `/queue/simulation/${group}/iscs/pa`;
@ -31,6 +31,12 @@ export function getTopic(type, group, stationCode) {
case 'ISCSPIS': case 'ISCSPIS':
topic = `/queue/simulation/${group}/iscs/pis`; topic = `/queue/simulation/${group}/iscs/pis`;
break; 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': case 'CTC':
topic = `/user/queue/simulation/${group}/ctc`; topic = `/user/queue/simulation/${group}/ctc`;
break; break;
@ -75,6 +81,10 @@ function callback(Response) {
store.dispatch('socket/handleIscsPaState', JSON.parse(Response.body)); store.dispatch('socket/handleIscsPaState', JSON.parse(Response.body));
} else if (Response.headers.destination.includes('iscs/pis')) { } else if (Response.headers.destination.includes('iscs/pis')) {
store.dispatch('socket/handleIscsPisState', JSON.parse(Response.body)); 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 { } else {
const data = JSON.parse(Response.body); const data = JSON.parse(Response.body);
store.dispatch('socket/setStomp', data); store.dispatch('socket/setStomp', data);

View File

@ -75,11 +75,11 @@ export default {
subscribe(stationCode) { subscribe(stationCode) {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() }; 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'); this.$store.dispatch('app/animationsClose');
}, },
clearSubscribe(stationCode) { 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 type: this.$route.query.type
}; };
setSessionStorage('projectDevice', JSON.stringify(res.data.deviceVO)); setSessionStorage('projectDevice', JSON.stringify(res.data.deviceVO));
if (this.$route.query.type == 'LSW') { if (this.$route.query.type == 'LSW') {
const config = JSON.parse(res.data.deviceVO.config); const config = JSON.parse(res.data.deviceVO.config);
if (config.quadrant == '99') { if (config.quadrant == '99') {
@ -553,7 +552,8 @@ export default {
} else if (this.$route.query.type === 'ILW') { } else if (this.$route.query.type === 'ILW') {
this.$router.push({ path: `/jointTrainingNew`, query: query }); this.$router.push({ path: `/jointTrainingNew`, query: query });
} else if (this.$route.query.type === 'PIS_STAND' || this.$route.query.type === 'PIS_TRAIN') { } else if (this.$route.query.type === 'PIS_STAND' || this.$route.query.type === 'PIS_TRAIN') {
this.$router.push({ path: `/pis`, query}) const config = JSON.parse(res.data.deviceVO.config)
this.$router.push({ path: `/pis`, query: {...query, ...config}})
} else { } else {
this.$router.push({ path: `/jointTrainingNew`, query: query }); this.$router.push({ path: `/jointTrainingNew`, query: query });
} }

View File

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