定时刷新
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user