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)) })