From 33a088e08b902bfe897ee72997674d363ef0ddb1 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 15 十一月 2024 15:50:41 +0800
Subject: [PATCH] 数据分析

---
 src/views/model/pre/analysis/index.vue |   83 +++++++++++++++++++++++++++++++++--------
 1 files changed, 67 insertions(+), 16 deletions(-)

diff --git a/src/views/model/pre/analysis/index.vue b/src/views/model/pre/analysis/index.vue
index de15ab9..b0939c3 100644
--- a/src/views/model/pre/analysis/index.vue
+++ b/src/views/model/pre/analysis/index.vue
@@ -6,18 +6,24 @@
           <el-date-picker
             v-model="formData.startTime"
             type="datetime"
+            format="YYYY-MM-DD HH:mm:00"
+            value-format="YYYY-MM-DD HH:mm:00"
             placeholder="选择日期时间"/>
         </el-form-item>
         <el-form-item label="结束时间">
           <el-date-picker
             v-model="formData.endTime"
             type="datetime"
+            format="YYYY-MM-DD HH:mm:00"
+            value-format="YYYY-MM-DD HH:mm:00"
             placeholder="选择日期时间"/>
         </el-form-item>
         <el-form-item label="预测时间">
           <el-date-picker
             v-model="formData.predictTime"
             type="datetime"
+            format="YYYY-MM-DD HH:mm:00"
+            value-format="YYYY-MM-DD HH:mm:00"
             placeholder="选择日期时间"/>
         </el-form-item>
         <el-form-item label="预测频率">
@@ -28,12 +34,12 @@
         <el-form-item>
           <el-button-group>
             <el-button type="primary" plain :icon="ArrowLeft"
-                       v-loading="loading1" @click="leftSearchDataByRange()"/>
+                       :loading="loading1" @click="leftSearchDataByRange()"/>
             <el-button type="primary" plain :icon="Search"
-                       v-loading="loading1" @click="getList()">查询
+                       :loading="loading1" @click="getList()">查询
             </el-button>
             <el-button type="primary" plain :icon="ArrowRight"
-                       v-loading="loading1" @click="rightSearchDataByRange()"/>
+                       :loading="loading1" @click="rightSearchDataByRange()"/>
           </el-button-group>
         </el-form-item>
 
@@ -52,18 +58,19 @@
           </div>
           <div class="his-body-right">
             <div class="his-body-chart">
-              <el-form :inline="true" :model="calRateForm" :rules="formRules" ref="calRateForm"
+              <el-form :inline="true" :model="calRateForm" :rules="formRules" ref="calRateFormRef"
                        label-width="108px">
                 <el-row>
                   <el-col :span="6">
                     <el-form-item label="预测项" prop="calItem" style="width: 90%">
-                      <el-select size="small" v-model="calRateForm.calItem" @change="calItemBaseVale"
+                      <el-select size="small" v-model="calRateForm.calItem"
+                                 @change="calItemBaseVale"
                                  placeholder="请选择">
                         <el-option
-                          v-for="item in formData.checkedItemData"
-                          :key="item.id"
-                          :label="item.label"
-                          :value="item.id"/>
+                          v-for="itemOut in formData.checkedItemData"
+                          :key="itemOut.id"
+                          :label="itemOut.label"
+                          :value="itemOut.id"/>
                       </el-select>
                     </el-form-item>
                   </el-col>
@@ -180,9 +187,7 @@
 import {getYMDHMS} from "@/utils/dateUtil"
 import * as McsApi from '@/api/model/mcs'
 import * as echarts from "echarts";
-import {onMounted, ref} from 'vue';
 import {Search, ArrowLeft, ArrowRight,} from '@element-plus/icons-vue'
-import {getPreDataCharts, getPredictItemTree} from "@/api/model/mcs";
 
 defineOptions({name: 'AnalysisformData'})
 
@@ -220,8 +225,9 @@
   isMultipleY: false,
   predictFreq: 3,
 })
-let calRateForm = ref({
-  calItem: '',
+const calRateFormRef = ref()
+const calRateForm = ref({
+  calItem: undefined,
   IN_DEVIATION: 0,
   OUT_DEVIATION: 0,
   IN_ACCURACY_RATE: 0,
@@ -493,8 +499,8 @@
 }
 
 onMounted(() => {
+  resetForm()
   getPreItemTree()
-  getList()
 })
 
 async function getPreItemTree() {
@@ -561,9 +567,8 @@
     calRateForm.value.itemMin = 0;
     calRateForm.value.itemAvg = 0;
     calRateForm.value.realCumulant = 0;
-    return
   } else {
-    let dataView = itemDataObject[calRateForm.value.calItem]
+    let dataView = itemDataObject.value[calRateForm.value.calItem]
     calRateForm.value.itemPreMax = dataView.preMax;
     calRateForm.value.itemPreMin = dataView.preMin;
     calRateForm.value.itemPreAvg = dataView.preAvg;
@@ -649,6 +654,52 @@
   getList();
 }
 
+/** 重置表单 */
+const resetForm = () => {
+  formData.value = {
+    rangeDate: '',
+    startTime: '',
+    endTime: '',
+    predictTime: '',
+    predictTimeStr: '',
+    startTimeStr: '',
+    endTimeStr: '',
+    predictTimeStamp: 0,
+    startTimeStamp: 0,
+    endTimeStamp: 0,
+    currentStamp: '',
+    currentStamp60: '',
+    predictStamp: '',
+    chartCheck: ['T+L', '真实值'],
+    chartOptions: ['T+N', 'T+L', '当时', '真实值', '调整值'],
+    checkedItemData: [],
+    backItem: '',
+    backValue: 0,
+    backCoe: 1,
+    preCumulant: 0,
+    realCumulant: 0,
+    queryStep: 2,
+    isMultipleYRadio: '单坐标轴',
+    isMultipleY: false,
+    predictFreq: 3,
+  }
+  calRateForm.value = {
+    calItem: undefined,
+    IN_DEVIATION: 0,
+    OUT_DEVIATION: 0,
+    IN_ACCURACY_RATE: 0,
+    OUT_ACCURACY_RATE: 0,
+    itemAvg: 0,
+    itemMax: 0,
+    itemMin: 0,
+    itemPreAvg: 0,
+    itemPreMax: 0,
+    itemPreMin: 0,
+    preCumulant: 0,
+    realCumulant: 0
+  }
+  calRateFormRef.value?.resetFields()
+}
 </script>
 <style scoped>
 .el-form-item {

--
Gitblit v1.9.3