Переглянути джерело

feat: 预测效果echart变更

sunxiao 7 місяців тому
батько
коміт
20fad5e612

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ VITE_APP_TITLE = LibraAI智能体运营平台
 VITE_APP_ENV = 'development'
 
 # 管理系统/开发环境
-VITE_APP_BASE_API = http://10.0.0.28:8080/
+VITE_APP_BASE_API = http://192.168.9.54:8080/
 
 VITE_APP_BASE_TEST = http://10.0.0.28:8080/
 VITE_APP_BASE_PROD = http://192.168.9.54:8080/

+ 11 - 11
src/views/business/comparison/components/echartConfig.js

@@ -24,17 +24,17 @@ export const getEchartLineOption = ({ xAxisData, echartData }) => {
       itemWidth: 8,
       itemHeight: 8,
       padding: [0, 30],
-      selected: {
-        Real_1:true,
-        Real_2:false,
-        Real_3:false,
-        TFTpre_1: true,
-        TFTpre_2: false,
-        TFTpre_3: false,
-        LSTMpre_1: true,
-        LSTMpre_2: false,
-        LSTMpre_3: false
-      }
+      // selected: {
+      //   Real_1:true,
+      //   Real_2:false,
+      //   Real_3:false,
+      //   TFTpre_1: true,
+      //   TFTpre_2: false,
+      //   TFTpre_3: false,
+      //   LSTMpre_1: true,
+      //   LSTMpre_2: false,
+      //   LSTMpre_3: false
+      // }
     },
     tooltip: {
       trigger: "axis",

+ 32 - 32
src/views/business/comparison/index.vue

@@ -243,11 +243,9 @@ export default {
         this.activeIndex = index === -1 ? 0 : index;
       }
       
-      
       const data = await getEchartData({ category: this.activeItem.value, timeBegin, timeEnd });
-    
-
-      const xAxisData = [];
+      console.log(data);
+      let xAxisData = [];
       const realOneList = [];
       const realTwoList = [];
       const realThreeList = [];
@@ -258,38 +256,40 @@ export default {
       const yyForecastTwoList = [];
       const yyForecastThreeList = [];
 
-      data.map(item => {
-        const {
-          remark,
-          realOne, realTwo, realThree,
-          hsForecastOne, hsForecastTwo, hsForecastThree,
-          yyForecastOne, yyForecastTwo, yyForecastThree
-        } = item;
-        xAxisData.push(remark);
-        realOneList.push(realOne);
-        realTwoList.push(realTwo);
-        realThreeList.push(realThree);
-        hsForecastOneList.push(hsForecastOne);
-        hsForecastTwoList.push(hsForecastTwo);
-        hsForecastThreeList.push(hsForecastThree);
-        yyForecastOneList.push(yyForecastOne);
-        yyForecastTwoList.push(yyForecastTwo);
-        yyForecastThreeList.push(yyForecastThree);
-      })
+      // data.map(item => {
+      //   const {
+      //     remark,
+      //     realOne, realTwo, realThree,
+      //     hsForecastOne, hsForecastTwo, hsForecastThree,
+      //     yyForecastOne, yyForecastTwo, yyForecastThree
+      //   } = item;
+      //   xAxisData.push(remark);
+      //   realOneList.push(realOne);
+      //   realTwoList.push(realTwo);
+      //   realThreeList.push(realThree);
+      //   hsForecastOneList.push(hsForecastOne);
+      //   hsForecastTwoList.push(hsForecastTwo);
+      //   hsForecastThreeList.push(hsForecastThree);
+      //   yyForecastOneList.push(yyForecastOne);
+      //   yyForecastTwoList.push(yyForecastTwo);
+      //   yyForecastThreeList.push(yyForecastThree);
+      // })
+    
+      xAxisData = data.yy.time
 
       const echartData = [
-        { name: 'Real_1', val: realOneList },
-        { name: 'Real_2', val: realTwoList },
-        { name: 'Real_3', val: realThreeList },
-        { name: 'TFTpre_1', val: hsForecastOneList },
-        { name: 'TFTpre_2', val: hsForecastTwoList },
-        { name: 'TFTpre_3', val: hsForecastThreeList },
-        { name: 'LSTMpre_1', val: yyForecastOneList },
-        { name: 'LSTMpre_2', val: yyForecastTwoList },
-        { name: 'LSTMpre_3', val: yyForecastThreeList }
+        { name: '红杉预测值', val: data.hs.data },
+        { name: '真实值', val: data.real.data },
+        { name: '跃渊预测值', val: data.yy.data },
+        // { name: 'TFTpre_1', val: hsForecastOneList },
+        // { name: 'TFTpre_2', val: hsForecastTwoList },
+        // { name: 'TFTpre_3', val: hsForecastThreeList },
+        // { name: 'LSTMpre_1', val: yyForecastOneList },
+        // { name: 'LSTMpre_2', val: yyForecastTwoList },
+        // { name: 'LSTMpre_3', val: yyForecastThreeList }
       ]
 
-      const option = getEchartLineOption({ xAxisData, echartData })
+      const option = getEchartLineOption({ xAxisData, echartData });
 
       echart.setOption(option);