Explorar el Código

验证增加+合并

rui.jiang hace 11 meses
padre
commit
7615d4ffdc

+ 7 - 3
README.md

@@ -1,11 +1,12 @@
 # pref-web
 
 #### 介绍
+
 风机数据管理平台
 
 #### 软件架构
-软件架构说明
 
+软件架构说明
 
 #### 安装教程
 
@@ -26,12 +27,15 @@
 3.  提交代码
 4.  新建 Pull Request
 
-
 #### 特技
 
-1.  使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
+1.  使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
 2.  Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
 3.  你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
 4.  [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
 5.  Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
 6.  Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
+
+个人工作台(自由托动、定制化)分析辅助工具
+各种变量对比分析、拖动轮播
+分析事件中的 loading 状态数据没请求到的

BIN
dist.zip


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 17321 - 1
package-lock.json


+ 2 - 0
package.json

@@ -9,6 +9,8 @@
   "dependencies": {
     "@jiaminghi/data-view": "^2.10.0",
     "@riophae/vue-treeselect": "^0.4.0",
+    "@wangeditor/editor": "^5.1.23",
+    "@wangeditor/editor-for-vue": "^1.0.2",
     "axios": "^1.6.8",
     "core-js": "^3.8.3",
     "css-minimizer-webpack-plugin": "^7.0.0",

+ 19 - 1
src/api/performance.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2024-06-03 09:29:50
- * @LastEditTime: 2024-06-14 14:02:53
+ * @LastEditTime: 2024-06-17 14:31:34
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/api/performance。.js
@@ -145,3 +145,21 @@ export function delAnalysisCommentType(data) {
     data,
   });
 }
+//富文本但文件上传
+export function uploadFile(data) {
+  return request({
+    url: "/energy-manage-service/api/check/upload",
+    method: "post",
+    data,
+  });
+}
+
+//富文本编辑,性能分析编辑描述
+
+export function analysisCommentEdit(data) {
+  return request({
+    url: "/energy-manage-service/analysisComment/analysisCommentEdit",
+    method: "post",
+    data,
+  });
+}

BIN
src/assets/upload.png


+ 149 - 156
src/components/Tinymce.vue

@@ -1,188 +1,181 @@
 <template>
-  <div>
-    <quill-editor
-      ref="quillEditor"
-      v-model="content"
-      :options="editorOptions"
-      @ready="onEditorReady"
+  <div style="border: 1px solid #ccc">
+    <Toolbar
+      style="border-bottom: 1px solid #ccc"
+      :editor="editor"
+      :defaultConfig="toolbarConfig"
+      :mode="mode"
     />
-    <button @click="submit">确定</button>
+    <Editor
+      style="height: 500px; overflow-y: hidden"
+      v-model="html"
+      :defaultConfig="editorConfig"
+      :mode="mode"
+      @onCreated="onCreated"
+      @change="handleEditorChange"
+    />
+    <!-- <input
+      type="file"
+      ref="fileInput"
+      style="display: none"
+      @change="handleFileUpload"
+    /> -->
   </div>
 </template>
 
 <script>
-import { quillEditor } from "vue-quill-editor";
-import "quill/dist/quill.core.css";
-import "quill/dist/quill.snow.css";
-import "quill/dist/quill.bubble.css";
+import Vue from "vue";
+import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
+import { Boot } from "@wangeditor/editor";
+import { uploadFile } from "@/api/performance";
 
-export default {
-  components: {
-    quillEditor,
-  },
+// const customMenuKey = "customUpload";
+// let isCustomMenuRegistered = false;
+
+// 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: "上传文件",
+//       };
+//     },
+//   };
+
+//   Boot.registerMenu({
+//     key: customMenuKey,
+//     ...customUploadMenu,
+//   });
+
+//   isCustomMenuRegistered = true;
+// }
+
+export default Vue.extend({
+  components: { Editor, Toolbar },
   props: {
     value: {
       type: String,
-      defaultValue: "",
+      default: "",
     },
   },
   data() {
     return {
-      content: "",
-      editorOptions: {
-        theme: "snow",
-        modules: {
-          toolbar: {
-            container: [
-              [{ header: "1" }, { header: "2" }, { font: [] }],
-              [{ size: [] }],
-              ["bold", "italic", "underline", "strike", "blockquote"],
-              [
-                { list: "ordered" },
-                { list: "bullet" },
-                { indent: "-1" },
-                { indent: "+1" },
-              ],
-              ["link", "image", "video", "custom-file"], // 添加自定义文件图标
-              ["clean"],
-            ],
-            handlers: {
-              // image: this.imageHandler,
-              video: this.videoHandler,
-              "custom-file": this.fileHandler, // 自定义文件处理函数
+      editor: null,
+      html: "<p>hello</p>",
+      toolbarConfig: {
+        excludeKeys: ["group-video"], // 移除上传视频功能
+      },
+      editorConfig: {
+        placeholder: "请输入内容...",
+        MENU_CONF: {
+          // 上传图片
+          uploadImage: {
+            async customUpload(file, insertFn) {
+              console.log(file, "上传文件");
+              if (!/^(image\/png|image\/jpeg|image\/jpg)$/i.test(file.type)) {
+                alert("只能上传格式为png、jpg、jpeg的图片文件!");
+                return;
+              }
+              const form = new FormData();
+              form.append("file", file);
+              uploadFile(form)
+                .then((res) => {
+                  let data = res.data;
+                  console.log(data, 7777);
+                  insertFn(`${data}`);
+                  Vue.prototype.$message({
+                    type: "success",
+                    message: `${file.name}上传成功`,
+                  });
+                })
+                .catch((err) => console.log(err, 888));
             },
           },
         },
       },
+      mode: "default",
     };
   },
   created() {
-    this.content = this.value;
+    this.html = this.value;
+    // registerCustomUploadIcon(this);
   },
   methods: {
-    submit() {
-      console.log(this.content, "this.$refs.quillEditor.getContents();");
-    },
-    onEditorReady(editor) {
-      console.log(editor, "editor");
-    },
-    imageHandler() {
-      const input = document.createElement("input");
-      input.setAttribute("type", "file");
-      input.setAttribute("accept", "image/*");
-      input.click();
-
-      input.onchange = async () => {
-        const file = input.files[0];
-        if (file) {
-          const formData = new FormData();
-          formData.append("file", file);
-          const quill = this.$refs.quillEditor.quill;
-          const range = quill.getSelection();
-          quill.insertEmbed(range.index, "image", formData);
-          // try {
-          //   const response = await this.uploadImage(formData);
-          //   const url = response.data.url; // 根据你的实际响应数据结构
-          //   const quill = this.$refs.quillEditor.quill;
-          //   const range = quill.getSelection();
-          //   quill.insertEmbed(range.index, "image", url);
-          // } catch (error) {
-          //   console.error("Image upload failed", error);
-          // }
-        }
-      };
-    },
-    videoHandler() {
-      const input = document.createElement("input");
-      input.setAttribute("type", "file");
-      input.setAttribute("accept", "video/*");
-      input.click();
-
-      input.onchange = async () => {
-        const file = input.files[0];
-        if (file) {
-          const formData = new FormData();
-          formData.append("file", file);
-
-          try {
-            const response = await this.uploadVideo(formData);
-            const url = response.data.url;
-            const quill = this.$refs.quillEditor.quill;
-            const range = quill.getSelection();
-            quill.insertEmbed(range.index, "video", url);
-          } catch (error) {
-            console.error("Video upload failed", error);
-          }
-        }
-      };
-    },
-    fileHandler() {
-      const input = document.createElement("input");
-      input.setAttribute("type", "file");
-      input.setAttribute("accept", ".doc,.docx,.pdf");
-      input.click();
-
-      input.onchange = async () => {
-        const file = input.files[0];
-        if (file) {
-          const formData = new FormData();
-          formData.append("file", file);
-          const quill = this.$refs.quillEditor.quill;
-          const range = quill.getSelection();
-          quill.insertText(
-            range.index,
-            `File uploaded: ${file.name} (URL: ${formData})`
-          );
-          // try {
-          //   const response = await this.uploadFile(formData);
-          //   const url = response.data.url;
-          //   const quill = this.$refs.quillEditor.quill;
-          //   const range = quill.getSelection();
-          //   quill.insertText(
-          //     range.index,
-          //     `File uploaded: ${file.name} (URL: ${url})`
-          //   );
-          // } catch (error) {
-          //   console.error("File upload failed", error);
-          // }
-        }
-      };
+    onCreated(editor) {
+      this.editor = Object.seal(editor);
+      // this.toolbarConfig.insertKeys = {
+      //   index: 22,
+      //   keys: [customMenuKey],
+      // };
     },
-    async uploadImage(formData) {
-      const response = await axios.post("/api/upload/image", formData, {
-        headers: {
-          "Content-Type": "multipart/form-data",
-        },
-      });
-      return response;
+    // 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);
     },
-    async uploadVideo(formData) {
-      const response = await axios.post("/api/upload/video", formData, {
-        headers: {
-          "Content-Type": "multipart/form-data",
-        },
-      });
-      return response;
+  },
+  watch: {
+    value(newVal) {
+      this.html = newVal;
     },
-    async uploadFile(formData) {
-      const response = await axios.post("/api/upload/file", formData, {
-        headers: {
-          "Content-Type": "multipart/form-data",
-        },
-      });
-      return response;
+    html(newVal) {
+      this.$emit("input", newVal);
     },
   },
-};
+});
 </script>
 
 <style scoped>
-/* 添加你需要的样式 */
-::v-deep .ql-snow.ql-toolbar .ql-custom-file {
-  background: url("../assets/upload.png");
-  background-size: 16px 16px;
-  background-position: center center;
-  background-repeat: no-repeat;
-  /*background: red;*/
-}
+/* Add your custom styles here */
 </style>

+ 1 - 1
src/main.js

@@ -7,7 +7,7 @@ import "./icons/index"; // icon
 // 引入element ui
 import ElementUI from "element-ui";
 import "element-ui/lib/theme-chalk/index.css";
-
+import "@wangeditor/editor/dist/css/style.css";
 // 引入css
 import "./styles/index.scss";
 // 注册svg组件

+ 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;
+      }
     },
   },
 };

+ 1 - 1
src/views/ledger/component/windsiteup.vue

@@ -296,4 +296,4 @@ export default {
 .uploaddemo2:hover {
   border: 1px dashed #409eff;
 }
-</style>
+</style>

+ 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({

+ 58 - 5
src/views/performance/components/EditAnalysis.vue

@@ -1,13 +1,13 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-29 09:14:23
- * @LastEditTime: 2024-06-14 16:06:02
+ * @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">
@@ -113,16 +113,21 @@
           :label="item.commentTypeName"
           :name="item.commentTypeCode"
         >
-          <!-- {{ item.comment }} -->
           <tinymce-editor
             ref="editor"
             v-model="item.comment"
             :disabled="disabled"
+            @input="handleEditorInput(index, $event)"
             @onClick="onClick"
           >
           </tinymce-editor>
         </el-tab-pane>
       </el-tabs>
+      <div style="margin-top: 20px; display: flex; justify-content: end">
+        <el-button type="primary" @click="handleComment"
+          >提交分析编辑描述</el-button
+        >
+      </div>
     </div>
 
     <el-dialog
@@ -160,6 +165,7 @@ import {
   analysisEditQuery,
   delAnalysisCommentType,
   addAnalysisCommentType,
+  analysisCommentEdit,
 } from "@/api/performance";
 import { getWindEngineGroup } from "@/api/ledger";
 import TinymceEditor from "@/components/Tinymce.vue";
@@ -169,6 +175,7 @@ export default {
   },
   data() {
     return {
+      loading: false,
       engineCode: null, //台账机组编号
       windDetail: {},
       flage: false,
@@ -207,6 +214,38 @@ export default {
     this.getWindCodeList();
   },
   methods: {
+    async handleComment() {
+      this.loading = true;
+      console.log(this.editableTabs, "this.editableTabs");
+      try {
+        const res = await analysisCommentEdit({
+          batchCode: this.$route.query.batchCode,
+          analysisTypeCode: this.form.configAnalysis,
+          commentList: this.editableTabs.map((item) => {
+            return {
+              commentTypeCode: item.commentTypeCode,
+              comment: item.comment,
+            };
+          }),
+        });
+        this.$message({
+          type: "success",
+          message: "保存成功",
+        });
+        this.loading = false;
+        this.getDetailInfo();
+      } catch (e) {
+        console.error(e);
+        this.loading = false;
+      }
+    },
+    handleEditorInput(index, newVal) {
+      // 更新对应的 comment 值
+      this.$set(this.editableTabs, index, {
+        ...this.editableTabs[index],
+        comment: newVal,
+      });
+    },
     handleEngineCode(e) {
       console.log(e);
       this.engineCode = e;
@@ -228,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) {
@@ -249,8 +289,10 @@ export default {
               ? this.editableTabs[0].commentTypeCode
               : "";
         }
+        this.loading = false;
       } catch (error) {
         console.error(error);
+        this.loading = false;
       }
     },
     mergeData(arr, brr) {
@@ -284,6 +326,7 @@ export default {
         .catch((_) => {});
     },
     async getWindCodeList() {
+      this.loading = true;
       try {
         const response = await analysisEditQuery({
           batchCode: this.$route.query.batchCode,
@@ -295,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;
       }
     },
     // 鼠标单击的事件
@@ -312,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,
@@ -320,14 +366,15 @@ export default {
             });
             this.$refs[formName].resetFields();
             this.dialogVisible = false;
+            this.loading = false;
             this.$message({
               type: "success",
               message: "添加成功",
             });
-            // this.editableTabsValue=
             this.getWindCodeList();
           } catch (e) {
             console.error(e);
+            this.loading = false;
           }
         } else {
           console.log("error submit!!");
@@ -344,7 +391,6 @@ export default {
         const obj = this.editableTabs.filter(
           (item) => item.commentTypeCode === targetName
         )[0];
-        console.log(obj, "obj");
         if (
           obj.commentTypeName === "分析内容与可视化分析" ||
           obj.commentTypeName === "现象描述" ||
@@ -364,6 +410,7 @@ export default {
           type: "warning",
         })
           .then(async () => {
+            this.loading = true;
             try {
               const formData = new FormData();
               formData.append("commentTypeCode", targetName);
@@ -372,9 +419,15 @@ export default {
                 type: "success",
                 message: "删除成功!",
               });
+              this.editableTabsValue =
+                this.editableTabs.length > 0
+                  ? 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);
       }
     },

+ 2 - 2
vue.config.js

@@ -64,10 +64,10 @@ module.exports = {
     // contentBase: path.join(__dirname, "public"),
     proxy: {
       "/api": {
-        target: "http://192.168.5.4:16200", // 石月
+        // target: "http://192.168.5.4:16200", // 石月
         // target: "http://192.168.50.235:16200", //内网
         // target: "http://192.168.5.15:16200",
-        // target: "http://106.120.102.238:16600", //外网
+        target: "http://106.120.102.238:16600", //外网
         changeOrigin: true,
         pathRewrite: {
           "^/api": "", // 需要regit write重写的,

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio