创建考试调整&路由replace调整

This commit is contained in:
fan 2020-07-29 14:14:34 +08:00
parent a18c84f684
commit fff5acab5d
9 changed files with 49 additions and 59 deletions

View File

@ -14,7 +14,7 @@
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;">
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-select v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-select ref="chooseTripNumber" v-model="addModel.tripNumber" filterable @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
@ -24,7 +24,7 @@
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
<el-select v-model="addModel.serviceNumber" filterable>
<el-select ref="chooseServiceNumber" v-model="addModel.serviceNumber" filterable @change="serviceNumberChange">
<el-option
v-for="serviceNumber in serviceNumberList"
:key="serviceNumber"
@ -109,6 +109,13 @@ export default {
return '创建计划车';
}
},
watch:{
'$store.state.map.keyboardEnterCount': function (val) {
if (this.dialogShow && this.popClass === 'ningbo-01__systerm' && !this.loading) {
this.commit();
}
}
},
mounted() {
this.$nextTick(() => {
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 () {

View File

@ -31,6 +31,7 @@
<el-col :span="9">
<el-select
:id="domIdChoose1"
ref="chooseStation"
v-model="model.confirmStationCode"
filterable
size="mini"
@ -43,6 +44,7 @@
<el-col :span="9">
<el-select
:id="domIdChoose2"
ref="chooseSection"
v-model="model.confirmSectionCode"
filterable
size="mini"
@ -317,6 +319,7 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
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();
});
},
/** 确认计轴恢复工作*/

View File

@ -31,6 +31,7 @@
<el-form-item v-if="!isCancelSpeed" label="限速值" label-width="80px">
<el-select
:id="domIdChoose"
ref="chooseSpeed"
v-model="speed"
size="small"
:disabled="spdDisabled"
@ -380,6 +381,7 @@ export default {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 });
this.$refs.chooseSpeed.blur();
}
});
},

View File

@ -15,6 +15,7 @@
<el-row style="margin-bottom: 20px">
<el-select
:id="domIdChooseStation"
ref="chooseStation"
v-model="station"
value-key="code"
filterable
@ -171,6 +172,7 @@ export default {
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.chooseStation.blur();
}
});
},

View File

@ -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;

View File

@ -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;
}

View File

@ -61,7 +61,7 @@ export default {
/** 回复中控请求(同意/拒绝) */
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_SURRENDER_CONTROL: {value:'CM_Surrender_Control', label: '交出控制'}
},
// 司机操作

View File

@ -9,23 +9,23 @@
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
<el-button-group>
<!-- 排班计划 -->
<el-button v-if="isShowScheduling && !dataError" type="primary" @click="jumpScheduling" size="small">{{ $t('display.demon.dispatchingPlan') }}</el-button>
<el-button v-if="isShowScheduling && !dataError" type="primary" size="small" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
<!-- cctv视图 -->
<el-button v-if="!isShowScheduling && !dataError" @click="jumpjl3dpassflow" size="small">{{ jl3dpassflow }}</el-button>
<el-button v-if="!isShowScheduling && !dataError" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
<!-- <el-button v-if="!isShowScheduling && !dataError" @click="jumpjl3dstation">{{ jl3dstation }}</el-button> -->
<!-- 三维视图 -->
<el-button v-if="!isShowScheduling && !dataError" @click="jumpjlmap3d" size="small">{{ jl3dname }}</el-button>
<el-button v-if="!isShowScheduling && !dataError" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<!-- 设备视图 -->
<el-button v-if="isShow3dmodel && !isShowScheduling && !dataError" @click="jumpjlmap3dmodel" size="small">{{ jl3dmodel }}</el-button>
<el-button v-if="isShow3dmodel && !isShowScheduling && !dataError" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
<template v-if="isShowQuest">
<!-- && !isDesignPlatform -->
<el-button v-if="!isDesignPlatform && !dataError" type="danger" @click="handleQuitQuest" size="small">{{ $t('display.demon.exitScript') }}</el-button>
<el-button v-if="!isDesignPlatform && !dataError" type="danger" size="small" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
</template>
<template v-else-if="!projectDevice">
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime" size="small">{{ $t('display.demon.drivingByPlan') }}</el-button>
<el-button type="danger" :disabled="dataError" @click="end" size="small">{{ $t('display.demon.initialize') }}</el-button>
<el-button type="success" :disabled="isDisable || dataError" size="small" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
<el-button type="danger" :disabled="dataError" size="small" @click="end">{{ $t('display.demon.initialize') }}</el-button>
</template>
<el-button type="primary" @click="back" size="small">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
<el-button type="primary" size="small" @click="back">{{ projectDevice?'退出':$t('display.demon.back') }}</el-button>
</el-button-group>
</div>
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />

View File

@ -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 => {