Browse Source

部件参数 合并

rui.jiang 2 tháng trước cách đây
mục cha
commit
f305937ba8

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

@@ -223,9 +223,9 @@ export default {
       layers: [
         new TileLayer({
           source: new XYZ({
-            url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
+            // url: "http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png", //外网
             // 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://192.168.50.235/tiles/{z}/{x}/{y}.png", //内网
             // url: "http://10.96.137.5:9080/tiles/{z}/{x}/{y}.png", //大~#@唐
           }),
         }),

+ 3 - 4
src/views/overview/components/analysis_information/index.vue

@@ -183,7 +183,6 @@
           </div>
         </div>
       </template>
-
       <el-empty v-else description="暂无完成分析模型"></el-empty>
     </div>
   </el-card>
@@ -326,7 +325,7 @@ export default {
   h4 {
     color: #303133;
     // border-bottom: 1px solid #ebeef5;
-    font-size: 13px;
+    font-size: 14px;
     font-weight: 500;
     margin-bottom: 10px;
   }
@@ -354,7 +353,7 @@ export default {
     h4 {
       color: #303133;
       // border-bottom: 1px solid #ebeef5;
-      font-size: 13px;
+      font-size: 14px;
       font-weight: 500;
       margin-bottom: 10px;
     }
@@ -436,7 +435,7 @@ export default {
 
     h4 {
       color: #303133;
-      font-size: 13px;
+      font-size: 14px;
       font-weight: 500;
       // margin-bottom: 10px;
     }

+ 19 - 33
src/views/performance/assetssMag.vue

@@ -44,7 +44,7 @@
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="onSubmit" size="small"
+          <el-button type="primary" @click="() => fetchData()" size="small"
             >查询</el-button
           >
           <el-button @click="reset('ruleForm')" size="small">重置</el-button>
@@ -53,6 +53,9 @@
         <el-form-item class="right-align">
           <el-button @click="Newanalyse" size="small">创建分析</el-button>
           <el-button @click="examine" size="small">查看导入数据</el-button>
+          <el-button @click="handleAutoAsstessList" size="small"
+            >查看自动分析列表</el-button
+          >
         </el-form-item>
       </el-form>
     </div>
@@ -463,8 +466,6 @@ import {
   queryCodeNum,
   editPriority,
 } from "@/api/performance";
-import { from } from "plotly.js-dist";
-import { disable } from "ol/rotationconstraint";
 export default {
   components: {
     MyDialog,
@@ -532,15 +533,17 @@ export default {
     };
   },
   created() {
+    this.fetchData();
     window.addEventListener("message", this.handleMessage); //江
   },
 
-  beforeDestroy() {
-    this.stopPolling();
-    // 销毁消息监听器
-    window.removeEventListener("message", this.handleMessage); //江
-  },
   methods: {
+    //自动分析列表页面跳转
+    handleAutoAsstessList() {
+      this.$router.push({
+        path: "/home/performance/autoAssetss",
+      });
+    },
     // 创建分析时请求
     async addRuleFormSubmit() {
       this.$refs.addRuleForm.validate(async (valid) => {
@@ -608,7 +611,6 @@ export default {
     downLoadeAssetss(row) {
       downloadPDF(row.reportAddr, row.reportName);
     },
-
     async HandleOnOffAuto(row) {
       try {
         const form = new FormData();
@@ -638,7 +640,6 @@ export default {
           formData.append("batchCode", row.batchCode);
           formData.append("priority", index);
           const result = await editPriority(formData);
-          console.log(result, "插队结果");
           if (result.code === 200) {
             this.$message({
               type: "success",
@@ -714,13 +715,11 @@ export default {
     // 修改 getTableList 方法,避免重复请求
     async getTableList() {
       // 如果正在请求中,跳过此次调用
-      console.log(this.loading, this.isPolling);
       if (this.loading || this.isPolling) return;
 
       this.loading = true;
       try {
         const params = { ...this.formInline, totalSize: undefined };
-
         // 传递条件参数
         if (this.formInline.analysisState !== undefined) {
           params.analysisState = this.formInline.analysisState;
@@ -728,10 +727,8 @@ export default {
         if (this.formInline.errState !== undefined) {
           params.errState = this.formInline.errState;
         }
-
         const result = await analysisResultList(params);
         this.tableData = result.data.list;
-        console.log(this.tableData, "result this.tableData");
         this.formInline.totalSize = result.data.totalSize;
       } catch (error) {
         this.$message({
@@ -753,23 +750,13 @@ export default {
       // 更新表单字段
       if (fieldName !== undefined) {
         this.formInline.fieldName = fieldName;
-        console.log(fieldName, "0");
       }
       if (analysisState !== undefined) {
         this.formInline.analysisState = analysisState;
       }
       if (errState !== undefined) {
         this.formInline.errState = errState;
-        console.log(errState, "1");
       }
-
-      // 如果当前没有请求中,才调用 getTableList
-      // console.log(
-      //   this.loading,
-      //   fieldName,
-      //   analysisState,
-      //   "如果当前没有请求中,才调用"
-      // );
       if (!this.loading) {
         this.getTableList();
         // this.startPolling();
@@ -778,10 +765,6 @@ export default {
     rowStyle() {
       return "text-align:center";
     },
-    // 查询
-    onSubmit() {
-      this.fetchData();
-    },
     // 重置
     reset(formName) {
       this.$refs[formName].resetFields();
@@ -808,6 +791,7 @@ export default {
       }
     },
     stopPolling() {
+      // 停止轮询
       if (this.intervalId) {
         clearInterval(this.intervalId);
         this.intervalId = null;
@@ -829,7 +813,7 @@ export default {
             this.fetchData();
           }
         }
-      }, 1000); // 每10秒检查一次
+      }, 10000); // 每10秒检查一次
     },
 
     //创建分析
@@ -843,10 +827,12 @@ export default {
     },
   },
   mounted() {
-    this.getTableList();
-    setTimeout(() => {
-      this.startPolling();
-    }, 10000);
+    this.startPolling();
+  },
+  beforeDestroy() {
+    this.stopPolling();
+    // 销毁消息监听器
+    window.removeEventListener("message", this.handleMessage); //江
   },
 };
 </script>

+ 654 - 0
src/views/performance/autoAssetss.vue

@@ -0,0 +1,654 @@
+<!--
+ * @Author: your name
+ * @Date: 2025-03-27 10:01:43
+ * @LastEditTime: 2025-03-27 10:30:09
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/performance/autoAssetss.vue
+-->
+<template>
+  <div class="global-variable">
+    <div class="condition">
+      <el-form
+        :inline="true"
+        ref="ruleForm"
+        :model="formInline"
+        class="demo-form-inline"
+        :rules="rules"
+      >
+        <el-form-item label="分析主题:" prop="analysisName">
+          <el-input
+            size="small"
+            v-model="formInline.analysisName"
+            placeholder="请输入分析主题"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="风场名称:" prop="fieldName">
+          <el-input
+            size="small"
+            v-model="formInline.fieldName"
+            placeholder="请输入风场名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="分析状态:" prop="analysisState">
+          <el-select
+            size="small"
+            v-model="formInline.analysisState"
+            placeholder="请选择分析状态"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onSubmit" size="small"
+            >查询</el-button
+          >
+          <el-button @click="reset('ruleForm')" size="small">重置</el-button>
+        </el-form-item>
+
+        <el-form-item class="right-align">
+          <el-button @click="examine" size="small">查看导入数据</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="list-page">
+      <el-table
+        class="center-align-table"
+        :data="tableData"
+        border
+        :cell-style="rowStyle"
+      >
+        <el-table-column
+          align="center"
+          label="分析主题"
+          prop="analysisName"
+          min-width="200"
+          fixed
+        >
+          <template slot-scope="scope">
+            <el-tooltip
+              class="item"
+              effect="dark"
+              :content="scope.row.sketch || '暂无分析简述'"
+              placement="top"
+            >
+              <span>{{ scope.row.analysisName }}</span>
+            </el-tooltip>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="fieldName"
+          label="风场名称"
+          min-width="200"
+        >
+        </el-table-column>
+
+        <el-table-column
+          prop="loginName"
+          align="center"
+          label="分析状态"
+          min-width="150"
+        >
+          <template slot-scope="scope">
+            <span v-if="scope.row.analysisState == -1">未关联</span>
+            <span
+              v-else-if="
+                scope.row.analysisState == 20 && scope.row.errState == 0
+              "
+              style="color: #f90"
+              >分析中</span
+            >
+            <span
+              v-else-if="
+                scope.row.errState == 1 && scope.row.analysisState == 30
+              "
+              style="color: #f00"
+              >分析异常</span
+            >
+
+            <span
+              v-else-if="scope.row.analysisState == 30"
+              style="color: #4caf50"
+              >分析完成</span
+            >
+            <span
+              v-else-if="scope.row.analysisState == 10"
+              style="color: #4caf50"
+              >排队中</span
+            >
+            <span v-else>/</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="loginName"
+          align="center"
+          label="进度"
+          min-width="150"
+        >
+          <template slot-scope="scope">
+            <el-progress
+              v-if="scope.row.analysisState == 20"
+              :text-inside="true"
+              :stroke-width="20"
+              :percentage="scope.row.analysisProgress"
+              :class="{
+                'indeterminate-progress': scope.row.analysisProgress < 100,
+                'animated-progress': true,
+              }"
+            ></el-progress>
+            <span v-else>/</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="优先执行"
+          prop="orderNum"
+          min-width="200"
+        >
+          <template slot-scope="scope">
+            <span> {{ scope.row.orderNum }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          align="center"
+          label="数据类型名称"
+          prop="dataTypeName"
+          min-width="200"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="roleName"
+          align="center"
+          label="异常信息"
+          min-width="120"
+        >
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.errState == 1"
+              @click="abnormalDialog(scope.row, '异常详情')"
+              type="text"
+              size="small"
+              >异常详情</el-button
+            >
+            <span v-else>/</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="roleName"
+          align="center"
+          label="分析记录"
+          min-width="120"
+        >
+          <template slot-scope="scope">
+            <!-- 分析完成 -->
+            <el-button
+              v-if="scope.row.analysisState == 30 && scope.row.errState !== 1"
+              @click="handleAssetssDetail(scope.row, '1')"
+              type="text"
+              size="small"
+              >分析详情</el-button
+            >
+            <!-- 分析中 -->
+            <el-button
+              v-else-if="
+                scope.row.analysisState == 20 && scope.row.errState == 0
+              "
+              @click="handleAssetssDetail(scope.row, '0')"
+              type="text"
+              size="small"
+              >分析详情</el-button
+            >
+
+            <span v-else>/</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="reportVos"
+          align="center"
+          label="报告"
+          min-width="120"
+        >
+          <template slot-scope="scope">
+            <el-dropdown v-if="scope.row.reportVos.length > 0" trigger="click">
+              <el-button type="text" size="small" class="el-dropdown-link">
+                查看报告
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item
+                  v-for="val in scope.row.reportVos"
+                  class="reportItemVal"
+                >
+                  <div class="reportLeft">
+                    <span>{{ val.reportName }}</span>
+                  </div>
+                  <div class="reportRight">
+                    <el-button
+                      type="text"
+                      size="small"
+                      @click="detailReportAssetss(val)"
+                    >
+                      查看
+                    </el-button>
+                    <el-button
+                      type="text"
+                      size="small"
+                      @click="downLoadeAssetss(val)"
+                    >
+                      下载
+                    </el-button>
+                  </div>
+                </el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+            <span v-else>/</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="dataStartTime"
+          align="center"
+          label="开始时间"
+          min-width="230"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="dataEndTime"
+          align="center"
+          label="结束时间"
+          min-width="230"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="transition"
+          align="center"
+          fixed="right"
+          label="操作"
+          min-width="300"
+        >
+          <template slot-scope="scope">
+            <el-button
+              @click="abnormalDialog(scope.row, '上传报告')"
+              type="text"
+              size="small"
+              >上传报告</el-button
+            >
+            <el-button
+              @click="handleAssetss(scope.row)"
+              type="text"
+              :disabled="
+                (scope.row.analysisState == 20 && scope.row.errState == 0) ||
+                scope.row.analysisState == 10
+              "
+              size="small"
+              >分析</el-button
+            >
+            <el-button
+              @click="abnormalDialog(scope.row, '机组异常记录')"
+              type="text"
+              size="small"
+              >机组异常记录</el-button
+            >
+            <el-button
+              v-if="scope.row.analysisState == 10"
+              @click="insertQueue(scope.row, 1)"
+              type="text"
+              size="small"
+              >插队</el-button
+            >
+            <el-button
+              v-if="scope.row.analysisState == 10"
+              @click="insertQueue(scope.row, 0)"
+              type="text"
+              size="small"
+              >取消插队</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination-container">
+        <el-pagination
+          @current-change="handleCurrentChange"
+          :current-page.sync="formInline.pageNum"
+          layout="total, prev, pager, next"
+          :page-size="formInline.pageSize"
+          :total="formInline.totalSize"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import MyDialog from "./components/dialogCom.vue";
+import { downloadPDF } from "@/utils/common";
+import {
+  onOffAutoAnalysis,
+  analysisResultList,
+  addAnalysisResult,
+  queryCodeNum,
+  editPriority,
+} from "@/api/performance";
+export default {
+  components: {
+    MyDialog,
+  },
+  data() {
+    return {
+      addDialogVisible: false,
+      loading: false, //数据加载中
+      errorInfo: "",
+      options: [
+        {
+          value: "-1",
+          label: "未关联",
+        },
+        {
+          value: "10",
+          label: "排队中",
+        },
+        {
+          value: "20",
+          label: "分析中",
+        },
+        {
+          value: "30",
+          label: "已分析",
+        },
+      ],
+
+      rules: {
+        fieldName: { trigger: "blur" },
+      },
+      formInline: {
+        fieldName: undefined,
+        pageNum: 1,
+        pageSize: 10,
+        totalSize: 0,
+        analysisName: undefined,
+        analysisState: undefined,
+      },
+      tableData: [],
+      rowInfo: {},
+      title: "",
+    };
+  },
+
+  methods: {
+    //获取风场列表
+
+    //插队接口
+    async insertQueue(row, index) {
+      this.$confirm(`确认插队?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const formData = new FormData();
+          formData.append("batchCode", row.batchCode);
+          formData.append("priority", index);
+          const result = await editPriority(formData);
+          console.log(result, "插队结果");
+          if (result.code === 200) {
+            this.$message({
+              type: "success",
+              message: "插队成功",
+            });
+            await this.fetchData();
+          }
+        })
+        .catch(() => {});
+    },
+    //分析
+    handleAssetss(row) {
+      this.$router.push({
+        path: "/home/performance/editAssets",
+        query: {
+          batchCode: row.batchCode,
+          analysisTypeCode: row.analysisTypeCode,
+          fieldEngineCode: row.fieldCode,
+          fieldName: row.fieldName,
+          analysisName: row.analysisName,
+        },
+      });
+    },
+    //分析详情
+    handleAssetssDetail(row, state) {
+      const navigateToDetails = () => {
+        this.$router.push({
+          path: "/home/performance/overview",
+          query: {
+            batchCode: row.batchCode,
+            // analysisTypeCode: row.analysisTypeCode,
+            fieldCode: row.fieldCode,
+          },
+        });
+      };
+      if (state === "0") {
+        // 分析状态为分析中
+        this.$confirm(
+          "当前查看的分析记录为历史分析结果,最新分析记录还未分析完成不展示!"
+        )
+          .then(() => {
+            navigateToDetails();
+          })
+          .catch(() => {});
+      } else {
+        navigateToDetails();
+      }
+    },
+    abnormalDialog(row, title) {
+      if (title === "异常详情") {
+        this.errorInfo = row.errInfo;
+        this.rowInfo = {};
+      } else if (title === "机组异常记录") {
+        this.errorInfo = "";
+        this.rowInfo = { ...row };
+      } else if (title === "上传报告") {
+        this.errorInfo = "";
+        this.rowInfo = {};
+        this.rowInfo.batchCode = row.batchCode;
+      }
+      this.title = title;
+    },
+
+    // 页码变化时才触发查询
+    handleCurrentChange(val) {
+      this.formInline.pageNum = val;
+      this.getTableList();
+    },
+
+    // 修改 getTableList 方法,避免重复请求
+    async getTableList() {
+      // 如果正在请求中,跳过此次调用
+
+      this.loading = true;
+      try {
+        const params = { ...this.formInline, totalSize: undefined };
+
+        // 传递条件参数
+        if (this.formInline.analysisState !== undefined) {
+          params.analysisState = this.formInline.analysisState;
+        }
+        if (this.formInline.errState !== undefined) {
+          params.errState = this.formInline.errState;
+        }
+
+        const result = await analysisResultList(params);
+        this.tableData = result.data.list;
+        console.log(this.tableData, "result this.tableData");
+        this.formInline.totalSize = result.data.totalSize;
+      } catch (error) {
+        this.$message({
+          type: "error",
+          message: "请检查是否连接网络",
+        });
+      } finally {
+        this.loading = false;
+      }
+    },
+    rowStyle() {
+      return "text-align:center";
+    },
+    // 查询
+    onSubmit() {
+      this.fetchData();
+    },
+    // 重置
+    reset(formName) {
+      this.$refs[formName].resetFields();
+      this.formInline.fieldName = "";
+      this.formInline.analysisName = "";
+      this.formInline.analysisState = "";
+      this.formInline.errState = "";
+      this.fetchData();
+    },
+    // fetchData 方法在轮询中调用
+    async fetchData() {
+      try {
+        const result = await analysisResultList({
+          ...this.formInline,
+          totalSize: undefined,
+        });
+        this.tableData = result.data.list;
+        this.formInline.totalSize = result.data.totalSize;
+      } catch (error) {
+        this.$message({
+          type: "error",
+          message: "请检查是否连接网络",
+        });
+      }
+    },
+    examine() {
+      const targetUrl = this.$router.resolve({ name: "transition" }).href;
+      window.open(targetUrl, "_blank");
+    },
+  },
+  mounted() {
+    this.getTableList();
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+@keyframes striped-flow {
+  from {
+    background-position: 0 100px;
+  }
+  to {
+    background-position: 1.25em 1.25em;
+  }
+}
+.general {
+  display: flex;
+  flex-wrap: wrap;
+
+  .condition {
+    width: 50%;
+    display: flex;
+
+    p {
+      width: 100px;
+      text-align: right;
+      line-height: 40px;
+    }
+
+    span {
+      line-height: 40px;
+
+      padding-left: 20px;
+    }
+
+    .el-select {
+      width: 100%;
+      margin-bottom: 20px;
+    }
+
+    .el-input {
+      margin-bottom: 20px;
+    }
+  }
+}
+
+.attachment {
+  display: flex;
+  padding-top: 10px;
+
+  p {
+    margin-right: 20px;
+    color: #409eff;
+  }
+}
+.add-ruleForm {
+  .el-select {
+    width: 100%;
+  }
+}
+.addition {
+  display: flex;
+  justify-content: flex-end;
+  margin-bottom: 10px;
+}
+.demo-ruleForm {
+  .el-form-item {
+    margin-bottom: 25px;
+  }
+}
+::v-deep .animated-progress .el-progress-bar__outer {
+  height: 15px; /* Adjust height as needed */
+  background-color: rgb(235, 238, 245);
+  background-image: linear-gradient(
+    45deg,
+    rgba(0, 0, 0, 0.1) 25%,
+    transparent 25%,
+    transparent 50%,
+    rgba(0, 0, 0, 0.1) 50%,
+    rgba(0, 0, 0, 0.1) 75%,
+    transparent 75%,
+    transparent
+  );
+  background-size: 1.25em 1.25em;
+  animation: striped-flow 3s linear infinite;
+}
+.reportItemVal {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  .reportLeft {
+    margin-right: 50px;
+  }
+}
+::v-deep .pdfDialog .el-dialog {
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+  margin: 0 auto !important;
+  .el-dialog__body {
+    // height: 100% !important;
+    flex: 1;
+    background: #fff;
+    .pdf-container {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      height: 100% !important;
+    }
+  }
+}
+
+canvas {
+  border: 1px solid #dcdfe6;
+}
+
+.right-align {
+  white-space: nowrap;
+}
+</style>

+ 2 - 0
src/views/performance/components/chartsCom/HeatmapCharts.vue

@@ -103,6 +103,8 @@ export default {
         x: this.initData[0].x,
         y: this.initData[0].y,
         z: this.initData[0].z,
+        zmin: 0, // 最小值
+        zmax: 100, // 最大值
         colorscale: [
           [0, this.color1[0]], // 0% - 50%
           [0.5, this.color1[0]], // 50%

+ 6 - 3
src/views/performance/components/chartsCom/Time3DChart.vue

@@ -220,7 +220,8 @@ export default {
               standoff: 100,
             },
             gridcolor: "#fff",
-            backgroundcolor: "#CFD4DC",
+            // backgroundcolor: "#CFD4DC",
+            backgroundcolor: "#e0e7f1",
             showbackground: true,
             linecolor: "black",
             ticks: "outside",
@@ -241,7 +242,8 @@ export default {
             dtick: "M3",
             gridcolor: "#fff",
             tickcolor: "#e5ecf6",
-            backgroundcolor: "#CFD4DC",
+            // backgroundcolor: "#CFD4DC",
+            backgroundcolor: "#e0e7f1",
             showbackground: true,
             linecolor: "black",
             ticks: "outside",
@@ -255,7 +257,8 @@ export default {
             },
             gridcolor: "#fff",
             tickcolor: "#fff",
-            backgroundcolor: "#CFD4DC",
+            // backgroundcolor: "#CFD4DC",
+            backgroundcolor: "#e0e7f1",
             showbackground: true,
             linecolor: "black",
             ticks: "outside",