修复:调整左右关联区段list数据为计轴区段和道岔区段

This commit is contained in:
fan 2019-12-23 10:15:45 +08:00
parent 4677be1b32
commit 065a3ba72e

View File

@ -41,7 +41,7 @@
</el-form-item>
<el-form-item v-if="createModel.type == '03'" :label="$t('map.leftAssociatedSection')" prop="leftSectionCode">
<el-select v-model="createModel.leftSectionCode" filterable>
<el-option v-for="item in PhysicalSectionList" :key="item.code" :label="item.name" :value="item.code" />
<el-option v-for="item in switchAndPhySicalSectionList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
<el-button
:type="field == 'getSectionStart' ? 'danger' : 'primary'"
@ -54,7 +54,7 @@
</el-form-item>
<el-form-item v-if="createModel.type == '02' || createModel.type == '04'" label="起始区段:" prop="leftSectionCode">
<el-select v-model="createModel.leftSectionCode" filterable>
<el-option v-for="item in PhysicalSectionList" :key="item.code" :label="item.name" :value="item.code" />
<el-option v-for="item in switchAndPhySicalSectionList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
<el-button
:type="field == 'getSectionStart' ? 'danger' : 'primary'"
@ -65,7 +65,7 @@
<el-form-item v-if="createModel.type == '02'" :label="$t('map.rightAssociatedSection')" prop="rightSectionCode">
<el-select v-model="createModel.rightSectionCode" filterable>
<el-option
v-for="item in PhysicalSectionList"
v-for="item in switchAndPhySicalSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
@ -381,8 +381,8 @@ export default {
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] },
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList},
{ prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.PhysicalSectionList, hover: this.hover, buttonType: 'leftSection', buttonShowType: this.isLeftSectionButtonShow, isHidden: !this.hasAssociatedSection},
{ prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.PhysicalSectionList, hover: this.hover, buttonType: 'rightSection', buttonShowType: this.isRightSectionButtonShow, isHidden: !this.hasAssociatedSection},
{ prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'leftSection', buttonShowType: this.isLeftSectionButtonShow, isHidden: !this.hasAssociatedSection},
{ prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'rightSection', buttonShowType: this.isRightSectionButtonShow, isHidden: !this.hasAssociatedSection},
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
{ prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
{ prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
@ -521,6 +521,13 @@ export default {
}
return list;
},
switchAndPhySicalSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01' || elem.type === '03'; });
}
return list;
},
switchSectionList() {
let list = [];
if (this.sectionList && this.sectionList.length) {
@ -1080,7 +1087,7 @@ export default {
const models = [];
let rsection = null;
let lsection = null;
this.PhysicalSectionList.forEach(section => {
this.switchAndPhySicalSectionList.forEach(section => {
if (section.code === this.mergeModel.lsectioncode) {
lsection = section;
}
@ -1187,13 +1194,6 @@ export default {
this.$emit('updateMapModel', models);
}
}
this.PhysicalSectionList.forEach(lsection => {
if (lsection.code === this.mergeModel.lsectioncode) {
this.PhysicalSectionList.forEach(rsection => {
});
}
});
}
}
});