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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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