diff --git a/src/main/resources/views/platform/zhgh/spread/statistics/index.html b/src/main/resources/views/platform/zhgh/spread/statistics/index.html index 9ab21bf1..8c2a2bcb 100644 --- a/src/main/resources/views/platform/zhgh/spread/statistics/index.html +++ b/src/main/resources/views/platform/zhgh/spread/statistics/index.html @@ -233,11 +233,12 @@ layout("/layouts/platform.html"){ if (this.categoryChart) this.categoryChart.resize() } }, - created() { - this.loadCategories().then(() => this.loadAll()) - }, mounted() { window.addEventListener("resize", this.resizeCharts) + // 图表容器挂载完成后自动执行首次查询,避免必须点击“查询”才显示数据。 + this.$nextTick(() => { + this.loadCategories().then(() => this.loadAll()) + }) }, beforeDestroy() { window.removeEventListener("resize", this.resizeCharts)