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> <p class="title-arrow"><svg-icon icon-class="menjin" class-name="warehouse-svg" />门禁记录</p>
</h3> </h3>
<el-table <el-table
ref="table"
ref="table2"
style="min-width: 100%;" style="min-width: 100%;"
height="100%" height="100%"
:data="tableData" :data="tableData"
@ -112,7 +112,9 @@ export default {
data() { data() {
return { return {
tableData: [], tableData: [],
iframeWin: null
iframeWin: null,
timer: null, // id
isScroll: false //
} }
}, },
created() { created() {
@ -126,6 +128,9 @@ export default {
_this.deviceState() _this.deviceState()
} }
window.addEventListener('message', this.handleMessageDevice) window.addEventListener('message', this.handleMessageDevice)
this.$nextTick(() => {
this.tableRefScroll()
})
}, },
methods: { methods: {
// data / iframe // data / iframe
@ -189,6 +194,43 @@ export default {
} else { } else {
return '' 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 { return {
tableData: [], tableData: [],
cameraNameId: null cameraNameId: null
} }
}, },
created() { created() {

Loading…
Cancel
Save