Forráskód Böngészése

修改分析页面新需求添加

liujiejie 10 hónapja
szülő
commit
a5524c7c7f

+ 2 - 2
src/components/map/index.vue

@@ -197,8 +197,8 @@ export default {
         new TileLayer({
           source: new XYZ({
             // url: "http://127.0.0.1:8010/tiles/{z}/{x}/{y}.png", //本地
-            // url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
-            url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
+            url: "http://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
+            // url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
           }),
         }),
         new VectorLayer({

+ 11 - 7
src/views/dataAdministration/index.vue

@@ -56,20 +56,21 @@
       >
         <!-- Table Columns -->
         <el-table-column
-          fixed
-          prop="batchName"
+          prop="fieldName"
           align="center"
-          label="批次名称"
+          label="风场名称"
           min-width="200"
         >
         </el-table-column>
         <el-table-column
-          prop="fieldName"
+          fixed
+          prop="batchName"
           align="center"
-          label="风场名称"
+          label="批次名称"
           min-width="200"
         >
         </el-table-column>
+
         <el-table-column
           prop="engineCount"
           align="center"
@@ -689,14 +690,16 @@ export default {
       this.newEditForm.batchName = row.batchName;
       this.newEditForm.dataTransferTypePathDtoList[0] = { ...row };
     },
-    editCancel() {
+    editCancel(name) {
       this.newform = {
         batchCode: "",
         dataTransferTypePathDtoList: [{}],
       };
       this.editNuedialog = false;
       this.loadingViewEdit = false;
-      this.getTableList();
+      if (!name) {
+        this.getTableList();
+      }
       this.getBatchCodeList();
     },
     editly(formName) {
@@ -915,6 +918,7 @@ export default {
         this.loading = false;
       }
     },
+
     async fetchData() {
       try {
         const result = await queryDataTransferList({

+ 25 - 18
src/views/performance/assetssDetail.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:25:45
- * @LastEditTime: 2024-07-09 15:37:46
+ * @LastEditTime: 2024-07-15 15:03:52
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/assetssDetail.vue
@@ -14,7 +14,7 @@
           type="text"
           style="font-size: 20px"
           icon="el-icon-arrow-left"
-          @click="() => $router.go(-1)"
+          @click="() => $router.push('/home/performance/assetssMag')"
           >返回</el-button
         ></el-col
       >
@@ -88,12 +88,16 @@
           >
         </div>
         <el-row class="assetssConent">
+          <!-- :span="getSpan(index, 'generalFiles')" -->
           <el-col
             v-for="(file, index) in generalFiles"
             :key="index"
-            :span="getSpan(index, 'generalFiles')"
+            :span="24"
             v-loading="loadings[index] && getFileType(file.fileAddr) === 'html'"
             class="col_content"
+            :style="{
+              display: getFileType(file.fileAddr) === 'html' ? 'block' : 'none',
+            }"
           >
             <iframe
               v-if="getFileType(file.fileAddr) === 'html'"
@@ -140,11 +144,14 @@
           <el-col
             v-for="(file, index) in diagramRelations"
             :key="index"
-            :span="getSpan(index, 'diagramRelations')"
+            :span="24"
             v-loading="
               loadings[index + generalFiles.length] &&
               getFileType(file.fileAddr) === 'html'
             "
+            :style="{
+              display: getFileType(file.fileAddr) === 'html' ? 'block' : 'none',
+            }"
             class="col_content"
           >
             <!-- <div>{{ file.fileAddr }}</div> -->
@@ -340,19 +347,19 @@ export default {
         console.error(error);
       }
     },
-    getSpan(index, type) {
-      let isLastElement = false;
-      if (type === "generalFiles") {
-        isLastElement = index === this.generalFiles.length - 1;
-      } else if (type === "diagramRelations") {
-        isLastElement = index === this.diagramRelations.length - 1;
-      }
-      const isOddPosition = (index + 1) % 2 !== 0;
-      if (isLastElement && isOddPosition) {
-        return 24;
-      }
-      return 12;
-    },
+    // getSpan(index, type) {
+    //   let isLastElement = false;
+    //   if (type === "generalFiles") {
+    //     isLastElement = index === this.generalFiles.length - 1;
+    //   } else if (type === "diagramRelations") {
+    //     isLastElement = index === this.diagramRelations.length - 1;
+    //   }
+    //   const isOddPosition = (index + 1) % 2 !== 0;
+    //   if (isLastElement && isOddPosition) {
+    //     return 24;
+    //   }
+    //   return 12;
+    // },
     getFileType(url) {
       // 使用 URL 对象解析 URL
       // 获取路径名部分
@@ -389,7 +396,7 @@ export default {
 }
 .analysisType {
   .assetssConent {
-    height: 450px !important;
+    height: 550px !important;
     .el-col-12 {
       height: 100%;
     }

+ 51 - 15
src/views/performance/assetssMag.vue

@@ -57,7 +57,7 @@
               v-if="scope.row.analysisState == 0"
               :text-inside="true"
               :stroke-width="20"
-              :percentage="30"
+              :percentage="scope.row.analysisProgress"
               :class="{
                 'indeterminate-progress': scope.row.analysisProgress < 100,
                 'animated-progress': true,
@@ -74,9 +74,16 @@
         >
           <template slot-scope="scope">
             <span v-if="scope.row.analysisState == -1">未分析</span>
-            <span v-else-if="scope.row.analysisState == 0" style="color: #f90"
+            <span
+              v-else-if="
+                scope.row.analysisState == 0 && scope.row.errState == 0
+              "
+              style="color: #f90"
               >分析中</span
             >
+            <span v-else-if="scope.row.errState == 1" style="color: #f00"
+              >分析异常</span
+            >
             <span
               v-else-if="scope.row.analysisState == 1"
               style="color: #4caf50"
@@ -94,9 +101,9 @@
           <template slot-scope="scope">
             <span>
               {{
-                scope.row.errState == 0
+                scope.row.errState == 0 && scope.row.analysisState !== -1
                   ? "未异常"
-                  : scope.row.errState == 1
+                  : scope.row.errState === 1
                   ? "异常"
                   : "/"
               }}</span
@@ -127,13 +134,25 @@
           min-width="120"
         >
           <template slot-scope="scope">
+            <!-- 分析完成 -->
             <el-button
               v-if="scope.row.analysisState == 1 && scope.row.errState !== 1"
-              @click="handleAssetssDetail(scope.row)"
+              @click="handleAssetssDetail(scope.row, '1')"
               type="text"
               size="small"
               >分析详情</el-button
             >
+            <!-- 分析中 -->
+            <el-button
+              v-else-if="
+                scope.row.analysisState == 0 && scope.row.errState == 0
+              "
+              @click="handleAssetssDetail(scope.row, '0')"
+              type="text"
+              size="small"
+              >分析详情</el-button
+            >
+
             <span v-else>/</span>
           </template>
         </el-table-column>
@@ -149,7 +168,7 @@
           align="center"
           fixed="right"
           label="操作"
-          min-width="200"
+          min-width="220"
         >
           <template slot-scope="scope">
             <el-button
@@ -164,6 +183,9 @@
               size="small"
               >异常描述</el-button
             >
+            <el-button @click="" type="text" size="small">{{
+              scope.row.onOffCall === 0 ? "开启自动分析" : "关闭自动分析"
+            }}</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -242,15 +264,29 @@ export default {
       });
     },
     //分析详情
-    handleAssetssDetail(row) {
-      this.$router.push({
-        path: "/home/performance/assetssDetail",
-        query: {
-          batchCode: row.batchCode,
-          analysisTypeCode: row.analysisTypeCode,
-          fieldEngineCode: row.fieldEngineCode,
-        },
-      });
+    handleAssetssDetail(row, state) {
+      const navigateToDetails = () => {
+        this.$router.push({
+          path: "/home/performance/assetssDetail",
+          query: {
+            batchCode: row.batchCode,
+            analysisTypeCode: row.analysisTypeCode,
+            fieldEngineCode: row.fieldEngineCode,
+          },
+        });
+      };
+      if (state === "0") {
+        // 分析状态为分析中
+        this.$confirm(
+          "当前查看的分析记录为历史分析结果,最新分析记录还未分析完成不展示!"
+        )
+          .then(() => {
+            navigateToDetails();
+          })
+          .catch(() => {});
+      } else {
+        navigateToDetails();
+      }
     },
     abnormalDialog(row, title) {
       this.dialogVisible = true;

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

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:23:37
- * @LastEditTime: 2024-07-10 10:26:17
+ * @LastEditTime: 2024-07-15 11:31:41
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/batchMag.vue
@@ -67,21 +67,22 @@
         :cell-style="rowStyle"
       >
         <el-table-column
+          prop="fieldName"
           align="center"
           min-width="100"
-          label="批次名称"
-          prop="batchName"
+          label="关联风场"
         >
         </el-table-column>
-        <!-- <el-table-column align="center" label="批次编号" prop="batchCode">
-        </el-table-column> -->
         <el-table-column
-          prop="fieldName"
           align="center"
           min-width="100"
-          label="关联风场"
+          label="批次名称"
+          prop="batchName"
         >
         </el-table-column>
+        <!-- <el-table-column align="center" label="批次编号" prop="batchCode">
+        </el-table-column> -->
+
         <el-table-column
           prop="batchState"
           align="center"

+ 3 - 3
src/views/performance/components/analysisEvent.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-29 09:13:51
- * @LastEditTime: 2024-07-11 16:47:13
+ * @LastEditTime: 2024-07-15 13:41:20
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/analysisEvent.vue
@@ -876,7 +876,7 @@ export default {
             type: "warning",
             message: "当前风场没有风机,无法进行分析",
           });
-          this.$router.go(-1);
+          this.$router.push("/home/performance/assetssMag");
         }
         this.form.powerFarmID = this.$route.query.fieldEngineCode;
         this.form.dataBatchNum = this.$route.query.batchCode;
@@ -898,7 +898,7 @@ export default {
           message: error,
         });
         this.loading = false;
-        this.$router.go(-1);
+        this.$router.push("/home/performance/assetssMag");
       }
     },
     handleCheckAllChange(val) {

+ 3 - 4
src/views/performance/editAssets.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-05-27 09:26:31
- * @LastEditTime: 2024-07-09 15:38:08
+ * @LastEditTime: 2024-07-15 13:35:47
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/editAssets.vue
@@ -14,7 +14,7 @@
           type="text"
           style="font-size: 20px"
           icon="el-icon-arrow-left"
-          @click="() => $router.go(-1)"
+          @click="() => $router.push('/home/performance/assetssMag')"
           >返回</el-button
         ></el-col
       >
@@ -43,8 +43,7 @@ export default {
     };
   },
   methods: {
-    handleClick(tab, event) {
-    },
+    handleClick(tab, event) {},
   },
 };
 </script>