西安二列车操作调整

This commit is contained in:
fan 2020-08-24 15:01:47 +08:00
parent b83673146e
commit 0e26ab9d6f
2 changed files with 183 additions and 2 deletions

View File

@ -0,0 +1,152 @@
<template>
<el-dialog
v-dialogDrag
class="xian-02__system warning-confirm"
:title="title"
:visible.sync="show"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
center
>
<el-row style="padding: 20px 0;">
<el-col :span="12" style="text-align: center;">
<el-row style="color: #000;">车体号:</el-row>
<el-row>
<el-input v-model="groupNumber" :disabled="true" style="width: 80px;" />
</el-row>
</el-col>
<el-col :span="12" style="text-align: center;">
<el-row style="color: #000;">追踪号:</el-row>
<el-input v-model="tid" :disabled="true" style="width: 80px;" />
</el-col>
</el-row>
<el-row v-if="isUpdate" style="padding: 20px 0;border-top: 1px solid #000">
<el-col :span="24" style="text-align: center">
<el-row style="color: #000;">新追踪号:</el-row>
<el-row>
<el-input v-model="newTid" style="width: 80px;" />
</el-row>
</el-col>
</el-row>
<el-row v-else style="padding: 20px 0;border-top: 1px solid #000">
<el-col :span="12" style="text-align: center">
<el-row style="color: #000">车体号:</el-row>
<el-row>
<el-input v-model="newGroupNumber" style="width: 80px;" />
</el-row>
</el-col>
<el-col :span="12" style="text-align: center">
<el-row style="color:#000">追踪号:</el-row>
<el-row>
<el-input v-model="newTid" style="width: 80px;" />
</el-row>
</el-col>
</el-row>
<el-row style="padding: 20px 0;">
<el-input
v-model="textarea"
type="textarea"
:rows="3"
placeholder="请输入内容"
/>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="20" :offset="2">
<el-button :id="domIdConfirm" style="margin-right: 170px;" @click="commit">确定</el-button>
<el-button :id="domIdCancel" style="margin-right: 170px;" @click="cancel">取消</el-button>
<el-button>帮助</el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { mapGetters } from 'vuex';
export default {
name: 'ChangeTID',
data() {
return {
groupNumber: '',
newGroupNumber: '',
tid: '',
newTid: '',
textarea: '',
loading: false,
dialogShow: false,
operate: {}
};
},
computed: {
...mapGetters('map', [
'stationList',
'mapConfig'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
if (this.dialogShow) {
return this.operate.operation === OperationEvent.Train.editTrainId.menu.operation ? OperationEvent.Train.editTrainId.confirm.domId : OperationEvent.Train.switchTrainId.confirm.domId;
} else {
return '';
}
},
domIdConfirm() {
if (this.dialogShow) {
return this.operate.operation === OperationEvent.Train.editTrainId.menu.operation ? OperationEvent.Train.editTrainId.confirm.domId : OperationEvent.Train.switchTrainId.confirm.domId;
} else {
return '';
}
},
title() {
return this.operate.operation === OperationEvent.Train.editTrainId.menu.operation ? '更改追踪号' : '交换追踪号';
},
isUpdate() {
return this.operate.operation === OperationEvent.Train.editTrainId.menu.operation;
}
},
methods: {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
doShow(step, selected ) {
this.dialogShow = true;
this.selected = selected;
this.groupNumber = selected.code;
this.tid = selected.tripNumber;
this.operate = step;
},
cancel() {
this.doClose();
},
commit() {
}
}
};
</script>
<style lang="scss" scoped>
.transfer_header {
text-align: center;
color: #000;
font-size: 16px;
}
.transfer_body {
height: 180px;
/*overflow-y: scroll;*/
border-top: 2px solid #2F4F50;
border-left: 2px solid #2F4F50;
border-bottom: 2px solid #B7D4D5;
border-right: 2px solid #B7D4D5;
text-align: center;
font-size: 16px;
color: #000;
}
</style>

View File

@ -10,6 +10,7 @@
<train-set-work ref="trainSetWork" />
<trainSetWorkATP ref="trainSetWorkATP" />
<train-destination ref="trainDestination" />
<change-tid ref="changeTid" />
<set-fault ref="setFault" pop-class="xian-02__system" />
</div>
</template>
@ -26,6 +27,7 @@ import TrainSetHead from './dialog/trainSetHead';
import TrainSetWork from './dialog/trainSetWork';
import trainSetWorkATP from './dialog/trainSetWorkATP';
import TrainDestination from './dialog/trainDestination';
import ChangeTid from './dialog/changeTID';
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -47,6 +49,7 @@ export default {
TrainSetWork,
trainSetWorkATP,
TrainDestination,
ChangeTid,
SetFault
},
props: {
@ -82,12 +85,12 @@ export default {
},
{
label: '更改追踪号',
handler: this.undeveloped,
handler: this.updateTid,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: '交换追踪号',
handler: this.undeveloped,
handler: this.switchTid,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
@ -546,6 +549,32 @@ export default {
}
});
},
updateTid() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.editTrainId.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.changeTid.doShow(operate, this.selected);
}
});
},
switchTid() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Train.switchTrainId.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.changeTid.doShow(operate, this.selected);
}
});
},
updateDestination() {
const operate = {
start: true,