Przeglądaj źródła

feat: 数据看板图例显示颜色不准确的问题

sunxiao 5 miesięcy temu
rodzic
commit
3192558eb1
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      src/views/control/components/TheEchartPanel.vue

+ 5 - 2
src/views/control/components/TheEchartPanel.vue

@@ -147,6 +147,7 @@ const initWaterEchart = async () => {
   const tempArr = [];
   
   const tempResult = selectValue.value.map(key => {
+    if (key == 12 || key == 13) return null;
     const data = echartDataSource.value[key] || [];
 
     tempArr.push(data);
@@ -154,7 +155,7 @@ const initWaterEchart = async () => {
       name: selectEnum.get(key),
       data
     });
-  });
+  }).filter(Boolean);
 
   const xAxis = tempArr.flat(Infinity).reduce((acc, curr) => {
     if (!acc.some(item => item.time === curr.time)) {
@@ -486,7 +487,9 @@ onMounted(async () => {
   selectOptions.value = echartOptions;
 
   echart = echarts.init(document.querySelector('#echartRef'), 'light');
-  await initWaterEchartData();
+  setTimeout(async () => {
+    await initWaterEchartData();
+  })
 
   window.addEventListener("resize", windowResize);