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