From 6e196aeb983274e1dc3cd7193e4446f0be053c76 Mon Sep 17 00:00:00 2001 From: "liujw155@outlook.com" Date: Tue, 21 Dec 2021 10:50:42 +0800 Subject: [PATCH] change linkage methods --- src/pages/site/manage/manage.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/site/manage/manage.vue b/src/pages/site/manage/manage.vue index ab660b4..35738e8 100644 --- a/src/pages/site/manage/manage.vue +++ b/src/pages/site/manage/manage.vue @@ -383,6 +383,8 @@ export default { venueList: _venueList, selectedKey: '_isSelect', linkageKey: 'isLinkage', + linkageIDArrKey: 'link_venue_ids', + linkageIDKey: 'venue_id', }) this.venueList = _venueList; this.$nextTick(_=>{ @@ -401,13 +403,15 @@ export default { venueList = [], // 所有场地 selectedKey = 'selectedKey', // 选中key linkageKey = 'linkageKey', // 联动禁用key + linkageIDArrKey = 'link_venue_ids', + linkageIDKey = 'venue_id', curTag }){ let _curGroupInfo = {...venueList[group]}; for(let i=0; i{ // 单列联动 if(venueList[i].link_venue_ids && venueList[i].link_venue_ids.length == 1){ @@ -415,14 +419,13 @@ export default { } // 多列联动 if(venueList[i].link_venue_ids && venueList[i].link_venue_ids.length > 1){ - let _link_venueLs = venueList.filter(item=> venueList[i].link_venue_ids.includes(item.venue_id)); + let _link_venueLs = venueList.filter(item=> venueList[i].link_venue_ids.includes(item[linkageIDKey])); // 已联动列表选中情况 ex: [ true, false ]; let _link_venueLs_selectedLs = _link_venueLs.map(el=> el['items'][ele._defineIndex] && el['items'][ele._defineIndex][selectedKey]); venueList[i].items[ele._defineIndex][linkageKey] = _link_venueLs_selectedLs.includes(true); // 多场联动,只要有一个被选中就禁止 } }); } - } return venueList || []; },