ソースを参照

修改配置文件

liujiejie 4 ヶ月 前
コミット
f5709a61cb

+ 1 - 1
.env.jl

@@ -1,7 +1,7 @@
 VUE_APP_THEM="green"
 VUE_APP_ISSHOWHD='default'
 VUE_APP_Helath='dev'
-VUE_APP_TITLE='机组功率曲线异常检测数据分析系统'
+VUE_APP_TITLE='风电机组隐患识别及健康状态评估系统'
 
 #吉林外网
 VUE_APP_MAPVIEW="http://127.0.0.1:8080/tiles/{z}/{x}/{y}.png"

+ 2 - 1
public/index.html

@@ -10,8 +10,9 @@
     <link rel="stylesheet" href="/dist/css/luckysheet.css" />
     <link rel="stylesheet" href="/dist/assets/iconfont/iconfont.css" />
     <!-- <link rel="stylesheet" href="/dist/expendPlugins/chart/chartmix.css" /> -->
+    <!-- 先于应用脚本加载;部署后可编辑 dist/runtime-config.js 改标题 -->
+    <script src="<%= BASE_URL %>runtime-config.js"></script>
     <title>机组功率曲线异常检测数据分析系统</title>
-    <!-- <script src="./config/config.js"></script> -->
   </head>
 
   <body>

+ 12 - 0
public/runtime-config.js

@@ -0,0 +1,12 @@
+/**
+ * 运行时配置(不参与 webpack 打包,会原样复制到 dist 根目录)
+ * 部署后修改本文件即可更新标题,无需重新 build。
+ */
+(function () {
+  window.__RUNTIME_CONFIG__ = {
+    title: "机组功率曲线异常检测数据分析系统",
+  };
+  if (typeof document !== "undefined" && window.__RUNTIME_CONFIG__.title) {
+    document.title = window.__RUNTIME_CONFIG__.title;
+  }
+})();

+ 10 - 9
src/views/ledger/milltype.vue

@@ -148,13 +148,13 @@
               >停用</el-button
             >
 
-            <el-button
+            <!-- <el-button
               style="color: #666"
               @click="ONunit(scope.row)"
               type="text"
               size="small"
               >部件信息</el-button
-            >
+            > -->
 
             <el-button
               style="color: #f00"
@@ -444,10 +444,11 @@ export default {
           { required: true, message: "请输入叶轮直径", trigger: "blur" },
           { validator: this.validateNumber, trigger: ["blur", "change"] },
         ],
-         rotationalSpeedRatio: [ // 新增传动比字段的验证规则
-    { required: true, message: "请输入传动比", trigger: "blur" },
-    { validator: this.validateNumber, trigger: ["blur", "change"] }, // 假设您也有验证数字的自定义验证器
-  ],
+        rotationalSpeedRatio: [
+          // 新增传动比字段的验证规则
+          { required: true, message: "请输入传动比", trigger: "blur" },
+          { validator: this.validateNumber, trigger: ["blur", "change"] }, // 假设您也有验证数字的自定义验证器
+        ],
       },
       particularsdata: [],
       // 新增信息
@@ -597,7 +598,7 @@ export default {
         callback(new Error("该项不能为空"));
       } else if (!numberRegex.test(value)) {
         callback(
-          new Error("该项必须为不超过四位数且小数点后不超过三位数的数字")
+          new Error("该项必须为不超过四位数且小数点后不超过三位数的数字"),
         );
       } else {
         callback();
@@ -644,7 +645,7 @@ export default {
         (res) => {
           this.unusualdialog = true;
           this.particularsdata = res.data;
-        }
+        },
       );
     },
     //分页数据切换
@@ -675,7 +676,7 @@ export default {
             this.ruleForm[key] = item[key];
           });
           console.log(res);
-        }
+        },
       );
       this.title = "编辑机型";
       this.nuedialog = true;

+ 20 - 3
src/views/login/Index.vue

@@ -44,6 +44,16 @@
 </template>
 
 <script>
+/** `runtime-config.js` 未加载或字段为空时的兜底文案 */
+const DEFAULT_LOGIN_TITLE = "机组功率曲线异常检测数据分析系统";
+
+function getRuntimeTitle() {
+  const cfg =
+    typeof window !== "undefined" ? window.__RUNTIME_CONFIG__ : undefined;
+  const t = cfg && cfg.title;
+  return typeof t === "string" && t.trim() ? t.trim() : DEFAULT_LOGIN_TITLE;
+}
+
 export default {
   data() {
     var validatePass = (rule, value, callback) => {
@@ -58,7 +68,6 @@ export default {
         userName: "",
         password: "",
       },
-      title: process.env.VUE_APP_TITLE,
       loadingView: false,
       rules: {
         userName: [
@@ -73,7 +82,15 @@ export default {
       },
     };
   },
-  created() {},
+  computed: {
+    /** 与 `public/runtime-config.js` 中 title 同步,部署后改文件即可 */
+    title() {
+      return getRuntimeTitle();
+    },
+  },
+  created() {
+    document.title = this.title;
+  },
   methods: {
     // 登录
     login(formName) {
@@ -122,7 +139,7 @@ export default {
   left: 50%;
   transform: translate(-50%, -50%);
   padding: 0 50px;
-  width: 430px;
+  width: 450px;
   background: #fff;
   border: 1px solid rgb(231, 231, 231);
   border-radius: 5px;

+ 207 - 207
src/views/performance/assetssMag.vue

@@ -309,7 +309,7 @@
           min-width="300"
         >
           <template slot-scope="scope">
-            <el-button
+            <!-- <el-button
               @click="handleDownLoadChart(scope.row)"
               type="text"
               size="small"
@@ -320,7 +320,7 @@
               "
             >
               下载报告
-            </el-button>
+            </el-button> -->
             <!-- <el-button
               @click="abnormalDialog(scope.row, '上传报告')"
               type="text"
@@ -481,7 +481,7 @@ import {
 import { downloadDocx } from "@/utils/common";
 import { getFieldInfo } from "@/api/overview";
 import axios from "axios";
-import pLimit from "p-limit";
+// import pLimit from "p-limit";
 import { allAnalysisType } from "./js/allAnalysisType";
 import { mapMutations, mapState } from "vuex";
 import {
@@ -593,7 +593,7 @@ export default {
       itemAnalysis,
       itemField,
       filterAnalysis,
-      typeChart
+      typeChart,
     ) {
       try {
         if (itemField.analysisTypeName === "环境温度传感器") {
@@ -625,18 +625,18 @@ export default {
               filterAnalysis.typeDocxName === "production_indicator_unit"
                 ? "radar"
                 : urlType,
-          }
+          },
         );
         // 每完成 10% 提示一次(可调)
         const percent = Math.floor(
-          (this.progress.current / this.progress.total) * 100
+          (this.progress.current / this.progress.total) * 100,
         );
         if (percent % 5 === 0 && !this._shownPercents?.includes(percent)) {
           this._shownPercents = this._shownPercents || [];
           this._shownPercents.push(percent);
 
           this.$notify.info(
-            `📈 已完成 ${percent}%/${this.progress.current}张,共 ${this.progress.total} 张图表`
+            `📈 已完成 ${percent}%/${this.progress.current}张,共 ${this.progress.total} 张图表`,
           );
         }
         let key = `zn-techcn-replace-tags-${filterAnalysis.typeDocxName}-${typeChart}`;
@@ -685,207 +685,207 @@ export default {
         console.error("生成失败:", err);
       }
     },
-    async handleDownLoadChart(row) {
-      this.progress.current = 0;
-      this.progress.total = 0;
-      this.fileDataList = {};
-      this.setDownloadDisabled(true);
-      this.$notify.warning("开始生成 Word 文档...");
-      try {
-        await this.getAllAnalysis(row.batchCode);
-        await this.getFieldDetail(row.batchCode);
-        this.$message.info("开始生成word文档");
-        const limit = pLimit(5); // 限制同时并发的请求数量为 5
-        const tasks = [];
-        for (const itemAnalysis of this.allAnalysis) {
-          const filterAnalysis = allAnalysisType.filter(
-            (itemType) => itemType.typeName === itemAnalysis.analysisTypeName
-          )[0];
+    // async handleDownLoadChart(row) {
+    //   this.progress.current = 0;
+    //   this.progress.total = 0;
+    //   this.fileDataList = {};
+    //   this.setDownloadDisabled(true);
+    //   this.$notify.warning("开始生成 Word 文档...");
+    //   try {
+    //     await this.getAllAnalysis(row.batchCode);
+    //     await this.getFieldDetail(row.batchCode);
+    //     this.$message.info("开始生成word文档");
+    //     const limit = pLimit(5); // 限制同时并发的请求数量为 5
+    //     const tasks = [];
+    //     for (const itemAnalysis of this.allAnalysis) {
+    //       const filterAnalysis = allAnalysisType.filter(
+    //         (itemType) => itemType.typeName === itemAnalysis.analysisTypeName,
+    //       )[0];
 
-          if (itemAnalysis.generalFiles) {
-            //这里过滤的是发电机温度的类型 在url 中是否能找到filterFileAddr
-            for (const itemField of filterAnalysis.filterFileAddr
-              ? itemAnalysis.generalFiles
-                  .filter((item) => item.fileAddr.endsWith(".json"))
-                  .filter((item) =>
-                    item.fileAddr.includes(filterAnalysis.filterFileAddr)
-                  ) || []
-              : itemAnalysis.generalFiles) {
-              //静态偏航误差 --通过allAnalysisType.js文件配置实现需求
-              if (Array.isArray(filterAnalysis.generalFiles.urlType)) {
-                filterAnalysis.generalFiles.urlType.map(
-                  (itemUrlType, indUrlType) => {
-                    tasks.push(
-                      limit(async () => {
-                        await this.postChartData(
-                          itemUrlType,
-                          row,
-                          itemAnalysis,
-                          itemField,
-                          filterAnalysis,
-                          "generalFiles"
-                        );
-                        this.progress.current++;
-                      })
-                    );
-                  }
-                );
-              } else if (filterAnalysis.typeCode === "fault") {
-                if (itemField.fileAddr.includes("turbine_fault_result")) {
-                  if (itemField.engineTypeCode === "turbine_fault_result") {
-                    tasks.push(
-                      limit(async () => {
-                        await this.postChartData(
-                          "faultUnitChart",
-                          row,
-                          itemAnalysis,
-                          itemField,
-                          filterAnalysis,
-                          "generalFiles"
-                        );
-                        this.progress.current++;
-                      })
-                    );
-                  }
-                } else {
-                  if (itemField.engineTypeCode === "total_fault_result") {
-                    tasks.push(
-                      limit(async () => {
-                        await this.postChartData(
-                          "faultAllChart",
-                          row,
-                          itemAnalysis,
-                          itemField,
-                          filterAnalysis,
-                          "generalFiles"
-                        );
-                        this.progress.current++;
-                      })
-                    );
-                  }
-                }
-              } else if (filterAnalysis.typeCode === "production_indicator") {
-                //总图全场
-                if (
-                  itemField.fileAddr.includes(
-                    filterAnalysis.generalFiles.FileTypeFromUrl
-                  )
-                ) {
-                  tasks.push(
-                    limit(async () => {
-                      await this.postChartData(
-                        filterAnalysis.generalFiles.urlType,
-                        row,
-                        itemAnalysis,
-                        itemField,
-                        filterAnalysis,
-                        "generalFiles"
-                      );
-                      this.progress.current++;
-                      // 每完成 10% 提示一次(可调)
-                    })
-                  );
-                } else {
-                  tasks.push(
-                    limit(async () => {
-                      await this.postChartData(
-                        "radarChart",
-                        row,
-                        itemAnalysis,
-                        itemField,
-                        filterAnalysis,
-                        "generalFiles"
-                      );
-                      this.progress.current++;
-                    })
-                  );
-                }
-              } else {
-                tasks.push(
-                  limit(async () => {
-                    await this.postChartData(
-                      filterAnalysis.generalFiles.urlType,
-                      row,
-                      itemAnalysis,
-                      itemField,
-                      filterAnalysis,
-                      "generalFiles"
-                    );
-                    this.progress.current++;
-                  })
-                );
-              }
-            }
-          }
-          if (itemAnalysis.diagramRelations) {
-            for (const itemField of filterAnalysis.filterFileAddr
-              ? itemAnalysis.diagramRelations
-                  .filter((item) => item.fileAddr.endsWith(".json"))
-                  .filter((item) =>
-                    item.fileAddr.includes(filterAnalysis.filterFileAddr)
-                  ) || []
-              : itemAnalysis.diagramRelations) {
-              const urlType = Array.isArray(
-                filterAnalysis.diagramRelations.urlType
-              )
-                ? this.getFileTypeFromUrl(
-                    itemField.fileAddr,
-                    filterAnalysis.diagramRelations.FileTypeFromUrl
-                  ) === filterAnalysis.diagramRelations.FileTypeFromUrl
-                  ? filterAnalysis.diagramRelations.urlType[0]
-                  : filterAnalysis.diagramRelations.urlType[1]
-                : filterAnalysis.diagramRelations.urlType;
-              tasks.push(
-                limit(async () => {
-                  await this.postChartData(
-                    urlType,
-                    row,
-                    itemAnalysis,
-                    itemField,
-                    filterAnalysis,
-                    "diagramRelations"
-                  );
-                  this.progress.current++;
-                })
-              );
-            }
-          }
-        }
-        this.progress.total = tasks.length;
-        await Promise.all(tasks);
+    //       if (itemAnalysis.generalFiles) {
+    //         //这里过滤的是发电机温度的类型 在url 中是否能找到filterFileAddr
+    //         for (const itemField of filterAnalysis.filterFileAddr
+    //           ? itemAnalysis.generalFiles
+    //               .filter((item) => item.fileAddr.endsWith(".json"))
+    //               .filter((item) =>
+    //                 item.fileAddr.includes(filterAnalysis.filterFileAddr),
+    //               ) || []
+    //           : itemAnalysis.generalFiles) {
+    //           //静态偏航误差 --通过allAnalysisType.js文件配置实现需求
+    //           if (Array.isArray(filterAnalysis.generalFiles.urlType)) {
+    //             filterAnalysis.generalFiles.urlType.map(
+    //               (itemUrlType, indUrlType) => {
+    //                 tasks.push(
+    //                   limit(async () => {
+    //                     await this.postChartData(
+    //                       itemUrlType,
+    //                       row,
+    //                       itemAnalysis,
+    //                       itemField,
+    //                       filterAnalysis,
+    //                       "generalFiles",
+    //                     );
+    //                     this.progress.current++;
+    //                   }),
+    //                 );
+    //               },
+    //             );
+    //           } else if (filterAnalysis.typeCode === "fault") {
+    //             if (itemField.fileAddr.includes("turbine_fault_result")) {
+    //               if (itemField.engineTypeCode === "turbine_fault_result") {
+    //                 tasks.push(
+    //                   limit(async () => {
+    //                     await this.postChartData(
+    //                       "faultUnitChart",
+    //                       row,
+    //                       itemAnalysis,
+    //                       itemField,
+    //                       filterAnalysis,
+    //                       "generalFiles",
+    //                     );
+    //                     this.progress.current++;
+    //                   }),
+    //                 );
+    //               }
+    //             } else {
+    //               if (itemField.engineTypeCode === "total_fault_result") {
+    //                 tasks.push(
+    //                   limit(async () => {
+    //                     await this.postChartData(
+    //                       "faultAllChart",
+    //                       row,
+    //                       itemAnalysis,
+    //                       itemField,
+    //                       filterAnalysis,
+    //                       "generalFiles",
+    //                     );
+    //                     this.progress.current++;
+    //                   }),
+    //                 );
+    //               }
+    //             }
+    //           } else if (filterAnalysis.typeCode === "production_indicator") {
+    //             //总图全场
+    //             if (
+    //               itemField.fileAddr.includes(
+    //                 filterAnalysis.generalFiles.FileTypeFromUrl,
+    //               )
+    //             ) {
+    //               tasks.push(
+    //                 limit(async () => {
+    //                   await this.postChartData(
+    //                     filterAnalysis.generalFiles.urlType,
+    //                     row,
+    //                     itemAnalysis,
+    //                     itemField,
+    //                     filterAnalysis,
+    //                     "generalFiles",
+    //                   );
+    //                   this.progress.current++;
+    //                   // 每完成 10% 提示一次(可调)
+    //                 }),
+    //               );
+    //             } else {
+    //               tasks.push(
+    //                 limit(async () => {
+    //                   await this.postChartData(
+    //                     "radarChart",
+    //                     row,
+    //                     itemAnalysis,
+    //                     itemField,
+    //                     filterAnalysis,
+    //                     "generalFiles",
+    //                   );
+    //                   this.progress.current++;
+    //                 }),
+    //               );
+    //             }
+    //           } else {
+    //             tasks.push(
+    //               limit(async () => {
+    //                 await this.postChartData(
+    //                   filterAnalysis.generalFiles.urlType,
+    //                   row,
+    //                   itemAnalysis,
+    //                   itemField,
+    //                   filterAnalysis,
+    //                   "generalFiles",
+    //                 );
+    //                 this.progress.current++;
+    //               }),
+    //             );
+    //           }
+    //         }
+    //       }
+    //       if (itemAnalysis.diagramRelations) {
+    //         for (const itemField of filterAnalysis.filterFileAddr
+    //           ? itemAnalysis.diagramRelations
+    //               .filter((item) => item.fileAddr.endsWith(".json"))
+    //               .filter((item) =>
+    //                 item.fileAddr.includes(filterAnalysis.filterFileAddr),
+    //               ) || []
+    //           : itemAnalysis.diagramRelations) {
+    //           const urlType = Array.isArray(
+    //             filterAnalysis.diagramRelations.urlType,
+    //           )
+    //             ? this.getFileTypeFromUrl(
+    //                 itemField.fileAddr,
+    //                 filterAnalysis.diagramRelations.FileTypeFromUrl,
+    //               ) === filterAnalysis.diagramRelations.FileTypeFromUrl
+    //               ? filterAnalysis.diagramRelations.urlType[0]
+    //               : filterAnalysis.diagramRelations.urlType[1]
+    //             : filterAnalysis.diagramRelations.urlType;
+    //           tasks.push(
+    //             limit(async () => {
+    //               await this.postChartData(
+    //                 urlType,
+    //                 row,
+    //                 itemAnalysis,
+    //                 itemField,
+    //                 filterAnalysis,
+    //                 "diagramRelations",
+    //               );
+    //               this.progress.current++;
+    //             }),
+    //           );
+    //         }
+    //       }
+    //     }
+    //     this.progress.total = tasks.length;
+    //     await Promise.all(tasks);
 
-        const engineTypeList = await this.getEngineTypeList(
-          this.fieldInfo.engineMillTypes,
-          row.batchCode
-        );
-        this.$notify.success("✅ 图表全部生成完成,开始生成 Word 文档...");
-        const wordFilePath = await axios.post(
-          "/downLoadChart/chartServer/charts/CopyFileCsv",
-          {
-            fieldInfo: this.fieldInfo,
-            dataTime: `${this.analysisInfo.dataStartTime}-${this.analysisInfo.dataEndTime}`,
-            bucketName: "bucket-zhzn",
-            objectName: `charts/${row.fieldCode}/${row.batchCode}`,
-            engineTypeList: engineTypeList,
-            ...this.fileDataList,
-          }
-        );
-        // //下载minio 文件
-        downloadDocx(
-          wordFilePath.data.data.url,
-          wordFilePath.data.data.fileName
-        );
-        this.$notify.success("🎉 Word 文档生成并已下载!");
-        this.setDownloadDisabled(false);
-      } catch (error) {
-        console.log(error, "error");
-        this.$notify.error("🎉 Word 文档生成并下载失败!");
-        this.setDownloadDisabled(false);
-      }
-    },
+    //     const engineTypeList = await this.getEngineTypeList(
+    //       this.fieldInfo.engineMillTypes,
+    //       row.batchCode,
+    //     );
+    //     this.$notify.success("✅ 图表全部生成完成,开始生成 Word 文档...");
+    //     const wordFilePath = await axios.post(
+    //       "/downLoadChart/chartServer/charts/CopyFileCsv",
+    //       {
+    //         fieldInfo: this.fieldInfo,
+    //         dataTime: `${this.analysisInfo.dataStartTime}-${this.analysisInfo.dataEndTime}`,
+    //         bucketName: "bucket-zhzn",
+    //         objectName: `charts/${row.fieldCode}/${row.batchCode}`,
+    //         engineTypeList: engineTypeList,
+    //         ...this.fileDataList,
+    //       },
+    //     );
+    //     // //下载minio 文件
+    //     downloadDocx(
+    //       wordFilePath.data.data.url,
+    //       wordFilePath.data.data.fileName,
+    //     );
+    //     this.$notify.success("🎉 Word 文档生成并已下载!");
+    //     this.setDownloadDisabled(false);
+    //   } catch (error) {
+    //     console.log(error, "error");
+    //     this.$notify.error("🎉 Word 文档生成并下载失败!");
+    //     this.setDownloadDisabled(false);
+    //   }
+    // },
     async getEngineTypeList(typeList, batchCode) {
       return await Promise.all(
-        typeList.map((item) => this.getEngineMillList(item, batchCode))
+        typeList.map((item) => this.getEngineMillList(item, batchCode)),
       );
     },
     // 查询
@@ -912,7 +912,7 @@ export default {
       this.loading = true;
       const res = await windEngineMillPage(paramsData);
       const filterMill = uniqueList.filter(
-        (item) => item.millTypeCode === res.data.list[0].millTypeCode
+        (item) => item.millTypeCode === res.data.list[0].millTypeCode,
       );
       return { ...res.data.list[0], ratedPower: filterMill[0].ratedCapacity };
     },
@@ -935,7 +935,7 @@ export default {
     handleAutoAsstessList() {
       window.open(
         this.$router.resolve({ path: "/home/performance/autoAssetss" }).href,
-        "_blank"
+        "_blank",
       );
     },
     // 创建分析时请求
@@ -1061,7 +1061,7 @@ export default {
       if (state === "0") {
         // 分析状态为分析中
         this.$confirm(
-          "当前查看的分析记录为历史分析结果,最新分析记录还未分析完成不展示!"
+          "当前查看的分析记录为历史分析结果,最新分析记录还未分析完成不展示!",
         )
           .then(() => {
             navigateToDetails();