From 03775b091d7e44bb338e1d4519d74e4dbe45a41a Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Tue, 17 Nov 2020 23:17:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4shift=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E6=97=B6=E8=8E=B7=E5=8F=96=E9=A6=96=E5=B0=BE=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditSites.vue | 6 +++--- src/components/IPTV.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/EditSites.vue b/src/components/EditSites.vue index b8bf07e..88c7e0b 100644 --- a/src/components/EditSites.vue +++ b/src/components/EditSites.vue @@ -199,9 +199,9 @@ export default { selectionCellClick (selection, row) { 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) - const selections = this.sites.slice(start, end) + const start = this.sites.findIndex(e => e.id === Math.min(this.selectionBegin, this.selectionEnd)) + const end = this.sites.findIndex(e => e.id === Math.max(this.selectionBegin, this.selectionEnd)) + const selections = this.sites.slice(start, end + 1) this.$nextTick(() => { selections.forEach(e => this.$refs.editSitesTable.toggleRowSelection(e, true)) }) diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue index 4447d70..7f409d1 100644 --- a/src/components/IPTV.vue +++ b/src/components/IPTV.vue @@ -203,9 +203,9 @@ export default { selectionCellClick (selection, row) { if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) { this.selectionEnd = row.id - const start = Math.min(this.selectionBegin, this.selectionEnd) - 1 - this.iptvList.length - const end = Math.max(this.selectionBegin, this.selectionEnd) - this.iptvList.length - const selections = this.channelList.slice(start, end) // 多选时强制不让展开 + const start = this.channelList.findIndex(e => e.id === Math.min(this.selectionBegin, this.selectionEnd)) + const end = this.channelList.findIndex(e => e.id === Math.max(this.selectionBegin, this.selectionEnd)) + const selections = this.channelList.slice(start, end + 1) // 多选时强制不让展开 this.$nextTick(() => { selections.forEach(e => this.$refs.iptvTable.toggleRowSelection(e, true)) })