代码调整

This commit is contained in:
joylink_cuiweidong 2022-12-09 15:39:30 +08:00
parent 8ca90b1003
commit 2e0105c390
4 changed files with 147 additions and 11 deletions

View File

@ -314,7 +314,7 @@ export default {
{ label: '半自动闭塞', value: 'StationDirectionSemi' } { label: '半自动闭塞', value: 'StationDirectionSemi' }
], ],
paperStateArr: ['正在编辑', '封存', '失效'], // 试卷定义状态 paperStateArr: ['正在编辑', '封存', '失效'], // 试卷定义状态
paperStateQueryMap: { '1': '所有', '2': '编辑', /* '3':'可生成试卷', */ '4': '封存', '5': '失效' },// 试卷定义查询状态 paperStateQueryMap: { '1': '所有', '2': '编辑', /* '3':'可生成试卷', */ '4': '封存', '5': '失效' }, // 试卷定义查询状态
projectList:[ projectList:[
{label:'西铁院', value: 'XTY'}, {label:'西铁院', value: 'XTY'},
@ -352,7 +352,8 @@ export default {
{ label: '大客流视图', value: 'largePassengerView' }, { label: '大客流视图', value: 'largePassengerView' },
{ label: '行调台', value: 'dispatcherManage' }, { label: '行调台', value: 'dispatcherManage' },
{ label: '派班工作站', value: 'scheduleWork' }, { label: '派班工作站', value: 'scheduleWork' },
{ label: '应急调度', value: 'emergency' } { label: '应急调度', value: 'emergency' },
{ label: '联锁工作站', value: 'interlockWork' }
] ]
} }
}; };

View File

@ -27,6 +27,9 @@
<diagram-edit v-else-if="picture === 'diagramEdit'" ref="diagramEdit" /> <diagram-edit v-else-if="picture === 'diagramEdit'" ref="diagramEdit" />
<pis-terminal v-else-if="picture === 'pis'" ref="pisTerminal" /> <pis-terminal v-else-if="picture === 'pis'" ref="pisTerminal" />
<display-ba-si-di v-else-if="picture === 'basidi'" ref="displayBaSiDi" /> <display-ba-si-di v-else-if="picture === 'basidi'" ref="displayBaSiDi" />
<interlock-work v-if="picture=='interlockWork'" ref="interlockWork" :centralized-station-map="centralizedStationMap">
<terminal-menu <terminal-menu
v-if="menuShow" v-if="menuShow"
ref="terminalMenu" ref="terminalMenu"
@ -34,7 +37,7 @@
@pictureChange="pictureChange" @pictureChange="pictureChange"
@loadingChange="loadingChange" @loadingChange="loadingChange"
/> />
</div> </interlock-work></div>
</template> </template>
<script> <script>
@ -44,6 +47,7 @@ import {creatSubscribe, clearSubscribe, getTopic} from '@/utils/stomp';
import { defaultCallback, stateCallback } from '@/utils/subscribeCallback'; import { defaultCallback, stateCallback } from '@/utils/subscribeCallback';
import DispatcherWork from './dispatchWork'; import DispatcherWork from './dispatchWork';
import LocalWork from './localWork'; import LocalWork from './localWork';
import InterlockWork from './interlockWork';
import TerminalMenu from './terminalMenu'; import TerminalMenu from './terminalMenu';
import DispatchCmd from './dispatchCmd'; import DispatchCmd from './dispatchCmd';
import DispatcherLoger from './dispatcherLoger/index'; import DispatcherLoger from './dispatcherLoger/index';
@ -75,6 +79,7 @@ export default {
components: { components: {
DispatcherWork, DispatcherWork,
LocalWork, LocalWork,
InterlockWork,
TerminalMenu, TerminalMenu,
DispatchCmd, DispatchCmd,
DispatcherLoger, DispatcherLoger,

View File

@ -0,0 +1,128 @@
<template>
<div>
<component :is="menus" :selected="selected" />
<station-diagram ref="stationDiagram" @setSelected="setSelected" />
</div>
</template>
<script>
import StationDiagram from '../stationDiagram/index';
import { clearSubscribe, getTopic} from '@/utils/stomp';
import {mapGetters} from 'vuex';
export default {
name:'InterlockWork',
components: {
StationDiagram
},
props: {
centralizedStationMap:{
type: Object,
default() {
return [];
}
}
},
data() {
return {
menus: null,
selected: null
};
},
computed: {
...mapGetters('map', [
'sectionList',
'signalList',
'trainWindowList'
]),
mapData() {
return this.$store.state.map.map;
},
mapDevice() {
return this.$store.state.map.mapDevice;
},
roleDeviceCode() {
return this.$store.state.training.roleDeviceCode;
},
group() {
return this.$route.query.group;
}
},
watch: {
//
'$store.state.map.mapDataLoadedCount': function () {
const lineCode = this.$jlmap.lineCode;
if (lineCode) {
this.menus = this.$theme.loadLocalWorkMenuComponent(lineCode);
}
},
'$store.state.map.initJlmapLoadedCount': function (val) {
this.handleLocalWorkData();
},
'$store.state.training.roleDeviceCode': function (val) {
if (this.mapData && this.mapData.pictureList) {
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === 'localWork');
if (picture) {
this.handlerPictureShow(picture);
}
}
}
},
beforeDestroy() {
clearSubscribe(getTopic('ATS_STATUS', this.group));
clearSubscribe(getTopic('STATE', this.group));
},
methods: {
setSelected(val) {
this.selected = val;
},
//
handlerPictureShow(picture) {
const list = [];
const deviceList = [];
for (const key in this.mapDevice) {
list.push(this.mapDevice[key]);
deviceList.push(key);
}
this.$jlmap.updateShowStation(list);
this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap);
setTimeout(() => {
this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(picture.scaling, picture.origin);
this.$store.dispatch('map/setShowCentralizedStationCode', this.centralizedStationMap[this.roleDeviceCode]);
}, 10);
},
handleLocalWorkData() {
const logicData = {routeData:this.$store.state.map.routeData, autoReentryData: this.$store.state.map.autoReentryData};
const repaint = this.$store.state.map.initJlmapLoadedCount === 1;
this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint);
if (this.mapData && this.mapData.pictureList) {
// let type = this.datie ? 'chainStation' : 'localWork';
// const station = this.mapDevice[this.roleDeviceCode];
// if (station && station.depot) {
// type = 'chainStation';
// }
const type = 'localWork';
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
if (picture) {
this.handlerPictureShow(picture);
} else {
this.handlerSwitchStationMode();
}
} else {
this.handlerSwitchStationMode();
}
},
//
handlerSwitchStationMode() {
this.$jlmap.amendDevice([...this.sectionList, ...this.signalList, ...this.trainWindowList]);
this.showStation = this.centralizedStationMap[this.roleDeviceCode];
const showStation = this.centralizedStationMap[this.roleDeviceCode];
const list = [];
for (const key in this.mapDevice) {
list.push(this.mapDevice[key]);
}
this.$jlmap.updateShowStation(list, showStation);
this.$jlmap.setCenter(showStation);
}
}
};
</script>

View File

@ -397,7 +397,9 @@ export default {
} else if (this.data.type === 'ILW') { } else if (this.data.type === 'ILW') {
this.$refs.dataForm.validateForm(() => { this.$refs.dataForm.validateForm(() => {
const param = { const param = {
deviceCode: this.formData.deviceCode deviceCode: this.formData.deviceCode,
roleCode: this.formData.roleCode,
client: this.formData.client
}; };
const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(param) }; const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(param) };
setDeviceConfig(data).then(() => { setDeviceConfig(data).then(() => {