Browse Source

table-scroll

master
xuhuajiao 3 years ago
parent
commit
fae763a161
  1. 46
      src/views/storeManage/warehouse3D/archivesStorage/index.vue
  2. 1
      src/views/storeManage/warehouse3D/fullView/index.vue

46
src/views/storeManage/warehouse3D/archivesStorage/index.vue

@ -89,7 +89,7 @@
<p class="title-arrow"><svg-icon icon-class="menjin" class-name="warehouse-svg" />门禁记录</p>
</h3>
<el-table
ref="table"
ref="table2"
style="min-width: 100%;"
height="100%"
:data="tableData"
@ -112,7 +112,9 @@ export default {
data() {
return {
tableData: [],
iframeWin: null
iframeWin: null,
timer: null, // id
isScroll: false //
}
},
created() {
@ -126,6 +128,9 @@ export default {
_this.deviceState()
}
window.addEventListener('message', this.handleMessageDevice)
this.$nextTick(() => {
this.tableRefScroll()
})
},
methods: {
// data / iframe
@ -189,6 +194,43 @@ export default {
} else {
return ''
}
},
// table
tableRefScroll() {
clearInterval(this.timer) //
const table = this.$refs.table // DOM
const bodyWrapper = table.bodyWrapper // div
this.addTableRefScroll(bodyWrapper)
//
bodyWrapper.onmouseover = () => {
clearInterval(this.timer)
}
//
bodyWrapper.onmouseout = () => {
this.addTableRefScroll(bodyWrapper)
}
},
addTableRefScroll(bodyWrapper) {
let scrollTop = bodyWrapper.scrollTop
this.timer = setInterval(() => {
scrollTop = bodyWrapper.scrollTop
bodyWrapper.scrollTop += 5
if (scrollTop === bodyWrapper.scrollTop) {
if (this.isScroll) {
scrollTop = 0
bodyWrapper.scrollTop = 0
} else {
if (this.flag === 1) {
this.currentPage++
this.handleSearch() //
}
}
}
}, 100)
},
handleSearch() {
//
clearInterval(this.timer)
}
}
}

1
src/views/storeManage/warehouse3D/fullView/index.vue

@ -45,6 +45,7 @@ export default {
return {
tableData: [],
cameraNameId: null
}
},
created() {

Loading…
Cancel
Save