删除实训平台运行图编辑,修改综合演练值班员角色调整问题

This commit is contained in:
fan 2019-11-14 11:30:32 +08:00
parent 595db4f8b7
commit e41d324c27
8 changed files with 630 additions and 640 deletions

View File

@ -1,130 +1,128 @@
<template> <template>
<div id="PlanMenuTool"> <div id="PlanMenuTool">
<div class="nav"> <div class="nav">
<div class="tool" v-for="(item,index) in tools" :key="index"> <div v-for="(item,index) in tools" :key="index" class="tool">
<img :src="item.src" :alt="item.title" /> <img :src="item.src" :alt="item.title">
</div> </div>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { prefixIntrger } from '@/utils/date';
import { prefixIntrger } from '@/utils/date'; import logo_ from '@/assets/logo_.png';
import logo_ from '@/assets/logo_.png';
export default {
export default { name: 'PlanMenuTool',
name: 'PlanMenuTool', data() {
data() { return {
return { tools: [
tools: [ {
{ title: '服务器1',
title: '服务器1', operate: '',
operate: '', src: logo_,
src: logo_, click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '服务器2',
title: '服务器2', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '前置机1',
title: '前置机1', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '前置机2',
title: '前置机2', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '主调',
title: '主调', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '调度台1',
title: '调度台1', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '调度台2',
title: '调度台2', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '调度台3',
title: '调度台3', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '大屏',
title: '大屏', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '维护工作站',
title: '维护工作站', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '运行图显示人工站',
title: '运行图显示人工站', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '跳停',
title: '跳停', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '扣车',
title: '扣车', operate: '',
operate: '', src: '',
src: '', click: this.undeveloped
click: this.undeveloped, },
}, {
{ title: '列车报警',
title: '列车报警', operate: '',
operate: '', src: logo_,
src: logo_, click: this.undeveloped
click: this.undeveloped, }
} ]
] };
} },
}, computed: {
watch: { isShowSystemTime() {
'$store.state.training.initTime': function (initTime) { return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode;
let date = new Date(initTime); }
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}` },
} watch: {
}, '$store.state.training.initTime': function (initTime) {
computed: { const date = new Date(initTime);
isShowSystemTime() { this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`;
return this.$route.params.mode == 'demon' || this.$route.params.mode === 'dp' || !this.$route.params.mode; }
} },
}, mounted() {
mounted() { this.initTools();
this.initTools(); },
}, methods: {
methods: { initTools() {
initTools() { this.tools = [];
this.tools = [];
}
} }
} }
};
</script> </script>
<style scoped rel="stylesheet/scss" lang="scss" scoped> <style scoped rel="stylesheet/scss" lang="scss" scoped>

View File

@ -28,53 +28,53 @@
import { OperationEvent } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/ConstDic';
export default { export default {
name: 'NoticeInfo', name: 'NoticeInfo',
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
messages: [this.$t('tip.commandFailed')], messages: [this.$t('tip.commandFailed')],
operate: null operate: null
}; };
}, },
computed: { computed: {
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
title() { title() {
return this.$t('tip.hint'); return this.$t('tip.hint');
}, },
domIdSure() { domIdSure() {
return this.dialogShow ? OperationEvent.Command.close.notice.domId : ''; return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
doShow(operate, messages) { doShow(operate, messages) {
this.operate = operate || {}; this.operate = operate || {};
this.dialogShow = true; this.dialogShow = true;
this.messages = [this.$t('tip.commandFailed')]; this.messages = [this.$t('tip.commandFailed')];
if (messages) { if (messages) {
this.messages = messages; this.messages = messages;
} }
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { commit() {
this.doClose(); this.doClose();
}, },
cancel() { cancel() {
this.doClose(); this.doClose();
} }
} }
}; };
</script> </script>

View File

@ -30,237 +30,237 @@ import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/Co
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'StandDetainTrain', name: 'StandDetainTrain',
components: { components: {
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
standName: '', standName: '',
selected: null, selected: null,
operation: null operation: null
}; };
}, },
computed: { computed: {
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? getDomIdByOperation(this.operation) : ''; return this.dialogShow ? getDomIdByOperation(this.operation) : '';
}, },
title() { title() {
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) { if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
return this.$t('menu.menuStationStand.detainTrain'); return this.$t('menu.menuStationStand.detainTrain');
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
return this.$t('menu.menuStationStand.cancelDetainTrain'); return this.$t('menu.menuStationStand.cancelDetainTrain');
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
return this.$t('menu.menuStationStand.cancelDetainTrainForce'); return this.$t('menu.menuStationStand.cancelDetainTrainForce');
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
return this.$t('menu.menuStationStand.earlyDeparture'); return this.$t('menu.menuStationStand.earlyDeparture');
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) { } else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
return this.$t('menu.menuStationStand.setJumpStop'); return this.$t('menu.menuStationStand.setJumpStop');
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
return this.$t('menu.menuStationStand.cancelJumpStop'); return this.$t('menu.menuStationStand.cancelJumpStop');
} }
return ''; return '';
}, },
preContext() { preContext() {
return this.title + ':'; return this.title + ':';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
doShow(operate, selected) { doShow(operate, selected) {
if (!this.dialogShow) { if (!this.dialogShow) {
this.standName = ''; this.standName = '';
if (selected) { if (selected) {
this.standName = selected.name; this.standName = selected.name;
} }
this.selected = selected; this.selected = selected;
this.operation = operate.operation; this.operation = operate.operation;
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
commit() { commit() {
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) { if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
/** 设置扣车*/ /** 设置扣车*/
this.setDetainTrain(); this.setDetainTrain();
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
/** 取消扣车*/ /** 取消扣车*/
this.cancelDetainTrain(); this.cancelDetainTrain();
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
/** 强制取消扣车*/ /** 强制取消扣车*/
this.cancelDetainTrainForce(); this.cancelDetainTrainForce();
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
/** 提前发车*/ /** 提前发车*/
this.earlyDeparture(); this.earlyDeparture();
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) { } else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
/** 设置跳停*/ /** 设置跳停*/
this.setJumpStop(); this.setJumpStop();
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) { } else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
/** 取消跳停*/ /** 取消跳停*/
this.cancelJumpStop(); this.cancelJumpStop();
} }
}, },
// //
setDetainTrain() { setDetainTrain() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setDetainTrain.menu.operation operation: OperationEvent.StationStand.setDetainTrain.menu.operation
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
if (!valid) { if (!valid) {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
cancelDetainTrain() { cancelDetainTrain() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
if (!valid) { if (!valid) {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
cancelDetainTrainForce() { cancelDetainTrainForce() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
if (!valid) { if (!valid) {
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
earlyDeparture() { earlyDeparture() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.earlyDeparture.menu.operation operation: OperationEvent.StationStand.earlyDeparture.menu.operation
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
setJumpStop() { setJumpStop() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.setJumpStop.menu.operation, operation: OperationEvent.StationStand.setJumpStop.menu.operation,
val: this.selected.direction // , 01: /02: val: this.selected.direction // , 01: /02:
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
// //
cancelJumpStop() { cancelJumpStop() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
val: this.selected.direction // , 01: /02: val: this.selected.direction // , 01: /02:
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.loading = false; this.loading = false;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
}; };
</script> </script>
<style> <style>

View File

@ -59,133 +59,133 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'StandDetainTrainAll', name: 'StandDetainTrainAll',
components: { components: {
NoticeInfo NoticeInfo
}, },
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
upDown: '01', upDown: '01',
tempData: [], tempData: [],
disabled: true, disabled: true,
operation: '' operation: ''
}; };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationStandList' 'stationStandList'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
domIdChoose() { domIdChoose() {
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : ''; return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : '';
}, },
domIdConfirm() { domIdConfirm() {
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : ''; return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : '';
}, },
title() { title() {
if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) { if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) {
return this.$t('menu.menuStationStand.cancelDetainTrainAll'); return this.$t('menu.menuStationStand.cancelDetainTrainAll');
} else { } else {
return this.$t('menu.menuStationStand.cancelJumpStopAll'); return this.$t('menu.menuStationStand.cancelJumpStopAll');
} }
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}); });
}, },
methods: { methods: {
loadTableData() { loadTableData() {
this.tempData = []; this.tempData = [];
this.stationStandList.forEach(elem => { this.stationStandList.forEach(elem => {
/** status 01: 未扣车*/ /** status 01: 未扣车*/
const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).status; const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).status;
const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}); const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {});
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) { if (station && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) {
this.tempData.push({ stationName: station.name, standName: elem.name }); this.tempData.push({ stationName: station.name, standName: elem.name });
} }
}); });
// //
if (this.tempData.length > 0) { if (this.tempData.length > 0) {
this.disabled = false; this.disabled = false;
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.loading = false; this.loading = false;
this.upDown = selected.direction; this.upDown = selected.direction;
this.loadTableData(); this.loadTableData();
this.operation = operate.operation; this.operation = operate.operation;
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}, },
doClose() { doClose() {
this.loading = false; this.loading = false;
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
choose(upDown) { choose(upDown) {
// //
this.loadTableData(); this.loadTableData();
const operate = { const operate = {
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation, operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
val: `${upDown}` val: `${upDown}`
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
commit() { commit() {
const operate = { const operate = {
send: true, send: true,
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
val: this.upDown val: this.upDown
}; };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}); });
}, },
cancel() { cancel() {
const operate = { const operate = {
type: MapDeviceType.StationStand.type, type: MapDeviceType.StationStand.type,
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
} }
} }
}; };
</script> </script>

View File

@ -526,11 +526,6 @@ export const asyncRouter = [
path: 'draft', path: 'draft',
component: PackageDraft, component: PackageDraft,
hidden: true hidden: true
},
{
path: 'runPlan/manage/:mapId',
component: PlanMonitorDetail,
hidden: true
} }
] ]
} }

View File

@ -232,7 +232,7 @@ export default {
this.$emit('getUserRole'); this.$emit('getUserRole');
break; break;
case 'Attendant': case 'Attendant':
if (!item['stationCode']) { if (!item['deviceCode']) {
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Attendant'); this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Attendant');
break; break;
} }

View File

@ -12,124 +12,124 @@ import { putUserRoles } from '@/api/chat';
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
export default { export default {
name: 'OperateMenu', name: 'OperateMenu',
components: { components: {
PopMenu, PopMenu,
ChooseRole ChooseRole
}, },
props: { props: {
group: { group: {
type: String, type: String,
required: true required: true
}, },
point: { point: {
type: Object, type: Object,
required: true required: true
}, },
selected: { selected: {
type: Object, type: Object,
required: true required: true
}, },
driverList: { driverList: {
type: Array, type: Array,
required: true required: true
}, },
driverMapDict: { driverMapDict: {
type: Object, type: Object,
required: true required: true
} }
}, },
data() { data() {
return { return {
menuShow: false, menuShow: false,
menu: [ menu: [
{ {
label: this.$t('joinTraining.chooseDriver'), label: this.$t('joinTraining.chooseDriver'),
handler: this.chooseDriver handler: this.chooseDriver
}, },
{ {
label: this.$t('joinTraining.cancelDriver'), label: this.$t('joinTraining.cancelDriver'),
handler: this.cancelDriver handler: this.cancelDriver
} }
] ]
}; };
}, },
watch: { watch: {
'$store.state.menuOperation.menuCount': function (val) { '$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.SetDriver)) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.SetDriver)) {
this.doShow(this.$store.state.menuOperation.menuPosition); this.doShow(this.$store.state.menuOperation.menuPosition);
} else { } else {
this.doClose(); this.doClose();
} }
} }
}, },
mounted() { mounted() {
this.closeEvent(); this.closeEvent();
}, },
methods: { methods: {
closeEvent() { closeEvent() {
const self = this; const self = this;
window.onclick = function (e) { window.onclick = function (e) {
self.doClose(); self.doClose();
}; };
}, },
doShow(point) { doShow(point) {
this.closeEvent(); this.closeEvent();
if (this.$refs && this.$refs.popMenu) { if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point); this.$refs.popMenu.resetShowPosition(point);
} }
this.menuShow = true; this.menuShow = true;
}, },
doClose() { doClose() {
if (this.$refs && this.$refs.popMenu) { if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close(); this.$refs.popMenu.close();
} }
this.menuShow = false; this.menuShow = false;
}, },
chooseDriver() { chooseDriver() {
const arrs = Object.values(this.driverMapDict); const arrs = Object.values(this.driverMapDict);
const list = this.driverList.filter(elem => { const list = this.driverList.filter(elem => {
let ret = true; let ret = true;
arrs.forEach(item => { arrs.forEach(item => {
if (item.id == elem.id) { if (item.id == elem.id) {
ret = false; ret = false;
} }
}); });
return ret; return ret;
}); });
this.$refs.chooseRole.doShow({ title: this.$t('joinTraining.chooseDriver'), list: list }); this.$refs.chooseRole.doShow({ title: this.$t('joinTraining.chooseDriver'), list: list });
}, },
async setDriver(obj) { async setDriver(obj) {
if (obj && this.selected) { if (obj && this.selected) {
const params = [{ const params = [{
id: obj.id, id: obj.id,
nickName: obj.name, nickName: obj.name,
userRole: 'Driver', userRole: 'Driver',
stationCode: '', stationCode: '',
trainCode: this.selected._code trainCode: this.selected._code
}]; }];
await putUserRoles(params, this.group); await putUserRoles(params, this.group);
} }
}, },
async cancelDriver() { async cancelDriver() {
const data = this.driverMapDict[this.selected._code]; const data = this.driverMapDict[this.selected._code];
if (data) { if (data) {
const params = [{ const params = [{
id: data.id, id: data.id,
nickName: data.name, nickName: data.name,
userRole: 'Driver', userRole: 'Driver',
stationCode: '', stationCode: '',
trainCode: '' trainCode: ''
}]; }];
await putUserRoles(params, this.group); await putUserRoles(params, this.group);
} }
}, },
refresh() { refresh() {
this.$emit('refresh'); this.$emit('refresh');
} }
} }
}; };
</script> </script>

View File

@ -145,9 +145,6 @@ export default {
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}}); this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
break; break;
case 'Plan':
this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {lineCode: '02'} });
break;
} }
}).catch((error) => { }).catch((error) => {
if (error.code === '40004') { if (error.code === '40004') {