diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue
index 1a15e8030..184e69659 100644
--- a/src/views/newMap/newMapdraft/mapoperate/section.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/section.vue
@@ -224,19 +224,6 @@ export default {
}
},
data() {
- var validateLeftSection = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请选择做关联区段'));
- } else {
- const leftSection = this.$store.getters['map/getDeviceByCode'](value);
- if (leftSection.point[0] !== this.selected.point[0]) {
- callback(new Error('所选择关联区段不相邻!'));
- } else {
- callback();
- }
- }
-
- };
return {
questionList: [],
activeName: 'first',
@@ -395,9 +382,9 @@ export default {
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', 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: 'leftSection', label: '左关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
{ prop: 'rightSection', label: '右关联区段', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.PhysicalSectionList},
- { prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList},
{ 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
@@ -467,6 +454,22 @@ export default {
return form;
},
rules() {
+ var validateLeftSection = (rule, value, callback) => {
+ 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 )) {
+ callback(new Error('所选择关联区段不相邻!'));
+ } else {
+ callback();
+ }
+ };
+ var validateRightSection = (rule, value, callback) => {
+ 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 )) {
+ callback(new Error('所选择关联区段不相邻!'));
+ } else {
+ callback();
+ }
+ };
const rules = {
code: [
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
@@ -517,10 +520,10 @@ export default {
{ required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' }
],
leftSection: [
- { required: this.editModel.type === '01', message: '请选择左关联区段', trigger: 'change' }
+ { required: this.editModel.type === '01', validator: validateLeftSection, trigger: 'change' }
],
rightSection: [
- { required: this.editModel.type === '01', message: '请选择右关联区段', trigger: 'change'}
+ { required: this.editModel.type === '01', validator: validateRightSection, trigger: 'change'}
]
};
return rules;
@@ -530,7 +533,6 @@ export default {
if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01'; });
}
- list.unshift({code: '', name: '无'});
return list;
},
ReverseSectionList() {
diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue
index 93d71d1bc..a54b53c18 100644
--- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue
@@ -8,7 +8,7 @@
- {{ $t('map.updateObj') }}
+
{{ $t('map.deleteObj') }}
@@ -133,24 +133,24 @@ export default {
name: this.$t('map.drawData'),
item: [
{ prop: 'code', label: this.$t('map.relStandCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationStandList, change: true, deviceChange: this.deviceChange },
- { prop: 'name', label: this.$t('map.stationstandNameColon'), type: 'input' },
+ { prop: 'name', label: this.$t('map.stationstandNameColon'), type: 'input', change:true, deviceChange:this.updateView },
{ prop: 'position', label: this.$t('map.stationstandPosition'), type: 'coordinate', width: '120px', children: [
- { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
- { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
+ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', change:true, deviceChange:this.updateView },
+ { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', change:true, deviceChange:this.updateView }
] },
- { prop: 'direction', label: this.$t('map.stationstandTopBottom'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.RunDirectionTypeList },
- { prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
- { prop: 'doorLocationType', label: this.$t('map.stationstandDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList },
- { prop: 'hasDoor', label: this.$t('map.stationstandHasDoor'), type: 'checkbox' },
- { prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
- { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' }
+ { prop: 'direction', label: this.$t('map.stationstandTopBottom'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.RunDirectionTypeList, change: true, deviceChange:this.updateView },
+ { prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox', change: true, deviceChange: this.updateView},
+ { prop: 'doorLocationType', label: this.$t('map.stationstandDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList, change: true, deviceChange:this.updateView },
+ { prop: 'hasDoor', label: this.$t('map.stationstandHasDoor'), type: 'checkbox', change: true, deviceChange:this.updateView },
+ { prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px', change:true, deviceChange:this.updateView},
+ { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px', change:true, deviceChange:this.updateView}
]
},
map: {
name: this.$t('map.mapData'),
item: [
- { prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList },
- { prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }
+ { prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView },
+ { prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, change: true, deviceChange:this.updateView }
]
}
}
@@ -229,6 +229,10 @@ export default {
deviceChange(code) {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
+ this.edit();
+ },
+ updateView() {
+ this.edit();
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();