mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 18:34:50 +08:00
调整shift多选时获取首尾位置的方法
This commit is contained in:
@@ -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))
|
||||
})
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user