This commit is contained in:
zyy 2019-11-14 13:06:31 +08:00
commit f31026608a
14 changed files with 749 additions and 777 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>
@ -169,4 +167,4 @@
width: $width - 5; width: $width - 5;
} }
} }
</style> </style>

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

@ -2,7 +2,6 @@ import Vue from 'vue';
import store from '@/store'; import store from '@/store';
import router from './router'; import router from './router';
import NProgress from 'nprogress'; // Progress 进度条 import NProgress from 'nprogress'; // Progress 进度条
// import 'nprogress/nprogress.css';// Progress 进度条样式
import { admin, userDesign} from './router'; import { admin, userDesign} from './router';
import { getToken, getDesignToken} from '@/utils/auth'; // 验权 import { getToken, getDesignToken} from '@/utils/auth'; // 验权
import { LoginParams } from '@/utils/login'; import { LoginParams } from '@/utils/login';
@ -17,6 +16,14 @@ function hasPermission(roles, permissionRoles) {
const whiteList = ['/login', '/design/login', '/xty/login', '/designxty/login']; // 不重定向白名单 const whiteList = ['/login', '/design/login', '/xty/login', '/designxty/login']; // 不重定向白名单
const designPageRegex = [/^\/design/, /^\/scriptDisplay/, /^\/publish/, /^\/orderauthor/, /^\/system/, /^\/display\/record/, /^\/display\/manage/, /^\/apply/, /^\/plan/, /^\/display\/plan/];
function isDesignPage(toRoutePath) {
return designPageRegex.some(item => {
return item.test(toRoutePath);
});
}
const loginPage = whiteList[0]; const loginPage = whiteList[0];
const loginDesignPage = whiteList[1]; const loginDesignPage = whiteList[1];
@ -35,20 +42,10 @@ function getRouteInfo(to) {
loginPath = loginDesignXtyPage; loginPath = loginDesignXtyPage;
getTokenInfo = getDesignToken; getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId; clientId = LoginParams.Design.clientId;
} else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath) || /^\/display\/record/.test(toRoutePath) || /^\/display\/manage/.test(toRoutePath) || /^\/apply/.test(toRoutePath)) { } else if (isDesignPage(toRoutePath)) {
loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage; loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage;
getTokenInfo = getDesignToken; getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId; clientId = LoginParams.Design.clientId;
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
if (getSessionStorage('project').startsWith('design')) {
loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage;
getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId;
} else {
loginPath = getSessionStorage('project') === 'xty' ? loginXtyPage : loginPage;
getTokenInfo = getToken;
clientId = null;
}
} else if ( /^\/xty/.test(toRoutePath)) { } else if ( /^\/xty/.test(toRoutePath)) {
loginPath = loginXtyPage; loginPath = loginXtyPage;
getTokenInfo = getToken; getTokenInfo = getToken;
@ -58,7 +55,6 @@ function getRouteInfo(to) {
getTokenInfo = getToken; getTokenInfo = getToken;
clientId = null; clientId = null;
} }
return { clientId, loginPath, getTokenInfo }; return { clientId, loginPath, getTokenInfo };
} }

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

@ -110,9 +110,6 @@ export default {
this.queryList.reload(); this.queryList.reload();
} }
}, },
goDetail() {
this.$router.push({path:``});
},
async loadInitData() { async loadInitData() {
try { try {
// //

View File

@ -33,74 +33,74 @@
<script> <script>
export default { export default {
name: 'Digit', name: 'Digit',
props: { props: {
zoom: { zoom: {
type: Number, type: Number,
required: true required: true
}, },
number: { number: {
type: Number, type: Number,
required: true required: true
}, },
fine: { fine: {
type: Number, type: Number,
required: true required: true
}, },
color: { color: {
type: String, type: String,
required: true required: true
} }
}, },
computed: { computed: {
isShowOne() { isShowOne() {
return [2, 3, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1; return [2, 3, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1;
}, },
isShowTwo() { isShowTwo() {
return [1, 2, 3, 4, 7, 8, 9, 0].indexOf(this.number) != -1; return [1, 2, 3, 4, 7, 8, 9, 0].indexOf(this.number) != -1;
}, },
isShowThee() { isShowThee() {
return [1, 3, 4, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1; return [1, 3, 4, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1;
}, },
isShowFour() { isShowFour() {
return [2, 3, 5, 6, 8, 9, 0].indexOf(this.number) != -1; return [2, 3, 5, 6, 8, 9, 0].indexOf(this.number) != -1;
}, },
isShowFive() { isShowFive() {
return [2, 6, 8, 0].indexOf(this.number) != -1; return [2, 6, 8, 0].indexOf(this.number) != -1;
}, },
isShowSix() { isShowSix() {
return [4, 5, 6, 8, 9, 0].indexOf(this.number) != -1; return [4, 5, 6, 8, 9, 0].indexOf(this.number) != -1;
}, },
isShowSeven() { isShowSeven() {
return [2, 3, 4, 5, 6, 8, 9].indexOf(this.number) != -1; return [2, 3, 4, 5, 6, 8, 9].indexOf(this.number) != -1;
}, },
b1() { b1() {
return this.fine * 2; return this.fine * 2;
}, },
b2() { b2() {
return this.fine * 4; return this.fine * 4;
}, },
z1() { z1() {
return this.zoom * 4; return this.zoom * 4;
}, },
z2() { z2() {
return this.zoom * 8; return this.zoom * 8;
}, },
p() { p() {
return this.fine * 1; return this.fine * 1;
}, },
w() { w() {
return this.zoom * 4 + this.fine * 6 + this.p*2; return this.zoom * 4 + this.fine * 6 + this.p * 2;
}, },
h() { h() {
return this.zoom * 8 + this.fine * 6 + this.p*2; return this.zoom * 8 + this.fine * 6 + this.p * 2;
} }
}, },
methods: { methods: {
opacity(show) { opacity(show) {
return show ? 1 : 0.2; return show ? 1 : 0.2;
} }
} }
}; };
</script> </script>

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

@ -3,7 +3,6 @@
<menu-bar ref="menuBar" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" /> <menu-bar ref="menuBar" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" />
<schedule <schedule
ref="schedule" ref="schedule"
:line-code="lineCode"
:plan-convert="PlanConvert" :plan-convert="PlanConvert"
:max-height="height" :max-height="height"
:max-width="width" :max-width="width"
@ -108,7 +107,7 @@ export default {
mounted() { mounted() {
this.timeDemon = setInterval(() => { this.timeDemon = setInterval(() => {
checkLoginLine(); checkLoginLine();
}, 3000 * 60); }, 5000 * 60);
}, },
beforeDestroy() { beforeDestroy() {
if (this.timeDemon) { if (this.timeDemon) {
@ -116,11 +115,6 @@ export default {
} }
}, },
methods: { methods: {
setPosition() {
this.$nextTick(() => {
this.$refs.schedule.setPosition();
});
},
dispatchDialog(dialogObj) { dispatchDialog(dialogObj) {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs[dialogObj.name]) { if (this.$refs[dialogObj.name]) {

View File

@ -31,44 +31,44 @@
<script> <script>
export default { export default {
name: 'DataTable', name: 'DataTable',
props: { props: {
height: { height: {
type: Number, type: Number,
required: true required: true
}, },
config: { config: {
type: Object, type: Object,
required: true required: true
} }
}, },
data() { data() {
return { return {
show: true, show: true,
maxmini: true, maxmini: true,
touchStrategy: { touchStrategy: {
'Close': [false, true], 'Close': [false, true],
'Minim': [true, false], 'Minim': [true, false],
'Maxim': [true, true] 'Maxim': [true, true]
} }
}; };
}, },
methods: { methods: {
handleChange(row) { handleChange(row) {
if (this.config.handleChange) { if (this.config.handleChange) {
this.config.handleChange(row); this.config.handleChange(row);
} }
}, },
setCurrentRow(row) { setCurrentRow(row) {
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
}, },
touch(operate) { touch(operate) {
this.$nextTick(() => { this.$nextTick(() => {
[this.show, this.maxmini] = this.touchStrategy[operate]; [this.show, this.maxmini] = this.touchStrategy[operate];
this.$emit('touch', this.maxmini); this.$emit('touch', this.maxmini);
}); });
} }
} }
}; };
</script> </script>

View File

@ -38,14 +38,10 @@ export default {
DataTable DataTable
}, },
props: { props: {
lineCode: { planConvert: {
type: String, type: Object,
required: true required: true
}, },
// planConvert: {
// type: Object,
// required: true
// },
maxWidth: { maxWidth: {
type: Number, type: Number,
required: true required: true
@ -57,7 +53,6 @@ export default {
}, },
data() { data() {
return { return {
planConvert: null,
top: 0, top: 0,
height: 0, height: 0,
mapName: '', mapName: '',
@ -368,7 +363,7 @@ export default {
this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`; this.mapName = `${resp.data.name} (${this.$route.query.planName || ''})`;
}); });
} }
this.planConvert = this.$theme.loadPlanConvert(this.lineCode);
this.$store.dispatch('runPlan/clear').then(() => { this.$store.dispatch('runPlan/clear').then(() => {
this.loadInitChart().then(() => { this.loadInitChart().then(() => {
if (this.$route.query.mapId) { if (this.$route.query.mapId) {

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') {