代码调整

This commit is contained in:
fan 2023-07-10 10:22:27 +08:00
parent 502a994451
commit 7ff2271c38
5 changed files with 120 additions and 120 deletions

View File

@ -54,12 +54,6 @@ export default {
}
},
mounted() {
const self = this;
window.onclick = function (e) {
if (document.getElementById('menuBar') && !self.$store.state.training.trainingStart) {
self.doClose(false);
}
};
this.initMenu();
},
methods: {

View File

@ -204,9 +204,12 @@ export default {
if (!this.dialogShow) {
let info = SimulationType[member.type];
console.log(member.deviceCode, this.$store.getters['map/getDeviceByCode'](member.deviceCode), '********');
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
if (device) {
info = info + `(${device.name})`;
}
}
if (member.userId) {
simulationUserList.forEach(item => {

View File

@ -1,27 +1,27 @@
<template>
<div id="menuBarDatie">
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%;" />
<set-operation-plan ref="setOperationPlan" />
<operation-plan-detail ref="operationPlanDetail" />
<station-control-convert ref="stationControlConvert" :work="'dispatchWork'" />
<view-name ref="viewName" />
<train-operation ref="trainOperation" />
<switch-control ref="switchControl" />
<signal-control ref="signalControl" />
</div>
<div id="menuBarDatie">
<menu-bar ref="menuBar" :menu-normal="menuNormal" style="width:100%;" />
<set-operation-plan ref="setOperationPlan" />
<operation-plan-detail ref="operationPlanDetail" />
<station-control-convert ref="stationControlConvert" :work="'dispatchWork'" />
<view-name ref="viewName" />
<train-operation ref="trainOperation" />
<switch-control ref="switchControl" />
<signal-control ref="signalControl" />
</div>
</template>
<script>
import MenuBar from '@/jmapNew/theme/components/menus/menuBarNew'
import { destroySimulationByAdmin, exitSimulation } from '@/api/simulation'
import SetOperationPlan from './menuDialog/setOperationPlan.vue'
import OperationPlanDetail from './menuDialog/operationPlanDetail.vue'
import ViewName from './menuDialog/viewName'
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'
import StationControlConvert from './menuDialog/stationControlConvert'
import TrainOperation from './menuDialog/trainOperation'
import SwitchControl from './menuDialog/switchControl'
import SignalControl from './menuDialog/signalControl'
import { mapGetters } from 'vuex'
import MenuBar from '@/jmapNew/theme/components/menus/menuBarNew';
import { destroySimulationByAdmin, exitSimulation } from '@/api/simulation';
import SetOperationPlan from './menuDialog/setOperationPlan.vue';
import OperationPlanDetail from './menuDialog/operationPlanDetail.vue';
import ViewName from './menuDialog/viewName';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import StationControlConvert from './menuDialog/stationControlConvert';
import TrainOperation from './menuDialog/trainOperation';
import SwitchControl from './menuDialog/switchControl';
import SignalControl from './menuDialog/signalControl';
import { mapGetters } from 'vuex';
export default {
name: 'DispatchWorkMenuBar',
@ -33,7 +33,7 @@ export default {
StationControlConvert,
TrainOperation,
SwitchControl,
SignalControl,
SignalControl
},
data() {
return {
@ -44,19 +44,19 @@ export default {
children: [
{
title: 'Exit',
click: this.handleExit,
},
],
click: this.handleExit
}
]
},
{
title: 'UI Control',
operate: '',
click: this.uiControl,
click: this.uiControl
},
{
title: 'Station',
operate: '',
children: [],
children: []
},
{
title: 'Station Ctrl Mode',
@ -65,25 +65,25 @@ export default {
{
title: 'To Station Control',
click: this.turnToStationControl,
operate: OperationEvent.StationControl.requestStationControl.mbar,
operate: OperationEvent.StationControl.requestStationControl.mbar
},
{
title: 'Emergency Station Control',
click: this.mandatoryStationControl,
operate: OperationEvent.StationControl.forcedStationControl.password,
operate: OperationEvent.StationControl.forcedStationControl.password
},
{
title: 'To Center Control',
click: this.conterStationControl,
operate: OperationEvent.StationControl.requestCentralControl.mbar,
force: true,
},
],
force: true
}
]
},
{
title: 'Train Control',
operate: '',
click: this.trainControlShow,
click: this.trainControlShow
},
{
title: 'Signal Device Control',
@ -92,181 +92,181 @@ export default {
{
title: 'Signal Close',
click: this.handleSignalOperate,
operate: OperationEvent.Signal.signalClose.mbar,
operate: OperationEvent.Signal.signalClose.mbar
},
{
title: 'Signal Reopen',
click: this.handleSignalOperate,
operate: OperationEvent.Signal.reopenSignal.mbar,
operate: OperationEvent.Signal.reopenSignal.mbar
},
{
title: 'Turnout Normal',
click: this.handleSwitchOperate,
operate: OperationEvent.Switch.locate.mbar,
operate: OperationEvent.Switch.locate.mbar
},
{
title: 'Turnout Reverse',
click: this.handleSwitchOperate,
operate: OperationEvent.Switch.reverse.mbar,
operate: OperationEvent.Switch.reverse.mbar
},
{
title: 'Turnout Block',
click: this.handleSwitchOperate,
operate: OperationEvent.Switch.lock.mBar,
operate: OperationEvent.Switch.lock.mBar
},
{
title: 'Turnout Unblock',
click: this.handleSwitchOperate,
operate: OperationEvent.Switch.unlock.mbar,
},
],
operate: OperationEvent.Switch.unlock.mbar
}
]
},
{
title: 'Operation Plan',
operate: '',
click: this.openOperationPlan,
children: [],
children: []
},
{
title: 'Plan Details',
operate: '',
click: this.openPlanDetail,
children: [],
},
],
}
children: []
}
]
};
},
computed: {
...mapGetters('map', ['stationList']),
...mapGetters('map', ['stationList'])
},
mounted() {
this.stationList.forEach(station => {
this.menuNormal[2].children.push({
title: station.name,
click: () => {
this.$jlmap.setCenter(station.code)
},
})
})
this.$jlmap.setCenter(station.code);
}
});
});
},
methods: {
trainControlShow() {
this.$refs.trainOperation.doShow()
this.$refs.trainOperation.doShow();
},
handleSignalOperate(order) {
const operate = {
operation: order.operation,
}
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
this.$refs.signalControl.doShow(operate)
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.signalControl.doShow(operate);
}
})
});
},
handleSwitchOperate(order) {
const operate = {
operation: order.operation,
}
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
this.$refs.switchControl.doShow(operate)
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate);
}
})
});
},
turnToStationControl(order) {
const operate = {
operation: order.operation,
}
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
this.$refs.stationControlConvert.doShow(operate)
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
})
});
},
//
mandatoryStationControl(order) {
const operate = {
operation: order.operation,
}
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
this.$refs.stationControlConvert.doShow(operate)
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
})
});
},
//
conterStationControl(order) {
const operate = {
operation: order.operation,
}
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
this.$refs.stationControlConvert.doShow(operate)
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.stationControlConvert.doShow(operate);
}
})
});
},
uiControl(order) {
const operate = {
operation: order.operation,
}
operation: order.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true })
this.$refs.viewName.doShow(operate)
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.viewName.doShow(operate);
}
})
});
},
blankClickClose() {
this.$refs.menuBar.doClose()
this.$refs.menuBar.doClose();
},
handleExit() {
this.$confirm('Whether to exit emulation?', 'Hint', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning',
type: 'warning'
}).then(() => {
this.back()
})
this.back();
});
},
back() {
if (this.$store.state.training.simulationCreator) {
destroySimulationByAdmin(this.group)
destroySimulationByAdmin(this.group);
} else {
exitSimulation(this.group)
exitSimulation(this.group);
}
if (this.projectDevice && this.$store.state.training.simulationCreator) {
this.logout()
this.logout();
} else if (this.$route.query.third) {
if (this.$route.query.project === 'cgy' || this.$route.query.project === 'drts') {
window.parent.postMessage('back', '*')
window.parent.postMessage('back', '*');
} else {
window.close()
window.close();
}
} else if (this.projectDevice) {
this.logout()
this.logout();
} else {
this.$router.go(-1)
this.$router.go(-1);
}
},
//
logout() {
this.$store.dispatch('LogOut').then(() => {
location.reload()
})
location.reload();
});
},
openOperationPlan() {
this.$refs.setOperationPlan.doShow()
this.$refs.setOperationPlan.doShow();
},
openPlanDetail() {
this.$refs.operationPlanDetail.doShow()
},
},
}
this.$refs.operationPlanDetail.doShow();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
#menuBarDatie {

View File

@ -136,6 +136,9 @@ export default {
// this.$store.dispatch('config/updateMenuBar');
const _that = this;
window.onclick = function (e) {
if (!_that.$store.state.training.trainingStart) {
_that.$refs.menuBar && _that.$refs.menuBar.blankClickClose();
}
_that.$refs.menuStationStand.doClose();
_that.$refs.menuSwitch.doClose();
_that.$refs.menuSignal.doClose();

View File

@ -165,19 +165,19 @@ export const TrainType = {
/** 仿真成员类型 */
export const SimulationType = {
DISPATCHER: '行调',
STATION_SUPERVISOR: '车站值班员',
DRIVER: '司机',
MAINTAINER: '通号',
STATION_ASSISTANT: '车站助理',
STATION_MASTER:'车站站长',
STATION_SIGNALER:'车站信号员',
STATION_PASSENGER:'车站客运员',
STATION_SWITCH_MAN:'车站扳道员',
STATION_FACILITATOR:'车站引导员',
STATION_WORKER:'车站工务工',
DEVICE_MANAGER:'设备管理员',
TRAIN_MASTER:'车务段段长 '
DISPATCHER: 'DISPATCHING CONSOLE',
STATION_SUPERVISOR: 'STATION_SUPERVISOR',
DRIVER: 'DRIVER',
MAINTAINER: 'MAINTAINER',
STATION_ASSISTANT: 'STATION_ASSISTANT',
STATION_MASTER:'STATION_MASTER',
STATION_SIGNALER:'STATION_SIGNALER',
STATION_PASSENGER:'STATION_PASSENGER',
STATION_SWITCH_MAN:'STATION_SWITCH_MAN',
STATION_FACILITATOR:'STATION_FACILITATOR',
STATION_WORKER:'STATION_WORKER',
DEVICE_MANAGER:'DEVICE_MANAGER',
TRAIN_MASTER:'TRAIN_MASTER '
};
export const UrlConfig = {