Procházet zdrojové kódy

Merge branch 'master' of http://192.168.50.233:3000/rui.jiang/performance-test

liujiejie před 1 měsícem
rodič
revize
540375d2a3

+ 20 - 20
src/views/health/components/envelopecharts.vue

@@ -96,12 +96,12 @@ export default {
         { val: "移动峰值", checked: false, disabled: false },
       ],
       PXcheckList: [
-        { val: "Fr", checked: false },
-        { val: "BPFI", checked: false },
-        { val: "BPFO", checked: false },
-        { val: "BSF", checked: false },
-        { val: "FTF", checked: false },
-        { val: "3P", checked: false },
+        { val: "转速频率", checked: false },
+        { val: "内圈故障频率", checked: false },
+        { val: "外圈故障频率", checked: false },
+        { val: "滚动体故障频率", checked: false },
+        { val: "保持架频率", checked: false },
+        { val: "叶片频率", checked: false },
       ],
       Fr: [],
       BPFI: [],
@@ -203,7 +203,7 @@ export default {
         fmax: this.daval,
       };
       axios
-        .post("/WJapi/analysis/envelope", params)
+        .post("/AnalysisMulti/analysis/envelope", params)
         .then((res) => {
           this.envelopeList = JSON.parse(res.data);
           const XrmsValue = this.envelopeList?.Xrms;
@@ -211,24 +211,24 @@ export default {
           this.PXcheckList.forEach((item) => {
             if (item.checked) {
               switch (item.val) {
-                case "Fr":
+                case "转速频率":
                   this.Fr = this.envelopeList.fn_Gen;
 
                   break;
-                case "BPFI":
+                case "内圈故障频率":
                   this.BPFI = this.envelopeList.BPFI;
 
                   break;
-                case "BPFO":
+                case "外圈故障频率":
                   this.BPFO = this.envelopeList.BPFO;
                   break;
-                case "BSF":
+                case "滚动体故障频率":
                   this.BSF = this.envelopeList.BSF;
                   break;
-                case "FTF":
+                case "保持架频率":
                   this.FTF = this.envelopeList.FTF;
                   break;
-                case "3P":
+                case "叶片频率":
                   this.B3P = Array.isArray(this.envelopeList.B3P)
                     ? this.envelopeList.B3P
                     : [{ Xaxis: this.envelopeList.B3P, val: "3P" }];
@@ -266,12 +266,12 @@ export default {
 
       // 构建新的特征频率数据
       const newFeatureLines = {
-        Fr: this.checkedValues.includes("Fr") ? this.envelopeList.fn_Gen : [],
-        BPFI: this.checkedValues.includes("BPFI") ? this.envelopeList.BPFI : [],
-        BPFO: this.checkedValues.includes("BPFO") ? this.envelopeList.BPFO : [],
-        BSF: this.checkedValues.includes("BSF") ? this.envelopeList.BSF : [],
-        FTF: this.checkedValues.includes("FTF") ? this.envelopeList.FTF : [],
-        B3P: this.checkedValues.includes("3P")
+        Fr: this.checkedValues.includes("转速频率") ? this.envelopeList.fn_Gen : [],
+        BPFI: this.checkedValues.includes("内圈故障频率") ? this.envelopeList.BPFI : [],
+        BPFO: this.checkedValues.includes("外圈故障频率") ? this.envelopeList.BPFO : [],
+        BSF: this.checkedValues.includes("滚动体故障频率") ? this.envelopeList.BSF : [],
+        FTF: this.checkedValues.includes("保持架频率") ? this.envelopeList.FTF : [],
+        B3P: this.checkedValues.includes("叶片频率")
           ? Array.isArray(this.envelopeList.B3P)
             ? this.envelopeList.B3P
             : [{ Xaxis: this.envelopeList.B3P, val: "3P" }]
@@ -513,7 +513,7 @@ export default {
   top: 60px;
   right: 0;
   font-size: 10px;
-  width: 100px;
+  width: 146px;
   border: 1px solid black;
   padding: 5px;
   background: #fff;

+ 41 - 19
src/views/health/components/malfunction/bearing.vue

@@ -159,10 +159,8 @@ export default {
       envelopeTotalAlarmThreshold: "",
       envelopeTotalDangerThreshold: "",
       // 分页
-
       currentPage: 1,
       total: 1,
-
       xData: [],
       yData: [],
       // 颜色判断
@@ -213,7 +211,13 @@ export default {
     },
 
     automaticDiagnosis() {
-      this.loading = true;
+   
+      if (this.tableData.length === 0) {
+        this.$message.warning("当前没有数据,无法进行诊断");
+        this.loading = false; // 确保关闭 loading 状态
+        return; // 直接返回,不发请求
+      }
+   this.loading = true;
       const ids = this.tableData
         .map((item) => item.id)
         .filter((id) => id !== undefined);
@@ -235,15 +239,19 @@ export default {
       });
 
       axios
-        .post(`/WJJdiag/autodiag/${autodiagType}`, params)
+        .post(`/AnalysisMulti/autodiag/${autodiagType}`, params)
         .then((res) => {
-          const result = res.data.results;
+          if (res.data.code === 405) {
+            this.$message.warning(
+              res.data.message || "当前采集频率不适合进行诊断分析"
+            );
+            return; // 终止后续数据处理逻辑
+          }
 
+          const result = res.data.results;
           this.statistics = res.data.statistics || {};
-
           // x轴数据,时间戳
           this.xData = this.tableData.map((item) => item.timeStamp);
-
           // y轴数据,状态码二维数组
           this.yData = [
             result.BPFI?.status_codes || [],
@@ -253,18 +261,18 @@ export default {
           ];
 
           // 根据 max_status 设置颜色的函数
-     const setColor = (status) => {
-  switch (status) {
-    case 0:
-      return '#8ae359'
-    case 1:
-      return '#eecb5f'
-    case 2:
-      return '#f7715f'
-    default:
-      return '#80808057'
-  }
-}
+          const setColor = (status) => {
+            switch (status) {
+              case 0:
+                return "#8ae359";
+              case 1:
+                return "#eecb5f";
+              case 2:
+                return "#f7715f";
+              default:
+                return "#80808057";
+            }
+          };
 
           this.bearingStateColors.innerRing = setColor(
             result.BPFI?.max_status || 0
@@ -285,6 +293,20 @@ export default {
           this.loading = false;
         });
     },
+
+    reset() {
+      // 重置状态
+      this.xData = [];
+      this.yData = [];
+      this.statistics = {};
+      this.bearingStateColors = {
+        innerRing: "#80808057",
+        outerRing: "#80808057",
+        rollingElement: "#80808057",
+        cage: "#80808057",
+      };
+      this.tableData = [];
+    },
   },
 };
 </script>

+ 1 - 1
src/views/health/components/malfunction/bingTwo.vue

@@ -121,7 +121,7 @@ export default {
                 itemStyle: { color: "#EECB5F" },
               },
               {
-                    value: this.statistics.count_2 || 0,
+                value: this.statistics.count_2 || 0,
                 name: "危险",
                 itemStyle: { color: "#f7715f" },
               },

+ 30 - 3
src/views/health/components/malfunction/dissymmetry.vue

@@ -96,7 +96,6 @@
           :yData="[yData]"
           :yNames="['不对中故障']"
           yAxisName="不对中故障状态"
-   
         ></Eecharts>
       </div>
     </div>
@@ -194,12 +193,19 @@ export default {
       console.log(`当前页: ${val}`);
       setTimeout(() => {
         this.automaticDiagnosis();
-      },500);
+      }, 500);
 
       this.currentPage = val; // 子组件内部更新当前页
       this.$emit("updatePage", this.currentPage); // 通知父组件,把当前页传出去
     },
     automaticDiagnosis() {
+
+           if (this.tableData.length === 0) {
+        this.$message.warning("当前没有数据,无法进行诊断");
+        this.loading = false; // 确保关闭 loading 状态
+        return; // 直接返回,不发请求
+      }
+
       this.loading = true;
       const ids = this.tableData
         .map((item) => item.id)
@@ -220,8 +226,15 @@ export default {
       });
 
       axios
-        .post(`/WJJdiag/autodiag/${autodiagType}`, params)
+        .post(`/AnalysisMulti/autodiag/${autodiagType}`, params)
         .then((res) => {
+          if (res.data.code === 405) {
+            this.$message.warning({
+              message: "当前采集频率不适合进行诊断分析",
+              duration: 2000,
+            });
+            return; // 停止继续处理数据
+          }
           this.statistics = res.data.statistics;
           this.$set(this, "yData", [...res.data.results]);
           this.$set(
@@ -261,6 +274,20 @@ export default {
           this.loading = false;
         });
     },
+
+    reset() {
+      this.tableData = [];
+      this.xData = [];
+      this.yData = [];
+      this.statistics = {};
+      this.bearingStateColors = {
+        innerRing: "#80808057",
+        outerRing: "#80808057",
+        rollingElement: "#80808057",
+        cage: "#80808057",
+      };
+      this.currentPage = 1;
+    },
   },
 };
 </script>

+ 65 - 42
src/views/health/components/malfunction/gear.vue

@@ -202,6 +202,11 @@ export default {
     },
 
     automaticDiagnosis() {
+            if (this.tableData.length === 0) {
+        this.$message.warning("当前没有数据,无法进行诊断");
+        this.loading = false; // 确保关闭 loading 状态
+        return; // 直接返回,不发请求
+      }
       this.loading = true;
       const ids = this.tableData
         .map((item) => item.id)
@@ -223,50 +228,53 @@ export default {
         background: "rgba(0, 0, 0, 0.7)",
       });
 
-      axios
-        .post(`/WJJdiag/autodiag/${autodiagType}`, params)
-        .then((res) => {
-        if (res.data.code === 400) {
-    this.$message({
-          message: '当前测点无法进行齿轮箱诊断',
-          type: 'warning'
-        });
-          
-        }else{
- const result = res.data.results || {};
-          this.statistics = res.data.statistics || {};
-          // x轴数据,时间戳
-          this.xData = this.tableData.map((item) => item.timeStamp);
-          // y轴数据,状态码二维数组
-          this.yData = [
-            result.crack?.status_codes || [],
-            result.wear?.status_codes || [],
-          ];
-          // 设置颜色函数(根据 max_status)
-          const setColor = (status) => {
-            switch (status) {
-              case 0:
-                return "#8ae359"; // 正常
-              case 1:
-                return "#eecb5f"; // 报警
-              case 2:
-                return "#f7715f"; // 危险
-              default:
-                return "#80808057"; // 未知或缺失
-            }
-          }
+  axios
+  .post(`/AnalysisMulti/autodiag/${autodiagType}`, params)
+  .then((res) => {
+    if (res.data.code === 400) {
+      this.$message({
+        message: '当前测点无法进行齿轮箱诊断',
+        type: 'warning',
+      });
+    } else if (res.data.code === 405) {
+      this.$message({
+        message: '当前采集频率不适合进行诊断分析',
+        type: 'warning',
+      });
+    } else {
+      const result = res.data.results || {};
+      this.statistics = res.data.statistics || {};
+      // x轴数据,时间戳
+      this.xData = this.tableData.map((item) => item.timeStamp);
+      // y轴数据,状态码二维数组
+      this.yData = [
+        result.crack?.status_codes || [],
+        result.wear?.status_codes || [],
+      ];
+      // 设置颜色函数(根据 max_status)
+      const setColor = (status) => {
+        switch (status) {
+          case 0:
+            return '#8ae359'; // 正常
+          case 1:
+            return '#eecb5f'; // 报警
+          case 2:
+            return '#f7715f'; // 危险
+          default:
+            return '#80808057'; // 未知或缺失
+        }
+      };
 
-          // 根据 max_status 设置颜色
-          this.bearingStateColors.innerRing = setColor(
-            result.crack?.max_status ?? -1
-          );
-          this.bearingStateColors.outerRing = setColor(
-            result.wear?.max_status ?? -1
-          );
+      // 根据 max_status 设置颜色
+      this.bearingStateColors.innerRing = setColor(
+        result.crack?.max_status ?? -1
+      );
+      this.bearingStateColors.outerRing = setColor(
+        result.wear?.max_status ?? -1
+      );
+    }
+  })
 
-        }
-         
-        })
         .catch((err) => {
           console.error("诊断失败:", err);
         })
@@ -275,6 +283,21 @@ export default {
           this.loading = false;
         });
     },
+
+    reset() {
+  this.tableData = []
+  this.xData = []
+  this.yData = []
+  this.statistics = {}
+  this.result = {}
+  this.currentPage = 1
+  this.bearingStateColors = {
+    innerRing: '#80808057',
+    outerRing: '#80808057',
+    rollingElement: '#80808057',
+    cage: '#80808057',
+  }
+}
   },
 };
 </script>

+ 28 - 3
src/views/health/components/malfunction/loose.vue

@@ -96,7 +96,6 @@
           :yData="[yData]"
           :yNames="['松动故障']"
           yAxisName="松动故障状态"
-   
         ></Eecharts>
       </div>
     </div>
@@ -194,12 +193,17 @@ export default {
       console.log(`当前页: ${val}`);
       setTimeout(() => {
         this.automaticDiagnosis();
-      },500);
+      }, 500);
 
       this.currentPage = val; // 子组件内部更新当前页
       this.$emit("updatePage", this.currentPage); // 通知父组件,把当前页传出去
     },
     automaticDiagnosis() {
+      if (this.tableData.length === 0) {
+        this.$message.warning("当前没有数据,无法进行诊断");
+        this.loading = false; // 确保关闭 loading 状态
+        return; // 直接返回,不发请求
+      }
       this.loading = true;
       const ids = this.tableData
         .map((item) => item.id)
@@ -220,8 +224,15 @@ export default {
       });
 
       axios
-        .post(`/WJJdiag/autodiag/${autodiagType}`, params)
+        .post(`/AnalysisMulti/autodiag/${autodiagType}`, params)
         .then((res) => {
+          if (res.data.code === 405) {
+            this.$message.warning(
+              res.data.message || "当前采集频率不适合进行诊断分析"
+            );
+            return; // 终止后续数据处理逻辑
+          }
+
           this.statistics = res.data.statistics;
           this.$set(this, "yData", [...res.data.results]);
           this.$set(
@@ -261,6 +272,20 @@ export default {
           this.loading = false;
         });
     },
+
+    reset() {
+      // 重置状态
+      this.xData = [];
+      this.yData = [];
+      this.statistics = {};
+      this.bearingStateColors = {
+        innerRing: "#80808057",
+        outerRing: "#80808057",
+        rollingElement: "#80808057",
+        cage: "#80808057",
+      };
+      this.tableData = [];
+    },
   },
 };
 </script>

+ 28 - 3
src/views/health/components/malfunction/misalignment.vue

@@ -96,7 +96,6 @@
           :yData="[yData]"
           :yNames="['不平衡故障']"
           yAxisName="不平衡故障状态"
-   
         ></Eecharts>
       </div>
     </div>
@@ -194,12 +193,17 @@ export default {
       console.log(`当前页: ${val}`);
       setTimeout(() => {
         this.automaticDiagnosis();
-      },500);
+      }, 500);
 
       this.currentPage = val; // 子组件内部更新当前页
       this.$emit("updatePage", this.currentPage); // 通知父组件,把当前页传出去
     },
     automaticDiagnosis() {
+            if (this.tableData.length === 0) {
+        this.$message.warning("当前没有数据,无法进行诊断");
+        this.loading = false; // 确保关闭 loading 状态
+        return; // 直接返回,不发请求
+      }
       this.loading = true;
       const ids = this.tableData
         .map((item) => item.id)
@@ -220,8 +224,16 @@ export default {
       });
 
       axios
-        .post(`/WJJdiag/autodiag/${autodiagType}`, params)
+        .post(`/AnalysisMulti/autodiag/${autodiagType}`, params)
         .then((res) => {
+          if (res.data.code === 405) {
+            this.$message.warning({
+              message: "当前采集频率不适合进行诊断分析",
+              duration: 2000,
+            });
+            return; // 停止继续处理数据
+          }
+
           this.statistics = res.data.statistics;
           this.$set(this, "yData", [...res.data.results]);
           this.$set(
@@ -261,6 +273,19 @@ export default {
           this.loading = false;
         });
     },
+         reset() {
+    // 重置状态
+    this.xData = []
+    this.yData = []
+    this.statistics = {}
+    this.bearingStateColors = {
+      innerRing: '#80808057',
+      outerRing: '#80808057',
+      rollingElement: '#80808057',
+      cage: '#80808057',
+    }
+    this.tableData = []
+  },
   },
 };
 </script>

+ 20 - 20
src/views/health/components/spectrogramcharts.vue

@@ -77,12 +77,12 @@ export default {
         { val: "移动峰值", checked: false, disabled: false },
       ],
       PXcheckList: [
-        { val: "Fr", checked: false },
-        { val: "BPFI", checked: false },
-        { val: "BPFO", checked: false },
-        { val: "BSF", checked: false },
-        { val: "FTF", checked: false },
-        { val: "3P", checked: false },
+        { val: "转速频率", checked: false },
+        { val: "内圈故障频率", checked: false },
+        { val: "外圈故障频率", checked: false },
+        { val: "滚动体故障频率", checked: false },
+        { val: "保持架频率", checked: false },
+        { val: "叶片频率", checked: false },
       ],
       Fr: [],
       BPFI: [],
@@ -195,12 +195,12 @@ export default {
 
     updateFeatureLines() {
       const newFeatureLines = {
-        Fr: this.checkedValues.includes("Fr") ? this.spectrumList.fn_Gen : [],
-        BPFI: this.checkedValues.includes("BPFI") ? this.spectrumList.BPFI : [],
-        BPFO: this.checkedValues.includes("BPFO") ? this.spectrumList.BPFO : [],
-        BSF: this.checkedValues.includes("BSF") ? this.spectrumList.BSF : [],
-        FTF: this.checkedValues.includes("FTF") ? this.spectrumList.FTF : [],
-        B3P: this.checkedValues.includes("3P")
+        Fr: this.checkedValues.includes("转速频率") ? this.spectrumList.fn_Gen : [],
+        BPFI: this.checkedValues.includes("内圈故障频率") ? this.spectrumList.BPFI : [],
+        BPFO: this.checkedValues.includes("外圈故障频率") ? this.spectrumList.BPFO : [],
+        BSF: this.checkedValues.includes("滚动体故障频率") ? this.spectrumList.BSF : [],
+        FTF: this.checkedValues.includes("保持架频率") ? this.spectrumList.FTF : [],
+        B3P: this.checkedValues.includes("叶片频率")
           ? Array.isArray(this.spectrumList.B3P)
             ? this.spectrumList.B3P
             : [{ Xaxis: this.spectrumList.B3P, val: "3P" }]
@@ -444,7 +444,7 @@ export default {
         analysisType: "frequency",
       };
       axios
-        .post("/WJapi/analysis/frequency", params)
+        .post("/AnalysisMulti/analysis/frequency", params)
         .then((res) => {
           this.spectrumList = { ...JSON.parse(res.data) };
 
@@ -455,22 +455,22 @@ export default {
           this.PXcheckList.forEach((item) => {
             if (item.checked) {
               switch (item.val) {
-                case "Fr":
+                case "转速频率":
                   this.Fr = this.spectrumList.fn_Gen;
                   break;
-                case "BPFI":
+                case "内圈故障频率":
                   this.BPFI = this.spectrumList.BPFI;
                   break;
-                case "BPFO":
+                case "外圈故障频率":
                   this.BPFO = this.spectrumList.BPFO;
                   break;
-                case "BSF":
+                case "滚动体故障频率":
                   this.BSF = this.spectrumList.BSF;
                   break;
-                case "FTF":
+                case "保持架频率":
                   this.FTF = this.spectrumList.FTF;
                   break;
-                case "3P":
+                case "叶片频率":
                   this.B3P = Array.isArray(this.spectrumList.B3P)
                     ? this.spectrumList.B3P
                     : [{ Xaxis: this.spectrumList.B3P, val: "3P" }];
@@ -531,7 +531,7 @@ export default {
   top: 30px;
   right: 0;
   font-size: 10px;
-  width: 100px;
+  width: 146px;
   border: 1px solid black;
   padding: 5px;
   background: #fff;

+ 1 - 1
src/views/health/components/timedomaincharts.vue

@@ -246,7 +246,7 @@ export default {
         windCode: this.windCode,
       };
       axios
-        .post("/WJapi/analysis/time", params)
+        .post("/AnalysisMulti/analysis/time", params)
         .then((res) => {
           this.timeList = JSON.parse(res.data);
 

+ 24 - 4
src/views/health/index.vue

@@ -25,6 +25,7 @@
           size="small"
           type="month"
           placeholder="选择月"
+          :picker-options="monthPickerOptions"
         />
       </p>
 
@@ -161,8 +162,6 @@ export default {
       timevalue: [],
       ListData: [],
       loading: false, // ✅ 加载状态
-
-  
     };
   },
   computed: {
@@ -173,6 +172,28 @@ export default {
         semi: "半直驱",
       };
     },
+
+    monthPickerOptions() {
+      return {
+        disabledDate: (time) => {
+          const code = this.companyCode;
+          const date = time;
+
+          if (code === "WOF046400029") {
+            const start = new Date("2023-10-01");
+            const end = new Date("2024-10-30");
+            return date < start || date > end;
+          } else if (code === "WOF091200030") {
+            const start = new Date("2023-01-01");
+            const end = new Date("2024-11-30");
+            return date < start || date > end;
+          } else {
+            // 其他公司不限制时间选择
+            return false;
+          }
+        },
+      };
+    },
   },
   created() {
     this.GETtree();
@@ -233,10 +254,9 @@ export default {
       const start = performance.now(); // ⏱️ 请求开始时间
 
       axios
-        .post(`/WJJhealth/health_assess`, parms)
+        .post(`/AnalysisMulti/health_assess`, parms)
         .then((res) => {
           this.ListData = res.data;
-
           const end = performance.now(); // ⏱️ 请求结束时间
           const duration = ((end - start) / 1000).toFixed(2);
           console.log(`接口请求耗时:${duration} 秒`);

+ 2 - 2
src/views/health/malfunction copy.vue

@@ -346,7 +346,7 @@ export default {
         });
 
         const thresholdReq = axios
-          .post("/WJJdiag/temperature/threshold", temperature)
+          .post("/AnalysisMulti/temperature/threshold", temperature)
           .then((res) => {
             const data = res.data.data.records || [];
             this.tabData[tab].codedata = data;
@@ -359,7 +359,7 @@ export default {
           });
 
         const trendReq = axios
-          .post("/WJJdiag/SPRT/trend", temperature)
+          .post("/AnalysisMulti/SPRT/trend", temperature)
           .then((res) => {
             const echartsdata = res.data.data || {};
             this.tabData[tab].echartsdata = echartsdata;

+ 120 - 107
src/views/health/malfunction.vue

@@ -106,6 +106,7 @@
     <div class="main-body">
       <keep-alive>
         <component
+          ref="activeComponent"
           :is="activeTab"
           :codedata="tabData[activeTab].codedata"
           v-bind="
@@ -276,10 +277,14 @@ export default {
       });
 
       axios
-        .get(`/ETLapi/waveData/getAllSamplingFrequency/${data.codeNumber}`)
-        .then((res) => {
-          condition.frequencyoptions = res.data.datas;
-        });
+ .get(`/ETLapi/waveData/getAllSamplingFrequency/${data.codeNumber}`)
+.then((res) => {
+  condition.frequencyoptions = (res.data.datas || [])
+    .map(item => Number(item))
+    .filter(num => num >= 12800)
+    .map(num => num.toString());
+});
+
 
       condition.companyCode = data.codeNumber;
     },
@@ -337,114 +342,122 @@ export default {
 
     conditions(page, isPageChange = false) {
       const tab = this.activeTab;
-      const condition = this.tabConditions[tab];
-
-    if (tab === "Temperature") {
-      const temperature = {
-        windCode: condition.companyCode,
-        windTurbineNumberList: [condition.unitvalue],
-        startTime: this.$formatDateTWO(condition.timevalue[0]),
-        endTime: this.$formatDateTWO(condition.timevalue[1]),
-        pageNo: page,
-        pageSize: 500,
-      }
-
-      const loading = this.$loading({
-        lock: true,
-        text: "温度诊断数据加载中,请稍候…",
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.8)",
-      })
-
-      const emptyEchartsData = {
-        gearbox_oil: { timestamps: [], values: [] },
-        generator_drive_end: { timestamps: [], values: [] },
-        generator_nondrive_end: { timestamps: [], values: [] },
-        main_bearing: { timestamps: [], values: [] },
-      }
-
-      const trendRequest = () => {
-        const trendStart = performance.now()
-        return axios
-          .post("/WJJdiag/SPRT/trend", temperature)
-          .then((res) => {
-            const trendEnd = performance.now()
-            console.log(
-              `温度诊断 trend 接口耗时: ${(
-                (trendEnd - trendStart) /
-                1000
-              ).toFixed(2)}s`
-            )
-            const echartsdata = res.data.data || {}
-            this.tabData[tab].echartsdata = echartsdata
-          })
-          .catch((err) => {
-            console.error("趋势图请求失败:", err)
-            this.$message.error("温度趋势图数据请求失败,请稍后再试")
-          })
-      }
+      this.$nextTick(() => {
+        const comp = this.$refs.activeComponent;
+        if (comp && typeof comp.reset === "function") {
+          comp.reset();
+        }
+      });
 
-      const thresholdStart = performance.now()
-      const thresholdReq = axios
-        .post("/WJJdiag/temperature/threshold", temperature)
-        .then((res) => {
-          const thresholdEnd = performance.now()
-          console.log(
-            `温度诊断 threshold 接口耗时: ${(
-              (thresholdEnd - thresholdStart) /
-              1000
-            ).toFixed(2)}s`
-          )
-
-          const data = res.data.data.records || []
-          this.tabData[tab].codedata = data
-          this.tabData[tab].totalCount = res.data.data.totalSize || 0
-
-          if (!data.length) {
-            this.$message.warning("暂无诊断数据")
-            // 清空echartsdata为固定空结构
-            this.tabData[tab].echartsdata = emptyEchartsData
-            return Promise.resolve("skip trend")
-          }
+      // 把后面接口请求部分放进延迟里,确保 reset 先执行完成
+      setTimeout(() => {
+        const condition = this.tabConditions[tab];
+
+        if (tab === "Temperature") {
+          const temperature = {
+            windCode: condition.companyCode,
+            windTurbineNumberList: [condition.unitvalue],
+            startTime: this.$formatDateTWO(condition.timevalue[0]),
+            endTime: this.$formatDateTWO(condition.timevalue[1]),
+            pageNo: page,
+            pageSize: 500,
+          };
+
+          const loading = this.$loading({
+            lock: true,
+            text: "温度诊断数据加载中,请稍候…",
+            spinner: "el-icon-loading",
+            background: "rgba(0, 0, 0, 0.8)",
+          });
 
-          // 有数据时,根据是否分页决定是否请求趋势图
-          return isPageChange ? Promise.resolve() : trendRequest()
-        })
-        .catch((err) => {
-          console.error("温度诊断请求失败:", err)
-          this.$message.error("温度诊断数据请求失败,请稍后再试")
-        })
+          const emptyEchartsData = {
+            gearbox_oil: { timestamps: [], values: [] },
+            generator_drive_end: { timestamps: [], values: [] },
+            generator_nondrive_end: { timestamps: [], values: [] },
+            main_bearing: { timestamps: [], values: [] },
+          };
+
+          const trendRequest = () => {
+            const trendStart = performance.now();
+            return axios
+              .post("/AnalysisMulti/SPRT/trend", temperature)
+              .then((res) => {
+                const trendEnd = performance.now();
+                console.log(
+                  `温度诊断 trend 接口耗时: ${(
+                    (trendEnd - trendStart) /
+                    1000
+                  ).toFixed(2)}s`
+                );
+                const echartsdata = res.data.data || {};
+                this.tabData[tab].echartsdata = echartsdata;
+              })
+              .catch((err) => {
+                console.error("趋势图请求失败:", err);
+                this.$message.error("温度趋势图数据请求失败,请稍后再试");
+              });
+          };
+
+          const thresholdStart = performance.now();
+          const thresholdReq = axios
+            .post("/AnalysisMulti/temperature/threshold", temperature)
+            .then((res) => {
+              const thresholdEnd = performance.now();
+              console.log(
+                `温度诊断 threshold 接口耗时: ${(
+                  (thresholdEnd - thresholdStart) /
+                  1000
+                ).toFixed(2)}s`
+              );
 
-      Promise.resolve(thresholdReq).finally(() => {
-        loading.close()
-      })
-    } else {
-        const params = {
-          samplingFrequency: condition.frequencyvalue,
-          windCode: condition.companyCode,
-          windTurbineNumberList: [condition.unitvalue],
-          mesureNameList: [condition.monitoringvalue],
-          startTime: this.$formatDateTWO(condition.timevalue[0]),
-          endTime: this.$formatDateTWO(condition.timevalue[1]),
-          pageNo: page,
-          pageSize: 10,
-        };
-
-        const startTime = performance.now();
-        axios
-          .post("/ETLapi/waveData/getMesureDataWithSF", params)
-          .then((res) => {
-            const endTime = performance.now();
-            console.log(
-              `其他 tab 接口请求耗时: ${(endTime - startTime).toFixed(2)}ms`
-            );
+              const data = res.data.data.records || [];
+              this.tabData[tab].codedata = data;
+              this.tabData[tab].totalCount = res.data.data.totalSize || 0;
+
+              if (!data.length) {
+                this.$message.warning("暂无诊断数据");
+                this.tabData[tab].echartsdata = emptyEchartsData;
+                return Promise.resolve("skip trend");
+              }
+
+              return isPageChange ? Promise.resolve() : trendRequest();
+            })
+            .catch((err) => {
+              console.error("温度诊断请求失败:", err);
+              this.$message.error("温度诊断数据请求失败,请稍后再试");
+            });
 
-            const data = res.data || {};
-            this.tabData[tab].codedata = data.datas || [];
-            this.tabData[tab].totalCount = data.totalCount || 0;
-            this.tabData[tab].totalPage = data.totalPage || 0;
+          Promise.resolve(thresholdReq).finally(() => {
+            loading.close();
           });
-      }
+        } else {
+          const params = {
+            samplingFrequency: condition.frequencyvalue,
+            windCode: condition.companyCode,
+            windTurbineNumberList: [condition.unitvalue],
+            mesureNameList: [condition.monitoringvalue],
+            startTime: this.$formatDateTWO(condition.timevalue[0]),
+            endTime: this.$formatDateTWO(condition.timevalue[1]),
+            pageNo: page,
+            pageSize: 10,
+          };
+
+          const startTime = performance.now();
+          axios
+            .post("/ETLapi/waveData/getMesureDataWithSF", params)
+            .then((res) => {
+              const endTime = performance.now();
+              console.log(
+                `其他 tab 接口请求耗时: ${(endTime - startTime).toFixed(2)}ms`
+              );
+
+              const data = res.data || {};
+              this.tabData[tab].codedata = data.datas || [];
+              this.tabData[tab].totalCount = data.totalCount || 0;
+              this.tabData[tab].totalPage = data.totalPage || 0;
+            });
+        }
+      }, 300); // 延迟100毫秒执行接口请求逻辑
     },
   },
 };

+ 7 - 7
src/views/health/vibration.vue

@@ -547,7 +547,7 @@ export default {
         this.$set(this.fourList[activeIndex], "loading", true);
         params.analysisType = "time";
         axios
-          .post("/WJapi/analysis/time", params)
+          .post("/AnalysisMulti/analysis/time", params)
           .then((res) => {
             const timeListTwo = JSON.parse(res.data);
             this.$set(this.fourList[activeIndex], "rowData", currentRow);
@@ -564,7 +564,7 @@ export default {
         this.$set(this.fourList[activeIndex], "loading", true);
         params.analysisType = "frequency";
         axios
-          .post("/WJapi/analysis/frequency", params)
+          .post("/AnalysisMulti/analysis/frequency", params)
           .then((res) => {
             const spectrumListTwo = JSON.parse(res.data);
             this.$set(this.fourList[activeIndex], "rowData", currentRow);
@@ -587,7 +587,7 @@ export default {
         params.fmin = this.xiaoval; // 最小频率参数
         params.fmax = this.daval; // 最大频率参数
         axios
-          .post("/WJapi/analysis/envelope", params)
+          .post("/AnalysisMulti/analysis/envelope", params)
           .then((res) => {
             const envelopeListTwo = JSON.parse(res.data);
             this.$set(this.fourList[activeIndex], "rowData", currentRow);
@@ -633,7 +633,7 @@ export default {
         this.$set(this.fourList[activeIndex], "loading", true);
         params.analysisType = "time";
         axios
-          .post("/WJapi/analysis/time", params)
+          .post("/AnalysisMulti/analysis/time", params)
           .then((res) => {
             const timeListTwo = JSON.parse(res.data);
             this.$set(this.fourList[activeIndex], "rowData", currentRow);
@@ -650,7 +650,7 @@ export default {
         this.$set(this.fourList[activeIndex], "loading", true);
         params.analysisType = "frequency";
         axios
-          .post("/WJapi/analysis/frequency", params)
+          .post("/AnalysisMulti/analysis/frequency", params)
           .then((res) => {
             const spectrumListTwo = JSON.parse(res.data);
             this.$set(this.fourList[activeIndex], "rowData", currentRow);
@@ -673,7 +673,7 @@ export default {
         params.fmin = this.xiaoval; // 最小频率
         params.fmax = this.daval; // 最大频率
         axios
-          .post("/WJapi/analysis/envelope", params)
+          .post("/AnalysisMulti/analysis/envelope", params)
           .then((res) => {
             const envelopeListTwo = JSON.parse(res.data);
             this.$set(this.fourList[activeIndex], "rowData", currentRow);
@@ -761,7 +761,7 @@ export default {
       };
 
       axios
-        .post("/WJapi/analysis/trend", params)
+        .post("/AnalysisMulti/analysis/trend", params)
         .then((res) => {
           this.qsList = JSON.parse(res.data);
           this.fourList.push(newItem);

+ 14 - 17
vue.config.js

@@ -66,8 +66,8 @@ module.exports = {
         // target: "http://192.168.5.4:16200", // 石月
         // target: "http://192.168.50.235:16200", // 内网
         // target: "http://192.168.5.15:16200",
-        target: "http://192.168.50.235:16500", //演示环境
-        // target: "http://106.120.102.238:26500", //外网演示环境
+        // target: "http://192.168.50.235:16500", //演示环境
+        target: "http://106.120.102.238:26500", //外网演示环境
         // target: "http://106.120.102.238:16700", // 外网16700  生产16600
         // target: "http://10.96.137.5",
         changeOrigin: true,
@@ -102,31 +102,28 @@ module.exports = {
 
       // 文佳
       "/WJapi": {
-        // target: "http://192.168.50.235:8888", // WZLapi 内网 目标地址
-        target: "http://106.120.102.238:18888", // WZLapi/ 内网 目标地址
+        target: "http://106.120.102.238:18888", 
         changeOrigin: true,
         pathRewrite: {
-          "^/WJapi": "", // 去掉 /WZLapi 前缀
-        },
-        onProxyReq(proxyReq, req, res) {
-          console.log("Proxying /sAlgorithm request to:", proxyReq.path); // 打印代理请求路径
+          "^/WJapi": "", 
         },
       },
 
       // 王娇娇健康评估
-      "/WJJhealth": {
-        target: "http://106.120.102.238:28999/WJJhealth/api/health", // WZLapi/ 内网 目标地址
+      "/AnalysisMulti": {
+        target: "http://106.120.102.238:28999/AnalysisMulti", 
         changeOrigin: true,
         pathRewrite: {
-          "^/WJJhealth": "", // 去掉 /WZLapi 前缀
+          "^/AnalysisMulti": "", 
         },
       },
+      
       // 故障诊断
       "/WJJdiag": {
-        target: "http://106.120.102.238:28999/WJJdiag", // WZLapi/ 内网 目标地址
+        target: "http://106.120.102.238:28999/WJJdiag",
         changeOrigin: true,
         pathRewrite: {
-          "^/WJJdiag": "", // 去掉 /WZLapi 前缀
+          "^/WJJdiag": "", 
         },
       },
 
@@ -137,7 +134,7 @@ module.exports = {
         // target: "http://192.168.50.235:8999/transDataWeb", //测试
         changeOrigin: true,
         pathRewrite: {
-          "^/transDataWeb": "", // 去掉 /transDataWeb 前缀
+          "^/transDataWeb": "", 
         },
       },
       //自定义算法文佳
@@ -146,7 +143,7 @@ module.exports = {
         target: "http://106.120.102.238:58880", //这个代理会走两次代理转发
         changeOrigin: true,
         pathRewrite: {
-          "^/sAlgorithm": "", // 如果后端需要 `/api` 前缀
+          "^/sAlgorithm": "", 
         },
       },
       //nodejs 数据库数据
@@ -155,7 +152,7 @@ module.exports = {
         target: "http://106.120.102.238:58880", //这个代理会走两次代理转发
         changeOrigin: true,
         pathRewrite: {
-          "^/databaseApi": "", // 去掉 /databaseApi 前缀
+          "^/databaseApi": "",
         },
       },
       //nodejs 数据库数据
@@ -165,7 +162,7 @@ module.exports = {
         // target: "http://106.120.102.238:28999/downLoadChart", //外网演示
         changeOrigin: true,
         pathRewrite: {
-          "^/downLoadChart": "", // 去掉 /downLoadChart 前缀
+          "^/downLoadChart": "", 
         },
       },
     },