Ver Fonte

分析事件编辑修改

liujiejie há 10 meses atrás
pai
commit
052dd48cfd

+ 25 - 1
src/api/performance.js

@@ -1,12 +1,36 @@
 /*
  * @Author: your name
  * @Date: 2024-06-03 09:29:50
- * @LastEditTime: 2024-07-05 15:35:24
+ * @LastEditTime: 2024-07-16 10:10:05
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/api/performance。.js
  */
 import request from "@/utils/request";
+//分析类型查询
+export function queryAnalysisedType(data) {
+  return request({
+    url: "/energy-manage-service/analysis/queryAnalysisedType",
+    method: "get",
+    params: data,
+  });
+}
+//风机机组编号查询
+export function queryAnalysisedEngine(data) {
+  return request({
+    url: "/energy-manage-service/analysis/queryAnalysisedEngine",
+    method: "get",
+    params: data,
+  });
+}
+//开启自动分析开关接口
+export function onOffAutoAnalysis(data) {
+  return request({
+    url: "/energy-manage-service/analysis/onOffAutoAnalysis",
+    method: "post",
+    data,
+  });
+}
 //自动生成批次名称
 export function createBatchName(data) {
   return request({

+ 21 - 14
src/views/dataAdministration/index.vue

@@ -648,21 +648,28 @@ export default {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.loadingViewEdit = true;
-          dataTransfer({
-            dataTransferAddr: this.editTransferStateForm.dataTransferTypePath,
-            dataTransferType: this.editTransferStateForm.transferType,
-            batchCode: this.editTransferStateForm.batchCode,
-            timeGranularity: this.editTransferStateForm.timeGranularity,
-          })
-            .then((res) => {
-              this.$message({
-                message: "操作成功",
-                type: "success",
-              });
-              this.getTableList();
-              this.editstateCancel();
+          this.$confirm("请检查平台内的风机名称和转换数据的风机名称是否一致!")
+            .then((_) => {
+              dataTransfer({
+                dataTransferAddr:
+                  this.editTransferStateForm.dataTransferTypePath,
+                dataTransferType: this.editTransferStateForm.transferType,
+                batchCode: this.editTransferStateForm.batchCode,
+                timeGranularity: this.editTransferStateForm.timeGranularity,
+              })
+                .then((res) => {
+                  this.$message({
+                    message: "操作成功",
+                    type: "success",
+                  });
+                  this.getTableList();
+                  this.editstateCancel();
+                })
+                .catch((error) => {
+                  this.loadingViewEdit = false;
+                });
             })
-            .catch((error) => {
+            .catch((_) => {
               this.loadingViewEdit = false;
             });
         } else {

+ 28 - 27
src/views/performance/assetssDetail.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:25:45
- * @LastEditTime: 2024-07-15 15:03:52
+ * @LastEditTime: 2024-07-16 15:02:10
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/assetssDetail.vue
@@ -44,9 +44,9 @@
               <el-select v-model="formInfo.analysisTypeCode" size="small">
                 <el-option
                   v-for="item in analysisTypeList"
-                  :key="item.typeCode"
-                  :label="item.typeName"
-                  :value="item.typeCode"
+                  :key="item.analysisTypeCode"
+                  :label="item.analysisTypeName"
+                  :value="item.analysisTypeCode"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -211,7 +211,12 @@
   </div>
 </template>
 <script>
-import { analysisDetail, analysisEditQuery } from "@/api/performance";
+import {
+  analysisDetail,
+  analysisEditQuery,
+  queryAnalysisedType,
+  queryAnalysisedEngine,
+} from "@/api/performance";
 import axios from "axios";
 
 export default {
@@ -317,30 +322,26 @@ export default {
     async getWindCodeList() {
       this.loading = true;
       try {
-        const response = await analysisEditQuery({
+        const resAnalysisedType = await queryAnalysisedType({
           batchCode: this.$route.query.batchCode,
         });
-        // if (
-        //   response.data.windEngineGroupList === null ||
-        //   response.data.windEngineGroupList.length === 0
-        // ) {
-        //   this.$message({
-        //     type: "warning",
-        //     message: "当前风场没有风机,无法进行分析",
-        //   });
-        // }
-        this.analysisTypeList = response.data.analysisTypeList;
-        this.windEngineGroupList = response.data.windEngineGroupList;
-        this.formInfo.fieldEngineCode =
-          response.data.windEngineGroupList !== null &&
-          response.data.windEngineGroupList.length > 0
-            ? response.data.windEngineGroupList[0].engineCode
-            : null;
-        this.formInfo.analysisTypeCode =
-          response.data.analysisTypeList.length > 0
-            ? response.data.analysisTypeList[0].typeCode
-            : "";
-        this.loading = false;
+        if (resAnalysisedType.data && resAnalysisedType.data.length > 0) {
+          const resEngineList = await queryAnalysisedEngine({
+            batchCode: this.$route.query.batchCode,
+            analysisTypeCode: resAnalysisedType.data[0].analysisTypeCode,
+          });
+          this.analysisTypeList = resAnalysisedType.data;
+          this.windEngineGroupList = resEngineList.data;
+          this.formInfo.fieldEngineCode =
+            resEngineList.data !== null && resEngineList.data.length > 0
+              ? resEngineList.data[0].engineCode
+              : null;
+          this.formInfo.analysisTypeCode =
+            resAnalysisedType.data.length > 0
+              ? resAnalysisedType.data[0].analysisTypeCode
+              : "";
+          this.loading = false;
+        }
         this.getDetailInfo();
       } catch (error) {
         this.loading = false;

+ 28 - 4
src/views/performance/assetssMag.vue

@@ -183,9 +183,14 @@
               size="small"
               >异常描述</el-button
             >
-            <el-button @click="" type="text" size="small">{{
-              scope.row.onOffCall === 0 ? "开启自动分析" : "关闭自动分析"
-            }}</el-button>
+            <el-button
+              @click="HandleOnOffAuto(scope.row)"
+              type="text"
+              size="small"
+              >{{
+                scope.row.onOffCall === 0 ? "开启自动分析" : "关闭自动分析"
+              }}</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -217,8 +222,9 @@
 </template>
 
 <script>
+import { fromCircle } from "ol/geom/Polygon";
 import MyDialog from "./components/dialogCom.vue";
-import { getAnalysisResultList } from "@/api/performance";
+import { getAnalysisResultList, onOffAutoAnalysis } from "@/api/performance";
 export default {
   components: {
     MyDialog,
@@ -252,6 +258,24 @@ export default {
   },
 
   methods: {
+    async HandleOnOffAuto(row) {
+      try {
+        const form = new FormData();
+        form.append("batchCode", row.batchCode);
+        form.append("onOffCall", row.onOffCall === 0 ? 1 : 0);
+        const res = await onOffAutoAnalysis(form);
+        // console.log(res, "res");
+        if (res.code === 200) {
+          this.getTableList();
+          this.$message({
+            type: "success",
+            message: `${row.onOffCall === 0 ? "开启" : "关闭"}成功`,
+          });
+        }
+      } catch (err) {
+        console.error(err);
+      }
+    },
     //分析
     handleAssetss(row) {
       this.$router.push({

+ 62 - 24
src/views/performance/components/EditAnalysis.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-29 09:14:23
- * @LastEditTime: 2024-07-09 15:38:39
+ * @LastEditTime: 2024-07-16 14:53:55
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/EditAnalysis.vue
@@ -19,12 +19,13 @@
                   placeholder="请选择分析类型"
                   size="small"
                   clearable
+                  @change="handleAnalysisType"
                 >
                   <el-option
                     v-for="item in analysisTypeList"
-                    :key="item.typeCode"
-                    :label="item.typeName"
-                    :value="item.typeCode"
+                    :key="item.analysisTypeCode"
+                    :label="item.analysisTypeName"
+                    :value="item.analysisTypeCode"
                   ></el-option>
                 </el-select> </el-form-item
             ></el-col>
@@ -55,7 +56,11 @@
         </el-collapse-item>
       </el-collapse>
     </el-form>
-    <el-card shadow="always" class="box-card">
+    <el-empty
+      v-if="noData"
+      description="暂无分析任何数据,无法进行手动分析描述"
+    ></el-empty>
+    <el-card v-if="!noData" shadow="always" class="box-card">
       <el-row>
         <el-col :span="12"
           ><div class="left">
@@ -141,7 +146,7 @@
       </el-row>
     </el-card>
     <el-empty :image-size="200" v-if="flage"></el-empty>
-    <div class="abalysisType" v-else>
+    <div class="abalysisType" v-else-if="!flage && !noData">
       <el-tabs
         v-model="editableTabsValue"
         type="card"
@@ -207,6 +212,8 @@ import {
   delAnalysisCommentType,
   addAnalysisCommentType,
   analysisCommentEdit,
+  queryAnalysisedType, //查询分析类型
+  queryAnalysisedEngine, //查询机组
 } from "@/api/performance";
 import { getWindEngineGroup } from "@/api/ledger";
 import TinymceEditor from "@/components/Tinymce.vue";
@@ -216,6 +223,7 @@ export default {
   },
   data() {
     return {
+      noData: false,
       htmlLoading: true,
       loading: false,
       engineCode: null, //台账机组编号
@@ -259,6 +267,25 @@ export default {
     iframeLoad() {
       this.htmlLoading = false;
     },
+    async handleAnalysisType(e) {
+      const resEngineList = await queryAnalysisedEngine({
+        batchCode: this.$route.query.batchCode,
+        analysisTypeCode: e,
+      });
+      this.windEngineGroupList = resEngineList.data;
+      this.form.turbines =
+        resEngineList.data !== null && resEngineList.data.length > 0
+          ? resEngineList.data[0].engineCode
+          : null;
+      this.engineCode =
+        resEngineList.data !== null && resEngineList.data.length > 0
+          ? resEngineList.data[0].engineCode
+          : null;
+      if (resEngineList.data.length > 0) {
+        //获取台账机组编号
+        this.getWindEngList();
+      }
+    },
     async handleComment() {
       this.loading = true;
       try {
@@ -291,6 +318,7 @@ export default {
       });
     },
     handleEngineCode(e) {
+      console.log(e, "e");
       this.engineCode = e;
       this.getWindEngList();
     },
@@ -327,6 +355,7 @@ export default {
             response.data[0].commentDescriptionVos,
             response.data[0].commentTypeRelations
           );
+          console.log(this.editableTabs, "this.editableTabs");
           this.editableTabsValue =
             this.editableTabs.length > 0
               ? this.editableTabs[0].commentTypeCode
@@ -368,30 +397,39 @@ export default {
         })
         .catch((_) => {});
     },
+    //修改赋值
     async getWindCodeList() {
       this.loading = true;
       try {
-        const response = await analysisEditQuery({
+        const resAnalysisedType = await queryAnalysisedType({
           batchCode: this.$route.query.batchCode,
         });
-        this.analysisTypeList = response.data.analysisTypeList;
-        this.windEngineGroupList = response.data.windEngineGroupList;
-        this.form.configAnalysis = response.data.analysisTypeList[0].typeCode;
-        this.form.turbines =
-          response.data.windEngineGroupList !== null &&
-          response.data.windEngineGroupList.length > 0
-            ? response.data.windEngineGroupList[0].engineCode
-            : null;
-        this.engineCode =
-          response.data.windEngineGroupList !== null &&
-          response.data.windEngineGroupList.length > 0
-            ? response.data.windEngineGroupList[0].engineCode
-            : null;
-        this.getDetailInfo();
-        if (response.data.windEngineGroupList.length > 0) {
-          //获取台账机组编号
-          this.getWindEngList();
+        if (resAnalysisedType.data && resAnalysisedType.data.length > 0) {
+          this.noData = false;
+          const resEngineList = await queryAnalysisedEngine({
+            batchCode: this.$route.query.batchCode,
+            analysisTypeCode: resAnalysisedType.data[0].analysisTypeCode,
+          });
+          this.analysisTypeList = resAnalysisedType.data;
+          this.windEngineGroupList = resEngineList.data;
+          this.form.configAnalysis = resAnalysisedType.data[0].analysisTypeCode;
+          this.form.turbines =
+            resEngineList.data !== null && resEngineList.data.length > 0
+              ? resEngineList.data[0].engineCode
+              : null;
+          this.engineCode =
+            resEngineList.data !== null && resEngineList.data.length > 0
+              ? resEngineList.data[0].engineCode
+              : null;
+          this.getDetailInfo();
+          if (resEngineList.data.length > 0) {
+            //获取台账机组编号
+            this.getWindEngList();
+          }
+        } else {
+          this.noData = true;
         }
+
         this.loading = false;
       } catch (error) {
         console.error(error);

+ 8 - 0
vue.config.js

@@ -67,12 +67,20 @@ module.exports = {
         // target: "http://192.168.5.4:16200", // 石月
         target: "http://192.168.50.235:16200", //内网
         // target: "http://192.168.5.15:16200",
+        // target: "192.168.50.241:9000",
         // target: "http://106.120.102.238:16600", //外网
         changeOrigin: true,
         pathRewrite: {
           "^/api": "", // 需要regit write重写的,
         },
       },
+      "/transDataWeb": {
+        target: "http://192.168.50.241:9000/trans_data_web",
+        changeOrigin: true,
+        pathRewrite: {
+          "^/transDataWeb": "", // 需要regit write重写的,
+        },
+      },
       // "/downLoadApi": {
       //   target: "http://192.168.50.241:8080", //http://192.168.50.241:8080/
       //   changeOrigin: true,