关联关系select添加可清除功能
This commit is contained in:
parent
4da5ce2e52
commit
2a851dc51f
@ -12,6 +12,7 @@
|
|||||||
filterable
|
filterable
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
|
:clearable="item.clearable"
|
||||||
@change="item.deviceChange"
|
@change="item.deviceChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -28,6 +29,7 @@
|
|||||||
filterable
|
filterable
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
|
:clearable="item.clearable"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="option in item.options"
|
v-for="option in item.options"
|
||||||
|
@ -383,8 +383,8 @@ export default {
|
|||||||
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
{ 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: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList},
|
||||||
{ prop: 'leftSection', label: '左关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
|
{ prop: 'leftSection', label: '左关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', clearable: true, options: this.PhysicalSectionList},
|
||||||
{ prop: 'rightSection', label: '右关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
|
{ prop: 'rightSection', label: '右关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', clearable: true, options: this.PhysicalSectionList},
|
||||||
{ 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: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
|
||||||
|
|
||||||
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
|
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
|
||||||
@ -458,6 +458,8 @@ export default {
|
|||||||
const leftSection = this.$store.getters['map/getDeviceByCode'](value);
|
const leftSection = this.$store.getters['map/getDeviceByCode'](value);
|
||||||
if (leftSection && (leftSection.points[1].x !== this.selected.points[0].x || leftSection.points[1].y !== this.selected.points[0].y )) {
|
if (leftSection && (leftSection.points[1].x !== this.selected.points[0].x || leftSection.points[1].y !== this.selected.points[0].y )) {
|
||||||
callback(new Error('所选择关联区段不相邻!'));
|
callback(new Error('所选择关联区段不相邻!'));
|
||||||
|
// } else if (this.editModel.type === '03' && !this.editModel.rightSection && !value) {
|
||||||
|
// callback(new Error('道岔区段需有一侧关联区段'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
@ -466,6 +468,8 @@ export default {
|
|||||||
const rightSection = this.$store.getters['map/getDeviceByCode'](value);
|
const rightSection = this.$store.getters['map/getDeviceByCode'](value);
|
||||||
if (rightSection && (rightSection.points[0].x !== this.selected.points[1].x || rightSection.points[0].y !== this.selected.points[1].y )) {
|
if (rightSection && (rightSection.points[0].x !== this.selected.points[1].x || rightSection.points[0].y !== this.selected.points[1].y )) {
|
||||||
callback(new Error('所选择关联区段不相邻!'));
|
callback(new Error('所选择关联区段不相邻!'));
|
||||||
|
// } else if (this.editModel.type === '03' && !this.editModel.leftSection && !value) {
|
||||||
|
// callback(new Error('道岔区段需有一侧关联区段'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user