|
|
@ -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 |
|
|
|
} |
|
|
|