Commit 088af825 authored by 张伯涛's avatar 张伯涛

首页定时任务bug修改

parent bb5e4780
......@@ -629,6 +629,8 @@ export default {
name: 'HomePageTable',
data() {
return {
intercal: undefined,
intercalType: false,
queryParams1: {
lineNo: ''
},
......@@ -714,15 +716,17 @@ export default {
}
},
created() {
this.getStaTable()
this.intercalType = true
this.intercal = setInterval(_ => {
this.getStaTable()
}, 2000)
},
mounted() {
},
beforeDestroy() {
this.intercalType = false
clearInterval(this.intercal)
},
destroyed() {
clearInterval(this.intercal)
this.intercal = undefined
},
methods: {
/**
......@@ -853,11 +857,6 @@ export default {
},
// 获取表数据
getStaTable() {
this.intercal = setInterval(_ => {
this.getStaTableChild()
}, 2000)
},
getStaTableChild() {
clearInterval(this.intercal)
const params = {}
getTableData(params).then(res => {
......@@ -888,10 +887,18 @@ export default {
// this.monitoringData[i].tableData.push(row)
}
if (this.intercalType) {
this.intercal = setInterval(_ => {
this.getStaTable()
}, 2000)
}
console.log('this.monitoringData', this.monitoringData)
this.getStaTable()
}).catch(_ => {
this.getStaTable()
if (this.intercalType) {
this.intercal = setInterval(_ => {
this.getStaTable()
}, 2000)
}
})
},
openModel(row, item, data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment