From bb24b2a5f66aa342f26d756734cf215456b5a3ec Mon Sep 17 00:00:00 2001 From: "Aeolus.Zhang" Date: Sun, 3 Apr 2022 16:42:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=A4=8D=E9=80=89=E4=B8=8B=E6=8B=89=E6=A1=86=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E5=8A=A0=E8=BD=BD=E6=83=85=E5=86=B5=E4=B8=8B=E5=85=A8?= =?UTF-8?q?=E9=80=89=E5=90=8E,=E5=8F=96=E6=B6=88=E6=9F=90=E9=80=89?= =?UTF-8?q?=E9=A1=B9,=E5=86=8D=E9=80=89=E4=B8=8A=E8=AF=A5=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=85=A8=E9=80=89=E6=A1=86=E4=B8=BA=E5=8D=8A=E9=80=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/list/list.select.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 12f71e383..12037b9a9 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -93,10 +93,23 @@ BI.SelectList = BI.inherit(BI.Widget, { var notSelectLength = this.getAllLeaves().length - selectLength; var hasNext = this.list.hasNext(); var isAlreadyAllSelected = this.toolbar.isSelected(); - var isHalf = selectLength > 0 && (notSelectLength > 0 || (!isAlreadyAllSelected && hasNext)); - isHalf = isHalf || (notSelectLength > 0 && hasNext && isAlreadyAllSelected); + var isHalf = selectLength > 0 && notSelectLength > 0; + var allSelected = isAlreadyAllSelected; + + if (this.isAllSelected() === false) { + hasNext && (isHalf = selectLength > 0); + if (!isAlreadyAllSelected && notSelectLength === 0 && !hasNext) { + allSelected = true; + } + } else { + hasNext && (isHalf = notSelectLength > 0); + if (!isAlreadyAllSelected && notSelectLength === 0) { + allSelected = true; + } + } + this.toolbar.setHalfSelected(isHalf); - !isHalf && this.toolbar.setSelected(selectLength > 0 && notSelectLength <= 0 && (!hasNext || isAlreadyAllSelected)); + !isHalf && this.toolbar.setSelected(allSelected); }, setAllSelected: function (v) {