From bbe7b8a02124c7804d9ae47afbb027bd9e39d645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=AB=E7=8C=ABguowen?= <9290821+guowen-the-cat@user.noreply.gitee.com> Date: Tue, 16 Dec 2025 13:41:58 +0800 Subject: [PATCH] =?UTF-8?q?KPI=E5=BF=AB=E9=80=9F=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99=EF=BC=8C=E9=A5=BC=E5=9B=BE?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/kpi/inAnalysis/indexByTime.vue | 7 +++++++ ruoyi-ui/src/views/kpi/outAnalysis/indexByTime.vue | 5 +++++ ruoyi-ui/src/views/kpi/spaceAnalysis/index.vue | 1 + 3 files changed, 13 insertions(+) diff --git a/ruoyi-ui/src/views/kpi/inAnalysis/indexByTime.vue b/ruoyi-ui/src/views/kpi/inAnalysis/indexByTime.vue index fa04f35..d6994e5 100644 --- a/ruoyi-ui/src/views/kpi/inAnalysis/indexByTime.vue +++ b/ruoyi-ui/src/views/kpi/inAnalysis/indexByTime.vue @@ -116,6 +116,9 @@ export default { }, /** 更新图表数据 */ updateChart() { + // 在调用setOption前检查chart实例是否存在 + if (this.chart && typeof this.chart.setOption === 'function') { + const option = { title: { text: '入库数量统计' // 入库数量统计(按巷道) @@ -166,6 +169,10 @@ export default { })) } this.chart.setOption(option, true) + } else { + console.warn('Chart instance is not ready yet'); + } + }, /** 处理日期范围变化 */ handleDateRangeChange(val) { diff --git a/ruoyi-ui/src/views/kpi/outAnalysis/indexByTime.vue b/ruoyi-ui/src/views/kpi/outAnalysis/indexByTime.vue index e175bae..5c47063 100644 --- a/ruoyi-ui/src/views/kpi/outAnalysis/indexByTime.vue +++ b/ruoyi-ui/src/views/kpi/outAnalysis/indexByTime.vue @@ -116,6 +116,8 @@ export default { }, /** 更新图表数据 */ updateChart() { + // 在调用setOption前检查chart实例是否存在 + if (this.chart && typeof this.chart.setOption === 'function') { const option = { title: { text: '出库数量统计' // 出库数量统计(按巷道) @@ -163,6 +165,9 @@ export default { })) } this.chart.setOption(option, true) + } else { + console.warn('Chart instance is not ready yet'); + } }, /** 处理日期范围变化 */ handleDateRangeChange(val) { diff --git a/ruoyi-ui/src/views/kpi/spaceAnalysis/index.vue b/ruoyi-ui/src/views/kpi/spaceAnalysis/index.vue index 9521ace..3813831 100644 --- a/ruoyi-ui/src/views/kpi/spaceAnalysis/index.vue +++ b/ruoyi-ui/src/views/kpi/spaceAnalysis/index.vue @@ -192,6 +192,7 @@ export default { color: "#292c2c" }, }, + color: ['#25abd9', '#fac858', '#91cc75', '#ee6666', '#73c0de', '#3ba272'], // 添加六个自定义颜色 series: [{ name: '货位状态', type: 'pie',