新版北京一号线 新建计划车指令代码修改

This commit is contained in:
joylink_cuiweidong 2020-02-13 12:33:54 +08:00
parent e5f78fd3e3
commit 9115155865

View File

@ -4,13 +4,29 @@
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules"> <el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="width: 96%;"> <div style="width: 96%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainCode"> <el-form-item label="车 组 号:" label-width="95px" prop="trainCode">
<el-input v-model="addModel.trainCode" /> <!-- <el-input v-model="addModel.trainCode" /> -->
</el-form-item> <el-select v-model="addModel.trainCode" filterable>
<el-form-item label="服 务 号:" label-width="95px" prop="serverNumber"> <el-option
<el-input v-model="addModel.serverNumber" /> v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.code"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="车 次 号:" label-width="95px" prop="tripNumber"> <el-form-item label="车 次 号:" label-width="95px" prop="tripNumber">
<el-input v-model="addModel.tripNumber" /> <!-- <el-input v-model="addModel.tripNumber" /> -->
<el-select v-model="addModel.tripNumber" @change="tripNumberChange">
<el-option
v-for="tripNum in tripNumberList"
:key="tripNum"
:label="tripNum"
:value="tripNum"
/>
</el-select>
</el-form-item>
<el-form-item label="服 务 号:" label-width="95px" prop="serviceNumber">
<el-input v-model="addModel.serviceNumber" />
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
@ -29,6 +45,7 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation';
export default { export default {
// name: 'TrainMove', // name: 'TrainMove',
@ -39,21 +56,21 @@
return { return {
trainNoList: [], trainNoList: [],
selected: null, selected: null,
tripNumberList: [],
addModel: { addModel: {
trainCode: '', // trainCode: '', //
serverNumber: '', // serviceNumber: '', //
tripNumber: '' // tripNumber: '' //
}, },
rules: { rules: {
trainCode: [ trainCode: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'change' }
], ],
serverNumber: [ serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'change' } { required: true, message: '请输入服务号', trigger: 'blur' }
], ],
tripNumber: [ tripNumber: [
{ required: true, message: '请输入车次号', trigger: 'blur' } { required: true, message: '请输入车次号', trigger: 'change' }
] ]
}, },
dialogShow: false, dialogShow: false,
@ -62,7 +79,9 @@
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationStandList' 'trainList',
'stationStandList',
'trainWindowSectionCode'
]), ]),
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
@ -83,12 +102,30 @@
}) })
}, },
methods: { methods: {
tripNumberChange(tripNumber) {
getServiceNumbersByTripNum(this.$route.query.group, tripNumber).then(resp => {
this.serviceNumber = resp.data;
});
},
doShow(operate, selected) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
} }
this.addModel = {
trainCode:'',
tripNumber:'',
serviceNumber:''
};
getTripNumberList(this.$route.query.group).then(resp => {
this.tripNumberList = [];
resp.data.forEach(item => {
if (!this.tripNumberList.includes(item)) {
this.tripNumberList.push(item);
}
});
});
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
@ -99,7 +136,7 @@
this.dialogShow = false; this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected); // mouseCancelState(this.selected);
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
@ -110,7 +147,7 @@
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
param: { param: {
trainCode: this.addModel.trainCode, // trainCode: this.addModel.trainCode, //
serverNumber: this.addModel.serverNumber, // serviceNumber: this.addModel.serviceNumber, //
tripNumber: this.addModel.tripNumber // tripNumber: this.addModel.tripNumber //
} }
} }
@ -133,7 +170,6 @@
}, },
cancel() { cancel() {
let operate = { let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation,
} }