From 50c43b01df9c5dc3d0dcc39dfae6b403ba1ff7ee Mon Sep 17 00:00:00 2001 From: xiayifan Date: Wed, 29 Jul 2020 10:22:04 +0800 Subject: [PATCH] UI fix multiSelect component limit value does not effect --- .../ui/src/components/multiselectGroup.vue | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/mindinsight/ui/src/components/multiselectGroup.vue b/mindinsight/ui/src/components/multiselectGroup.vue index 51f0977..b6c32f9 100644 --- a/mindinsight/ui/src/components/multiselectGroup.vue +++ b/mindinsight/ui/src/components/multiselectGroup.vue @@ -164,25 +164,26 @@ export default { listSelectAll() { this.operateSelectAll = !this.operateSelectAll; this.multiSelectedItemNames = {}; - this.selectedNumber = 0; // Setting the status of list items if (this.operateSelectAll) { if (this.isLimit) { const loopCount = this.checkListArr.length; for (let i = 0; i < loopCount; i++) { - if (this.selectedNumber >= this.limitNum) { - break; - } const listItem = this.checkListArr[i]; - if (listItem.checked) { - this.selectedNumber++; - if (listItem.show) { + if (this.selectedNumber >= this.limitNum) { + if (listItem.checked && listItem.show) { this.multiSelectedItemNames[listItem.label] = true; } - } else if (listItem.show) { - listItem.checked = true; - this.multiSelectedItemNames[listItem.label] = true; - this.selectedNumber++; + } else { + if (listItem.checked) { + if (listItem.show) { + this.multiSelectedItemNames[listItem.label] = true; + } + } else if (listItem.show) { + listItem.checked = true; + this.multiSelectedItemNames[listItem.label] = true; + this.selectedNumber++; + } } } } else { -- GitLab