延续保护 增加 保护区段ctc

This commit is contained in:
fan 2021-12-09 16:53:40 +08:00
parent 7b854e717e
commit afeec55025

View File

@ -74,7 +74,7 @@
</div> </div>
<div> <div>
<el-form ref="overlabForm" :model="addOverlapModel" :rules="overLapRules" label-width="135px" size="mini" style="margin-top: 15px"> <el-form ref="overlabForm" :model="addOverlapModel" :rules="overLapRules" label-width="135px" size="mini" style="margin-top: 15px">
<el-form-item :label="$t('map.routeProtectsData') + ':'" prop="sectionList"> <el-form-item label="保护区段(非CTC)" prop="sectionList">
<el-select v-model="addOverlapModel.sectionList" multiple clearable :filterable="true"> <el-select v-model="addOverlapModel.sectionList" multiple clearable :filterable="true">
<el-option <el-option
v-for="item in sectionList" v-for="item in sectionList"
@ -88,6 +88,17 @@
@click="hover('routeOverlapSectionList')" @click="hover('routeOverlapSectionList')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item label="保护区段(CTC)" prop="logicList">
<el-select v-model="addOverlapModel.logicList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
:label="item.name + ' (' + item.code + ')'"
:value="item.code"
/>
</el-select>
<el-button :type="field === 'routeOverlapLogicList'?'danger':'primary'" @click="hover('routeOverlapLogicList')">{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.continueProtectSwitchData') + ':'" prop="switchPositionList"> <el-form-item :label="$t('map.continueProtectSwitchData') + ':'" prop="switchPositionList">
<el-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')"> <el-select v-model="overlapCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
<el-option <el-option
@ -188,7 +199,8 @@ export default {
}, },
addOverlapModel: { addOverlapModel: {
parentIndex: '', parentIndex: '',
sectionList: [], // logicList: [], // ctc
sectionList: [], // ctc
switchPositionList: [] // switchPositionList: [] //
}, },
overlapType: '', overlapType: '',
@ -305,6 +317,13 @@ export default {
} else if ( sectionIndex !== -1 ) { } else if ( sectionIndex !== -1 ) {
this.addOverlapModel.sectionList.splice(sectionIndex, 1); this.addOverlapModel.sectionList.splice(sectionIndex, 1);
} }
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'routeOverlapLogicList'.toUpperCase()) {
const sectionIndex = this.addOverlapModel.logicList.indexOf(selected.code);
if ((selected.type === '01' || selected.type === '03' || selected.type === '02') && sectionIndex === -1) {
this.addOverlapModel.logicList.push(selected.code);
} else if (sectionIndex !== -1) {
this.addOverlapModel.logicList.splice(sectionIndex, 1);
}
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchPositionList'.toUpperCase()) { } else if (selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field.toUpperCase() === 'switchPositionList'.toUpperCase()) {
this.overlapCode = selected.code; this.overlapCode = selected.code;
} }
@ -385,6 +404,7 @@ export default {
if (this.addOverlapModel.parentIndex || this.addOverlapModel.parentIndex === 0 ) { if (this.addOverlapModel.parentIndex || this.addOverlapModel.parentIndex === 0 ) {
this.addModel.pathList[this.addOverlapModel.parentIndex] = { this.addModel.pathList[this.addOverlapModel.parentIndex] = {
sectionList:this.addOverlapModel.sectionList, sectionList:this.addOverlapModel.sectionList,
logicList: this.addOverlapModel.logicList,
switchPositionList:this.addOverlapModel.switchPositionList switchPositionList:this.addOverlapModel.switchPositionList
}; };
this.clearOverlab(); this.clearOverlab();
@ -401,6 +421,7 @@ export default {
} else { } else {
this.addModel.pathList.push({ this.addModel.pathList.push({
sectionList:this.addOverlapModel.sectionList, sectionList:this.addOverlapModel.sectionList,
logicList: this.addOverlapModel.logicList,
switchPositionList:this.addOverlapModel.switchPositionList switchPositionList:this.addOverlapModel.switchPositionList
}); });
this.$refs.overlabForm.resetFields(); this.$refs.overlabForm.resetFields();
@ -411,6 +432,7 @@ export default {
this.addOverlapModel = { this.addOverlapModel = {
parentIndex: '', parentIndex: '',
sectionList:[], sectionList:[],
logicList: [],
switchPositionList:[] switchPositionList:[]
}; };
this.overlapCode = ''; this.overlapCode = '';