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

20
src/views/components/WarehouseWarning.vue

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

Loading…
Cancel
Save