Преглед изворни кода

fix(图表组件): 移除数据长度检查以优化空数据处理

liujt пре 5 месеци
родитељ
комит
6f5a503ee0

+ 1 - 1
src/views/bpm/vis-page/components/charts/DeviceStatusChart.vue

@@ -42,7 +42,7 @@ export default {
       this.updateChart();
     },
     updateChart() {
-      if (!this.chartInstance || !this.data || this.data.length === 0) return;
+      if (!this.chartInstance || !this.data) return;
       
       const totalDevice = this.data.reduce((sum, item) => sum + +item.value, 0);
       const option = {

+ 1 - 1
src/views/bpm/vis-page/components/charts/ProcessPersonnelChart.vue

@@ -42,7 +42,7 @@ export default {
       this.updateChart();
     },
     updateChart() {
-      if (!this.chartInstance || !this.data || this.data.length === 0) return;
+      if (!this.chartInstance || !this.data) return;
       
       const totalPersonnel = this.data.reduce((sum, item) => sum + item.value, 0);
       const option = {

+ 1 - 1
src/views/bpm/vis-page/components/charts/ProductTop10Chart.vue

@@ -42,7 +42,7 @@ export default {
       this.updateChart();
     },
     updateChart() {
-      if (!this.chartInstance || !this.data || this.data.length === 0) return;
+      if (!this.chartInstance || !this.data) return;
       
       const sortedProductData = [...this.data].sort((a, b) => b.value - a.value);
       const salvProName = sortedProductData.map((item) => item.name);