refresh
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@ import Vue from 'vue'
|
||||
import App from './App'
|
||||
import router from './router'
|
||||
import store from './vuex/store'
|
||||
// import './style/reset.css'
|
||||
import './style/reset.css'
|
||||
import './style/layout.styl'
|
||||
import * as echarts from 'echarts'
|
||||
import 'default-passive-events'
|
||||
|
||||
@@ -27,6 +27,9 @@ export default {
|
||||
name: 'PointStatus',
|
||||
data () {
|
||||
return {
|
||||
timeOut: null,
|
||||
interTime: this.$store.getters.setTime,
|
||||
timer: null,
|
||||
bgUrl: '',
|
||||
retData: []
|
||||
// retData: [
|
||||
@@ -45,8 +48,18 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.initData()
|
||||
this.refresh()
|
||||
},
|
||||
beforeDestroy () {
|
||||
clearInterval(this.timer)
|
||||
clearInterval(this.timeOut)
|
||||
},
|
||||
methods: {
|
||||
refresh () {
|
||||
this.timer = setInterval(() => {
|
||||
this.initData()
|
||||
}, this.interTime)
|
||||
},
|
||||
async initData () {
|
||||
let res = await dwzt()
|
||||
clearInterval(this.timeOut)
|
||||
|
||||
Reference in New Issue
Block a user