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',