Browse Source

Merge branch 'dev' into test

Mr. Robot 2 months ago
parent
commit
ff69190398

+ 4 - 4
src/components/LineChart/index.vue

@@ -117,13 +117,13 @@ const initChart = () => {
       left: '10%', //滚动条靠左侧的百分比
       right: '10%',
       bottom: 0, //滚动条底部位置
-      start: 0, //滚动条的起始位置
-      end: 50 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
+      // start: 0, //滚动条的起始位置
+      // end: 50 //滚动条的截止位置(按比例分割你的柱状图x轴长度)
     },
     {
       type: 'inside',
-      start: 0, //滚动条的起始位置
-      end: 50, //滚动条的截止位置(按比例分割你的柱状图x轴长度)
+      // start: 0, //滚动条的起始位置
+      // end: 50, //滚动条的截止位置(按比例分割你的柱状图x轴长度)
       zoomOnMouseWheel: true, // Enable zooming with mouse wheel
       moveOnMouseMove: true,  // Enable moving with mouse drag
       moveOnMouseWheel: true, // Enable moving with mouse wheel

+ 2 - 1
src/layout/index.vue

@@ -142,6 +142,7 @@ const hidePopup = () => {
   width: 100vw;
   height: 100vh;
   user-select: none;
+  overflow-x: hidden;
 }
 
 .container-header {
@@ -218,7 +219,7 @@ const hidePopup = () => {
   z-index: 999;
   display: flex;
   flex-direction: column;
-  background-color: #333;
+  background-color: rgba(0, 0, 0, 0.76);
 }
 
 .popup-item {

+ 49 - 4
src/views/FileManagement/database.vue

@@ -147,7 +147,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, getCurrentInstance } from "vue";
+import { ref, onMounted, getCurrentInstance, onUnmounted } from "vue";
 import {
   shipsList,
   shipsCreate,
@@ -193,6 +193,19 @@ const pageInit = async () => {
   }
 };
 
+const loopQuery = () => {
+  const params = {
+    current: currentPage.value,
+    size: pageSize.value,
+  };
+  shipsList(params).then((res) => {
+    if (res.message == "success") {
+      totalItems.value = res.data.total;
+      tableData.value = res.data.records;
+    }
+  });
+};
+
 /**
  * 处理分页按钮点击事件,更新当前页并刷新数据
  * @param val 新选择的页码
@@ -227,9 +240,9 @@ const onCancel = () => {
  * 上传或编辑文件
  */
 const submitData = async () => {
-  // @ts-ignore
-  proxy.$loading.start();
   if (isBatch.value) {
+      // @ts-ignore
+    proxy.$loading.start();
     const res = (await uploadBatch({
       id: Number(form.value.id),
       paths: form.value.file,
@@ -246,6 +259,8 @@ const submitData = async () => {
     }
   } else {
     if (isUpdate.value) {
+      // @ts-ignore
+      proxy.$loading.start();
       const res = (await shipsUpdate({
         id: Number(form.value.id),
         shipTag: form.value.shipTag,
@@ -261,6 +276,15 @@ const submitData = async () => {
         });
       }
     } else {
+      if (!!!form.value.shipTag) {
+        ElMessage({
+          message: "数据库名称不能为空",
+          type: "warning",
+        });
+        return;
+      }
+      // @ts-ignore
+      proxy.$loading.start();
       const res = (await shipsCreate({
         shipTag: form.value.shipTag,
       })) as unknown as any;
@@ -273,6 +297,13 @@ const submitData = async () => {
           type: "success",
         });
         isVisible.value = false;
+      } else {
+        // @ts-ignore
+        proxy.$loading.stop();
+        ElMessage({
+          message: res.message,
+          type: "error",
+        });
       }
     }
   }
@@ -306,7 +337,6 @@ const toRpc = async (row: any) => {
     remark: row.remark,
   };
   form.value.file = []
-  console.log('toRpc ===>', form.value)
   isBatch.value = true;
   isVisible.value = true;
 };
@@ -316,7 +346,11 @@ const toRpc = async (row: any) => {
  * @param row 当前操作的数据库记录
  */
 const toUse = async (row: any) => {
+  // @ts-ignore
+  proxy.$loading.start();
   const res = (await shipsUse({ id: Number(row.id) })) as unknown as any;
+  // @ts-ignore
+  proxy.$loading.stop();
   if (res.code === 1) {
     ElMessage({
       message: "操作成功",
@@ -359,9 +393,20 @@ const deleteRecord = async (id: number) => {
   }
 };
 
+let timer: any = null;
 // 组件挂载时获取初始数据
 onMounted(() => {
   pageInit();
+
+  // 定时刷新数据
+  timer = setInterval(() => {
+    loopQuery();
+  }, 30000);
+});
+
+// 组件销毁时清除定时器
+onUnmounted(() => {
+  clearInterval(timer);
 });
 </script>
 

+ 64 - 4
src/views/FileManagement/offline.vue

@@ -87,6 +87,17 @@
           align="center"
           width="240"
         ></el-table-column>
+        <el-table-column label="上传状态" width="240" align="center">
+          <template v-slot="scope">
+            {{
+              scope.row.status == 0
+                ? "🟡上传中"
+                : scope.row.status == 1
+                ? "🔵成功"
+                : "🔴失败"
+            }}
+          </template>
+        </el-table-column>
         <el-table-column
           prop="remark"
           label="备注"
@@ -132,7 +143,7 @@
             <el-input v-model="form.name" maxlength="20" />
           </el-form-item>
           <el-form-item required label="上传文件" v-show="!isUpdate">
-            <cTree v-model="form.file"></cTree>
+            <cTree v-model="form.file" v-if="isVisible"></cTree>
           </el-form-item>
           <el-form-item label="描述">
             <el-input
@@ -153,7 +164,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, getCurrentInstance } from "vue";
+import { ref, onMounted, getCurrentInstance, onUnmounted } from "vue";
 import {
   fileList,
   fileAdd,
@@ -187,6 +198,20 @@ const form = ref({
   remark: "",
 });
 
+const loopQuery = () => {
+  const params = {
+    name: filename.value,
+    current: currentPage.value,
+    size: pageSize.value,
+  };
+  fileList(params).then((res) => {
+    if (res.code === 200) {
+      totalItems.value = res.data.total;
+      tableData.value = res.data.records;
+    }
+  });
+}
+
 /**
  * 获取文件列表数据并初始化表格
  */
@@ -242,11 +267,11 @@ const onCancel = () => {
  * 上传或编辑文件
  */
 const submitData = async () => {
-  // @ts-ignore
-  proxy.$loading.start();
   const formData = JSON.parse(JSON.stringify({ ...form.value, file: [] }));
 
   if (isUpdate.value) {
+    // @ts-ignore
+    proxy.$loading.start();
     const res = await fileUpdate(formData);
     if (res.code === 200) {
       isVisible.value = false;
@@ -259,6 +284,23 @@ const submitData = async () => {
       });
     }
   } else {
+    if (!!!formData.name) {
+      ElMessage({
+        message: "文件名称不能为空",
+        type: "warning",
+      });
+      return;
+    }
+    if (form.value !== undefined && form.value.file.length === 0) {
+      ElMessage({
+        message: "请选择文件",
+        type: "warning",
+      });
+      return;
+    }
+
+    // @ts-ignore
+    proxy.$loading.start();
     const res = await fileAdd(formData);
     if (res.code === 200) {
       const data = {
@@ -276,6 +318,13 @@ const submitData = async () => {
         });
         isVisible.value = false;
       }
+    } else {
+      // @ts-ignore
+      proxy.$loading.stop();
+      ElMessage({
+        message: res.msg,
+        type: "error",
+      });
     }
   }
 };
@@ -374,9 +423,20 @@ const deleteRecord = async (id: number) => {
   }
 };
 
+let timer: any = null;
 // 组件挂载时获取初始数据
 onMounted(() => {
   pageInit();
+
+  // 定时刷新数据
+  timer = setInterval(() => {
+    loopQuery();
+  }, 10000);
+});
+
+// 组件销毁时清除定时器
+onUnmounted(() => {
+  clearInterval(timer);
 });
 </script>
 

+ 195 - 114
src/views/HealthStatusAnalysis/mock.vue

@@ -7,17 +7,17 @@
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
 <template>
-  <div class="all-page">
+  <div class="all-page" style="scale: 98%;margin: 20px;position: relative;right: 1%;">
     <div class="left">
       <!-- {{machineImgParamsRef}} -->
-      <div class="left-top">
-        <div class="mockDiv custom-time-select">
+      <div class="left-top" style="width: 96.8%;">
+        <div class="mockDiv custom-time-select" style="position: relative;bottom: 3%;margin-bottom: 8px;">
           选择时间: &nbsp;
           <el-date-picker
             popper-class="data-style"
             class="custom-time-input"
             v-model="queryParamsMock.sDate"
-            style="width: 140px"
+            style="width: 150px"
             type="datetime"
             placeholder=""
             :disabled-date="disabledDate"
@@ -26,7 +26,7 @@
           <div class="line-select"></div>
           <el-date-picker
             v-model="queryParamsMock.eDate"
-            style="width: 140px"
+            style="width: 150px"
             type="datetime"
             placeholder=""
             :disabled-date="disabledDate"
@@ -63,7 +63,7 @@
           </div>
         </div>
 
-        <div class="machine-all">
+        <div class="machine-all" style="margin-top: 10px;">
           <img
             class="machine"
             src="@/assets/img/macgine.png"
@@ -71,34 +71,34 @@
             srcset=""
           />
           <!-- 添加注释和标签 -->
-          <div class="annotation" style="top: 23%; left: 11%">左DE活塞</div>
-          <div class="annotation" style="top: 20%; left: 27%">左DE燃油齿条</div>
-          <div class="annotation" style="top: 8%; left: 38%">
+          <div class="annotation" style="top: 16%; left: 10%">左DE活塞</div>
+          <div class="annotation" style="top: 15%; left: 25%">左DE燃油齿条</div>
+          <div class="annotation" style="top: 2.8%; left: 36%">
             左DE冷却水
           </div>
-          <div class="annotation" style="top: 19%; left: 41%">左DE箱装体</div>
-          <div class="annotation" style="top: 14%; left: 44%">左DE燃油齿条</div>
-          <div class="annotation" style="top: 7%; left: 53%">右齿轮箱</div>
-          <div class="annotation" style="top: 16%; left: 54.5%">
+          <div class="annotation" style="top: 15%; left: 40%">左DE箱装体</div>
+          <div class="annotation" style="top: 8%; left: 46%">左DE燃油齿条</div>
+          <div class="annotation" style="top: 0%; left: 55.8%">右齿轮箱</div>
+          <div class="annotation" style="top: 10%; left: 57%">
             右GT高压压气机
           </div>
-          <div class="annotation" style="top: 23%; left: 63%">
+          <div class="annotation" style="top: 20%; left: 68%">
             右GT脉冲温度调节器保护
           </div>
-          <div class="annotation" style="bottom: 11%; left: 18.5%">
+          <div class="annotation" style="bottom: 4%; left: 15.5%">
             右DE增压空气
           </div>
-          <div class="annotation" style="bottom: 11%; left: 29%">
+          <div class="annotation" style="bottom: 10%; left: 24%">
             右DE海水泵
           </div>
-          <div class="annotation" style="bottom: 4%; left: 28%">
+          <div class="annotation" style="bottom: -2%; left: 28%">
             右DE箱装体冷却风机
           </div>
-          <div class="annotation" style="bottom: 7%; left: 42.5%">
+          <div class="annotation" style="bottom: 0%; left: 43%">
             右DE滑油
           </div>
           <!-- 带有小边框的注释 -->
-          <div class="annotation bordered-box" style="top: 6%; left: 8%">
+          <div class="annotation bordered-box" style="top: -2%; left: 2.5%">
             <div>
               <div>压力A排</div>
 
@@ -123,7 +123,7 @@
               </div>
             </div>
           </div>
-          <div class="annotation bordered-box" style="top: 4%; right: 15%">
+          <div class="annotation bordered-box" style="top: -4%; right: 11.5%">
             <div>
               <div>海水压力</div>
               <div class="value">
@@ -149,7 +149,7 @@
           </div>
           <div
             class="annotation bordered-box"
-            style="bottom: 6%; left: 3%"
+            style="bottom: -1%; left: -3%"
           >
             <div>
               <div>后气压PP030</div>
@@ -175,7 +175,7 @@
             </div>
           </div>
 
-          <div class="annotation bordered-box" style="top: 32%; right: 12%">
+          <div class="annotation bordered-box" style="top: 29%; right: 6%">
             <div>
               <div>压力(1)</div>
               <div class="value">
@@ -195,7 +195,7 @@
               </div>
             </div>
           </div>
-          <div class="annotation bordered-box" style="top: 83%; right: 16%">
+          <div class="annotation bordered-box" style="top: 90%; right: 11.5%">
             <div>
               <div>压力A排</div>
               <div class="value">
@@ -221,7 +221,7 @@
           </div>
         </div>
       </div>
-      <div class="left-bottom">
+      <div class="left-bottom" style="margin-top: 8px;">
         <s-title titleText="参数运行曲线"></s-title>
         <div class="paramsRunRcharts">
           <div class="paramsRunBtn" @click="showParamsModel">选择显示参数</div>
@@ -239,7 +239,7 @@
     <div class="right">
       <div class="right-top">
         <s-title :type="2" titleText="运行工况分析"></s-title>
-        <div class="history-all">
+        <div class="history-all" style="width: 94%;">
           <div class="his-text">历史工况记录</div>
           <div class="his-fun">
             <!-- {{ chartData }} -->
@@ -286,13 +286,13 @@
           </div>
         </div>
 
-        <div class="timeEcharts">
+        <div class="timeEcharts" style="width: 97%;">
           <CalendarHeatmap :data="chartData" @showDetails="handleShowDetails" />
         </div>
       </div>
-      <div class="right-bottom">
+      <div class="right-bottom" style="width: 100%;">
         <s-title :type="2" titleText="健康状态评估结果"></s-title>
-        <div class="status-line">
+        <div class="status-line" style="width: 93%;">
           <div class="run-status">
             <div class="status-text">
               当前健康指数
@@ -391,7 +391,7 @@
             </div>
           </div>
         </div>
-        <div class="healthEcharts">
+        <div class="healthEcharts" style="width: 96%;">
           <LineChart
             :xAxisData="xAxisData"
             :seriesData="seriesData"
@@ -568,6 +568,8 @@ import {
   mockTotal
 } from "@/api/index";
 
+const cacheNoComplete = ref(true);
+
 // 用户是否在操作参数运行曲线
 const isOperating = ref(false);
 // 操作倒计时 30秒
@@ -624,34 +626,38 @@ const getQueryDataRangeSpeed = async () => {
     count: Number(valueObj.batch_size),
     time: Number(valueObj.interval),
   };
+  mockTotalText.value = {
+    start_time: valueObj.start_time,
+    end_time: valueObj.end_time
+  };
   // handleConditionHistoryRecords(valueObj.start_time, valueObj.end_time);
   mockStart(true);
 };
 onMounted(async () => {
   nextTick(() => {
     pageInit()
-    getMockTotal()
+    // getMockTotal()
   })
 });
-const getMockTotal = () => {
-  mockTotal({}).then((res) => {
-    mockTotalText.value = {
-      start_time: res.data.start_time,
-      end_time: res.data.end_time
-    };
-  });
-};
+// const getMockTotal = () => {
+//   mockTotal({}).then((res) => {
+//     mockTotalText.value = {
+//       start_time: res.data.start_time,
+//       end_time: res.data.end_time
+//     };
+//   });
+// };
 const pageInit = async () => {
   getcateData();
   getQueryDataRangeSpeed();
   await getPointData(btnBigIndex.value, "温度");
   getHStatus();
-  if (!!sessionStorage.getItem("runStatus")) {
-    runstatusMessage(JSON.parse(sessionStorage.getItem("runStatus")));
-  }
-  if (!!sessionStorage.getItem("healthyStatusText")) {
-    healthyMessage(JSON.parse(sessionStorage.getItem("healthyStatusText")));
-  }
+  // if (!!sessionStorage.getItem("runStatus")) {
+  //   runstatusMessage(JSON.parse(sessionStorage.getItem("runStatus")));
+  // }
+  // if (!!sessionStorage.getItem("healthyStatusText")) {
+  //   healthyMessage(JSON.parse(sessionStorage.getItem("healthyStatusText")));
+  // }
 
   nextTick(() => {
     let cachecheckedParams = localStorage.getItem("OE_checked_params");
@@ -662,50 +668,77 @@ const pageInit = async () => {
     }
   });
 
-  mockCacheData({}).then((res: any) => {
-    // 检测 res.data 是否不为空对象
-    if (res.data && Object.keys(res.data).length !== 0) {
-      lineParamsAllRef.value = res.data.realtime.map((its: any) => {
-        return {
-          data: its,
-        };
-      });
-      res.data.healths.forEach((item: any) => {
-        newHealthyMessage(item)
-      })
-    }
-  });
+  // mockCacheData({}).then((res: any) => {
+  //   // 检测 res.data 是否不为空对象
+  //   if (res.data && Object.keys(res.data).length !== 0) {
+  //     lineParamsAllRef.value = res.data.realtime.map((its: any) => {
+  //       return {
+  //         data: its,
+  //       };
+  //     });
+  //     res.data.healths.forEach((item: any) => {
+  //       newHealthyMessage(item)
+  //     })
+  //   }
+  // });
   // 处理接收到的消息
+  // wsMockClient.onMessage = (data: string) => {
+  //   try {
+  //     const newData: any = JSON.parse(data);
+  //     switch (newData.TYPE) {
+  //       // 参数运行曲线
+  //       case "1":
+  //         if (Object.keys(newData.data).length > 0) {
+  //           dealMessage(data);
+  //         }
+  //         break;
+  //       case "2":
+  //         if (Object.keys(newData.data).length > 0) {
+  //           runstatusMessage(newData.data);
+  //         }
+
+  //         break;
+  //       case "3":
+  //         if (Object.keys(newData.data).length > 0) {
+  //           healthyMessage(newData.data);
+  //         }
+  //         break;
+  //       case "4":
+  //         workMessage(newData.data);
+  //         console.log("workMessage ===>", newData.data);
+  //         break;
+  //       default:
+  //         break;
+  //     }
+  //   } catch (error) {
+  //     console.log("不合法的data数据2================");
+  //   }
+  // };
+  
   wsMockClient.onMessage = (data: string) => {
     try {
       const newData: any = JSON.parse(data);
       switch (newData.TYPE) {
         // 参数运行曲线
-        case "1":
-          if (Object.keys(newData.data).length > 0) {
-            dealMessage(data);
+        case "5":
+          if (newData.data[0]) {
+            dealMessage(JSON.parse(newData.data[0]));
           }
-          break;
-        case "2":
-          if (Object.keys(newData.data).length > 0) {
-            runstatusMessage(newData.data);
+          if (newData.data[1]) {
+            runstatusMessage(JSON.parse(newData.data[1]).data);
           }
-
-          break;
-        case "3":
-          if (Object.keys(newData.data).length > 0) {
-            healthyMessage(newData.data);
+          if (newData.data[2]) {
+            healthyMessage(JSON.parse(newData.data[2]).data);
           }
           break;
         case "4":
           workMessage(newData.data);
-          console.log("workMessage ===>", newData.data);
           break;
         default:
           break;
       }
     } catch (error) {
-      console.log("不合法的data数据2================");
+      console.log(error);
     }
   };
 }
@@ -752,9 +785,7 @@ const handleConditionHistoryRecords = async (s: string, d: string) => {
       }
     }
   });
-  console.log("chartData 2");
   chartData.value = transformData(dataList);
-  console.log("chartData 2", chartData.value);
 };
 // 上一周
 const prevWeek = async () => {
@@ -897,9 +928,25 @@ const onClickStart = async () => {
       message: '调整成功',
       type: 'success',
     })
-    pageInit()
+    await pageInit()
+
+    let cacheParams = localStorage.getItem("OE_checked_params");
+    if (cacheParams) {
+      interface PointItem {
+        pointName: string;
+        pointCode: string;
+      }
+
+      const fields: string[] = []
+      const pointData = await measurementPoints({})
+      pointData.data.forEach((item: PointItem) => {
+        if (cacheParams.includes(item.pointName)) {
+          fields.push(item.pointCode)
+        }
+      })
+      await editDisplayParams({ fields })
+    }
     proxy.$loading.stop();
-    console.log("res ===>", res);
   } catch (error) {
     console.error("Error in fetching data: ", error);
   }
@@ -922,6 +969,15 @@ const mockStart = async (state: boolean = false) => {
   // mounted进来使用缓存接口数据
   if (state) {
     let resultCatch = await mockCacheData({});
+    lineParamsAllRef.value = [];
+    seriesData.value = [
+      {
+        name: "趋势",
+        data: [],
+      },
+    ];
+    xAxisData.value = [];
+    healthyStatusText.value = {name: '',color: ''};
     if (resultCatch.data && Object.keys(resultCatch.data).length !== 0) {
       lineParamsAllRef.value = resultCatch.data.realtime.map((its: any) => {
         return {
@@ -932,21 +988,15 @@ const mockStart = async (state: boolean = false) => {
         newHealthyMessage(item)
       })
     }
+    cacheNoComplete.value = false;
   } else {
     lineParamsAllRef.value = [];
   }
-  seriesData.value = [
-    {
-      name: "趋势",
-      data: [],
-    },
-  ];
-  xAxisData.value = [];
 
   if (wsMockClient.readyState === WebSocket.CLOSED) {
     wsMockClient.connect();
     // 向服务器发送消息
-    wsMockClient.send("你好!");
+    // wsMockClient.send("你好!");
   }
 
   handleDateRangeChange({
@@ -1011,8 +1061,15 @@ watch(
       setLineparames(newdata, result);
       return false;
     }
-    machineImgParamsRef.value =
+
+    if (Object.keys(lineParamsAllRef.value[0].data).length > 8) {
+      machineImgParamsRef.value =
       lineParamsAllRef.value[lineParamsAllRef.value.length - 1].data;
+      localStorage.setItem('OE_ff_point', JSON.stringify(lineParamsAllRef.value[lineParamsAllRef.value.length - 1].data));
+    } else {
+      machineImgParamsRef.value = JSON.parse(localStorage.getItem('OE_ff_point') || '{}');
+    }
+
     // console.log("machineImgParamsRef.value", machineImgParamsRef.value);
 
     const result: Array<AnyObject> = convertToChartData(
@@ -1058,7 +1115,7 @@ const changeAttr = (valArr: string[]) => {
       message: `最多选择5个参数`,
       type: "error",
     });
-    checkedParams.value = val.slice(0, 5);
+    checkedChange.value = val.slice(0, 5);
     return
   } else {
     checkedChange.value = val;
@@ -1067,8 +1124,8 @@ const changeAttr = (valArr: string[]) => {
   //   `OE_checked_params_${props.data.id}`,
   //   JSON.stringify(checkedParams.value)
   // );
-  //   localStorage.setItem("btnIndex", btnIndex.value);
-  //   localStorage.setItem("btnBigIndex", btnBigIndex.value);
+    localStorage.setItem("btnIndex", btnIndex.value);
+    localStorage.setItem("btnBigIndex", btnBigIndex.value);
 };
 const saveAttr = async () => {
   checkedParams.value = checkedChange.value
@@ -1092,8 +1149,19 @@ const saveAttr = async () => {
   }
   console.log('data ===>', data)
   await editDisplayParams(data)
-  onClickStart();
-  runLineParams();
+
+  // onClickStart();
+  // runLineParams();
+  lineParamsAllRef.value = [];
+
+  let resultCatch = await mockCacheData({});
+  if (resultCatch.data && Object.keys(resultCatch.data).length !== 0) {
+    lineParamsAllRef.value = resultCatch.data.realtime.map((its: any) => {
+      return {
+        data: its,
+      };
+    });
+  }
   showModal.value = false;
 }
 onUnmounted(() => {
@@ -1129,7 +1197,7 @@ const getTip = () => {
 const dealMessage = (data: string) => {
   // 消息整合 有值 就是这个设备参数
   if (!!data) {
-    lineParamsAllRef.value.push(JSON.parse(data));
+    lineParamsAllRef.value.push(data);
   }
 };
 
@@ -1155,6 +1223,11 @@ const showParamsModel = () => {
     getPointData(btnBigIndex.value, cateSmallRef.value[btnIndex.value]);
   }
 
+  let cacheParams = localStorage.getItem("OE_checked_params");
+  if (cacheParams) {
+    checkedParams.value = JSON.parse(cacheParams);
+  }
+
   showModal.value = true;
 };
 const checkedParams = ref([]);
@@ -1234,6 +1307,11 @@ const convertToChartData = (
   // // console.log(selectedData);
 
   // debugger
+  let cacheParams = localStorage.getItem("OE_checked_params");
+  if (cacheParams) {
+    properties = JSON.parse(cacheParams);
+  }
+
   return properties.map((propertyName) => ({
     name: propertyName,
     // name: propertyName,
@@ -1358,7 +1436,7 @@ const runstatusMessage = (data: { label: string; state: 0 | 1 | 2 }) => {
   // 获取工况状态
   runStatusText.value = enumParasm[data.state].text + `(${data.label})`;
   runStatusColor.value = enumParasm[data.state].color;
-  sessionStorage.setItem("runStatus", JSON.stringify(data));
+  // sessionStorage.setItem("runStatus", JSON.stringify(data));
 };
 const workMessage = (data: any) => {
   // 获取工况数据 一小时来一次
@@ -1527,22 +1605,21 @@ const healthyStatusText = ref({
 let flag = false;
 
 const newHealthyMessage = (data: Object) => {
-  console.log('newHealthyMessage ===>', data)
-  if (data.health == 99) {
-    if (flag) {
-      data.health = 92;
-      flag = false;
-    } else {
-      data.health = 98;
-      flag = true;
-    }
-  }
+  // if (data.health == 99) {
+  //   if (flag) {
+  //     data.health = 92;
+  //     flag = false;
+  //   } else {
+  //     data.health = 98;
+  //     flag = true;
+  //   }
+  // }
 
   // 获取健康数据
   // let obj=determineHealthStatus(data.avg_num)
   let obj = determineHealthStatus(`${data.sha}(${data.health}%)`);
   healthyStatusText.value = obj;
-  sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
+  // sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
   xAxisData.value.push(moment(data._ts).format("HH:mm:ss"));
   seriesData.value[0].data.push(data.health);
   let arr = seriesData.value[0].data;
@@ -1555,21 +1632,25 @@ const newHealthyMessage = (data: Object) => {
 };
 
 const healthyMessage = (data: Object) => {
-  if (data.avg_num == 99) {
-    if (flag) {
-      data.avg_num = 92;
-      flag = false;
-    } else {
-      data.avg_num = 98;
-      flag = true;
-    }
+  if (cacheNoComplete.value) {
+    return;
   }
 
+  // if (data.avg_num == 99) {
+  //   if (flag) {
+  //     data.avg_num = 92;
+  //     flag = false;
+  //   } else {
+  //     data.avg_num = 98;
+  //     flag = true;
+  //   }
+  // }
+
   // 获取健康数据
   // let obj=determineHealthStatus(data.avg_num)
   let obj = determineHealthStatus(`${data.sha}(${data.avg_num}%)`);
   healthyStatusText.value = obj;
-  sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
+  // sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
   xAxisData.value.push(moment(data.date).format("HH:mm:ss"));
   seriesData.value[0].data.push(data.avg_num);
   let arr = seriesData.value[0].data;
@@ -1731,15 +1812,15 @@ const healthColor = (status: string) => {
   position: absolute;
   color: rgba(255, 255, 255, 0.75);
   background-color: rgba(0, 0, 0, 0.5);
-  padding: 2px 5px;
+  padding: 0.5px 1px;
   border-radius: 3px;
-  font-size: 1rem;
+  font-size: 14px;
 }
 .bordered-box div {
   font-size: 12px;
   display: flex;
   justify-content: space-between; /* 使文本和数值分布在两端 */
-  line-height: 20px;
+  line-height: 18px;
 }
 .bordered-box .value {
   margin-left: 15px; /* 在文本和数值之间添加5px的间距 */

+ 1 - 1
src/views/MaintenanceStrategyAssistance/offline/index.vue

@@ -178,7 +178,7 @@ const setActiveTab = (val: number) => {
 const viewDetails = (id: number) => {
   router.push({
     path: "/repair/MaintenanceStrategyAssistanceView",
-    query: { id, type: "auto" },
+    query: { id, type: "offline" },
   });
   // ElMessage({
   //   message: `查看详情: ${id}`,

+ 1 - 1
src/views/MaintenanceStrategyAssistance/record/hand.vue

@@ -80,7 +80,7 @@
         }}</span>
       </template>
     </el-table-column>
-    <el-table-column label="操作" width="280" align="center">
+    <el-table-column label="操作" width="250" align="center">
       <template v-slot="scope">
         <el-button
           class="btns"

+ 5 - 9
src/views/OperationalReliabilityPrediction/index.vue

@@ -312,7 +312,10 @@ if (!!route.query.start_time) {
 if (!!route.query.end_time) {
   timeObj.end_time=route.query.end_time.replaceAll('+',' ')
 }
-  evaluateHealthStatus({ source, fileName: file_name, [source == 2 ? "fileId" : "id"]: pageId,...timeObj })
+
+  setTimeout(() => {
+    proxy.$loading.start();
+    evaluateHealthStatus({ source, fileName: file_name, [source == 2 ? "fileId" : "id"]: pageId,...timeObj })
     .then((res: any) => {
       proxy.$loading.stop();
 
@@ -347,15 +350,8 @@ if (!!route.query.end_time) {
     })
     .catch((error: any) => {
       proxy.$loading.stop();
-      console.log(`获取警告提示失败: ${error.message || "未知错误"}`);
-
-      // ElMessage({
-      //   message: `获取警告提示失败: ${error.message || '未知错误'}`,
-      //   type: 'error',
-      // });
     });
-  // nextTick(() => {
-  // });
+  }, 100);
 });
 </script>