调整车站筛选

This commit is contained in:
zyy 2020-11-06 17:00:41 +08:00
parent 6f4b4fa6dd
commit 226abef552
4 changed files with 48 additions and 35 deletions

View File

@ -107,7 +107,8 @@ export default {
field: '',
oldLeftSectionCode: '',
oldRightSectionCode: '',
tipInfoList: []
tipInfoList: [],
centralizedStationList: []
};
},
computed: {
@ -369,9 +370,6 @@ export default {
return this.$store.state.map.map.skinVO.code === '03';
}
return false;
},
centralizedStationList() {
return this.stationList.filter(station => station.centralized);
}
},
watch: {
@ -402,9 +400,14 @@ export default {
this.editModel.roadType = null;
}
},
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station => station.centralized);
}
},
deviceSelect(selected) {
//
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
if (selected && selected._type === 'Section') {
if (this.field === 'leftSection') {
if (selected.type === '01' || selected.type === '03') {
this.editModel.leftSectionCode = selected.code;
@ -423,6 +426,7 @@ export default {
return;
}
this.clear();
this.handleInit();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.oldPoint = selected.points;

View File

@ -44,7 +44,7 @@ export default {
{ code: true, name: '向右' }
],
SignalLeftOrRightList: [],
CentralizedStationList:[],
// CentralizedStationList:[],
mergeRules: {
sectionCode: [
{ required: true, message: this.$t('rules.selectPhysicalExtentName'), trigger: 'change' }
@ -87,6 +87,13 @@ export default {
});
return list;
},
ciStationList() {
let list = [];
list = this.stationList.filter(station=>{
return station.ciStation;
});
return list;
},
isButtonType() {
return this.field == 'selectSingalCode';
},
@ -104,7 +111,7 @@ export default {
{ prop: 'right', label: this.$t('map.signalDirectionTypeX'), type: 'radio', optionLabel: 'name', optionValue:'code', border:true, radioList: this.SignalDirectionList},
{ prop: 'positionType', label: this.$t('map.positionType'), type: 'radio', optionLabel: 'name', optionValue:'code', border:true, radioList: this.SignalPositionTypeList},
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList},
{ prop: 'interlockStationCode', label: '所属联锁站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList}
{ prop: 'interlockStationCode', label: '所属联锁站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.ciStationList}
]
}
}

View File

@ -266,7 +266,9 @@ export default {
},
lampPositionModel: {
lampPositionType: ''
}
},
centralizedStationList: [], //
ciStationList: [] //
};
},
computed: {
@ -293,20 +295,6 @@ export default {
}
return list;
},
centralizedStationList() {
let list = [];
list = this.stationList.filter(station=>{
return station.centralized;
});
return list;
},
ciStationList() {
let list = [];
list = this.stationList.filter(station=> {
return station.ciStation;
});
return list;
},
form() {
return {
labelWidth: '150px',
@ -426,6 +414,12 @@ export default {
});
},
methods: {
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station=> station.centralized);
this.ciStationList = this.stationList.filter(station=> station.ciStation);
}
},
hover(field) {
this.field = field == this.field ? '' : field;
this.signalSectionCode(this.field);
@ -435,12 +429,13 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'Signal'.toUpperCase() && (this.field != 'selectSingalCode' && this.field != 'signalCodesType' && this.field != 'signalIgnoreRouteEnd' && this.field != 'signalCodes')) {
if (selected && selected._type == 'Signal' && (this.field != 'selectSingalCode' && this.field != 'signalCodesType' && this.field != 'signalIgnoreRouteEnd' && this.field != 'signalCodes')) {
this.handleInit();
this.editModel = getModel('Signal');
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
} else if (selected && selected._type.toUpperCase() == 'Section'.toUpperCase() && this.field == 'selectSingalCode') {
} else if (selected && selected._type == 'Section' && this.field == 'selectSingalCode') {
if (selected.type == '01' || selected.type === '03') {
this.$refs.createSignal.setSectionCode(selected.code);
} else if (selected.type == '02') {
@ -464,12 +459,12 @@ export default {
this.signalStationModel.signalLists.push(selected.code);
}
this.activeName = 'three';
} else if (selected && selected._type === 'Signal' && this.field == 'signalIgnoreRouteEnd') {
} else if (selected && selected._type == 'Signal' && this.field == 'signalIgnoreRouteEnd') {
if (!this.editModel.ignoreRouteEnd.includes(selected.code) && this.editModel.code != selected.code) {
this.editModel.ignoreRouteEnd.push(selected.code);
}
this.activeName = 'first';
} else if (selected && selected._type === 'Signal' && this.field == 'signalCodes') {
} else if (selected && selected._type == 'Signal' && this.field == 'signalCodes') {
if (!this.ciModelForm.signalList.includes(selected.code)) {
this.ciModelForm.signalList.push(selected.code);
}

View File

@ -21,7 +21,8 @@ export default {
},
data() {
return {
editModel: getModel('Switch')
editModel: getModel('Switch'),
centralizedStationList: []
};
},
computed: {
@ -98,21 +99,27 @@ export default {
'switchList',
'stationList',
'lineCode'
]),
centralizedStationList() {
let list = [];
list = this.stationList.filter(station=>{
return station.centralized;
});
return list;
}
])
// centralizedStationList() {
// let list = [];
// list = this.stationList.filter(station=>{
// return station.centralized;
// });
// return list;
// }
},
methods:{
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station=> station.centralized );
}
},
deviceChange(code) {
this.$emit('setCenter', code);
this.setModel(this.$store.getters['map/getDeviceByCode'](code));
},
setModel(data) {
this.handleInit();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.editModel = deepAssign(this.editModel, data);
},