ncc客户端调整

This commit is contained in:
fan 2023-04-25 13:56:09 +08:00
parent a188121aac
commit 1faf4fadc5
4 changed files with 129 additions and 4 deletions

View File

@ -6,6 +6,7 @@
<jl3d-drive v-else-if="picture === 'drivingPlan'" ref="jl3dDrive" />
<jl3d-device v-else-if="picture === 'jl3dModle'" ref="jl3dModle" />
<cctv-view v-else-if="picture === 'cctvView'" ref="cctvView" />
<line-monitor v-else-if="picture === 'lineMonitor'" ref="lineMonitor" />
<digital-stand v-else-if="picture === 'digitalStand'" ref="digitalStand" />
<iscs-system v-else-if="picture === 'iscsView'" ref="IscsSystem" />
@ -87,6 +88,7 @@ import TroDetailWork from './troDetailWork';
import TestRunplan from './testRunplan';
import DriverAtsWork from './driverAtsWork';
import NccWork from './nccWork';
import LineMonitor from './lineMonitor';
export default {
name: 'Index',
@ -124,7 +126,8 @@ export default {
Jl3dMaintainerSelect,
TestRunplan,
DriverAtsWork,
NccWork
NccWork,
LineMonitor
},
data() {
return {

View File

@ -0,0 +1,110 @@
<template>
<div>
<station-diagram ref="stationDiagram" @setSelected="setSelected" />
</div>
</template>
<script>
import StationDiagram from '../stationDiagram/index';
import {mapGetters} from 'vuex';
import { clearSubscribe, getTopic} from '@/utils/stomp';
export default {
name: 'LineMonitor',
components: {
StationDiagram
},
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;
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.map.initJlmapLoadedCount': function (val) {
this.handleDispatchWorkData();
}
},
beforeDestroy() {
clearSubscribe(getTopic('ATS_STATUS', this.group));
},
methods: {
setSelected(val) {
this.selected = val;
},
handleDispatchWorkData() {
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) {
const picture = this.mapData.pictureList.find(picture => picture.type === 'dispatchWork');
if (picture) {
this.handlerPictureShow(picture);
} else {
this.$jlmap.amendDevice([...this.sectionList, ...this.signalList, ...this.trainWindowList]);
const list = [];
for (const key in this.mapDevice) {
list.push(this.mapDevice[key]);
}
this.$jlmap.updateShowStation(list);
this.initLocation();
}
} else {
this.$jlmap.amendDevice([...this.sectionList, ...this.signalList, ...this.trainWindowList]);
const list = [];
for (const key in this.mapDevice) {
list.push(this.mapDevice[key]);
}
this.$jlmap.updateShowStation(list);
this.initLocation();
}
},
initLocation() {
const trainingDetail = this.$store.state.trainingNew.trainingDetail;
if (trainingDetail && trainingDetail.mapLocationJson) { //
const mapLocation = JSON.parse(trainingDetail.mapLocationJson);
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
}
},
//
handlerPictureShow(picture) {
const list = [];
const deviceList = [];
for (const key in this.mapDevice) {
list.push(this.mapDevice[key]);
deviceList.push(key);
}
this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap);
setTimeout(() => {
this.$jlmap.updatePicture(deviceList);
const trainingDetail = this.$store.state.trainingNew.trainingDetail;
if (trainingDetail && trainingDetail.mapLocationJson) { //
const mapLocation = JSON.parse(trainingDetail.mapLocationJson);
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
} else {
this.$jlmap.updateTransform(picture.scaling, picture.origin);
}
}, 10);
}
}
};
</script>
<style scoped>
</style>

View File

@ -41,9 +41,16 @@ export default {
click: this.changePictureShow
},
{
name: 'Ncc',
name: '线网监控',
code: 'nccWork',
roleList: ['DISPATCHER'],
roleList: ['NCC_DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '线路监控',
code: 'lineMonitor',
roleList: ['NCC_DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
@ -113,7 +120,7 @@ export default {
{
name: '运行图预览',
code: 'diagramPreview',
roleList: ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER'],
roleList: ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'NCC_DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
@ -313,6 +320,8 @@ export default {
//
const trainingDesign = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingDesign : false;
this.changePictureShow(trainingDesign ? 'driverAtsWork' : 'drivingPlan');
} else if (this.roles === 'NCC_DISPATCHER') {
this.changePictureShow('nccWork');
}
},
changePictureShow(code) {

View File

@ -361,6 +361,9 @@ export default {
case 'STATION_ELECTRIC_WORKER':
data.label = '电力工务 ' + (member.name ? `-${member.name}` : '');
break;
case 'NCC_DISPATCHER':
data.label = 'NCC调度' + (member.name ? `-${member.name}` : '');
break;
}
return data;
},