fix: 修复一开始没数据,更改条件后有数据也刷不出来的问题

This commit is contained in:
chenjinsong
2022-09-06 11:37:56 +08:00
parent 5be4044b51
commit 39fd6f3e7a
2 changed files with 5 additions and 3 deletions

View File

@@ -136,7 +136,6 @@ export default {
mixins: [chartMixin], mixins: [chartMixin],
watch: { watch: {
timeFilter: { timeFilter: {
deep: true,
handler (n) { handler (n) {
this.init() this.init()
} }
@@ -206,6 +205,8 @@ export default {
}) })
this.tableData = tableData this.tableData = tableData
}) })
} else {
this.tableData = []
} }
}).finally(() => { }).finally(() => {
this.toggleLoading(false) this.toggleLoading(false)

View File

@@ -99,12 +99,14 @@ export default {
const packetPercent = get(api.npm.overview.packetRetransPercent, params) const packetPercent = get(api.npm.overview.packetRetransPercent, params)
this.toggleLoading(true) this.toggleLoading(true)
Promise.all([tcp, http, ssl, tcpPercent, packetPercent]).then(res => { Promise.all([tcp, http, ssl, tcpPercent, packetPercent]).then(res => {
this.npmNetworkCycleData = []
res.forEach(t => { res.forEach(t => {
if (t.code === 200) { if (t.code === 200) {
this.npmNetworkCycleData.push(t.data.result) this.npmNetworkCycleData.push(t.data.result)
} }
}) })
}).finally(() => { this.npmNetworkLastCycleQuery()
}).catch(e => {
this.toggleLoading(false) this.toggleLoading(false)
}) })
} }
@@ -266,7 +268,6 @@ export default {
this.chartData = _.cloneDeep(this.chart) this.chartData = _.cloneDeep(this.chart)
} }
this.npmNetworkCycleQuery() this.npmNetworkCycleQuery()
this.npmNetworkLastCycleQuery()
} }
} }
</script> </script>