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 App from './App'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './vuex/store'
|
import store from './vuex/store'
|
||||||
// import './style/reset.css'
|
import './style/reset.css'
|
||||||
import './style/layout.styl'
|
import './style/layout.styl'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import 'default-passive-events'
|
import 'default-passive-events'
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ export default {
|
|||||||
name: 'PointStatus',
|
name: 'PointStatus',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
timeOut: null,
|
||||||
|
interTime: this.$store.getters.setTime,
|
||||||
|
timer: null,
|
||||||
bgUrl: '',
|
bgUrl: '',
|
||||||
retData: []
|
retData: []
|
||||||
// retData: [
|
// retData: [
|
||||||
@@ -45,8 +48,18 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.initData()
|
this.initData()
|
||||||
|
this.refresh()
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
clearInterval(this.timer)
|
||||||
|
clearInterval(this.timeOut)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
refresh () {
|
||||||
|
this.timer = setInterval(() => {
|
||||||
|
this.initData()
|
||||||
|
}, this.interTime)
|
||||||
|
},
|
||||||
async initData () {
|
async initData () {
|
||||||
let res = await dwzt()
|
let res = await dwzt()
|
||||||
clearInterval(this.timeOut)
|
clearInterval(this.timeOut)
|
||||||
|
|||||||
Reference in New Issue
Block a user