客户端调整

This commit is contained in:
fan 2023-05-11 15:13:39 +08:00
parent 0f15e2d41f
commit a4525be99e
9 changed files with 302 additions and 329 deletions

View File

@ -192,6 +192,7 @@ const training = {
state.prdType = prdType;
},
setRoles: (state, roles) => {
console.log(roles, '***********');
state.roles = roles;
},
setCenterStationCode:(state, centerStationCode) => {

View File

@ -31,7 +31,7 @@ export function handlerUrl() {
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -98,7 +98,7 @@ export default {
this.hasVoice = val.hasVoice;
this.hasTraining = val.hasTraining;
this.trainingDesign = val.trainingDesign;
this.$refs.simulationMenu.handleMenuShow();
// this.$refs.simulationMenu.handleMenuShow();
}
},
async mounted() {

View File

@ -63,19 +63,13 @@ export default {
{ label: '设备管理', name: 'deviceManage', click: this.deviceManage, isDisabled: () => { return false; }, isShow: () => { return (this.$store.state.training.domConfig.hasDeviceManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER) || (this.$route.query.client === 'interlockWork' && this.$route.query.projectDevice === 'ILW'); } },
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isDisabled: () => { return false; }, isShow: () => { return true; } },
{ label: '生成仿真号', name: 'generateQrCode', click: this.generateQrCode, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.joint && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
{ label: '切换客流数据', name: 'changeFlowData', click: this.changeFlowData, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasLpf && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
{ label: '切换客流数据', name: 'changeFlowData', click: this.changeFlowData, isDisabled: () => { return false; }, isShow: this.isShowLpf},
{ label: '成员管理', name: 'memberManage', click: this.memberManage, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasMemberManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
{ label: '考试', name: 'exam', click: this.goExam, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasExam && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
{ label: '按计划行车', name: 'drivingPlan', click: this.drivingPlan, isDisabled: () => { return this.$store.state.trainingNew.trainingSwitch; },
isShow: () => {
return this.$store.state.training.simulationUserType === SimulationUserType.TEACHER &&
(this.$route.query.client !== 'diagramEdit' || (this.$route.query.client == 'diagramEdit' && this.$store.state.map.picture == 'testRunplan'));
} },
isShow: () => this.$store.state.training.simulationUserType === SimulationUserType.TEACHER && this.$store.state.map.picture !== 'diagramEdit' },
{ label: '初始化', name: 'initialize', click: this.initializeSim, isDisabled: () => { return this.$store.state.trainingNew.trainingSwitch; },
isShow: () => {
return this.$store.state.training.simulationUserType === SimulationUserType.TEACHER &&
(this.$route.query.client !== 'diagramEdit' || (this.$route.query.client == 'diagramEdit' && this.$store.state.map.picture == 'testRunplan'));
} },
isShow: () => this.$store.state.training.simulationUserType === SimulationUserType.TEACHER && this.$store.state.map.picture !== 'diagramEdit' },
{ label: '退出', name: 'quit', click: this.exitSim, isDisabled: () => { return false; }, isShow: () => { return true; } }
]
};
@ -95,17 +89,6 @@ export default {
}
},
watch: {
'$store.state.ibp.moreScreen': function (val) {
this.handleMenuShow();
},
'$store.state.training.simulationUserType': function (val) {
this.handleMenuShow();
},
'$store.state.map.picture': function (val) {
if (val == 'testRunplan') {
this.handleMenuShow();
}
},
'$store.state.socket.simulationOver':function(val) {
this.back();
},
@ -124,6 +107,21 @@ export default {
window.removeEventListener('click', this.hideMenuList);
},
methods: {
isShowLpf() {
let flag = this.$store.state.training.simulationUserType === SimulationUserType.TEACHER;
if (flag) {
const clientIdList = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.clientList || [] : [];
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
flag = false;
mapClientList.forEach(client => {
if (client.type === 'largePassengerView' && clientIdList.includes(client.id)) {
flag = true;
}
});
}
return flag;
},
switchOffset() {
EventBus.$emit('switchOffset');
},
@ -141,6 +139,7 @@ export default {
},
showMenuList(event) {
event.stopPropagation();
this.handleMenuShow();
this.isShowMenuList = !this.isShowMenuList;
this.active = -1;
},

View File

@ -1,7 +1,7 @@
<template>
<div v-loading="loading" style="height: 100%">
<dispatcher-work v-if="picture === 'dispatchWork'" ref="dispatcherWork" />
<local-work v-else-if="picture === 'localWork'" ref="localWork" :centralized-station-map="centralizedStationMap" />
<local-work v-else-if="picture === 'localWork'" ref="localWork" :now-terminal="nowTerminal" :centralized-station-map="centralizedStationMap" />
<ncc-work v-else-if="picture === 'nccWork'" ref="nccWork" />
<jl3d-drive v-else-if="picture === 'drivingPlan'" ref="jl3dDrive" />
<jl3d-device v-else-if="picture === 'jl3dModle'" ref="jl3dModle" />
@ -42,7 +42,7 @@
<terminal-menu
v-if="menuShow"
ref="terminalMenu"
:picture="picture"
:now-terminal="nowTerminal"
@pictureChange="pictureChange"
@loadingChange="loadingChange"
/>
@ -138,7 +138,8 @@ export default {
loading: false,
isFirst: true,
group: '',
showStationCode: ''
showStationCode: '',
nowTerminal: {}
};
},
computed: {
@ -155,7 +156,7 @@ export default {
return this.$store.state.training.roleDeviceCode;
},
menuShow() {
return !this.$route.query.singleClient || !this.$store.state.training.roles;
return !this.$route.query.singleClient && !this.$route.query.projectDevice;
}
},
watch: {
@ -175,11 +176,6 @@ export default {
if (map) {
this.initMemberUserInfo();
this.setCentralizedStationList(map); //
if (this.$route.query.client) {
setTimeout(() => {
this.pictureChange(this.$route.query.client);
}, 200);
}
}
} catch (error) {
console.log('[ERROR] ', error);
@ -190,7 +186,8 @@ export default {
const device = this.$store.state.menuOperation.selected;
if (device && device._type === 'Station' && this.$store.state.menuOperation.subType === 'troButton') {
this.showStationCode = device.code;
this.pictureChange('troDetailWork');
const terminal = this.findTerminalFromMap('troDetailWork');
this.pictureChange(terminal);
}
},
'$store.state.socket.simulationReset': function (val) { // 仿
@ -219,9 +216,22 @@ export default {
this.$store.dispatch('socket/clearSimulationRoleList');
this.$store.dispatch('trainingNew/clearTrainingData');
this.$store.dispatch('map/resetActiveTrainList');
this.$store.dispatch('map/setPicture', '');
this.$store.dispatch('runPlan/setPlanData', []);
},
methods: {
findTerminalFromMap(type) {
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
return mapClientList.find(item => item.type === type && (!item.deviceCode || item.deviceCode === this.roleDeviceCode));
},
initTerminalIfNoDefault() {
if (!this.$store.state.training.roles && !this.$route.query.client) {
let client = this.findTerminalFromMap('dispatchWork');
if (!client) { client = this.findTerminalFromMap('troDetailWork'); }
this.pictureChange(client);
}
},
async initMemberUserInfo() {
try {
let memberResp = '';
@ -230,6 +240,7 @@ export default {
userResp = await getAllSimulationUser(this.group);
this.$store.dispatch('training/setMemberList', {memberList: memberResp.data, userId: this.userId});
this.$store.dispatch('training/setSimulationUserList', userResp.data);
this.initTerminalIfNoDefault();
} catch {
this.$messageBox('获取仿真成员或用户列表失败!');
}
@ -259,36 +270,39 @@ export default {
this.pictureChange(data.name);
this.loadPlanId = data.planId;
},
pictureChange(val) {
this.picture = val;
pictureChange(terminal) {
this.picture = terminal.type;
this.nowTerminal = terminal;
console.log(terminal, this.picture);
this.$store.dispatch('map/setPicture', this.picture);
if (val === 'ibp') {
this.$nextTick(() => { this.$refs.ibpPlate.show(this.roleDeviceCode, ''); });
} else if (val === 'drivingPlan') {
if (this.picture === 'ibp') {
const deviceCode = this.nowTerminal.deviceCode || this.roleDeviceCode;
this.$nextTick(() => { this.$refs.ibpPlate.show(deviceCode, ''); });
} else if (this.picture === 'drivingPlan') {
this.$nextTick(() => { this.$refs.jl3dDrive.show(this.mapId, this.group); this.mapViewLoaded(true); });
} else if (val === 'trafficTerminal') {
} else if (this.picture === 'trafficTerminal') {
this.$nextTick(() => { this.subscribe('CTC'); });
} else if (val === 'largePassengerView') {
} else if (this.picture === 'largePassengerView') {
this.$nextTick(() => { this.subscribe('LPF'); });
} else if (val === 'emergency') {
} else if (this.picture === 'emergency') {
this.$nextTick(() => { this.subscribe('YJDDZH'); });
} else if (val === 'diagramPreview') {
} else if (this.picture === 'diagramPreview') {
this.$nextTick(() => { this.subscribe('RUNFACT'); });
} else if (val === 'digitalStand') {
} else if (this.picture === 'digitalStand') {
this.$nextTick(() => { this.subscribe('JL3D'); });
} else if (val === 'cctvView') {
} else if (this.picture === 'cctvView') {
const RealCctvList = ['richorjoint', 'richorhhcj'];
const project = this.$route.query.project || 'login';
if (!RealCctvList.includes(project)) {
this.$nextTick(() => { this.subscribe('JL3D'); });
}
} else if (val === 'scheduleWork') {
} else if (this.picture === 'scheduleWork') {
this.mapViewLoaded(true);
} else if (val === 'dispatcherManage') {
} else if (this.picture === 'dispatcherManage') {
this.mapViewLoaded(true);
} else if (val === 'dispatchingCommand') {
} else if (this.picture === 'dispatchingCommand') {
this.$nextTick(() => { this.subscribe('CTC'); });
} else if (val === 'nccWork') {
} else if (this.picture === 'nccWork') {
this.$nextTick(() => { this.subscribe('NCC'); });
}
this.$nextTick(() => { this.loading = false; });

View File

@ -20,6 +20,12 @@ export default {
default() {
return [];
}
},
nowTerminal: {
type: Object,
default() {
return {};
}
}
},
data() {
@ -63,12 +69,13 @@ export default {
'$store.state.map.initJlmapLoadedCount': function (val) {
this.handleLocalWorkData();
},
'$store.state.training.roleDeviceCode': function (val) {
nowTerminal() {
const type = this.datie ? 'chainStation' : 'localWork';
if (this.mapData && this.mapData.pictureList) {
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
const deviceCode = this.nowTerminal.deviceCode || this.roleDeviceCode;
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(deviceCode) && picture.type === type);
if (picture) {
this.handlerPictureShow(picture);
this.handlerPictureShow(picture, deviceCode);
}
}
}
@ -84,24 +91,25 @@ export default {
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);
const deviceCode = this.nowTerminal.deviceCode || this.roleDeviceCode;
if (this.mapData && this.mapData.pictureList) {
let type = this.datie ? 'chainStation' : 'localWork';
const station = this.mapDevice[this.roleDeviceCode];
const station = this.mapDevice[deviceCode];
if (station && station.depot) {
type = 'chainStation';
}
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(this.roleDeviceCode) && picture.type === type);
const picture = this.mapData.pictureList.find(picture => picture.stationCodes && picture.stationCodes.includes(deviceCode) && picture.type === type);
if (picture) {
this.handlerPictureShow(picture);
this.handlerPictureShow(picture, deviceCode);
} else {
this.handlerSwitchStationMode();
this.handlerSwitchStationMode(deviceCode);
}
} else {
this.handlerSwitchStationMode();
this.handlerSwitchStationMode(deviceCode);
}
},
//
handlerPictureShow(picture) {
handlerPictureShow(picture, deviceCode) {
const list = [];
const deviceList = [];
for (const key in this.mapDevice) {
@ -119,14 +127,14 @@ export default {
} else {
this.$jlmap.updateTransform(picture.scaling, picture.origin);
}
this.$store.dispatch('map/setShowCentralizedStationCode', this.centralizedStationMap[this.roleDeviceCode]);
this.$store.dispatch('map/setShowCentralizedStationCode', this.centralizedStationMap[deviceCode]);
}, 10);
},
//
handlerSwitchStationMode() {
handlerSwitchStationMode(deviceCode) {
this.$jlmap.amendDevice([...this.sectionList, ...this.signalList, ...this.trainWindowList]);
this.showStation = this.centralizedStationMap[this.roleDeviceCode];
const showStation = this.centralizedStationMap[this.roleDeviceCode];
this.showStation = this.centralizedStationMap[deviceCode];
const showStation = this.centralizedStationMap[deviceCode];
const list = [];
for (const key in this.mapDevice) {
list.push(this.mapDevice[key]);

View File

@ -1,247 +1,49 @@
<template>
<div>
<div v-if="isShow && terminalList.length" v-verticalDrag class="terminalList">
<div v-verticalDrag class="terminalList">
<div class="drag-line verticalDrag__header" />
<div v-for="(eachTerminal,index) in terminalList" :key="index" :class="picture==eachTerminal.code?'eachTerminal active':'eachTerminal'" @click="eachTerminal.click(eachTerminal.code)">{{ eachTerminal.name }}</div>
<div class="client-button" @click="showClientList">客户端</div>
<!-- <div v-for="(eachTerminal,index) in terminalList" :key="index" :class="picture==eachTerminal.code?'eachTerminal active':'eachTerminal'" @click="eachTerminal.click(eachTerminal.code)">{{ eachTerminal.name }}</div>-->
<div class="drag-line verticalDrag__footer" />
</div>
<el-drawer
title=""
:visible.sync="drawer"
:with-header="false"
size="300px"
direction="rtl"
:before-close="handleClose"
>
<div class="my-drawer-body">
<div class="my-drawer-title">客户端列表</div>
<template v-for="terminal in terminalList">
<div :key="terminal.id" class="terminal-button">
<div class="terminal-button-name" :class="{ active: terminal.id === nowTerminal.id }" @click="changePictureShow(terminal)">{{ terminal.name }}</div>
<div class="terminal-button-text" @click="openNewWindow(terminal)">新窗口打开</div>
</div>
</template>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name:'TerminalList',
props: {
picture: {
type: String,
nowTerminal: {
type: Object,
default() {
return '';
return {};
}
}
},
data() {
return {
isFirst: true,
terminalList:[],
centralizedStationList: [],
centralizedStationMap: {},
commonTerminal: [
{
name: this.$route.query.simType === 'RAILWAY' ? '联锁操作终端' : '现地工作站',
code: 'localWork',
roleList: ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', 'STATION_PASSENGER',
'STATION_SWITCH_MAN', 'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER', 'TRAIN_MASTER', 'DEPOT_DISPATCHER', 'SIGNAL_BUILDING'],
isShow: () => true,
click: this.changePictureShow
},
{
name: '行调工作站',
code: 'dispatchWork',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.lineCode !== '14',
click: this.changePictureShow
},
{
name: '线网监控',
code: 'nccWork',
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
},
{
name: '行调台',
code: 'dispatcherManage',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: '车务终端',
code: 'trafficTerminal',
roleList: ['STATION_SUPERVISOR'],
isShow: () => this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: '车务管理终端',
code: 'trafficManageTerminal',
roleList: ['STATION_SUPERVISOR'],
isShow: () => this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: '调度计划',
code: 'schedulingPlan',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: '调度命令',
code: 'dispatchingCommand',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: '路票',
code: 'trainTicket',
roleList: ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'DRIVER'],
isShow: () => this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: '簿册',
code: 'registerBook',
roleList: ['STATION_SUPERVISOR', 'STATION_MASTER', 'STATION_WORKER', 'ELECTRIC_DISPATCHER', 'STATION_ELECTRIC_WORKER'],
isShow: () => this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: '运行图加载',
code: 'diagramLoad',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '司机ATS工作站',
code: 'driverAtsWork',
roleList: ['DRIVER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '运行图预览',
code: 'diagramPreview',
roleList: ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'NCC_DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '运行图编制',
code: 'diagramEdit',
roleList: [],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '派班工作站',
code: 'scheduleWork',
roleList: ['DEPOT_DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: 'cctv视图',
code: 'cctvView',
roleList: ['DISPATCHER', 'STATION_SUPERVISOR'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: 'ISCS',
code: 'iscsView',
roleList: ['DISPATCHER', 'STATION_SUPERVISOR'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '大屏',
code: 'bigScreen',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '司机视角',
code: 'drivingPlan',
roleList: ['DRIVER'],
isShow: () => this.$route.query.simType === 'METRO' || this.$route.query.simType === 'RAILWAY',
click: this.changePictureShow
},
{
name: 'IBP盘',
code: 'ibp',
roleList: ['STATION_SUPERVISOR'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '数字沙盘',
code: 'digitalStand',
roleList: ['STATION_SUPERVISOR', 'DISPATCHER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '大客流策略',
code: 'largePassengerStrategy',
roleList: ['DISPATCHER'],
isShow: () => this.itemMap && this.itemMap.LPF,
click: this.changePictureShow
},
{
name: '大客流视图',
code: 'largePassengerView',
roleList: ['DISPATCHER'],
isShow: () => this.itemMap && this.itemMap.LPF,
click: this.changePictureShow
},
{
name: 'PSL',
code: 'psl',
roleList: ['STATION_SUPERVISOR'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: 'BaSiDi',
code: 'baSiDi',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.lineCode === '14' && this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '轨道总览',
code: 'troWork',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.lineCode === '14' && this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '轨道详览',
code: 'troDetailWork',
roleList: ['DISPATCHER'],
isShow: () => this.$route.query.lineCode === '14' && this.$route.query.simType === 'METRO',
click: this.changePictureShow
},
{
name: '通号端',
code: 'maintainerSelect',
roleList: ['MAINTAINER'],
isShow: () => this.$route.query.simType === 'METRO',
click: this.changePictureShow
}
],
itemMap: {}
drawer: false
};
},
computed:{
//
isShow() {
return !this.$route.query.projectDevice;
},
// 线
lineCode() {
return this.$route.query.lineCode;
},
simType() {
return this.$route.query.simType;
},
@ -251,40 +53,89 @@ export default {
},
watch: {
'$store.state.training.roles': function (val) {
this.initTerminalList();
const trainingDetail = this.$store.state.trainingNew.trainingDetail;
if (this.isFirst && this.$route.query.client) {
this.isFirst = false;
} else {
if (trainingDetail && trainingDetail.client) {
this.changePictureShow(trainingDetail.client);
} else {
const clientIdList = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.clientList : [];
if (!clientIdList || !clientIdList.length) {
this.initTerminalList();
if (!this.$store.state.trainingNew.trainingDetail) {
this.initPictureShow();
this.isFirst = false;
}
} else if (!this.terminalList.length) {
this.initTerminalList();
if (this.$route.query.client) {
const terminal = this.findTerminalFromMapById(this.$route.query.client);
this.changePictureShow(terminal);
}
}
},
'$store.state.training.memberList': function (val) {
if (!this.$store.state.training.roles && !this.$route.query.singleClient) {
this.changePictureShow('dispatchWork');
}
},
'$store.state.socket.simulationWorkParam': function (val) {
if (val) {
this.itemMap = val.itemMap || {};
this.initTerminalList();
'$store.state.trainingNew.trainingDetail': function(val) {
if (val.client) {
const client = this.findTerminalFromMap(val.client);
this.changePictureShow(client);
}
}
},
mounted() {
this.initTerminalList();
},
methods:{
handleTerminalDefaultShow(client) {
const map = {
localWork: ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', 'STATION_PASSENGER',
'STATION_SWITCH_MAN', 'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER', 'TRAIN_MASTER', 'DEPOT_DISPATCHER', 'SIGNAL_BUILDING'],
dispatchWork: ['DISPATCHER'],
nccWork: ['NCC_DISPATCHER'],
lineMonitor: ['NCC_DISPATCHER'],
dispatcherManage: ['DISPATCHER'],
trafficTerminal: ['STATION_SUPERVISOR'],
trafficManageTerminal: ['STATION_SUPERVISOR'],
schedulingPlan: ['DISPATCHER'],
dispatchingCommand: ['DISPATCHER'],
trainTicket: ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'DRIVER'],
registerBook: ['STATION_SUPERVISOR', 'STATION_MASTER', 'STATION_WORKER', 'ELECTRIC_DISPATCHER', 'STATION_ELECTRIC_WORKER'],
diagramLoad: ['DISPATCHER'],
driverAtsWork: ['DRIVER'],
diagramPreview: ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'NCC_DISPATCHER'],
diagramEdit: [],
scheduleWork: ['DEPOT_DISPATCHER'],
cctvView: ['DISPATCHER', 'STATION_SUPERVISOR'],
iscsView: ['DISPATCHER', 'STATION_SUPERVISOR'],
bigScreen: ['DISPATCHER'],
drivingPlan: ['DRIVER'],
ibp: ['STATION_SUPERVISOR'],
digitalStand: ['STATION_SUPERVISOR', 'DISPATCHER'],
largePassengerStrategy: ['DISPATCHER'],
largePassengerView: ['DISPATCHER'],
psl: ['STATION_SUPERVISOR'],
baSiDi: ['DISPATCHER'],
troWork:['DISPATCHER'],
troDetailWork: ['DISPATCHER'],
maintainerSelect: ['MAINTAINER']
};
if (client && client.type) {
const role = this.$store.state.training.roles;
const roleDevice = this.$store.state.training.roleDeviceCode;
if (client.deviceCode) {
return map[client.type].includes(role) && roleDevice === client.deviceCode;
} else {
return map[client.type].includes(role);
}
}
return false;
},
//
initTerminalList() {
this.terminalList = [];
this.commonTerminal.forEach(item => {
if (item.roleList.includes(this.roles) && item.isShow() && this.checkClientSet(item)) {
this.terminalList.push(item);
const clientIdList = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.clientList : [];
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
if (!mapClientList.length) {
this.$store.dispatch('app/animationsClose');
this.$messageBox('为获取到客户端数据,请查验地图数据!');
}
mapClientList.forEach(client => {
if (clientIdList && clientIdList.length) {
if (clientIdList.includes(client.id)) {
this.terminalList.push(client);
}
} else if (this.handleTerminalDefaultShow(client)) {
this.terminalList.push(client);
}
});
},
@ -296,43 +147,81 @@ export default {
return true;
}
},
noEvent(code) {
this.$emit('pictureChange', code);
findTerminalFromMapById(id) {
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
return mapClientList.find(item => item.id === id);
},
findTerminalFromMap(type) {
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
const roleDeviceCode = this.$store.state.training.roleDeviceCode;
return mapClientList.find(item => item.type === type && (!item.deviceCode || item.deviceCode === roleDeviceCode));
},
initPictureShow() {
const localWorkRoleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', 'STATION_PASSENGER', 'STATION_SWITCH_MAN',
'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER', 'TRAIN_MASTER', 'DEPOT_DISPATCHER'];
if (localWorkRoleList.includes(this.roles)) {
this.changePictureShow('localWork');
const terminal = this.findTerminalFromMap('localWork');
this.changePictureShow(terminal);
} else if (this.roles === 'DISPATCHER') {
if (this.$route.query.lineCode === '14') {
this.changePictureShow('baSiDi');
const terminal = this.findTerminalFromMap('baSiDi');
this.changePictureShow(terminal);
this.$store.dispatch('app/animationsClose');
} else if (this.$route.query.simType === 'RAILWAY') {
this.changePictureShow('dispatcherManage');
const terminal = this.findTerminalFromMap('dispatcherManage');
this.changePictureShow(terminal);
} else {
this.changePictureShow('dispatchWork');
const terminal = this.findTerminalFromMap('dispatchWork');
this.changePictureShow(terminal);
}
} else if (this.roles === 'MAINTAINER') {
//
this.changePictureShow('maintainerSelect');
const terminal = this.findTerminalFromMap('maintainerSelect');
this.changePictureShow(terminal);
} else if (this.roles === 'DRIVER') {
//
const trainingDesign = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingDesign : false;
this.changePictureShow(trainingDesign ? 'driverAtsWork' : 'drivingPlan');
const terminal = this.findTerminalFromMap(trainingDesign ? 'driverAtsWork' : 'drivingPlan');
this.changePictureShow(terminal);
} else if (this.roles === 'NCC_DISPATCHER') {
this.changePictureShow('nccWork');
const terminal = this.findTerminalFromMap('nccWork');
this.changePictureShow(terminal);
}
},
changePictureShow(code) {
if (!this.$store.state.map.map.clientSet || this.$store.state.map.map.clientSet.includes(code)) {
this.$emit('loadingChange');
setTimeout(() => {
this.$emit('pictureChange', code);
}, 100);
} else if (this.terminalList[0]) {
this.$emit('pictureChange', this.terminalList[0].code);
changePictureShow(terminal) {
if (!terminal) {
this.$messageBox('切换客户端失败:未找到对应客户端!');
return;
}
if (terminal.id === this.nowTerminal.id) {
return;
}
this.$emit('loadingChange');
setTimeout(() => {
this.$emit('pictureChange', terminal);
}, 100);
},
handleClose() {
this.drawer = false;
},
showClientList() {
this.drawer = true;
},
openNewWindow(terminal) {
const routeData = this.$router.resolve({
path:'/display/demon',
query:{
lineCode:this.$route.query.lineCode,
group:this.$route.query.group,
mapId:this.$route.query.mapId,
simType: this.$route.query.simType,
project: this.$route.query.project,
client: terminal.id
}
});
window.open(routeData.href, '_blank');
}
}
};
@ -342,7 +231,7 @@ export default {
position: absolute;
right: 0;
top: 45%;
width: 111px;
width: 25px;
padding: 1px;
background: #fff;
border-radius: 5px 0 0 5px;
@ -364,4 +253,70 @@ export default {
color:#409eff;
background: #ffff;
}
.client-button{
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
padding: 5px;
font-size: 15px;
cursor: pointer;
}
.my-drawer-body{
background: linear-gradient(to bottom, #01468B, #00172E);
height: 100%;
}
.my-drawer-title{
background: linear-gradient(to bottom, #01468B, #00172E);
text-align: center;
height: 50px;
line-height: 50px;
font-size: 24px;
color: #fff;
margin-bottom: 30px;
}
.terminal-button{
margin: 10px;
display: inline-block;
text-align: center;
width: 130px;
}
.terminal-button-name{
font-size: 15px;
color: #fbfbfb;
border: 1px solid #fff;
padding: 5px;
border-radius: 5px;
display: inline-block;
cursor: pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.active{
color: #00aaff;
background: #00172E;
border: 1px solid #00aaff;
}
.terminal-button-name:hover{
color: #00aaff;
background: #00172E;
border: 1px solid #00aaff;
}
.terminal-button-text{
font-size: 12px;
text-decoration: underline;
color: #00aaff;
margin-top: 5px;
text-align: center;
cursor: pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
.terminal-button-text:hover{
color: #d371ce;
}
</style>

View File

@ -168,7 +168,6 @@ export default {
{ key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList },
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },
@ -418,7 +417,6 @@ export default {
{ key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList },
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },

View File

@ -197,7 +197,6 @@ export default {
{ key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList },
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },
@ -296,7 +295,6 @@ export default {
{ key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList },
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },