rt-sim-training-client/src/views/iscs/iscsSystem/stationConfig/index.vue

112 lines
3.9 KiB
Vue

<template>
<div style="height: 100%; width: 100%;overflow-y:hidden;overflow-x:hidden;position: relative;">
<psd-system v-if="mode=='psdSystem'" />
<substation v-else-if="mode=='substation'" />
<schedule v-else-if="mode=='schedule'" />
<normal v-else-if="mode.includes('environment')" />
<fas v-else-if="fasList.includes(mode)" />
<signal-system v-else-if="mode === 'signal'" />
<ticket-or-entrance v-else-if="mode === 'autoTicket'||mode === 'afcTwo02'||mode === 'afcOne02'" />
<broadcast-home v-else-if="mode === 'paMain'" />
<radio-listening-pa v-else-if="mode === 'paMonitor'" />
<time-preview-pa v-else-if="mode === 'paPreview'" />
<pids-emergency v-else-if="mode === 'pidsEmergency'" />
<pids-lcd v-else-if="mode === 'pidsLcd'" />
<pids-main v-else-if="mode === 'pidsMain'" />
<pids-preview v-else-if="mode === 'pidsPreview'" />
</div>
</template>
<script>
import PsdSystem from './psdSystem/index.vue';
import Substation from './powerMonitor/substation.vue';
import Normal from './environment/index.vue';
import Schedule from './schedule';
import Fas from './fas/index.vue';
import SignalSystem from './signalSystem/index.vue';
import TicketOrEntrance from './ticketOrEntrance/index';
import BroadcastHome from '../config/broadcast/homeScreen';
import RadioListeningPa from '../config/pa/radioListeningPA';
import TimePreviewPa from '../config/pa/timePreviewPA';
import PidsEmergency from '../config/pis/emergencyRelease';
import PidsMain from '../config/pis/mainScreen';
import PidsPreview from '../config/pis/timePreview';
import PidsLcd from '../config/pis/lcdControl';
import { getSimulationInfoNew } from '@/api/simulation';
import { getByGroupStationList } from '@/api/jmap/map';
import { loadRunPlanData } from '@/utils/loaddata';
export default {
components:{
Schedule,
PsdSystem,
Substation,
Normal,
SignalSystem,
Fas,
TicketOrEntrance,
BroadcastHome,
RadioListeningPa,
TimePreviewPa,
PidsEmergency,
PidsMain,
PidsPreview,
PidsLcd
},
data() {
return {
mode: 'index',
deviceList: [],
fasList:[
'sensing',
'gas',
'section',
'linkage',
'stationHall',
'platform'
]
};
},
computed: {
group() {
return this.$route.query.group;
}
},
watch: {
'$route': function(val) {
this.mode = this.$route.params.mode;
},
'$store.state.socket.runPlanReloadCount': function (val) {
getSimulationInfoNew(this.group).then(res => {
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
loadRunPlanData(this.group);
});
},
'$store.state.socket.iscsStateMessages': function (list) {
this.$store.dispatch('iscs/updateIscsState', list);
}
},
mounted() {
this.mode = this.$route.params.mode;
getSimulationInfoNew(this.group).then(res => {
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
this.loadRunData();
});
},
methods: {
loadRunData() {
this.$store.dispatch('runPlan/clear').then(() => {
if (this.group) {
// 获取排序的车站列表
getByGroupStationList(this.group).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
loadRunPlanData(this.group);
});
}).catch(() => {
this.$messageBox(this.$t('display.schema.getStationListFail'));
});
}
});
}
}
};
</script>