新版地图 绘图 交路代码调整

This commit is contained in:
joylink_cuiweidong 2020-04-30 18:04:59 +08:00
parent 7460abd1f1
commit 101e58118a
3 changed files with 29 additions and 10 deletions

View File

@ -170,10 +170,10 @@ export default {
this.$emit('selectView', 'draft'); this.$emit('selectView', 'draft');
}, },
tabBeforeLeave(activeName, oldActiveName) { tabBeforeLeave(activeName, oldActiveName) {
if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel') { if (oldActiveName === 'route' || oldActiveName === 'signal' || oldActiveName == 'runLevel' || oldActiveName == 'routing') {
this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false); this.$refs[this.enabledTabMenu[oldActiveName]].batchSectionListFocus(false);
} }
if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel') { if (activeName === 'route' || activeName === 'signal' || activeName == 'runLevel' || activeName == 'routing') {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true); this.$refs[this.enabledTabMenu[activeName]].batchSectionListFocus(true);
}); });

View File

@ -78,6 +78,12 @@ export default {
}, },
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
},
initLoad() {
this.$refs.routeEdit.batchSectionListFocus(true);
},
batchSectionListFocus(flag) {
this.$refs.routeEdit.batchSectionListFocus(flag);
} }
} }
}; };

View File

@ -276,16 +276,16 @@ export default {
} }
}, },
'addModel.parkSectionCodeList':function(val, old) { 'addModel.parkSectionCodeList':function(val, old) {
val.forEach(each=>{ this.changeSectionSelected(val, true);
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
section.instance.drawBatchSelected(section, 'routingSection');
});
} }
}, },
mounted() { mounted() {
this.rowDrop(); this.rowDrop();
}, },
beforeDestroy() {
// debugger;
},
methods: { methods: {
// //
rowDrop() { rowDrop() {
@ -542,14 +542,27 @@ export default {
} }
}); });
}, },
clear() { batchSectionListFocus(flag) {
if (this.$refs && this.$refs.form && this.mapInfo) { this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
if (this.addModel.parkSectionCodeList.length > 0) { },
this.addModel.parkSectionCodeList.forEach(each=>{ changeSectionSelected(selectedList, flag) {
if (this.addModel.parkSectionCodeList.length > 0) {
if (flag) {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
section.instance.drawBatchSelected(section, 'routingSection');
});
} else {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode); const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
section.instance.drawBatchSelected(section, ''); section.instance.drawBatchSelected(section, '');
}); });
} }
}
},
clear() {
if (this.$refs && this.$refs.form && this.mapInfo) {
this.changeSectionSelected(this.addModel.parkSectionCodeList, false);
delete this.addModel.id; delete this.addModel.id;
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.addModel.mapId = this.mapInfo.id; this.addModel.mapId = this.mapInfo.id;