Browse Source

修复bu gbug

liujiejie 1 year ago
parent
commit
05d08e691e

BIN
dist.zip


+ 76 - 76
src/components/Tinymce.vue

@@ -14,12 +14,12 @@
       @onCreated="onCreated"
       @change="handleEditorChange"
     />
-    <input
+    <!-- <input
       type="file"
       ref="fileInput"
       style="display: none"
       @change="handleFileUpload"
-    />
+    /> -->
   </div>
 </template>
 
@@ -29,45 +29,45 @@ import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
 import { Boot } from "@wangeditor/editor";
 import { uploadFile } from "@/api/performance";
 
-const customMenuKey = "customUpload";
-let isCustomMenuRegistered = false;
+// const customMenuKey = "customUpload";
+// let isCustomMenuRegistered = false;
 
-function registerCustomUploadIcon(componentInstance) {
-  if (isCustomMenuRegistered) return;
+// function registerCustomUploadIcon(componentInstance) {
+//   if (isCustomMenuRegistered) return;
 
-  const customUploadMenu = {
-    key: customMenuKey,
-    factory() {
-      return {
-        tag: "button",
-        getValue(editor) {
-          return editor.getHtml();
-        },
-        isActive(editor) {
-          return false;
-        },
-        exec: () => {
-          componentInstance.uploadFile();
-        },
-        isDisabled(editor) {
-          return false;
-        },
-        title: "上传文件",
-        iconSvg: `<svg t="1718589544286" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1591" width="200" height="200">
-          <path d="M1024 693.248q0 25.6-8.704 48.128t-24.576 40.448-36.864 30.208-45.568 16.384l1.024 1.024-17.408 0-4.096 0-4.096 0-675.84 0q-5.12 1.024-16.384 1.024-39.936 0-74.752-15.36t-60.928-41.472-40.96-60.928-14.848-74.752 14.848-74.752 40.96-60.928 60.928-41.472 74.752-15.36l1.024 0q-1.024-8.192-1.024-15.36l0-16.384q0-72.704 27.648-137.216t75.776-112.128 112.128-75.264 136.704-27.648 137.216 27.648 112.64 75.264 75.776 112.128 27.648 137.216q0 37.888-8.192 74.24t-22.528 69.12q5.12-1.024 10.752-1.536t10.752-0.512q27.648 0 52.736 10.752t43.52 29.696 29.184 44.032 10.752 53.76zM665.6 571.392q20.48 0 26.624-4.608t-8.192-22.016q-14.336-18.432-31.744-48.128t-36.352-60.416-38.4-57.344-37.888-38.912q-18.432-13.312-27.136-14.336t-25.088 12.288q-18.432 15.36-35.84 38.912t-35.328 50.176-35.84 52.224-36.352 45.056q-18.432 18.432-13.312 32.768t25.6 14.336l16.384 0q9.216 0 19.968 0.512t20.992 0.512l17.408 0q14.336 1.024 18.432 9.728t4.096 24.064q0 17.408-0.512 30.72t-0.512 25.6-0.512 25.6-0.512 30.72q0 7.168 1.536 15.36t5.632 15.36 12.288 11.776 21.504 4.608l23.552 0q9.216 0 27.648 1.024 24.576 0 28.16-12.288t3.584-38.912q0-23.552 0.512-42.496t0.512-51.712q0-23.552 4.608-36.352t19.968-12.8q11.264 0 32.256-0.512t32.256-0.512z" p-id="1592"></path>
-        </svg>`,
-        text: "上传文件",
-      };
-    },
-  };
+//   const customUploadMenu = {
+//     key: customMenuKey,
+//     factory() {
+//       return {
+//         tag: "button",
+//         getValue(editor) {
+//           return editor.getHtml();
+//         },
+//         isActive(editor) {
+//           return false;
+//         },
+//         exec: () => {
+//           componentInstance.uploadFile();
+//         },
+//         isDisabled(editor) {
+//           return false;
+//         },
+//         title: "上传文件",
+//         iconSvg: `<svg t="1718589544286" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1591" width="200" height="200">
+//           <path d="M1024 693.248q0 25.6-8.704 48.128t-24.576 40.448-36.864 30.208-45.568 16.384l1.024 1.024-17.408 0-4.096 0-4.096 0-675.84 0q-5.12 1.024-16.384 1.024-39.936 0-74.752-15.36t-60.928-41.472-40.96-60.928-14.848-74.752 14.848-74.752 40.96-60.928 60.928-41.472 74.752-15.36l1.024 0q-1.024-8.192-1.024-15.36l0-16.384q0-72.704 27.648-137.216t75.776-112.128 112.128-75.264 136.704-27.648 137.216 27.648 112.64 75.264 75.776 112.128 27.648 137.216q0 37.888-8.192 74.24t-22.528 69.12q5.12-1.024 10.752-1.536t10.752-0.512q27.648 0 52.736 10.752t43.52 29.696 29.184 44.032 10.752 53.76zM665.6 571.392q20.48 0 26.624-4.608t-8.192-22.016q-14.336-18.432-31.744-48.128t-36.352-60.416-38.4-57.344-37.888-38.912q-18.432-13.312-27.136-14.336t-25.088 12.288q-18.432 15.36-35.84 38.912t-35.328 50.176-35.84 52.224-36.352 45.056q-18.432 18.432-13.312 32.768t25.6 14.336l16.384 0q9.216 0 19.968 0.512t20.992 0.512l17.408 0q14.336 1.024 18.432 9.728t4.096 24.064q0 17.408-0.512 30.72t-0.512 25.6-0.512 25.6-0.512 30.72q0 7.168 1.536 15.36t5.632 15.36 12.288 11.776 21.504 4.608l23.552 0q9.216 0 27.648 1.024 24.576 0 28.16-12.288t3.584-38.912q0-23.552 0.512-42.496t0.512-51.712q0-23.552 4.608-36.352t19.968-12.8q11.264 0 32.256-0.512t32.256-0.512z" p-id="1592"></path>
+//         </svg>`,
+//         text: "上传文件",
+//       };
+//     },
+//   };
 
-  Boot.registerMenu({
-    key: customMenuKey,
-    ...customUploadMenu,
-  });
+//   Boot.registerMenu({
+//     key: customMenuKey,
+//     ...customUploadMenu,
+//   });
 
-  isCustomMenuRegistered = true;
-}
+//   isCustomMenuRegistered = true;
+// }
 
 export default Vue.extend({
   components: { Editor, Toolbar },
@@ -117,50 +117,50 @@ export default Vue.extend({
   },
   created() {
     this.html = this.value;
-    registerCustomUploadIcon(this);
+    // registerCustomUploadIcon(this);
   },
   methods: {
     onCreated(editor) {
       this.editor = Object.seal(editor);
-      this.toolbarConfig.insertKeys = {
-        index: 22,
-        keys: [customMenuKey],
-      };
-    },
-    handleFileUpload(event) {
-      const file = event.target.files[0];
-      if (!file) return;
-      if (
-        !/^(text\/html|application\/pdf|application\/msword|application\/vnd\.ms-excel|application\/vnd\.ms-office|application\/vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|application\/vnd\.openxmlformats-officedocument\.wordprocessingml\.document|application\/vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|text\/csv)$/i.test(
-          file.type
-        )
-      ) {
-        alert("只能上传格式为html、pdf、word、excel、csv、docx、xlsx的文件!");
-        return;
-      }
-      const form = new FormData();
-      form.append("file", file);
-      uploadFile(form)
-        .then((res) => {
-          let data = res.data;
-          console.log(data, file.type, 7777, this.editor);
-          if (this.editor) {
-            this.editor.dangerouslyInsertHtml(
-              `<a href="${data}" target="_blank">点击查看 ${file.name}</a>`
-            );
-            this.$message({
-              type: "success",
-              message: `${file.name}上传成功`,
-            });
-          } else {
-            console.error("Editor instance is not available.");
-          }
-        })
-        .catch((err) => console.log(err, 888));
-    },
-    uploadFile() {
-      this.$refs.fileInput.click();
+      // this.toolbarConfig.insertKeys = {
+      //   index: 22,
+      //   keys: [customMenuKey],
+      // };
     },
+    // handleFileUpload(event) {
+    //   const file = event.target.files[0];
+    //   if (!file) return;
+    //   if (
+    //     !/^(text\/html|application\/pdf|application\/msword|application\/vnd\.ms-excel|application\/vnd\.ms-office|application\/vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|application\/vnd\.openxmlformats-officedocument\.wordprocessingml\.document|application\/vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|text\/csv)$/i.test(
+    //       file.type
+    //     )
+    //   ) {
+    //     alert("只能上传格式为html、pdf、word、excel、csv、docx、xlsx的文件!");
+    //     return;
+    //   }
+    //   const form = new FormData();
+    //   form.append("file", file);
+    //   uploadFile(form)
+    //     .then((res) => {
+    //       let data = res.data;
+    //       console.log(data, file.type, 7777, this.editor);
+    //       if (this.editor) {
+    //         this.editor.dangerouslyInsertHtml(
+    //           `<a href="${data}" target="_blank">点击查看 ${file.name}</a>`
+    //         );
+    //         this.$message({
+    //           type: "success",
+    //           message: `${file.name}上传成功`,
+    //         });
+    //       } else {
+    //         console.error("Editor instance is not available.");
+    //       }
+    //     })
+    //     .catch((err) => console.log(err, 888));
+    // },
+    // uploadFile() {
+    //   this.$refs.fileInput.click();
+    // },
     handleEditorChange(newVal) {
       this.$emit("input", newVal);
     },

+ 31 - 12
src/views/dataAdministration/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="global-variable">
+  <div class="global-variable" v-loading="loading">
     <div class="condition">
       <el-form
         ref="ruleForm"
@@ -50,7 +50,13 @@
         style="width: 100%"
       >
         <!-- Table Columns -->
-        <el-table-column fixed prop="batchCode" align="center" label="批次编号">
+        <el-table-column
+          fixed
+          prop="batchCode"
+          align="center"
+          label="批次编号"
+          width="230"
+        >
         </el-table-column>
         <el-table-column prop="fieldCode" align="center" label="风场编号">
         </el-table-column>
@@ -61,12 +67,17 @@
           width="100"
         >
         </el-table-column>
-        <el-table-column prop="" align="center" label="异常状态">
+        <el-table-column prop="" align="center" label="异常状态" width="100">
           <template slot-scope="scope">
             {{ scope.row.transferState == 2 ? "异常" : "未异常" }}
           </template>
         </el-table-column>
-        <el-table-column prop="abnormal" label="异常信息">
+        <el-table-column
+          prop="abnormal"
+          label="异常信息"
+          width="100"
+          align="center"
+        >
           <template slot-scope="scope">
             <el-button
               v-if="scope.row.transferState == 2"
@@ -78,13 +89,8 @@
             <span v-else>/</span>
           </template>
         </el-table-column>
-        <el-table-column
-          prop="transferFinishTime"
-          align="center"
-          label="转换时间"
-        >
-        </el-table-column>
-        <el-table-column prop="" align="center" label="状态">
+
+        <el-table-column prop="" align="center" label="状态" width="100">
           <template slot-scope="scope">
             {{
               scope.row.transferState == -1
@@ -102,6 +108,12 @@
         <el-table-column prop="transferTypeName" align="center" label="类型">
         </el-table-column>
         <el-table-column
+          prop="transferFinishTime"
+          align="center"
+          label="转换时间"
+        >
+        </el-table-column>
+        <el-table-column
           prop="transition"
           align="center"
           fixed="right"
@@ -393,8 +405,10 @@ import axios from "axios";
 export default {
   data() {
     return {
+      loading: false,
       editTransferStateForm: {
         transferAddr: "",
+        dataTransferTypePath: "",
       },
       editTransferStateTitle: "",
       editTransferStateLoading: false,
@@ -615,6 +629,7 @@ export default {
               });
               this.getTableList();
               this.cancel();
+              this.loadingView = false;
             })
             .catch(() => {
               this.loadingView = false;
@@ -690,12 +705,16 @@ export default {
     },
     //获取批次编号列表接口
     async getBatchCodeList() {
+      this.loading = true;
       try {
         const result = await fieldBatchListForDataTransfer();
         this.batchList = result.data.batchCodeList;
         this.newform.dataTransferTypePathDtoList =
           result.data.dataTransferTypeVoList;
-      } catch (error) {}
+        this.loading = false;
+      } catch (error) {
+        this.loading = false;
+      }
     },
   },
 };

+ 9 - 2
src/views/performance/assetssDetail.vue

@@ -1,13 +1,13 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:25:45
- * @LastEditTime: 2024-06-14 14:25:04
+ * @LastEditTime: 2024-06-17 16:31:33
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/assetssDetail.vue
 -->
 <template>
-  <div class="global-variable">
+  <div class="global-variable" v-loading="loading">
     <el-row type="flex" justify="space-between">
       <el-col :span="8"
         ><el-button
@@ -190,6 +190,7 @@ import axios from "axios";
 export default {
   data() {
     return {
+      loading: false,
       fileCheckResult: null,
       fileCheckResult1: null,
       analysisTypeList: [],
@@ -236,6 +237,7 @@ export default {
       formData.append("batchCode", this.$route.query.batchCode);
       formData.append("analysisTypeCode", this.formInfo.analysisTypeCode);
       formData.append("fieldEngineCode", this.formInfo.fieldEngineCode);
+      this.loading = true;
       //获取详情信息
       try {
         const response = await analysisDetail(formData);
@@ -260,11 +262,14 @@ export default {
             response.data[0].commentDescriptionVos) ||
           [];
         console.log(this.generalFiles, " this.generalFiles ");
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
       }
     },
     async getWindCodeList() {
+      this.loading = true;
       try {
         const response = await analysisEditQuery({
           batchCode: this.$route.query.batchCode,
@@ -276,8 +281,10 @@ export default {
           response.data.analysisTypeList.length > 0
             ? response.data.analysisTypeList[0].typeCode
             : "";
+        this.loading = false;
         this.getDetailInfo();
       } catch (error) {
+        this.loading = false;
         console.error(error);
       }
     },

+ 18 - 9
src/views/performance/assetssMag.vue

@@ -31,17 +31,16 @@
         border
         :cell-style="rowStyle"
       >
+        <el-table-column align="center" fixed prop="fieldName" label="风场名称">
+        </el-table-column>
+        <el-table-column align="center" label="批次编号" prop="batchCode">
+        </el-table-column>
         <el-table-column
+          prop="loginName"
           align="center"
-          fixed
-          prop="fieldName"
-          label="风场名称"
+          label="分析状态"
           width="100"
         >
-        </el-table-column>
-        <el-table-column align="center" label="批次编号" prop="batchCode">
-        </el-table-column>
-        <el-table-column prop="loginName" align="center" label="分析状态">
           <template slot-scope="scope">
             <span>
               {{
@@ -74,7 +73,12 @@
             >
           </template>
         </el-table-column>
-        <el-table-column prop="roleName" align="center" label="异常信息">
+        <el-table-column
+          prop="roleName"
+          align="center"
+          label="异常信息"
+          width="100"
+        >
           <template slot-scope="scope">
             <el-button
               v-if="scope.row.errState == 1"
@@ -86,7 +90,12 @@
             <span v-else>/</span>
           </template>
         </el-table-column>
-        <el-table-column prop="roleName" align="center" label="分析记录">
+        <el-table-column
+          prop="roleName"
+          align="center"
+          label="分析记录"
+          width="100"
+        >
           <template slot-scope="scope">
             <el-button
               v-if="scope.row.analysisState == 1 && scope.row.errState !== 1"

+ 25 - 7
src/views/performance/batchMag.vue

@@ -1,13 +1,13 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:23:37
- * @LastEditTime: 2024-06-03 16:25:45
+ * @LastEditTime: 2024-06-17 16:40:01
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/batchMag.vue
 -->
 <template>
-  <div class="global-variable">
+  <div class="global-variable" v-loading="loading">
     <div class="condition">
       <el-form
         :inline="true"
@@ -262,9 +262,16 @@ export default {
     },
     //获取风场列表
     async getQueryCodeNumList() {
-      const result = await queryCodeNum();
-      console.log(result, "result");
-      this.fieldCodeList = result.data.fieldCodeList;
+      this.loading = true;
+      try {
+        const result = await queryCodeNum();
+        console.log(result, "result");
+        this.fieldCodeList = result.data.fieldCodeList;
+        this.loading = false;
+      } catch (error) {
+        console.error(error);
+        this.loading = false;
+      }
     },
     //分页数据切换
     handleCurrentChange(val) {
@@ -274,6 +281,7 @@ export default {
     //修改状态
     setState(state, row) {
       //启用接口
+      this.loading = true;
       onOrOffFieldBatch({ batchCode: row.batchCode, batchState: state })
         .then((res) => {
           console.log(res, "res");
@@ -281,9 +289,12 @@ export default {
             message: res.msg,
             type: "success",
           });
+          this.loading = false;
           this.getTableList();
         })
-        .catch((error) => {});
+        .catch((error) => {
+          this.loading = false;
+        });
     },
     async getTableList() {
       try {
@@ -326,6 +337,7 @@ export default {
 
     // 新增,编辑确定
     submitForm(formName) {
+      // this.loading = true;
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.loadingView = true;
@@ -338,12 +350,14 @@ export default {
                     type: "success",
                     message: res.msg,
                   });
+                  // this.loading = false;
                   this.getTableList();
                   this.nuedialog = false;
                   this.loadingView = false;
                 })
                 .catch(() => {
                   this.loadingView = false;
+                  // this.loading = false;
                 });
 
               break;
@@ -404,15 +418,19 @@ export default {
         type: "warning",
       })
         .then(() => {
+          this.loading = true;
           deleteFieldBatch({ batchCode: row.batchCode })
             .then((res) => {
               this.$message({
                 type: "success",
                 message: "删除成功!",
               });
+              this.loading = false;
               this.getTableList();
             })
-            .catch(() => {});
+            .catch(() => {
+              this.loading = false;
+            });
         })
         .catch(() => {
           this.$message({

+ 23 - 3
src/views/performance/components/EditAnalysis.vue

@@ -1,13 +1,13 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-29 09:14:23
- * @LastEditTime: 2024-06-17 14:56:23
+ * @LastEditTime: 2024-06-17 16:11:54
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/EditAnalysis.vue
 -->
 <template>
-  <div>
+  <div v-loading="loading">
     <el-form ref="form" :model="form" label-width="120px">
       <el-collapse v-model="activeNames">
         <el-collapse-item title="基础筛选:" name="1">
@@ -123,7 +123,11 @@
           </tinymce-editor>
         </el-tab-pane>
       </el-tabs>
-      <button @click="handleComment">确定</button>
+      <div style="margin-top: 20px; display: flex; justify-content: end">
+        <el-button type="primary" @click="handleComment"
+          >提交分析编辑描述</el-button
+        >
+      </div>
     </div>
 
     <el-dialog
@@ -171,6 +175,7 @@ export default {
   },
   data() {
     return {
+      loading: false,
       engineCode: null, //台账机组编号
       windDetail: {},
       flage: false,
@@ -210,6 +215,7 @@ export default {
   },
   methods: {
     async handleComment() {
+      this.loading = true;
       console.log(this.editableTabs, "this.editableTabs");
       try {
         const res = await analysisCommentEdit({
@@ -226,9 +232,11 @@ export default {
           type: "success",
           message: "保存成功",
         });
+        this.loading = false;
         this.getDetailInfo();
       } catch (e) {
         console.error(e);
+        this.loading = false;
       }
     },
     handleEditorInput(index, newVal) {
@@ -259,6 +267,7 @@ export default {
       formData.append("analysisTypeCode", this.form.configAnalysis);
       formData.append("fieldEngineCode", this.form.turbines);
       //获取详情信息
+      this.loading = true;
       try {
         const response = await analysisDetail(formData);
         if (response.data.length === 0 || response.data === null) {
@@ -280,8 +289,10 @@ export default {
               ? this.editableTabs[0].commentTypeCode
               : "";
         }
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
       }
     },
     mergeData(arr, brr) {
@@ -315,6 +326,7 @@ export default {
         .catch((_) => {});
     },
     async getWindCodeList() {
+      this.loading = true;
       try {
         const response = await analysisEditQuery({
           batchCode: this.$route.query.batchCode,
@@ -326,8 +338,10 @@ export default {
         this.engineCode = response.data.windEngineGroupList[0];
         this.getDetailInfo();
         this.getWindEngList();
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
       }
     },
     // 鼠标单击的事件
@@ -343,6 +357,7 @@ export default {
     addAnalysisNameFn(formName) {
       this.$refs[formName].validate(async (valid) => {
         if (valid) {
+          this.loading = true;
           try {
             await addAnalysisCommentType({
               batchCode: this.$route.query.batchCode,
@@ -351,6 +366,7 @@ export default {
             });
             this.$refs[formName].resetFields();
             this.dialogVisible = false;
+            this.loading = false;
             this.$message({
               type: "success",
               message: "添加成功",
@@ -358,6 +374,7 @@ export default {
             this.getWindCodeList();
           } catch (e) {
             console.error(e);
+            this.loading = false;
           }
         } else {
           console.log("error submit!!");
@@ -393,6 +410,7 @@ export default {
           type: "warning",
         })
           .then(async () => {
+            this.loading = true;
             try {
               const formData = new FormData();
               formData.append("commentTypeCode", targetName);
@@ -406,8 +424,10 @@ export default {
                   ? this.editableTabs[0].commentTypeCode
                   : "";
               this.getWindCodeList();
+              this.loading = false;
             } catch (error) {
               console.error(error);
+              this.loading = false;
             }
           })
           .catch(() => {

+ 29 - 2
src/views/performance/components/abnormalDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div v-loading="loading">
     <div class="newly">
       <el-button type="primary" @click="addRow" size="small">新增</el-button>
     </div>
@@ -127,6 +127,7 @@ export default {
   },
   data() {
     return {
+      loading: false,
       setDataState: "",
       formInline: {
         pageNum: 1,
@@ -157,15 +158,19 @@ export default {
       this.getTableList(this.batchCode);
     },
     async getWindCodeList(batchCode) {
+      this.loading = true;
       try {
         const response = await analysisEditQuery({ batchCode });
         this.analysisTypeList = response.data.analysisTypeList;
         this.windEngineGroupList = response.data.windEngineGroupList;
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
       }
     },
     async getTableList(batchCode) {
+      this.loading = true;
       try {
         const response = await analysisErrQuery({
           batchCode,
@@ -174,9 +179,10 @@ export default {
         });
         this.tableData = response.data.list;
         this.formInline.totalSize = response.data.totalSize;
-        console.log(response, "response");
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
       }
     },
     // 新增数据
@@ -199,6 +205,7 @@ export default {
     // 提交行
     async submitRow(index) {
       if (this.setDataState === "add") {
+        this.loading = true;
         try {
           const response = await analysisErrAdd({
             batchCode: this.batchCode,
@@ -209,10 +216,17 @@ export default {
           });
           this.$set(this.tableData[index], "isEditing", false);
           this.getTableList(this.batchCode);
+          this.loading = false;
+          this.$message({
+            type: "success",
+            message: "新增成功",
+          });
         } catch (err) {
           console.error(err);
+          this.loading = false;
         }
       } else if (this.setDataState === "edit") {
+        this.loading = true;
         try {
           await analysisErrEdit({
             id: this.tableData[index].id,
@@ -220,9 +234,15 @@ export default {
             handleErrCount: this.tableData[index].handleErrCount,
           });
           this.$set(this.tableData[index], "isEditing", false);
+          this.loading = false;
+          this.$message({
+            type: "success",
+            message: "编辑成功",
+          });
           this.getTableList(this.batchCode);
         } catch (err) {
           console.error(err);
+          this.loading = false;
         }
       }
 
@@ -230,11 +250,18 @@ export default {
     },
     // 删除行
     async deleteRow(row) {
+      this.loading = true;
       try {
         await analysisErrDel({ id: row.id });
+        this.loading = false;
+        this.$message({
+          type: "success",
+          message: "删除成功",
+        });
         this.getTableList(this.batchCode);
       } catch (err) {
         console.error(err);
+        this.loading = false;
       }
     },
   },

+ 70 - 7
src/views/performance/components/analysisEvent.vue

@@ -1,13 +1,13 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-29 09:13:51
- * @LastEditTime: 2024-06-14 16:01:05
+ * @LastEditTime: 2024-06-17 15:45:24
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/analysisEvent.vue
 -->
 <template>
-  <div>
+  <div v-loading="loading">
     <el-form ref="form" :model="form" label-position="right">
       <el-row type="flex" justify="end">
         <el-col :span="5">
@@ -572,6 +572,7 @@ export default {
     return {
       engineCode: null, //台账机组编号
       picker: [],
+      loading: false,
       form: {
         configAnalysis: null, //分析类型
         powerFarmID: null, //风场编号//通过路由获取的默认传递的
@@ -627,21 +628,79 @@ export default {
       this.getWindEngList();
     },
     async getWindEngList() {
+      this.loading = true;
       try {
         const res = await getWindEngineGroup({
           engineCode: this.engineCode,
         });
+        this.loading = false;
         this.windDetail = res.data;
       } catch (error) {
+        this.loading = false;
         console.error(error);
       }
     },
     async getAnalysis() {
       console.log(this.form.excludingMonths, "过滤月份");
       console.log(this.picker, "分析时间");
+      this.loading = true;
       try {
         await analysis({
-          ...this.form,
+          // ...this.form,
+          configAnalysis:
+            this.form.configAnalysis !== null
+              ? this.form.configAnalysis
+              : undefined, //分析类型
+          powerFarmID: this.$route.query.fieldEngineCode, //风场编号//通过路由获取的默认传递的
+          dataBatchNum: this.$route.query.batchCode, //批次号
+          scada: this.form.scada !== null ? this.form.scada : undefined, //scada数类型
+          turbines:
+            this.form.turbines.length > 0 ? this.form.turbines : undefined, //机组编号
+          excludingMonths:
+            this.form.excludingMonths === null
+              ? undefined
+              : this.form.excludingMonths, //过滤月份
+          valueWindSpeed:
+            this.form.valueWindSpeed.length > 0
+              ? this.form.valueWindSpeed
+              : undefined, //风速值最大最小 数组第一值为min  第二个 max
+          valuePitchAngle:
+            this.form.valuePitchAngle.length > 0
+              ? this.form.valuePitchAngle
+              : undefined, //桨距角最大最小
+          valueActivePower:
+            this.form.valueActivePower.length > 0
+              ? this.form.valueActivePower
+              : undefined, //有功功率
+          valueGeneratorSpeed:
+            this.form.valueGeneratorSpeed.length > 0
+              ? this.form.valueGeneratorSpeed
+              : undefined, //发电机转速
+          //图像
+          dGeneratorSpeed:
+            this.form.dGeneratorSpeed.length > 0
+              ? this.form.dGeneratorSpeed
+              : undefined, //直驱发电机转速轴系 第一个值为步长 第二个min 第三个 max
+          iGeneratorSpeed:
+            this.form.iGeneratorSpeed.length > 0
+              ? this.form.iGeneratorSpeed
+              : undefined, //非直驱发电机转速轴系设置
+          dGeneratorTorque:
+            this.form.dGeneratorTorque.length > 0
+              ? this.form.dGeneratorTorque
+              : undefined, //直驱发电机转矩轴系
+          iGeneratorTorque:
+            this.form.iGeneratorTorque.length > 0
+              ? this.form.iGeneratorTorque
+              : undefined, //非直驱发电机转矩轴系
+          cp: this.form.cp.length > 0 ? this.form.cp : undefined, //风能利用系数轴系
+          tsr: this.form.tsr.length > 0 ? this.form.tsr : undefined, //叶尖速比轴系
+          pitchAngle:
+            this.form.pitchAngle.length > 0 ? this.form.pitchAngle : undefined, //桨距角轴系
+          activePower:
+            this.form.activePower.length > 0
+              ? this.form.activePower
+              : undefined, //有功功率轴系
           beginTime: this.picker[0], //开始时间
           endTime: this.picker[1], //结束时间
         });
@@ -649,11 +708,14 @@ export default {
           type: "success",
           message: "已分析请前往分析详情中查看结果",
         });
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
       }
     },
     async getWindCodeList() {
+      this.loading = true;
       try {
         const response = await analysisEditQuery({
           batchCode: this.$route.query.batchCode,
@@ -663,13 +725,14 @@ export default {
         this.analysisTypeList = response.data.analysisTypeList;
         this.windEngineGroupList = response.data.windEngineGroupList;
         this.engineCode = response.data.windEngineGroupList[0];
-        if(response.data.windEngineGroupList.length>0){
- //获取台账机组编号
-        this.getWindEngList();
+        if (response.data.windEngineGroupList.length > 0) {
+          //获取台账机组编号
+          this.getWindEngList();
         }
-       
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
         this.$router.go(-1);
       }
     },