From df3b43d8ac62efe46dc443b1896bb9ee55c1b708 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Sun, 8 Nov 2020 01:07:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E4=B8=80=E6=AD=A5=E5=AE=8C=E5=96=84sh?= =?UTF-8?q?ift=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditSites.vue | 8 ++++++-- src/components/IPTV.vue | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/EditSites.vue b/src/components/EditSites.vue index 3ac1bcc..5e826cb 100644 --- a/src/components/EditSites.vue +++ b/src/components/EditSites.vue @@ -198,7 +198,7 @@ export default { }) }, selectionCellClick (selection, row) { - if (this.shiftDown && this.selectionBegin !== '') { + if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) { this.selectionEnd = row.id const start = Math.min(this.selectionBegin, this.selectionEnd) - 1 const end = Math.max(this.selectionBegin, this.selectionEnd) @@ -209,7 +209,11 @@ export default { this.selectionBegin = this.selectionEnd = '' return } - this.selectionBegin = row.id + if (selection.includes(row)) { + this.selectionBegin = row.id + } else { + this.selectionBegin = '' + } }, handleSelectionChange (rows) { this.multipleSelection = rows diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue index 74d4236..add4643 100644 --- a/src/components/IPTV.vue +++ b/src/components/IPTV.vue @@ -191,7 +191,7 @@ export default { return a.group.localeCompare(b.group, 'zh') }, selectionCellClick (selection, row) { - if (this.shiftDown && this.selectionBegin !== '') { + if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) { this.selectionEnd = row.id const start = Math.min(this.selectionBegin, this.selectionEnd) - 1 const end = Math.max(this.selectionBegin, this.selectionEnd) @@ -202,7 +202,11 @@ export default { this.selectionBegin = this.selectionEnd = '' return } - this.selectionBegin = row.id + if (selection.includes(row)) { + this.selectionBegin = row.id + } else { + this.selectionBegin = '' + } }, handleSelectionChange (rows) { this.multipleSelection = rows