Ver Fonte

feat: 数据统计分析 - 预测数据版块, 增加机理预测值的展示

sunxiao há 3 semanas atrás
pai
commit
aa0b53c65a

+ 1 - 1
src/views/analyse/WorkOrder.vue

@@ -407,7 +407,7 @@ onUnmounted(() => {
         <ChatTree :data="catalogData"></ChatTree>
         <ChatTree :data="catalogData"></ChatTree>
       </template>
       </template>
 
 
-      <ChatWelcome title="您好,我是LibraAI智慧工单助手" :sub-title="[
+      <ChatWelcome title="您好,我是LibraAI工艺运行诊断" :sub-title="[
         '基于大语言模型的智能工单分析助手,可以为您实现数据分析及数据解读',
         '基于大语言模型的智能工单分析助手,可以为您实现数据分析及数据解读',
         '选择日期并为您生成日报分析'
         '选择日期并为您生成日报分析'
       ]" v-if="!chatDataSource.length" />
       ]" v-if="!chatDataSource.length" />

+ 7 - 5
src/views/data/ComparisonView.vue

@@ -5,7 +5,7 @@ import dayjs from 'dayjs';
 import { TheChatView } from '@/components';
 import { TheChatView } from '@/components';
 import { dataApi } from '@/api/data';
 import { dataApi } from '@/api/data';
 import * as echarts from 'echarts';
 import * as echarts from 'echarts';
-import { ForecastColumns, getEchartMultiLineOption } from './config';
+import { ForecastColumns, getEchartMultiLineOption, formatTofixed } from './config';
 
 
 let echart = null;
 let echart = null;
 const formData = ref({ pageNum: 1 });
 const formData = ref({ pageNum: 1 });
@@ -13,7 +13,7 @@ const pageCount = ref(0);
 const echartRef = ref(null);
 const echartRef = ref(null);
 const tableData = ref([]);
 const tableData = ref([]);
 const timeRangeValue = ref(null);
 const timeRangeValue = ref(null);
-const selectValue = ref('xsy1');
+const selectValue = ref('cod');
 
 
 const selectOptions = [
 const selectOptions = [
   { label: "#1NO₃⁻", value: 'xsy1' },
   { label: "#1NO₃⁻", value: 'xsy1' },
@@ -83,12 +83,15 @@ const initEchartData = async () => {
     })
     })
 
 
     const reusltData = data.hs.data.splice(data.real.data.length, data.hs.data.length - data.real.data.length);
     const reusltData = data.hs.data.splice(data.real.data.length, data.hs.data.length - data.real.data.length);
+    
     let xAxisData = [];
     let xAxisData = [];
+
     xAxisData = [...data.yy.time];
     xAxisData = [...data.yy.time];
 
 
     const echartData = [
     const echartData = [
-      { name: '预测值', val: [...data.hs.data, ...reusltData] },
-      { name: '真实值', val: data.real.data }
+      { name: '真实值', val: data.real.data.map(item => formatTofixed(item)) },
+      { name: '预测值', val: [...data.hs.data.map(item => formatTofixed(item)), ...reusltData.map(item => formatTofixed(item))] },
+      { name: '机理预测值', val: data.jl.data.map(item => formatTofixed(item)) }
     ]
     ]
 
 
     const specificData = new Array(data.hs.data.length).fill(null).concat( reusltData );
     const specificData = new Array(data.hs.data.length).fill(null).concat( reusltData );
@@ -117,7 +120,6 @@ const getTableList = async () => {
     qynh31: '#1缺氧氨氮',
     qynh31: '#1缺氧氨氮',
     qynh32: '#2缺氧氨氮'
     qynh32: '#2缺氧氨氮'
   }
   }
-
   tableData.value = rows.map(item => ({ ...item, category: whiteList[item.category] }));
   tableData.value = rows.map(item => ({ ...item, category: whiteList[item.category] }));
   pageCount.value = total;
   pageCount.value = total;
 }
 }

+ 54 - 4
src/views/data/config.js

@@ -1,5 +1,5 @@
 import dayjs from "dayjs";
 import dayjs from "dayjs";
-const formatTofixed = val => val != 0 && !val ? '' : val.toFixed(2);
+export const formatTofixed = val => val != 0 && !val ? '' : val.toFixed(2);
 // const formatTofixed = val => val
 // const formatTofixed = val => val
 
 
 export const columns = [
 export const columns = [
@@ -92,7 +92,6 @@ export const ForecastColumns = [
     key: "remark",
     key: "remark",
     width: 140,
     width: 140,
     fixed: "left",
     fixed: "left",
-    // render: ({ vdateTime }) => dayjs(vdateTime).format("YYYY-MM-DD")
   },
   },
   {
   {
     title: "预测类型",
     title: "预测类型",
@@ -103,7 +102,6 @@ export const ForecastColumns = [
     title: "预测1时间",
     title: "预测1时间",
     key: "forecastTimeOne",
     key: "forecastTimeOne",
     width: 130,
     width: 130,
-    // render: ({ forecastTimeOne }) => dayjs(forecastTimeOne).format("HH")
   },
   },
   {
   {
     title: "实际1小时值",
     title: "实际1小时值",
@@ -128,6 +126,23 @@ export const ForecastColumns = [
     key: "hsErrorRateOneStr",
     key: "hsErrorRateOneStr",
     width: 160,
     width: 160,
   },
   },
+  {
+    title: "机理模型1小时值",
+    key: "jlForecastOne",
+    width: 140,
+    render: ({ jlForecastOne }) => formatTofixed(jlForecastOne)
+  },
+  {
+    title: "机理模型1小时误差值",
+    key: "jlOneSubtract",
+    width: 150,
+    render: ({ jlOneSubtract }) => formatTofixed(jlOneSubtract)
+  },
+  {
+    title: "机理模型1小时百分比误差",
+    key: "jlErrorRateOneStr",
+    width: 180,
+  },
   {
   {
     title: "预测2时间",
     title: "预测2时间",
     key: "forecastTimeTwo",
     key: "forecastTimeTwo",
@@ -156,11 +171,28 @@ export const ForecastColumns = [
     key: "hsErrorRateTwoStr",
     key: "hsErrorRateTwoStr",
     width: 160,
     width: 160,
   },
   },
+  {
+    title: "机理模型2小时值",
+    key: "jlForecastTwo",
+    width: 140,
+    render: ({ jlForecastTwo }) => formatTofixed(jlForecastTwo)
+  },
+  {
+    title: "机理模型2小时差值",
+    key: "jlTwoSubtract",
+    width: 150,
+    render: ({ jlTwoSubtract }) => formatTofixed(jlTwoSubtract)
+  },
+  {
+    title: "机理模型2小时百分比误差",
+    key: "jlErrorRateTwoStr",
+    width: 180,
+  },
+  
   {
   {
     title: "预测3时间",
     title: "预测3时间",
     key: "forecastTimeThree",
     key: "forecastTimeThree",
     width: 130,
     width: 130,
-    // render: ({ forecastTimeThree }) => dayjs(forecastTimeThree).format("HH")
   },
   },
   {
   {
     title: "实际3小时值",
     title: "实际3小时值",
@@ -185,6 +217,24 @@ export const ForecastColumns = [
     key: "hsErrorRateThreeStr",
     key: "hsErrorRateThreeStr",
     width: 160,
     width: 160,
   },
   },
+
+  {
+    title: "机理模型3小时值",
+    key: "jlForecastThree",
+    width: 140,
+    render: ({ jlForecastThree }) => formatTofixed(jlForecastThree)
+  },
+  {
+    title: "机理模型3小时差值",
+    key: "jlThreeSubtract",
+    width: 150,
+    render: ({ jlThreeSubtract }) => formatTofixed(jlThreeSubtract)
+  },
+  {
+    title: "机理模型3小时百分比误差",
+    key: "jlErrorRateThreeStr",
+    width: 180,
+  },
 ];
 ];
 
 
 export const getEchartLineOptions = ({ xAxisData, seriesData }) => {
 export const getEchartLineOptions = ({ xAxisData, seriesData }) => {