diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue index 036682a2c..ee603e5f9 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue @@ -22,7 +22,12 @@ @@ -51,7 +56,8 @@ export default { ], expressions: [''], matchSymbol: '|=', - matchContent: '' + matchContent: '', + loading: true } }, methods: { @@ -93,10 +99,8 @@ export default { reader.readAsText(error.response.data) }) }, - queryLogData (limit) { // log的chart和table是一个请求 - if (!limit) { - limit = this.$refs.logDetail.getLimit() - } + queryLogData (limit = 1000) { // log的chart和table是一个请求 + this.loading = true if (this.expressions.length > 0) { const requestArr = [] this.expressions.forEach((item, index) => { @@ -108,7 +112,11 @@ export default { }) axios.all(requestArr).then(res => { this.logData = res.map(r => r.data) + }).finally(() => { + this.loading = false }) + } else { + this.loading = false } } }, diff --git a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue index 6505b9021..3ca927935 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue @@ -265,8 +265,9 @@ export default { useUTC: false // 使用本地时间 } this.myChart.clear() + this.myChart.setOption(option) this.$nextTick(() => { - this.myChart.setOption(option) + this.myChart.resize() }) /* 点击legend * 1.当前如果是全高亮状态,则全部置灰,只留被点击的legend高亮 @@ -416,7 +417,9 @@ export default { const { tableData, tableChartData } = this.applyFilter(logData, this.operations) // 应用operation区域的过滤项 this.tableData = tableData this.tableChartData = tableChartData - this.loadChart() + this.$nextTick(() => { + this.loadChart() + }) } }, operations: {