From fff5acab5dadbe441052a04eef68fa465f9404b7 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 29 Jul 2020 14:14:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=80=83=E8=AF=95=E8=B0=83?= =?UTF-8?q?=E6=95=B4&=E8=B7=AF=E7=94=B1replace=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/menus/dialog/trainAddPlan.vue | 19 ++++++--- .../ningbo_01/menus/dialog/alxeEffective.vue | 4 ++ .../menus/dialog/speedLimitControl.vue | 2 + .../menus/menuDialog/stationControl.vue | 2 + src/router/index_Common.js | 5 ++- src/scripts/ConstDic.js | 6 ++- src/scripts/cmdPlugin/CommandEnum.js | 6 +-- src/views/newMap/displayNew/menuDemon.vue | 24 +++++------ src/views/publish/examRule/draft/editRule.vue | 40 ++----------------- 9 files changed, 49 insertions(+), 59 deletions(-) diff --git a/src/jmapNew/theme/components/menus/dialog/trainAddPlan.vue b/src/jmapNew/theme/components/menus/dialog/trainAddPlan.vue index 6a62e62b2..90b7fb088 100644 --- a/src/jmapNew/theme/components/menus/dialog/trainAddPlan.vue +++ b/src/jmapNew/theme/components/menus/dialog/trainAddPlan.vue @@ -14,7 +14,7 @@
- + - + { this.$store.dispatch('training/tipReload'); @@ -118,6 +125,7 @@ export default { tripNumberChange(tripNumber) { getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => { this.serviceNumberList = []; + this.$refs.chooseTripNumber.blur(); if (typeof resp.data == 'string') { this.serviceNumberList.push(resp.data); } else { @@ -132,12 +140,12 @@ export default { } }); }, + serviceNumberChange(val) { + this.$refs.chooseServiceNumber.blur(); + }, doShow(operate, selected) { this.selected = selected; // 如果不是断点激活,则需要对初始值进行初始化 - // if (!this.dialogShow) { - - // } this.addModel = { tripNumber:'', serviceNumber:'' @@ -151,7 +159,6 @@ export default { }); }).catch(error => { console.log(error); - // this.$messageBox(error.message); }); this.dialogShow = true; this.$nextTick(function () { diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue index 662516d7b..d2246c6e4 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue @@ -31,6 +31,7 @@ { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.chooseStation.blur(); }); }, sectionSelectChange(code) { @@ -333,6 +336,7 @@ export default { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.chooseSection.blur(); }); }, /** 确认计轴恢复工作*/ diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue index e22db3748..441b6cffe 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/speedLimitControl.vue @@ -31,6 +31,7 @@ { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.chooseStation.blur(); } }); }, diff --git a/src/router/index_Common.js b/src/router/index_Common.js index d2d2f5a5d..ed810a05b 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -1154,8 +1154,11 @@ const router = createRouter(); // 兼容 vue-router在3.1.0版本以上的路由跳转使用的是 promise 的方式 const originalPush = Router.prototype.push; +const originalReplace = Router.prototype.replace; Router.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err); }; - +Router.prototype.replace = function replace(location) { + return originalReplace.call(this, location).catch(err => err); +}; export default router; diff --git a/src/scripts/ConstDic.js b/src/scripts/ConstDic.js index ad72ecc77..58fc5ce4a 100644 --- a/src/scripts/ConstDic.js +++ b/src/scripts/ConstDic.js @@ -2337,7 +2337,8 @@ export function getTrainingOperateTypeMap() { Station: [], ControlConvertMenu: [], TrainWindow: [], - LimitControl: [] + LimitControl: [], + Driver: [] }; let val; for ( val in CMD['Switch']) { @@ -2364,5 +2365,8 @@ export function getTrainingOperateTypeMap() { for ( val in CMD['Train']) { trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]); } + for ( val in CMD['Driver']) { + trainingOperateTypeMap['Driver'].push(CMD['Driver'][val]); + } return trainingOperateTypeMap; } diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 2984387d7..555272383 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -59,9 +59,9 @@ export default { /** 回复站控请求(同意/拒绝) */ CMD_CM_REPLY_STATION_CONTROL: {value:'CM_Reply_Station_Control', label: '回复站控请求'}, /** 回复中控请求(同意/拒绝) */ - CMD_CM_REPLY_CENTER_CONTROL: {value:'CM_Reply_Center_Control', label: '回复中控请求'}, - CMD_CM_RECEIVE_CONTROL: {value:'CM_Receive_Control', label: '接收控制'}, - CMD_CM_SURRENDER_CONTROL: {value:'CM_Surrender_Control', label: '交出控制'}, + CMD_CM_REPLY_CENTER_CONTROL: {value:'CM_Reply_Center_Control', label: '回复中控请求'}, + CMD_CM_RECEIVE_CONTROL: {value:'CM_Receive_Control', label: '接收控制'}, + CMD_CM_SURRENDER_CONTROL: {value:'CM_Surrender_Control', label: '交出控制'} }, // 司机操作 diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 710670eee..1ae06c5e8 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -8,24 +8,24 @@
- - {{ $t('display.demon.dispatchingPlan') }} - - {{ jl3dpassflow }} + + {{ $t('display.demon.dispatchingPlan') }} + + {{ jl3dpassflow }} - - {{ jl3dname }} - - {{ jl3dmodel }} + + {{ jl3dname }} + + {{ jl3dmodel }} - {{ projectDevice?'退出':$t('display.demon.back') }} + {{ projectDevice?'退出':$t('display.demon.back') }}
diff --git a/src/views/publish/examRule/draft/editRule.vue b/src/views/publish/examRule/draft/editRule.vue index f1397ba50..6a6b6b5c6 100644 --- a/src/views/publish/examRule/draft/editRule.vue +++ b/src/views/publish/examRule/draft/editRule.vue @@ -37,6 +37,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { getCmdList } from '@/api/management/dictionary'; import ConstConfig from '@/scripts/ConstConfig'; import Cookies from 'js-cookie'; +import { getTrainingOperateTypeMap } from '@/scripts/ConstDic'; export default { name: 'EditRule', @@ -133,41 +134,7 @@ export default { await this.getList(); await this.refresh(); if (this.drawWay) { - this.trainingOperateTypeMap = { - Switch: [], - Section: [], - Signal: [], - Stand: [], - Station: [], - ControlConvertMenu: [], - TrainWindow: [], - LimitControl: [] - }; - let val; - for ( val in CMD['Switch']) { - this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]); - } - for ( val in CMD['Section']) { - this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]); - } - for ( val in CMD['Signal']) { - this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]); - } - for ( val in CMD['Stand']) { - this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]); - } - for ( val in CMD['Station']) { - this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]); - } - for ( val in CMD['LimitControl']) { - this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][val]); - } - for ( val in CMD['ControlConvertMenu']) { - this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]); - } - for ( val in CMD['Train']) { - this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]); - } + this.trainingOperateTypeMap = getTrainingOperateTypeMap(); const lineCode = this.lineCode; const res = await getCmdList(lineCode, {}); const trainingOperateList = []; @@ -180,7 +147,8 @@ export default { Station: [], ControlConvertMenu: [], TrainWindow: [], - LimitControl: [] + LimitControl: [], + Driver: [] }; if (res && res.code === 200) { res.data.forEach(item => {