Przeglądaj źródła

自定义分析热力图的visualMap修改

liujiejie 1 rok temu
rodzic
commit
6cf5642adc

BIN
src/assets/analyse/exitFullScreen.png


BIN
src/assets/analyse/fullScreen.png


BIN
src/assets/analyse/mark.png


+ 52 - 52
src/assets/js/constants/color.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2024-11-27 14:40:15
- * @LastEditTime: 2024-12-10 09:58:45
+ * @LastEditTime: 2024-12-17 09:51:33
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/assets/js/constants/color.js
@@ -299,56 +299,56 @@
 //   "#7FA348",
 //   "#B3B72E",
 // ];
-//蓝色-青色
+//蓝色-青色 正常色系
 export const colorPalette = [
-  "#6296E2",
-  "#69C5C8",
-  "#4A90E2",
-  "#1D3C73",
-  "#2F6BB8",
-  "#3F8DAB",
-  "#5C9FBB",
-  "#1A6A84",
-  "#6A8EAE",
-  "#3C7C92",
-  "#1D5479",
-  "#4896D1",
-  "#3B9CB5",
-  "#51A8D2",
-  "#287DAC",
-  "#5F8A99",
-  "#3D84A4",
-  "#67C4D7",
-  "#4F9FC8",
-  "#6B94BD",
-  "#2C7E9A",
-  "#64A9CC",
-  "#3A86B1",
-  "#478F9B",
-  "#5C88B9",
-  "#367F9E",
-  "#4C89B2",
-  "#61A2D5",
-  "#5698B5",
-  "#82B9D5",
-  "#5B7E92",
-  "#6C8E9B",
-  "#4395C0",
-  "#67C1B9",
-  "#5B87A8",
-  "#5189D1",
-  "#5C7B92",
-  "#4E9DB4",
-  "#63A7C3",
-  "#55739A",
-  "#6D88A2",
-  "#3B7CA2",
-  "#6289BD",
-  "#4779A8",
-  "#5B9EBC",
-  "#4C7E9B",
-  "#6B7D98",
-  "#587C9B",
-  "#466690",
-  "#8B94B8",
+  "#D7EFB7",
+  "#9CD9BD",
+  "#7ACCC1",
+  "#5DBFC4",
+  "#46AFC5",
+  "#379CC2",
+  "#3286BB",
+  "#406DAB",
+  "#3856A0",
+  "#314291",
+  "#28357A",
+  "#1A285E",
 ];
+//蓝色-青色 正常色系
+// export const colorPalette = [
+//   // "#FFFFDF",
+//   "#DFEDC1",
+//   // "#EBF6C1",
+//   "#DBEEBC",
+//   "#A8D7BE",
+//   "#8ECAC1",
+//   "#77BDC2",
+//   "#64ADC2",
+//   "#559ABE",
+//   "#4884B7",
+//   "#406DAB",
+//   "#3856A0",
+//   "#314291",
+//   "#28357A",
+//   "#1A285E",
+// ];
+//涉及到温度的 图表
+// export const colorPalette = [
+//   "#F96F4A",
+//   "#F78F4F",
+//   "#FCB06C",
+//   "#FFC475",
+//   "#FFE286",
+//   "#FDF1A9",
+//   "#FBFFBE",
+//   "#EEF9A7",
+//   "#E4F39E",
+//   "#CFEE9E",
+//   "#A8DCA2",
+//   "#85D0AE",
+//   "#60C5A3",
+//   "#52A3AE",
+//   "#4FA4B5",
+//   "#3586BF",
+//   "#476CB9",
+// ];

+ 8 - 5
src/assets/js/constants/echarts-config/Heatmap.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2024-11-20 09:13:21
- * @LastEditTime: 2024-12-16 10:20:24
+ * @LastEditTime: 2024-12-17 16:27:13
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/assets/js/constants/echarts-config/Heatmap.js
@@ -42,7 +42,7 @@ export const option = {
     orient: "vertical",
     right: 20,
     top: "center",
-    color: ["#0d59b7", "#bee8ff"],
+    color: ["#1A285E", "#379CC2", "#D7EFB7"],
   },
   series: [
     {
@@ -50,11 +50,14 @@ export const option = {
       type: "heatmap",
       data: [
         [0, 0, 5],
-        [1, 0, 10],
-        [2, 0, 15],
-        [0, 1, 7],
+        [1, 0, 100],
+        [2, 0, 35],
+        [0, 1, 70],
         [1, 1, 8],
         [2, 1, 12],
+        [0, 2, 80],
+        [1, 2, 58],
+        [2, 2, 92],
       ], // [x, y, 风速值]
       emphasis: {
         itemStyle: {

+ 9 - 0
src/assets/js/constants/echarts-config/bar.js

@@ -51,6 +51,15 @@ export const option = {
       type: "bar",
       barWidth: "60%",
       data: [10, 52, 200, 334, 390, 330, 220],
+      markPoint: {
+        data: [
+          { type: "max", name: "Max" },
+          { type: "min", name: "Min" },
+        ],
+      },
+      markLine: {
+        data: [{ type: "average", name: "Avg" }],
+      },
     },
   ],
 };

+ 9 - 0
src/assets/js/constants/echarts-config/line.js

@@ -52,6 +52,15 @@ export const option = {
       name: "功率曲线",
       type: "line",
       data: [300, 22, 249, 345, 234, 56, 73], // 风速与功率对应数据
+      markPoint: {
+        data: [
+          { type: "max", name: "Max" },
+          { type: "min", name: "Min" },
+        ],
+      },
+      markLine: {
+        data: [{ type: "average", name: "Avg" }],
+      },
     },
   ],
 };

+ 5 - 5
src/assets/js/constants/echarts-config/scatter.js

@@ -35,11 +35,11 @@ export const option = {
       ], // [风向, 风速, 数据点大小]
       // symbolSize: (data) => data[2], // 根据大小调整气泡尺寸
       renderMode: "webgl", // 启用 WebGL 渲染
-      itemStyle: {
-        shadowBlur: 10,
-        shadowColor: "rgba(25, 100, 150, 0.5)",
-        shadowOffsetY: 5,
-      },
+      // itemStyle: {
+      //   shadowBlur: 10,
+      //   shadowColor: "rgba(25, 100, 150, 0.5)",
+      //   shadowOffsetY: 5,
+      // },
     },
   ],
   tooltip: {

+ 41 - 4
src/utils/vuexIndexedDBPlugin.js

@@ -1,7 +1,8 @@
-import { saveData, getData, openDB } from "@/utils/indexedDb";
+import { saveData, getData } from "@/utils/indexedDb";
 import { stringify, parse } from "flatted"; // 用于处理循环引用 压缩数据处理
 import pako from "pako";
 import { Message } from "element-ui";
+
 // 通用分片函数
 const splitIntoChunks = (data, chunkSize) => {
   const chunks = [];
@@ -10,6 +11,38 @@ const splitIntoChunks = (data, chunkSize) => {
   }
   return chunks;
 };
+
+// 修改后的 openDB 方法
+const openDB = (dbName, version) => {
+  return new Promise((resolve, reject) => {
+    const request = indexedDB.open(dbName, version);
+
+    request.onsuccess = () => {
+      resolve(request.result);
+    };
+
+    request.onerror = (error) => {
+      reject(error);
+    };
+
+    request.onupgradeneeded = (event) => {
+      const db = event.target.result;
+
+      // 创建对象存储(如果不存在)
+      if (!db.objectStoreNames.contains("dragChart_chunk_meta")) {
+        db.createObjectStore("dragChart_chunk_meta");
+      }
+      if (!db.objectStoreNames.contains("dragChart_compressed")) {
+        db.createObjectStore("dragChart_compressed");
+      }
+      if (!db.objectStoreNames.contains("myIndexedDB")) {
+        db.createObjectStore("myIndexedDB");
+      }
+    };
+  });
+};
+
+// vuex 插件
 const vuexIndexedDBPlugin = (store) => {
   const dbName = "vuexDB";
   const keyName = "vuexState";
@@ -34,7 +67,7 @@ const vuexIndexedDBPlugin = (store) => {
           ...store.state,
           ...savedState,
         });
-        console.log("Vuex state loaded from IndexedDB");
+        // console.log("Vuex state loaded from IndexedDB");
       }
     });
   });
@@ -71,7 +104,9 @@ const vuexIndexedDBPlugin = (store) => {
           chunks.forEach((chunk, index) => {
             const chunkKey = `dragChart_chunk_${index}`;
             saveData("myIndexedDB", chunkKey, chunk)
-              .then(() => console.log(`Chunk ${index} saved successfully`))
+              .then(() => {
+                console.log(`Chunk ${index} saved successfully`);
+              })
               .catch((error) =>
                 console.error(`Failed to save chunk ${index}:`, error)
               );
@@ -87,7 +122,9 @@ const vuexIndexedDBPlugin = (store) => {
           to: "string",
         });
         saveData("myIndexedDB", "dragChart_compressed", compressedData)
-          .then(() => console.log("Compressed metadata saved"))
+          .then(() => {
+            //console.log("Compressed metadata saved")
+          })
           .catch((error) =>
             console.error("Failed to save compressed metadata:", error)
           );

+ 494 - 0
src/views/dataAdministration/laser/index.vue

@@ -0,0 +1,494 @@
+<!--
+ * @Author: your name
+ * @Date: 2024-12-16 11:30:03
+ * @LastEditTime: 2024-12-17 09:25:42
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/dataAdministration/laser/index.vue
+-->
+
+<template>
+  <div class="global-variable" v-loading="loading">
+    <!-- 激光测距仪转换操作页面 -->
+    <div class="condition">
+      <el-form
+        :inline="true"
+        ref="ruleForm"
+        :model="formInline"
+        class="demo-form-inline"
+      >
+        <el-form-item label="风场名称:" prop="fieldName">
+          <el-input
+            size="small"
+            v-model="formInline.fieldName"
+            placeholder="请输入风场名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="状态:">
+          <el-select
+            size="small"
+            v-model="formInline.transferStatus"
+            placeholder="请选择状态"
+            style="width: 100%"
+          >
+            <el-option
+              :label="item.label"
+              v-for="item in StateCodeList"
+              :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>
+    </div>
+    <div class="list-page">
+      <div class="newly">
+        <el-button
+          v-hasPermi="['performance:batchMag:add']"
+          type="primary"
+          @click="newnuedialog"
+          size="small"
+          >新增</el-button
+        >
+      </div>
+      <el-table
+        v-loading="loading"
+        class="center-align-table"
+        :data="tableData"
+        border
+        :cell-style="rowStyle"
+      >
+        <el-table-column
+          prop="fieldName"
+          align="center"
+          min-width="100"
+          label="风场名称"
+        >
+        </el-table-column>
+        <el-table-column
+          align="center"
+          min-width="100"
+          label="转换路径"
+          prop="transferAddr"
+        >
+        </el-table-column>
+        <el-table-column
+          align="center"
+          min-width="100"
+          label="进度"
+          prop="transferProgress"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="transferStatus"
+          align="center"
+          label="状态"
+          min-width="100"
+        >
+          <template slot-scope="scope">
+            <span>
+              {{
+                scope.row.transferStatus == 0
+                  ? "转换中"
+                  : scope.row.transferStatus == 1
+                  ? "转换完成"
+                  : scope.row.transferStatus == 2
+                  ? "转换异常"
+                  : scope.row.transferStatus == -1
+                  ? "未转换"
+                  : "/"
+              }}</span
+            >
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          align="center"
+          min-width="100"
+          label="异常信息"
+          prop="errInfo"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="transferStartTime"
+          align="center"
+          min-width="150"
+          label="开始时间"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="transferEndTime"
+          align="center"
+          min-width="150"
+          label="结束时间"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="transition"
+          align="center"
+          fixed="right"
+          label="操作"
+          min-width="200"
+        >
+          <!-- 需要配置按钮权限再加这个自定义指令 -->
+          <!-- v-hasPermi="['dataAdministration:vibration:conversion']" -->
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.transferStatus === -1"
+              @click="conversion(scope.row, 0)"
+              type="text"
+              size="small"
+              >转换</el-button
+            >
+            <!-- v-hasPermi="['dataAdministration:vibration:reconversion']" -->
+            <el-button
+              v-if="
+                scope.row.transferStatus === 0 ||
+                scope.row.transferStatus === 1 ||
+                scope.row.transferStatus === 2
+              "
+              @click="conversion(scope.row, 1)"
+              type="text"
+              size="small"
+              :disabled="scope.row.transferStatus == 0"
+              >重新转换</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>
+
+    <!-- 弹出层 -->
+    <!-- 新增 /编辑-->
+    <el-dialog
+      :title="title"
+      :visible.sync="nuedialog"
+      width="500px"
+      :before-close="handleCloses"
+    >
+      <div v-loading="loadingView" class="views">
+        <el-form
+          :model="ruleForm"
+          :rules="addUserRules"
+          ref="addUserForm"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="风场:" prop="fieldCode">
+            <el-select
+              v-model="ruleForm.fieldCode"
+              placeholder="请选择风场"
+              :disabled="title !== '新增'"
+              style="width: 100%"
+            >
+              <el-option
+                :label="item.fieldName"
+                v-for="item in fieldCodeList"
+                :value="item.codeNumber"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="转换路径" prop="transferAddr">
+            <el-input
+              v-model="ruleForm.transferAddr"
+              placeholder="请输入转换路径"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="cancel('addUserForm')" size="small"
+            >取 消
+          </el-button>
+          <el-button
+            type="primary"
+            @click="submitForm('addUserForm')"
+            size="small"
+          >
+            确 定
+          </el-button>
+        </span>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { updateFieldBatch, queryCodeNum } from "@/api/performance.js";
+import {
+  getDataTransfer,
+  addDataTransfer,
+  DataTransfer,
+} from "@/api/dataManage.js";
+
+export default {
+  data() {
+    return {
+      loadingView: false,
+      loading: false, //数据加载中
+      fieldCodeList: [],
+      StateCodeList: [
+        {
+          label: "未转换",
+          value: -1,
+        },
+        {
+          label: "转换中",
+          value: 0,
+        },
+        {
+          label: "转换完成",
+          value: 1,
+        },
+        {
+          label: "转换异常",
+          value: 2,
+        },
+      ],
+      formInline: {
+        pageNum: 1,
+        pageSize: 10,
+        transferType: 2,
+        fieldName: "",
+        transferStatus: "",
+      },
+      tableData: [],
+      // 新增编辑表单
+      ruleForm: {
+        fieldCode: null,
+        transferAddr: null,
+      },
+      addUserRules: {
+        fieldCode: {
+          required: true,
+          message: "请选择风场",
+          trigger: "change",
+        },
+        transferAddr: [
+          { required: true, message: "请输入转换路径", trigger: "blur" },
+        ],
+      },
+      nuedialog: false,
+      title: "",
+      id: "",
+    };
+  },
+  created() {
+    this.getTableList();
+    this.getQueryCodeNumList();
+  },
+
+  methods: {
+    //转换重新转换
+    conversion(row, retransfer) {
+      try {
+        // 直接替换整个对象,以确保 Vue 的响应式系统能够检测到变化
+        this.ruleForm = {
+          fieldCode: row.fieldCode,
+          transferAddr: row.transferAddr,
+        };
+        this.id = row.id;
+        this.nuedialog = true;
+        this.title = retransfer === 0 ? "转换" : "重新转换";
+      } catch (error) {
+        this.$message.error("获取用户信息失败");
+      }
+    },
+    handleCloses(done) {
+      this.$confirm("确认关闭?")
+        .then((_) => {
+          done();
+        })
+        .catch((_) => {});
+    },
+
+    //获取风场列表
+    async getQueryCodeNumList() {
+      this.loading = true;
+      try {
+        const result = await queryCodeNum();
+        this.fieldCodeList = result.data.fieldCodeList;
+        this.loading = false;
+      } catch (error) {
+        console.error(error);
+        this.loading = false;
+      }
+    },
+    //分页数据切换
+    handleCurrentChange(val) {
+      this.formInline.pageNum = val;
+      this.getTableList();
+    },
+
+    async getTableList() {
+      try {
+        this.loading = true;
+        const result = await getDataTransfer({
+          ...this.formInline,
+          transferStatus:
+            this.formInline.transferStatus === ""
+              ? undefined
+              : this.formInline.transferStatus,
+          fieldName:
+            this.formInline.fieldName === ""
+              ? undefined
+              : this.formInline.fieldName,
+        });
+        this.tableData = result.data.list;
+        this.formInline.totalSize = result.data.totalSize;
+        this.loading = false;
+      } catch (error) {
+        this.$message({
+          type: "error",
+          message: "请检查是否连接网络",
+        });
+      }
+    },
+
+    rowStyle() {
+      return "text-align:center";
+    },
+    // 查询
+    onSubmit() {
+      this.getTableList();
+    },
+
+    // 新增,编辑确定
+    submitForm(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if (!valid) return false;
+        this.loadingView = true;
+        // 定义处理逻辑的映射
+        const actionMap = {
+          新增: () => addDataTransfer({ transferType: 2, ...this.ruleForm }),
+          转换: () =>
+            DataTransfer({
+              id: this.id,
+              retransfer: 0,
+              transferAddr: this.ruleForm.transferAddr,
+            }),
+          重新转换: () =>
+            DataTransfer({
+              id: this.id,
+              retransfer: 1,
+              transferAddr: this.ruleForm.transferAddr,
+            }),
+        };
+        try {
+          // 执行对应的操作
+          const response = await actionMap[this.title]?.();
+          if (response) {
+            this.$message({
+              type: "success",
+              message: response.msg,
+            });
+            this.getTableList();
+            this.nuedialog = false;
+          }
+        } catch (error) {
+          console.error("操作失败:", error);
+          this.$message.error(error?.msg || "操作失败,请稍后重试。");
+        } finally {
+          this.loadingView = false;
+        }
+      });
+    },
+
+    //点击取消
+    cancel(formName) {
+      this.$refs[formName] && this.$refs[formName].resetFields();
+      this.ruleForm = {
+        fieldCode: null,
+        transferAddr: null,
+      };
+      this.nuedialog = false;
+      this.loadingView = false;
+    },
+    reset() {
+      this.formInline = {
+        fieldName: "",
+        transferStatus: "",
+      };
+      this.getTableList();
+    },
+    // 新增
+    newnuedialog() {
+      this.cancel("addUserForm");
+      this.ruleForm = {
+        transferAddr: "",
+        fieldCode: "",
+      };
+      this.nuedialog = true;
+      this.title = "新增";
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.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;
+  }
+}
+
+.addition {
+  display: flex;
+  justify-content: flex-end;
+  margin-bottom: 10px;
+}
+.demo-ruleForm {
+  .el-form-item {
+    margin-bottom: 25px;
+  }
+}
+</style>

+ 3 - 3
src/views/dataAdministration/vibration/index.vue

@@ -1,14 +1,14 @@
 <!--
  * @Author: your name
  * @Date: 2024-11-25 09:28:47
- * @LastEditTime: 2024-12-06 16:12:50
+ * @LastEditTime: 2024-12-17 09:26:01
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/dataAdministration/vibration/index.vue
 -->
 <template>
   <div class="global-variable" v-loading="loading">
-    <!-- 振动数据操作页面 -->
+    <!-- 振动数据转换操作页面 -->
     <div class="condition">
       <el-form
         :inline="true"
@@ -372,7 +372,7 @@ export default {
         this.loadingView = true;
         // 定义处理逻辑的映射
         const actionMap = {
-          新增: () => addDataTransfer({ transferType: "1", ...this.ruleForm }),
+          新增: () => addDataTransfer({ transferType: 1, ...this.ruleForm }),
           转换: () =>
             DataTransfer({
               id: this.id,

+ 12 - 10
src/views/health/vibration.vue

@@ -131,10 +131,15 @@
             v-loading="item.loading"
           >
             <!-- {{ item.rowData }} -->
-            <p>测点路径:{{ getDetectionPointCn(item?.rowData?.mesurePointName) }}-{{ item?.rowData?.windTurbineNumber }}</p>
+            <p>
+              测点路径:{{
+                getDetectionPointCn(item?.rowData?.mesurePointName)
+              }}-{{ item?.rowData?.windTurbineNumber }}
+            </p>
             <P>
               <!-- <span>采样频率:</span> -->
-              <span>采样时间: {{ item?.rowData?.timeStamp }} </span></P>
+              <span>采样时间: {{ item?.rowData?.timeStamp }} </span></P
+            >
             <!-- {{ samplingTime }} -->
             <div v-if="item.name === '时域图'">
               <timedomaincharts
@@ -262,7 +267,7 @@ export default {
       parentOpt: [],
       defaultdata: {},
       companyCode: "",
-      windCode:"",
+      windCode: "",
       maplist: {},
       timevalue: [], // 绑定 el-date-picker 的值
       startTime: "", // 开始时间
@@ -526,7 +531,6 @@ export default {
 
   created() {
     this.GETtree();
-
   },
   // watch: {
   //   // 监听 timeList 的变化
@@ -583,9 +587,8 @@ export default {
       // 获取风机
       windEngineGrouPage(paramsData).then((res) => {
         this.unitoptions = res.data.list;
-        this.windCode=this.companyCode
-        console.log(   this.windCode,'   this.windCode');
-        
+        this.windCode = this.companyCode;
+        console.log(this.windCode, "   this.windCode");
       });
 
       if (data.codeType === "field") {
@@ -745,9 +748,8 @@ export default {
 
       const params = {
         ids: currentRow.id,
-           windCode: "SKF001",
+        windCode: "SKF001",
         // windCode: this.companyCode,
-     
       };
 
       // 根据type加载不同的数据
@@ -1104,4 +1106,4 @@ export default {
   color: #088080;
   font-weight: 600;
 }
-</style>
+</style>

+ 2 - 2
src/views/laserRangeFinder/components/CylinderOfTower.vue

@@ -136,9 +136,9 @@ export default {
             sampling: "lttb",
             itemStyle: {
               normal: {
-                color: "#3070B7",
+                color: "#1A285E",
                 lineStyle: {
-                  color: "#3070B7",
+                  color: "#1A285E",
                   width: 1,
                 },
               },

+ 64 - 73
src/views/laserRangeFinder/components/PlotOfFit.vue

@@ -62,8 +62,24 @@ export default {
       currentIndex: 0, // 默认索引
       tableData: [], // 数据
       originalChartStyle: {}, // 用于存储原始样式
+      // 控制标注的显示/隐藏
+      markPointVisible: false,
+      markLineVisible: false,
     };
   },
+  watch: {
+    // 监听标注的显示状态变化
+    markPointVisible(newVal, oldVal) {
+      if (newVal !== oldVal) {
+        this.updateChart(); // 更新图表
+      }
+    },
+    markLineVisible(newVal, oldVal) {
+      if (newVal !== oldVal) {
+        this.updateChart(); // 更新图表
+      }
+    },
+  },
   mounted() {
     this.initializeChart();
     // 监听键盘事件
@@ -78,6 +94,7 @@ export default {
     initializeChart() {
       const chartDom = this.$refs.chart;
       this.chartInstance = echarts.init(chartDom);
+
       const defaultData = [
         Math.floor(Math.random() * 300),
         Math.floor(Math.random() * 300),
@@ -103,70 +120,20 @@ export default {
         (_, index) => `2024/1/${index + 1}`
       );
       const option = {
-        color: ["#9CC5AF", "#C9866B", "#709EA6", "#344453", "#B34138"],
-        // title: [
-        //   {
-        //     text: "",
-        //     left: "center",
-        //     // subtext: '纯属虚构'
-        //   },
-        //   {
-        //     text: "",
-        //     // subtext:'实线',
-        //     textStyle: {
-        //       color: "#c23531",
-        //       // }
-        //     },
-        //     right: 35,
-        //     top: 275,
-        //     // subtext: '纯属虚构'
-        //   },
-        //   {
-        //     text: "",
-        //     right: 3,
-        //     top: 280,
-        //     textStyle: {
-        //       color: "#c23531",
-        //       fontSize: 12,
-        //     },
-        //   },
-
-        //   {
-        //     text: "",
-        //     textStyle: {
-        //       color: "#2f4554",
-        //     },
-        //     right: 35,
-        //     top: 295,
-        //     // subtext: '纯属虚构'
-        //   },
-        //   {
-        //     text: "",
-        //     textStyle: {
-        //       // fontSize:12,
-        //       color: "#d48265",
-        //     },
-        //     right: 0,
-        //     top: 219,
-        //     // subtext: '纯属虚构'
-        //   },
-        //   {
-        //     text: "",
-        //     textStyle: {
-        //       color: "#61a0a8",
-        //     },
-        //     right: 35,
-        //     top: 410,
-        //     // subtext: '纯属虚构'
-        //   },
-        //   {
-        //     top: 510,
-        //     left: 50,
-        //     subtextStyle: {
-        //       fontWeight: "bold",
-        //     },
-        //   },
-        // ],
+        color: [
+          "#D7EFB7",
+          // "#9CD9BD",
+          // "#7ACCC1",
+          // "#5DBFC4",
+          "#46AFC5",
+          // "#379CC2",
+          // "#3286BB",
+          // "#406DAB",
+          "#3856A0",
+          // "#314291",
+          // "#28357A",
+          "#1A285E",
+        ],
         toolbox: {
           feature: {
             dataZoom: { yAxisIndex: "none" },
@@ -186,14 +153,22 @@ export default {
             },
             myCustomTool3: {
               show: true,
+              title: "标注",
+              icon: `image://${require("@/assets/analyse/mark.png")}`,
+              onclick: () => this.WhetherToDisplay(),
+            },
+            myCustomTool4: {
+              show: true,
               title: "全屏",
               icon: `image://${require("@/assets/analyse/fullScreen.png")}`,
+
               onclick: () => this.fullScreen(),
             },
-            myCustomTool4: {
+            myCustomTool5: {
               show: true,
               title: "退出全屏",
               icon: `image://${require("@/assets/analyse/exitFullScreen.png")}`, // 替换为你自己的图标路径
+
               onclick: () => this.exitFullScreen(),
             },
           },
@@ -232,24 +207,16 @@ export default {
             name: "叶片2根部轮廓",
             type: "line",
             showSymbol: false,
-            lineStyle: {
-              //   type: "dashed",
-            },
             data: [
               12.84, 13.03, 13.05, 13.89, 13.72, 12.97, 13.21, 14.02, 14.54,
               15.07, 14.94, 14.55, 13.84, 12.7, 12.06, 11.93, 11.6, 10.84,
               10.26, 10.18, 10.21, 9.86, 10.1, 9.96, 10.25, 11.1, 11.08, 10.7,
             ],
           },
-
           {
             name: "叶片3根部轮廓",
             showSymbol: false,
-            lineStyle: {
-              //   type: "dotted",
-            },
             type: "line",
-
             data: [
               7.38, 7.73, 7.46, 7.85, 7.68, 7.45, 6.94, 6.7, 5.98, 6.25, 6.28,
               5.74, 5.51, 5.35, 5.25, 5.03, 4.83, 4.57, 4.58, 4.33, 4.6, 4.42,
@@ -293,8 +260,32 @@ export default {
           },
         ],
       };
+      // 切换标注的显示状态
+      option.series = option.series.map((serie) => ({
+        ...serie,
+        markPoint: this.markPointVisible
+          ? {
+              data: [
+                { type: "max", name: "Max" },
+                { type: "min", name: "Min" },
+              ],
+            }
+          : { data: [] },
+        markLine: this.markLineVisible
+          ? {
+              data: [{ type: "average", name: "Avg" }],
+            }
+          : { data: [] },
+      }));
+      this.chartInstance.setOption(option, true); // 强制刷新
       this.chartInstance.setOption(option);
     },
+    // 标注是否显示
+    WhetherToDisplay() {
+      // 切换显示状态
+      this.markPointVisible = !this.markPointVisible;
+      this.markLineVisible = !this.markLineVisible;
+    },
     previousRow() {
       let newIndex =
         this.currentIndex > 0

+ 8 - 8
src/views/laserRangeFinder/components/initCharts.vue

@@ -115,20 +115,20 @@ export default {
             sampling: "lttb",
             itemStyle: {
               normal: {
-                color: "#3A84FF",
+                color: "#1A285E",
                 lineStyle: {
-                  color: "#3A84FF",
+                  color: "#1A285E",
                   width: 1,
                 },
                 areaStyle: {
                   color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
                     {
                       offset: 0,
-                      color: "rgba(58,132,255,0)",
+                      color: "rgba(26,40,94,0)",
                     },
                     {
                       offset: 1,
-                      color: "rgba(58,132,255,0.35)",
+                      color: "rgba(26,40,94,0.35)",
                     },
                   ]),
                 },
@@ -145,20 +145,20 @@ export default {
             sampling: "lttb",
             itemStyle: {
               normal: {
-                color: "rgba(255,80,124,1)",
+                color: "#d2e9b4",
                 lineStyle: {
-                  color: "rgba(255,80,124,1)",
+                  color: "#d2e9b4",
                   width: 1,
                 },
                 areaStyle: {
                   color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
                     {
                       offset: 0,
-                      color: "rgba(255,80,124,0)",
+                      color: "rgba(210,233,180,0)",
                     },
                     {
                       offset: 1,
-                      color: "rgba(255,80,124,0.35)",
+                      color: "rgba(210,233,180,1)",
                     },
                   ]),
                 },

+ 0 - 1
src/views/laserRangeFinder/index.vue

@@ -235,7 +235,6 @@ export default {
           windCode: this.formInline.companyCode,
           windTurbineNumber: this.formInline.unitvalue,
         };
-        console.log(this.formInline, "formInline");
         const res = await axios.post("/WZLapi/laserData/getLaserData", params);
         if (res.data.code === 200) {
           this.tableData = res.data.datas;

+ 5 - 114
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartLogic/modules/scatter.js

@@ -1,115 +1,6 @@
 //散点图+散点折线图
 import { filterData } from "../dargChartFIlter";
-// export function handleScatterChartLogic(
-//   item, //curEdit编辑项配置
-//   formLabelAlign, //每一项label显示
-//   formFilterAlign, //过滤数据 数据筛选from
-//   isFilter, //是否是过滤
-//   type //图表类型
-// ) {
-//   // 封装柱状图的具体逻辑
-//   if (isFilter === "filter") {
-//     // 数据筛选逻辑
-//     const filterResult = formLabelAlign.Ydata.map((yItem, index) => ({
-//       label: yItem.label,
-//       id: yItem.id,
-//       data: yItem.data.map((val) => {
-//         const filters = formFilterAlign[index]?.filters || [];
-//         return val === null ||
-//           (filters.length > 0 && !filters.includes(val[yItem.label]))
-//           ? null
-//           : val;
-//       }),
-//     }));
-//     // 条件筛选逻辑
-//     const filterList = filterResult.map((filteredItem, index) => {
-//       const filter = formFilterAlign[index];
-//       const { filterType1, filterType2, number1, number2 } = filter;
-//       if (
-//         (number1 === null || number1 === "") &&
-//         (number2 === null || number2 === "")
-//       ) {
-//         return {
-//           label: filteredItem.label,
-//           id: filteredItem.id,
-//           data: filteredItem.data,
-//         };
-//       } else {
-//         const filterDatas = filterData(
-//           filter,
-//           filteredItem.data,
-//           filteredItem.label
-//         );
-//         return {
-//           label: filteredItem.label,
-//           id: filteredItem.id,
-//           data: [...filterDatas],
-//         };
-//       }
-//     });
-//     item.Xdata = formLabelAlign.Xdata;
-//     item.Ydata = filterList;
-//   } else {
-//     item.Xdata = formLabelAlign.Xdata;
-//     item.Ydata = formLabelAlign.Ydata;
-//   }
-//   item.option.xAxis = {
-//     ...item.option.xAxis,
-//     type: "value",
-//     name: formLabelAlign.Xlable,
-//   };
-//   item.option.yAxis = {
-//     ...item.option.yAxis,
 
-//     name: formLabelAlign.Ylable,
-//   };
-
-//   if (item.Ydata[0]?.data?.length > 0 || item.Xdata[0]?.data?.length > 0) {
-//     // console.log(item.Xdata, "item.Xdata", item.Ydata);
-//     item.option.series = (
-//       item.Xdata.length > item.Ydata.length ? item.Xdata : item.Ydata
-//     ).map((val, ind) => {
-//       const xData = item.Xdata[ind]?.data || [];
-//       const yData = item.Ydata[ind]?.data || [];
-
-//       const scatterData = xData
-//         .map((xItem, idx) => {
-//           const yItem = yData[idx];
-//           if (!xItem || !yItem) return null; // 如果对应项不存在,则跳过
-//           return [
-//             Number(
-//               xItem[item.Xdata[ind].label] === undefined
-//                 ? 0
-//                 : xItem[item.Xdata[ind].label]
-//             ) || 0, // 取 X 值
-//             Number(
-//               yItem[item.Ydata[ind].label] === undefined
-//                 ? 0
-//                 : yItem[item.Ydata[ind].label]
-//             ) || 0, // 取 Y 值
-//           ];
-//         })
-//         .filter((point) => point !== null); // 过滤掉无效的点
-
-//       return {
-//         name: `${item.Xdata[ind]?.label || "X"} - ${
-//           item.Ydata[ind]?.label || "Y"
-//         }`,
-//         type: type,
-//         renderMode: "webgl", // 启用 WebGL 渲染
-//         data: scatterData, // 生成的散点图数据
-//         tooltip: {
-//           trigger: "item", // 鼠标悬停触发
-//         },
-//         itemStyle: {
-//           shadowBlur: 3,
-//           shadowColor: "rgba(25, 100, 150, 0.3)",
-//           shadowOffsetY: 1.5,
-//         },
-//       };
-//     });
-//   }
-// }
 export function handleScatterChartLogic(
   item, // curEdit编辑项配置
   formLabelAlign, // 每一项label显示
@@ -210,11 +101,11 @@ export function handleScatterChartLogic(
         tooltip: {
           trigger: "item", // 鼠标悬停触发
         },
-        itemStyle: {
-          shadowBlur: 3,
-          shadowColor: "rgba(25, 100, 150, 0.3)",
-          shadowOffsetY: 1.5,
-        },
+        // itemStyle: {
+        //   shadowBlur: 3,
+        //   shadowColor: "rgba(25, 100, 150, 0.3)",
+        //   shadowOffsetY: 1.5,
+        // },
       };
     });
 

+ 2 - 2
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/chartTitle.vue

@@ -113,7 +113,7 @@
               content="添加指标值"
               placement="bottom-start"
               v-if="
-                curEdit.type !== 'roseChart' &&
+                // curEdit.type !== 'roseChart' &&
                 curEdit.type !== 'pie' &&
                 curEdit.type !== 'sankeyDiagram' &&
                 curEdit.type !== 'Heatmap'
@@ -155,7 +155,7 @@
               </el-select>
               <el-tooltip
                 v-if="
-                  curEdit.type !== 'roseChart' &&
+                  // curEdit.type !== 'roseChart' &&
                   curEdit.type !== 'pie' &&
                   curEdit.type !== 'sankeyDiagram' &&
                   curEdit.type !== 'Heatmap'

+ 11 - 2
src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/configFn.js

@@ -1,8 +1,8 @@
 /*
  * @Author: your name
  * @Date: 2024-11-12 09:27:50
- * @LastEditTime: 2024-11-19 15:30:26
- * @LastEditors: milo-MacBook-Pro.local
+ * @LastEditTime: 2024-12-17 13:50:43
+ * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/performance/components/custonAsCom/dragChart/components/chartConfig/form/configFn.js
  */
@@ -31,6 +31,15 @@ export const getFormattedSeries = (data, chartType) => {
       data: item.data.map(
         (data) => parseFloat(data !== null && data[item.label]) || 0
       ), // 将数据转换为数值
+      markPoint: {
+        data: [
+          { type: "max", name: "Max" },
+          { type: "min", name: "Min" },
+        ],
+      },
+      markLine: {
+        data: [{ type: "average", name: "Avg" }],
+      },
     });
   });
   return series;

+ 53 - 24
src/views/performance/customAnalysis.vue

@@ -518,37 +518,56 @@ export default {
     // 文件变化时的处理
     handleChange(file) {
       this.checkFileType(file);
-      //csv 本身不支持多个sheet 页 ,所有以这里不需要循环处理
+
+      // 如果是 CSV 文件
       if (file && file.name.endsWith(".csv")) {
-        Papa.parse(file.raw, {
-          header: true,
-          complete: (results) => {
-            // 可以进一步处理解析后的数据
-            const fileData = {
-              filename: format(new Date(), "yyyyMMdd-HH:mm:ss") + file.name,
-              fileOldName: file.name,
-              fileData: results.data,
-              fileId: new Date().getTime(),
-            };
-            if (results.data.length > 0) {
-              this.storeData(fileData);
+        const reader = new FileReader();
+        reader.onload = (e) => {
+          // 检测文件编码并解析
+          const encoding = this.detectFileEncoding(e.target.result);
+          const text = new TextDecoder(encoding).decode(
+            new Uint8Array(e.target.result)
+          );
+
+          // 使用 Papa.parse 解析 CSV 数据
+          Papa.parse(text, {
+            header: true, // 第一行作为表头
+            complete: (results) => {
+              const fileData = {
+                filename: format(new Date(), "yyyyMMdd-HH:mm:ss") + file.name,
+                fileOldName: file.name,
+                fileData: results.data,
+                fileId: new Date().getTime(),
+              };
+              if (results.data.length > 0) {
+                this.storeData(fileData);
+                this.loading = false;
+              }
+            },
+            error: (error) => {
+              console.error("Error parsing CSV:", error);
               this.loading = false;
-            }
-          },
-          error: (error) => {
-            console.error("Error parsing CSV:", error);
-            this.loading = false;
-          },
-        });
+            },
+          });
+        };
+        reader.readAsArrayBuffer(file.raw); // 以 ArrayBuffer 读取文件
       } else {
+        // 如果是 Excel 文件
         const reader = new FileReader();
         reader.onload = (e) => {
           const data = new Uint8Array(e.target.result);
+
+          // 读取 Excel 文件
           const workbook = XLSX.read(data, { type: "array" });
+
           workbook.SheetNames.forEach((sheetName, ind) => {
             const sheetData = XLSX.utils.sheet_to_json(
-              workbook.Sheets[sheetName]
+              workbook.Sheets[sheetName],
+              {
+                defval: "", // 确保空值不会导致错误
+              }
             );
+
             const fileData = {
               filename:
                 format(new Date(), "yyyyMMdd-HH:mm:ss") + "_" + ind + file.name,
@@ -560,13 +579,23 @@ export default {
               this.storeData(fileData);
               this.loading = false;
             }
-            // console.log("Parsed Excel Sheet Data:", sheetData);
-            // 可以进一步处理解析后的数据
           });
         };
-        reader.readAsArrayBuffer(file.raw);
+        reader.readAsArrayBuffer(file.raw); // 以 ArrayBuffer 读取文件
       }
     },
+
+    // 检测文件编码的方法
+    detectFileEncoding(arrayBuffer) {
+      // 简单判断编码,默认 UTF-8,如果需要更精确,可以引入第三方库如 `jschardet`
+      const text = new TextDecoder("utf-8").decode(new Uint8Array(arrayBuffer));
+      if (text.includes("�")) {
+        // 如果有乱码字符,可能是 GBK 编码
+        return "gbk";
+      }
+      return "utf-8";
+    },
+
     //判断上传文件类型
     checkFileType(file) {
       const isPdf =

+ 3 - 3
vue.config.js

@@ -64,9 +64,9 @@ module.exports = {
     proxy: {
       "/api": {
         // target: "http://192.168.5.4:16200", // 石月
-        // target: "http://192.168.50.235:16200", // 内网
+        target: "http://192.168.50.235:16200", // 内网 开发
         // target: "http://192.168.5.15:16200",
-        target: "http://106.120.102.238:16700", // 外网  16600   16700
+        // target: "http://106.120.102.238:16700", // 外网   16600   16700
         // target: "http://10.96.137.5",
         changeOrigin: true,
         pathRewrite: {
@@ -103,7 +103,7 @@ module.exports = {
       },
       //自定义算法文佳
       "/sAlgorithm": {
-        target: "http://192.168.5.28:8666", // 目标地址
+        target: "http://192.168.50.235:8666", // 目标地址
         changeOrigin: true,
         pathRewrite: {
           "^/sAlgorithm": "", // 如果后端需要 `/api` 前缀