定时刷新

This commit is contained in:
蔡玲
2024-11-11 13:25:34 +08:00
parent 4c1380cf23
commit afbe83a8a5

View File

@@ -142,6 +142,7 @@ export default {
},
data () {
return {
timer: null,
options1: [],
sCode: '',
nCode: '',
@@ -176,9 +177,15 @@ export default {
mounted () {
this._queryAllPoints()
this._queryMaterials()
this._queryAreas()
// this._queryAreas()
this.refresh()
this._queryTaskIds()
},
beforeDestroy () {
if (this.timer !== null) {
clearInterval(this.timer)
}
},
methods: {
back () {
let flag = !!(document.fullscreenElement || document.mozFullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement)
@@ -195,6 +202,12 @@ export default {
}
this.$router.push('/setup')
},
refresh () {
this._queryAreas()
this.timer = setInterval(() => {
this._queryAreas()
}, 3000)
},
async _queryAllPoints () {
let res = await queryAllPoints()
this.options1 = [...res]