Browse Source

门禁记录和报警记录滚动

master
z_yu 2 years ago
parent
commit
6b34293730
  1. 17
      src/views/components/SecurityDoor.vue
  2. 20
      src/views/components/WarehouseWarning.vue

17
src/views/components/SecurityDoor.vue

@ -40,7 +40,6 @@ export default {
return { return {
tableData: [], // tableData: [], //
scrollTimer: null, scrollTimer: null,
showComplete: false, //
getDataTimer: null getDataTimer: null
} }
}, },
@ -52,19 +51,10 @@ export default {
}, },
created() { created() {
this.getSecuritydoor() this.getSecuritydoor()
this.getDataTimer = setInterval(() => {
console.log('SecurityDoor', this.showComplete)
if (this.showComplete) {
this.getSecuritydoor()
this.showComplete = false
}
}, 1000 * 30)
}, },
destroyed() { destroyed() {
clearInterval(this.scrollTimer) clearInterval(this.scrollTimer)
this.scrollTimer = null this.scrollTimer = null
clearInterval(this.getDataTimer)
this.getDataTimer = null
}, },
methods: { methods: {
// //
@ -94,7 +84,9 @@ export default {
this.addTableRefScroll(bodyWrapper) this.addTableRefScroll(bodyWrapper)
} }
} else { } else {
this.showComplete = true
this.scrollTimer = setInterval(() => {
this.getSecuritydoor()
}, 1000 * 3 * this.tableData.length)
} }
}, },
addTableRefScroll(bodyWrapper) { addTableRefScroll(bodyWrapper) {
@ -103,8 +95,7 @@ export default {
this.scrollTimer = setInterval(() => { this.scrollTimer = setInterval(() => {
// scrollTop = bodyWrapper.scrollTop // scrollTop = bodyWrapper.scrollTop
if (bodyWrapper.scrollTop + this.wrapperHeight >= this.tableData.length * 40) { if (bodyWrapper.scrollTop + this.wrapperHeight >= this.tableData.length * 40) {
bodyWrapper.scrollTop = 0
this.showComplete = true
this.getSecuritydoor()
} else { } else {
bodyWrapper.scrollTop += this.displayNum * 40 bodyWrapper.scrollTop += this.displayNum * 40
} }

20
src/views/components/WarehouseWarning.vue

@ -36,9 +36,7 @@ export default {
data() { data() {
return { return {
tableData: [], // tableData: [], //
scrollTimer: null,
showComplete: false, //
getDataTimer: null
scrollTimer: null
} }
}, },
watch: { watch: {
@ -49,19 +47,10 @@ export default {
}, },
created() { created() {
this.getAlarmInfo() this.getAlarmInfo()
this.getDataTimer = setInterval(() => {
console.log('WarehouseWarning', this.showComplete)
if (this.showComplete) {
this.getAlarmInfo()
this.showComplete = false
}
}, 1000 * 30)
}, },
destroyed() { destroyed() {
clearInterval(this.scrollTimer) clearInterval(this.scrollTimer)
this.scrollTimer = null this.scrollTimer = null
clearInterval(this.getDataTimer)
this.getDataTimer = null
}, },
methods: { methods: {
// //
@ -91,7 +80,9 @@ export default {
this.addTableRefScroll(bodyWrapper) this.addTableRefScroll(bodyWrapper)
} }
} else { } else {
this.showComplete = true
this.scrollTimer = setInterval(() => {
this.getAlarmInfo()
}, 1000 * 3 * this.tableData.length)
} }
}, },
addTableRefScroll(bodyWrapper) { addTableRefScroll(bodyWrapper) {
@ -100,8 +91,7 @@ export default {
this.scrollTimer = setInterval(() => { this.scrollTimer = setInterval(() => {
// scrollTop = bodyWrapper.scrollTop // scrollTop = bodyWrapper.scrollTop
if (bodyWrapper.scrollTop + this.wrapperHeight >= this.tableData.length * 40) { if (bodyWrapper.scrollTop + this.wrapperHeight >= this.tableData.length * 40) {
bodyWrapper.scrollTop = 0
this.showComplete = true
this.getAlarmInfo()
} else { } else {
bodyWrapper.scrollTop += this.displayNum * 40 bodyWrapper.scrollTop += this.displayNum * 40
} }

Loading…
Cancel
Save