大铁线路二注释新建计划车&新增故障操作添加备用车

This commit is contained in:
fan 2023-06-01 15:43:46 +08:00
parent 06ec5fe8e1
commit 928b380811
2 changed files with 187 additions and 9 deletions

View File

@ -0,0 +1,163 @@
<template>
<el-dialog
v-dialogDrag
:class="popClass+' train-set-plan'"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="11">车组号</el-col>
<el-col :span="11" :offset="1">
<el-select v-model="addModel.groupNumber" size="mini">
<el-option
v-for="item in trainList"
:key="item.code"
:disabled="disabledTrain(item.code)"
:label="item.code"
:value="item.code"
/>
</el-select>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'TrainSetPlan',
components: {
NoticeInfo
},
props:{
popClass:{
type:String,
required:true
}
},
data() {
return {
trainNoList: [],
selected: null,
messageTip1:'',
addModel: {
groupNumber: '',
sectionCode: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'mapConfig',
'trainList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '加载备用车';
}
},
watch:{},
methods: {
doShow(operate, selected) {
this.$root.$emit('dialogOpen', selected);
this.selected = selected;
//
this.addModel.sectionCode = selected.code;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.addModel = {
groupNumber: '',
sectionCode: ''
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
if (!this.addModel.groupNumber) {
this.messageTip1 = '请输入车组号';
return;
}
const params = {
groupNumber: this.addModel.groupNumber,
sectionCode: this.addModel.sectionCode,
right: true
};
this.messageTip1 = '';
this.loading = true;
commitOperate(menuOperate.Section.loadSpareTrain, params, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
},
disabledTrain(code) {
return this.$store.state.map.activeTrainList.includes(code);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -4,6 +4,7 @@
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
<train-add-plan ref="trainAddPlan" pop-class="chengdou-03__systerm" />
<set-fault ref="setFault" pop-class="datie-02__systerm" />
<load-spare-train ref="loadSpareTrain" pop-class="datie-02__systerm" />
<add-spare-train ref="addSpareTrain" />
<draw-select ref="drawSelect" />
<fork-directive ref="forkDirective" />
@ -22,6 +23,7 @@ import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/men
import AddSpareTrain from './dialog/addSpareTrain';
import DrawSelect from './dialog/drawSelect';
import ForkDirective from './dialog/forkDirective';
import LoadSpareTrain from './dialog/loadSpareTrain';
export default {
name: 'SectionMenu',
@ -32,7 +34,8 @@ export default {
SetFault,
AddSpareTrain,
DrawSelect,
ForkDirective
ForkDirective,
LoadSpareTrain
},
props: {
selected: {
@ -84,6 +87,11 @@ export default {
label: '取消故障',
handler: this.cancelStoppage,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
},
{
label: '设置备用车',
handler: this.loadSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN
}
]
};
@ -107,14 +115,14 @@ export default {
}
},
mounted() {
const isDev = process.env.NODE_ENV === 'development';
if (isDev) {
this.menuNormal.push( {
label: '新建计划列车',
handler: this.createPlanTrain,
cmdType: CMD.Section.CMD_Train_Init_Plan
});
}
// const isDev = process.env.NODE_ENV === 'development';
// if (isDev) {
// this.menuNormal.push( {
// label: '',
// handler: this.createPlanTrain,
// cmdType: CMD.Section.CMD_Train_Init_Plan
// });
// }
},
methods: {
initMenu() {
@ -202,6 +210,13 @@ export default {
this.$refs.trainAddPlan.doShow(operate);
}
});
},
loadSpare() {
commitOperate(menuOperate.Section.loadSpareTrain, {sectionCode:this.selected.code}).then(({valid, operate})=>{
if (valid) {
this.$refs.loadSpareTrain.doShow(operate, this.selected);
}
});
}
}
};