From 5311ae417df482b275c43062ec99f4e24bc4483a Mon Sep 17 00:00:00 2001 From: LiuJiaNan Date: Thu, 22 Feb 2024 13:52:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=BD=A8=E8=BF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/BI/components/bottom_options.vue | 27 ++++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/views/BI/components/bottom_options.vue b/src/views/BI/components/bottom_options.vue index 802f732..9720bf9 100644 --- a/src/views/BI/components/bottom_options.vue +++ b/src/views/BI/components/bottom_options.vue @@ -370,23 +370,26 @@ const fnBottomOptionsListChange = (item, index) => { rightOption.value = index !== 4; }; const fnBottomChildOptionsListChange = (index, item1, index1) => { + const currentItem = data.bottomOptionsList[index].list[index1]; if (item1.type === "historicalTrajectory") { for (let i = 0; i < data.bottomOptionsList.length; i++) { for (let j = 0; j < data.bottomOptionsList[i].list.length; j++) { - const currentItem = data.bottomOptionsList[i].list[j]; - if (currentItem.type !== item1.type) currentItem.check = false; + const currentForItem = data.bottomOptionsList[i].list[j]; + if (currentForItem.check) { + if (currentForItem.type !== item1.type) currentForItem.check = false; + if (currentForItem.action) currentForItem.action(false, item1.type); + } } } - data.bottomOptionsList[index].list[index1].check = - !data.bottomOptionsList[index].list[index1].check; + currentItem.check = !currentItem.check; isHistoricalTrajectory.value = !isHistoricalTrajectory.value; } else { let isSelf = false; for (let i = 0; i < data.bottomOptionsList.length; i++) { for (let j = 0; j < data.bottomOptionsList[i].list.length; j++) { - const currentItem = data.bottomOptionsList[i].list[j]; - if (currentItem.type === "historicalTrajectory") { - currentItem.check = false; + const currentForItem = data.bottomOptionsList[i].list[j]; + if (currentForItem.type === "historicalTrajectory") { + currentForItem.check = false; isHistoricalTrajectory.value = false; isSelf = true; break; @@ -394,14 +397,8 @@ const fnBottomChildOptionsListChange = (index, item1, index1) => { } if (isSelf) break; } - data.bottomOptionsList[index].list[index1].check = - !data.bottomOptionsList[index].list[index1].check; - if (data.bottomOptionsList[index].list[index1].action) { - data.bottomOptionsList[index].list[index1].action( - data.bottomOptionsList[index].list[index1].check, - item1.type - ); - } + currentItem.check = !currentItem.check; + if (currentItem.action) currentItem.action(currentItem.check, item1.type); } };