代码调整

This commit is contained in:
joylink_cuiweidong 2019-12-04 13:38:32 +08:00
parent f97bd74c39
commit eb9873e6e5
5 changed files with 14 additions and 17 deletions

View File

@ -63,7 +63,7 @@
:selected="selected"
@updateMapModel="updateMapModel"
@setCenter="setCenter"
@stationSectionCode="stationEnabledTab"
@standStationCode="standStationTab"
/>
</el-tab-pane>
<!-- <el-tab-pane :label="$t('map.zcZoneControl')" class="tab_pane_box" name="ZcControl">
@ -231,7 +231,7 @@ export default {
singlaType: '',
stationType: '',
switchType: '',
stationStand:'',
stationStandType:'',
ViewMode: ViewMode,
LogicalViewTypeList: [
{ code: 'Link', name: this.$t('map.link') }
@ -288,7 +288,9 @@ export default {
this.enabledTab = 'Switch';
} else if (this.singlaType) {
this.enabledTab = 'Signal';
}else if (this.feild) {
} else if (this.stationStandType) {
this.enabledTab = 'StationStand';
} else if (this.feild) {
this.enabledTab = 'Section';
} else {
this.enabledTab = type;
@ -300,6 +302,9 @@ export default {
}
}
},
standStationTab(type) {
this.stationStandType = type;
},
stationEnabledTab(type) {
this.stationType = type;
},

View File

@ -335,9 +335,9 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();
// this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase() && this.field.toUpperCase() != 'selectSingalCode'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.potLampType = selected.potLampType || '01';

View File

@ -193,9 +193,9 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();
// this.$refs.make.resetFields();
if (this.field.toUpperCase() != 'selectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.runPlanName = selected.runPlanName || '';

View File

@ -246,29 +246,21 @@ export default {
},
hover(field) {
this.field = field === this.field ? '' : field;
this.$emit('stationSectionCode', this.field);
this.$emit('standStationCode', this.field);
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();
// this.$refs.make.resetFields();
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
// else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
// this.addModel.stationCode = selected.code;
// }
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'standSelectStationCode'.toUpperCase()) {
this.addModel.stationCode = selected.code;
this.activeName = 'second';
this.field = '';
this.$emit('stationSectionCode', '');
this.$emit('standStationCode', '');
}
// else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'relevanceSectionList'.toUpperCase()) {
// this.fromData.relevanceSectionList.push(selected.code);
// }
},
create() {
this.$refs.make.validate((valid) => {

View File

@ -195,8 +195,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.dataform.resetFields();
if (this.field.toUpperCase() != 'relevanceSectionList'.toUpperCase() && selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'relevanceSectionList'.toUpperCase()) {