|
|
|
@ -122,30 +122,32 @@ export default create({
@@ -122,30 +122,32 @@ export default create({
|
|
|
|
|
}, this.getItemRefs()); |
|
|
|
|
}, |
|
|
|
|
setTime () { |
|
|
|
|
clearInterval(this.scrollCheck); |
|
|
|
|
this.headerHeight = this.$refs.table.$refs.headerWrapper ? parseInt(this.$refs.table.$refs.headerWrapper.clientHeight) : 0 |
|
|
|
|
const table = this.$refs.table |
|
|
|
|
const divData = table.$refs.bodyWrapper.querySelector('.el-scrollbar__wrap') |
|
|
|
|
const speed = this.scrollSpeed |
|
|
|
|
let top = 0 |
|
|
|
|
if (this.scroll) { |
|
|
|
|
this.scrollCheck = setInterval(() => { |
|
|
|
|
top = top + speed |
|
|
|
|
divData.scrollTop += speed; |
|
|
|
|
if (divData.clientHeight + divData.scrollTop == divData.scrollHeight) { |
|
|
|
|
divData.scrollTop = 0 |
|
|
|
|
} |
|
|
|
|
if (top >= this.cellHeight && this.scrollTime) { |
|
|
|
|
divData.scrollTop = divData.scrollTop - (top - this.cellHeight) |
|
|
|
|
clearInterval(this.scrollCheck); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.setTime() |
|
|
|
|
}, this.scrollTime) |
|
|
|
|
} |
|
|
|
|
}, 20) |
|
|
|
|
} else { |
|
|
|
|
divData.scrollTop = 0 |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
clearInterval(this.scrollCheck) |
|
|
|
|
this.headerHeight = this.$refs.table.$refs.headerWrapper ? parseInt(this.$refs.table.$refs.headerWrapper.clientHeight) : 0 |
|
|
|
|
const table = this.$refs.table |
|
|
|
|
const divData = table.$refs.bodyWrapper.querySelector('.el-scrollbar__wrap') |
|
|
|
|
const speed = this.scrollSpeed |
|
|
|
|
let top = 0 |
|
|
|
|
if (this.scroll) { |
|
|
|
|
this.scrollCheck = setInterval(() => { |
|
|
|
|
top = top + speed |
|
|
|
|
divData.scrollTop += speed |
|
|
|
|
if (divData.clientHeight + divData.scrollTop == divData.scrollHeight) { |
|
|
|
|
divData.scrollTop = 0 |
|
|
|
|
} |
|
|
|
|
if (top >= this.cellHeight && this.scrollTime) { |
|
|
|
|
divData.scrollTop = divData.scrollTop - (top - this.cellHeight) |
|
|
|
|
clearInterval(this.scrollCheck) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.setTime() |
|
|
|
|
}, this.scrollTime) |
|
|
|
|
} |
|
|
|
|
}, 20) |
|
|
|
|
} else { |
|
|
|
|
divData.scrollTop = 0 |
|
|
|
|
} |
|
|
|
|
} catch (e) {} |
|
|
|
|
}, |
|
|
|
|
cellStyle ({ row, column, rowIndex, columnIndex }) { |
|
|
|
|
return { |
|
|
|
|