瀏覽代碼

激光测距仪图表全屏展示

liujiejie 7 月之前
父節點
當前提交
e963df1bfe

File diff suppressed because it is too large
+ 22295 - 20
package-lock.json


+ 1 - 0
package.json

@@ -32,6 +32,7 @@
     "plotly.js-with-locales": "^1.31.2",
     "qs": "^6.12.0",
     "quill": "^2.0.2",
+    "screenfull": "^6.0.2",
     "svg-sprite-loader": "^6.0.11",
     "terser-webpack-plugin": "^5.3.10",
     "vue": "^2.6.14",

二進制
src/assets/analyse/exitFullScreen.png


二進制
src/assets/analyse/fullScreen.png


+ 216 - 77
src/assets/js/constants/color.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2024-11-27 14:40:15
- * @LastEditTime: 2024-11-27 15:12:50
+ * @LastEditTime: 2024-12-10 09:58:45
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/assets/js/constants/color.js
@@ -135,81 +135,220 @@
 //   "#468b8e",
 // ];
 //蓝紫色
+// export const colorPalette = [
+//   "#5167a2",
+//   "#687db0",
+//   "#8597c0",
+//   "#ccd5e3", // 给定的基础颜色
+//   "#3e4d76",
+//   "#7f98b5",
+//   "#9da9b8",
+//   "#b3c1d1", // 更深、稍带灰色的蓝色系列
+//   "#4f5f8d",
+//   "#5c73a0",
+//   "#728ab8",
+//   "#92a9c7", // 增加深浅对比的蓝色系列
+//   "#3c4f78",
+//   "#556e96",
+//   "#6b88b0",
+//   "#7b9fc3", // 增加对比度的蓝色系列
+//   "#2e3b5c",
+//   "#3e5376",
+//   "#4e6a90",
+//   "#6e8bb1", // 深蓝色系列和淡蓝色过渡
+//   "#1f2b47",
+//   "#2f3c61",
+//   "#406a8d",
+//   "#5a84a8", // 更加深沉的蓝色系列
+//   "#547d94",
+//   "#6c96b1",
+//   "#8fa7c2",
+//   "#c0d0e0", // 从深到浅的渐变系列
+//   "#4b5e7c",
+//   "#6f8099",
+//   "#8a9bb4",
+//   "#b8c7d9", // 更加鲜明的蓝色系列
+//   "#40618d",
+//   "#537ba3",
+//   "#6a92b9",
+//   "#90adc7", // 饱和度提高的蓝色系列
+//   "#305079",
+//   "#417f98",
+//   "#5b98b3",
+//   "#76adc6", // 淡蓝色与深蓝色相结合
+//   "#274c68",
+//   "#3c6481",
+//   "#558ea3",
+//   "#6db4c7", // 更加突出的对比
+//   "#3e4e7b",
+//   "#547b98",
+//   "#748da9",
+//   "#a1bbd4", // 深蓝至淡蓝的渐变
+//   "#2c3b5a",
+//   "#3d4d73",
+//   "#54798d",
+//   "#7498b6", // 深浅变化的蓝色
+//   "#2f3f65",
+//   "#41597f",
+//   "#5b799a",
+//   "#7f9fc7", // 不同深度的蓝色
+//   "#35476a",
+//   "#487f9e",
+//   "#5f9bb6",
+//   "#84b7d2", // 蓝色渐变系列
+//   "#1a2b43",
+//   "#2b3f5a",
+//   "#3e5779",
+//   "#51768f", // 更加沉稳的蓝色系
+//   "#263d56",
+//   "#3b5079",
+//   "#4c6c97",
+//   "#6885b4", // 中性蓝系列
+//   "#1e2e4b",
+//   "#2f3f62",
+//   "#41567b",
+//   "#567b9e", // 清晰的蓝色渐变
+//   "#283c54",
+//   "#3a4f73",
+//   "#4c698f",
+//   "#6486b0", // 蓝色的温暖渐变
+// ];
+//亮色
+// export const colorPalette = [
+//   "#ff0000",
+//   "#00ff00",
+//   "#0000ff",
+//   "#ffff00",
+//   "#ff00ff",
+//   "#00ffff",
+//   "#800000",
+//   "#808000",
+//   "#008000",
+//   "#800080",
+//   "#008080",
+//   "#000080",
+//   "#ff4500",
+//   "#2e8b57",
+//   "#6a5acd",
+//   "#ff6347",
+//   "#4682b4",
+//   "#9acd32",
+//   "#ffa07a",
+//   "#7b68ee",
+//   "#8b0000",
+//   "#32cd32",
+//   "#00008b",
+//   "#ffd700",
+//   "#adff2f",
+//   "#20b2aa",
+//   "#f08080",
+//   "#9370db",
+//   "#ff1493",
+//   "#40e0d0",
+// ];
+//紫色-黄色
+// export const colorPalette = [
+//   "#3D1150",
+//   "#412575",
+//   "#3F4687",
+//   "#3D678B",
+//   "#40808C",
+//   "#4A9D8A",
+//   "#5EB67E",
+//   "#85CB66",
+//   "#BFDE50",
+//   "#FAE654",
+//   "#6A1E66",
+//   "#5E317F",
+//   "#525898",
+//   "#5177A4",
+//   "#54A4A8",
+//   "#60B396",
+//   "#75C988",
+//   "#A6D970",
+//   "#E7ED60",
+//   "#FDEB87",
+//   "#320D46",
+//   "#35145D",
+//   "#332F74",
+//   "#315E7C",
+//   "#327D84",
+//   "#3C9882",
+//   "#52AD73",
+//   "#7DC061",
+//   "#B2D54B",
+//   "#E1DE40",
+//   "#2A093B",
+//   "#2C0F53",
+//   "#2A245A",
+//   "#293E6A",
+//   "#2B5F75",
+//   "#326E79",
+//   "#3F9171",
+//   "#65A960",
+//   "#94BD4C",
+//   "#CCCB39",
+//   "#230833",
+//   "#250D4B",
+//   "#231F50",
+//   "#223B5D",
+//   "#255C68",
+//   "#2B746C",
+//   "#367E64",
+//   "#568B58",
+//   "#7FA348",
+//   "#B3B72E",
+// ];
+//蓝色-青色
 export const colorPalette = [
-  "#5167a2",
-  "#687db0",
-  "#8597c0",
-  "#ccd5e3", // 给定的基础颜色
-  "#3e4d76",
-  "#7f98b5",
-  "#9da9b8",
-  "#b3c1d1", // 更深、稍带灰色的蓝色系列
-  "#4f5f8d",
-  "#5c73a0",
-  "#728ab8",
-  "#92a9c7", // 增加深浅对比的蓝色系列
-  "#3c4f78",
-  "#556e96",
-  "#6b88b0",
-  "#7b9fc3", // 增加对比度的蓝色系列
-  "#2e3b5c",
-  "#3e5376",
-  "#4e6a90",
-  "#6e8bb1", // 深蓝色系列和淡蓝色过渡
-  "#1f2b47",
-  "#2f3c61",
-  "#406a8d",
-  "#5a84a8", // 更加深沉的蓝色系列
-  "#547d94",
-  "#6c96b1",
-  "#8fa7c2",
-  "#c0d0e0", // 从深到浅的渐变系列
-  "#4b5e7c",
-  "#6f8099",
-  "#8a9bb4",
-  "#b8c7d9", // 更加鲜明的蓝色系列
-  "#40618d",
-  "#537ba3",
-  "#6a92b9",
-  "#90adc7", // 饱和度提高的蓝色系列
-  "#305079",
-  "#417f98",
-  "#5b98b3",
-  "#76adc6", // 淡蓝色与深蓝色相结合
-  "#274c68",
-  "#3c6481",
-  "#558ea3",
-  "#6db4c7", // 更加突出的对比
-  "#3e4e7b",
-  "#547b98",
-  "#748da9",
-  "#a1bbd4", // 深蓝至淡蓝的渐变
-  "#2c3b5a",
-  "#3d4d73",
-  "#54798d",
-  "#7498b6", // 深浅变化的蓝色
-  "#2f3f65",
-  "#41597f",
-  "#5b799a",
-  "#7f9fc7", // 不同深度的蓝色
-  "#35476a",
-  "#487f9e",
-  "#5f9bb6",
-  "#84b7d2", // 蓝色渐变系列
-  "#1a2b43",
-  "#2b3f5a",
-  "#3e5779",
-  "#51768f", // 更加沉稳的蓝色系
-  "#263d56",
-  "#3b5079",
-  "#4c6c97",
-  "#6885b4", // 中性蓝系列
-  "#1e2e4b",
-  "#2f3f62",
-  "#41567b",
-  "#567b9e", // 清晰的蓝色渐变
-  "#283c54",
-  "#3a4f73",
-  "#4c698f",
-  "#6486b0", // 蓝色的温暖渐变
+  "#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",
 ];

+ 54 - 190
src/views/health/vibration.vue

@@ -28,34 +28,24 @@
     <div class="searchbox">
       <p>
         单位:
-        <selecttree
-          style="width: 220px"
-          placeholder="请选择上级单位"
-          :list="parentOpt"
-          type="1"
-          v-model="companyCode"
-          @change="parentChange"
-          :defaultParentProps="{
-            children: 'children',
-            label: 'companyName',
-            value: 'codeNumber',
-          }"
-        >
-        </selecttree>
+        <el-select v-model="company" size="small" placeholder="请选择">
+          <el-option
+            v-for="item in companyoptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
       </p>
       <p>
         风机:
-        <el-select
-          v-model="unitvalue"
-          @change="getchedian"
-          size="small"
-          placeholder="请选择"
-        >
+        <el-select v-model="unitvalue" size="small" placeholder="请选择">
           <el-option
             v-for="item in unitoptions"
-            :key="item.engineCode"
-            :label="item.engineName"
-            :value="item.engineCode"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
           >
           </el-option>
         </el-select>
@@ -65,9 +55,9 @@
         <el-select v-model="monitoringvalue" size="small" placeholder="请选择">
           <el-option
             v-for="item in monitoringoptions"
-            :key="item.detectionPointEn"
-            :label="item.detectionPointCn"
-            :value="item.detectionPointEn"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
           >
           </el-option>
         </el-select>
@@ -84,9 +74,7 @@
         >
         </el-date-picker>
       </p>
-      <el-button type="primary" size="small" @click="conditions"
-        >查询</el-button
-      >
+      <el-button type="primary" size="small">查询</el-button>
       <el-button size="small">导出</el-button>
     </div>
     <div class="main-body">
@@ -123,12 +111,14 @@
               minimized: item.isMinimized,
             }"
           >
-            <p>测点路径:{{}}</p>
+            <p>测点路径:</p>
             <P><span>采样频率:</span><span>采样时间:</span></P>
             <div v-if="item.name === '时域图'">
               <timedomaincharts
-                :timeList="timeList"
+                :chartData="chartData"
+                :chartLabels="chartLabels"
                 :currentIndex="currentIndex"
+                :tableData="tableData"
                 @update:currentIndex="handleCurrentIndexUpdate"
               ></timedomaincharts>
             </div>
@@ -159,21 +149,17 @@
       <div class="data-origin">
         <el-table
           ref="singleTable"
-          :data="tableDataList"
+          :data="tableData"
           :current-row-key="currentIndex"
           @current-change="handleCurrentChange"
           highlight-current-row
           style="width: 100%"
         >
           <el-table-column type="index" label="排序"> </el-table-column>
-          <el-table-column prop="timeStamp" label="时间"> </el-table-column>
-          <el-table-column prop="mesurePointName" label="测点名称">
-          </el-table-column>
-          <el-table-column prop="address" label="场站">
-            {{ this.companyCode }}
-          </el-table-column>
-          <el-table-column prop="windTurbineNumber" label="风机" width="80px">
-          </el-table-column>
+          <el-table-column prop="name" label="时间"> </el-table-column>
+          <el-table-column prop="address" label="测点名称"> </el-table-column>
+          <el-table-column prop="address" label="场站"> </el-table-column>
+          <el-table-column prop="address" label="风机"> </el-table-column>
         </el-table>
       </div>
     </div>
@@ -181,27 +167,18 @@
 </template>
 
 <script>
-import {
-  getSysOrganizationAuthTreeByRoleId,
-  windEngineGrouPage,
-  queryDetectionDic,
-  getMesureData,
-} from "@/api/ledger.js";
-import selecttree from "../../components/selecttree.vue";
-
 import * as echarts from "echarts";
 import envelopecharts from "./components/envelopecharts.vue";
 import spectrogramcharts from "./components/spectrogramcharts.vue";
 import tendencycharts from "./components/tendencycharts.vue";
 import timedomaincharts from "./components/timedomaincharts.vue";
-import axios from "axios";
+
 export default {
   components: {
     envelopecharts,
     spectrogramcharts,
     tendencycharts,
     timedomaincharts,
-    selecttree,
   },
   data() {
     return {
@@ -210,7 +187,7 @@ export default {
       tableData: [],
       data: [10, 20, 30, 40], // 假设是图表的数据
       labels: ["2024/1/1", "2024/1/2", "2024/1/3", "2024/1/4"], // 假设是时间轴数据
-
+      currentIndex: 0,
       tableData: [], // 假设是来自父组件的数据
 
       company: "",
@@ -219,121 +196,40 @@ export default {
       unitoptions: [],
       monitoringvalue: "",
       monitoringoptions: [],
-
-      tableData: [],
+      timevalue: "",
+      tableData: [
+        { name: "2024-11-01", address: "Location A" },
+        { name: "2024-11-02", address: "Location B" },
+        { name: "2024-11-03", address: "Location C" },
+      ],
 
       fourList: [],
       currentRow: null, // 用于存储当前选中的行
       currentIndex: 0,
       isChartVisible: false,
-      parentOpt: [],
-      defaultdata: {},
-      companyCode: "",
-      maplist: {},
-      timevalue: [], // 绑定 el-date-picker 的值
-      startTime: "", // 开始时间
-      endTime: "", // 结束时间
-      tableDataList: [],
-
-      timeList: {},
     };
   },
 
-  created() {
-    this.GETtree();
-  },
   methods: {
-    // 获取风场
-    async GETtree() {
-      const res = await getSysOrganizationAuthTreeByRoleId();
-      const treedata = res.data;
-      const processedData = this.processTreeData(treedata);
-      this.parentOpt = processedData;
-      this.defaultdata = res.data[0];
-    },
-
-    parentChange(data) {
-      this.maplist = data;
-      this.maplistArr = data;
-      let paramsData = {
-        fieldCode: this.maplist.codeNumber,
-        pageNum: 1,
-        pageSize: 99,
-      };
-      this.unitvalue = "";
-      // 获取风机
-      windEngineGrouPage(paramsData).then((res) => {
-        this.unitoptions = res.data.list;
-      });
-
-      console.log(data, "parentChange");
-      if (data.codeType === "field") {
-        if (this.parseCoordinates(data.longitudeAndLatitudeString).length > 0) {
-          return;
-        }
-      } else {
-        const dataMapList = data.children;
-        dataMapList.forEach((element) => {
-          console.log(element);
-          if (
-            this.parseCoordinates(element.longitudeAndLatitudeString).length >
-              0 &&
-            element.codeType === "field"
-          ) {
-            return;
-          }
-        });
-      }
-    },
-    processTreeData(treeData) {
-      const processedData = [];
-      function processNode(node) {
-        if (node.codeType === "field") {
-          node.companyName = node.fieldName;
-        }
-        if (node.children && node.children.length > 0) {
-          node.children.forEach((child) => {
-            processNode(child);
-          });
-        }
-      }
-      treeData.forEach((root) => {
-        processNode(root);
-        processedData.push(root);
-      });
-      return processedData;
-    },
-    parseCoordinates(input) {
-      if (input && typeof input === "string") {
-        return input.split(",").map(Number);
-      }
-      // debugger;
-      return [];
-    },
-    // 获取测点
-    getchedian(value) {
-      queryDetectionDic({ engineCodes: value }).then((res) => {
-        this.monitoringoptions = res.data;
-      });
-    },
-// 更新父组件的 currentIndex
     handleCurrentIndexUpdate(newIndex) {
       this.currentIndex = newIndex;
-      this.setCurrentRowData(newIndex)
     },
-
-    // 当前所在行高亮提示
     setCurrent(row) {
-      this.$refs.singleTable.setCurrentRow(row);
+      this.$nextTick(() => {
+        if (this.$refs.singleTable) {
+          this.$refs.singleTable.setCurrentRow(row); // 设置当前行
+        } else {
+          console.warn("Cannot access $refs.singleTable: it's undefined.");
+        }
+      });
     },
-    // 当前单选
     handleCurrentChange(val) {
-      this.currentRow = val;
-      const index = this.tableData.indexOf(val);
+      this.currentRow = val; // 处理当前选中行
+      const index = this.tableData.indexOf(val); // 获取当前选中行的索引
       this.currentIndex = index; // 更新当前索引
+      console.log("currentIndex updated to:", this.currentIndex);
     },
 
-
     generate(type) {
       if (!this.currentRow) {
         this.$message.warning("请先选择数据");
@@ -355,19 +251,6 @@ export default {
         };
         this.fourList.push(newItem);
       }
-      const params = {
-        ids: [67803],
-        windCode: "SKF001_wave",
-        analysisType: "time",
-      };
-
-      axios
-        .post("/WJapi/analysis/time", params)
-        .then((res) => {
-          this.timeList = JSON.parse(res.data);
-          console.log(this.timeList);
-        })
-        .catch((error) => {});
     },
 
     tendency() {
@@ -383,34 +266,6 @@ export default {
       this.fourList.push(newItem);
     },
 
-    //   // const params = {
-    //   //   windCode: this.maplist.codeNumber,
-    //   //   windTurbineNumberList: this.unitvalue,
-    //   //   mesureNameList: this.monitoringvalue,
-    //   //   startTime: this.$formatDateTWO(this.timevalue[0]),
-    //   //   endTime: this.$formatDateTWO(this.timevalue[1]),
-    //   // };
-    conditions() {
-      const params = {
-        endTime: "2024-07-02 00:00:00",
-        mesureNameList: ["gearbox_input_end_radial_vibration"],
-        startTime: "2024-07-01 00:00:00",
-        windCode: "SKF001",
-        windTurbineNumberList: ["F004"],
-      };
-
-      axios
-        .post("/WZLapi/waveData/getMesureData", params)
-        .then((res) => {
-          this.tableDataList = res.data.datas;
-          console.log(this.tableDataList, "-----------------");
-        })
-        .catch((error) => {
-          console.error("Error:", error);
-          // Handle the error here
-        });
-    },
-
     // 缩小
     lessen(index) {
       if (!this.fourList[index].isMinimized) {
@@ -532,4 +387,13 @@ export default {
   height: 0px; /* Adjust height when minimized */
   overflow: hidden;
 }
-</style>
+
+#main {
+  width: 100%;
+  height: 280px;
+}
+
+// .line-chart {
+//   position: relative;
+// }
+</style>

+ 8 - 0
src/views/laserRangeFinder/components/copyCharts.vue

@@ -0,0 +1,8 @@
+<!--
+ * @Author: your name
+ * @Date: 2024-12-10 11:10:08
+ * @LastEditTime: 2024-12-10 11:10:10
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/laserRangeFinder/components/copyCharts.vue
+-->

+ 38 - 21
src/views/laserRangeFinder/components/descrBox.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2024-12-09 16:24:28
- * @LastEditTime: 2024-12-09 16:35:23
+ * @LastEditTime: 2024-12-10 11:05:40
  * @LastEditors: bogon
  * @Description: In User Settings Edit
  * @FilePath: /performance-test/src/views/laserRangeFinder/components/descrBox.vue
@@ -21,28 +21,28 @@
             <div>叶片1</div>
             <div>角度偏差°</div>
           </template>
-          -0.5
+          0
         </el-descriptions-item>
         <el-descriptions-item label="叶片2">
           <template slot="label">
             <div>叶片2</div>
             <div>角度偏差°</div>
           </template>
-          -0.33
+          0
         </el-descriptions-item>
         <el-descriptions-item label="叶片3">
           <template slot="label">
             <div>叶片3</div>
             <div>角度偏差°</div>
           </template>
-          0.83
+          0
         </el-descriptions-item>
         <el-descriptions-item label="相对">
           <template slot="label">
             <div>相对</div>
             <div>角度偏差°</div>
           </template>
-          1.33
+          0
         </el-descriptions-item>
       </el-descriptions>
       <el-descriptions
@@ -57,28 +57,28 @@
             <div>叶片1</div>
             <div>净空值m</div>
           </template>
-          -0.5
+          0
         </el-descriptions-item>
         <el-descriptions-item label="叶片2">
           <template slot="label">
             <div>叶片2</div>
             <div>净空值m</div>
           </template>
-          -0.33
+          0
         </el-descriptions-item>
         <el-descriptions-item label="叶片3">
           <template slot="label">
             <div>叶片3</div>
             <div>净空值m</div>
           </template>
-          0.83
+          0
         </el-descriptions-item>
         <el-descriptions-item label="平均">
           <template slot="label">
             <div>平均</div>
             <div>净空值m</div>
           </template>
-          1.33
+          0
         </el-descriptions-item>
       </el-descriptions>
       <el-descriptions
@@ -93,28 +93,28 @@
             <div>叶片1</div>
             <div>扭转角°</div>
           </template>
-          -0.5
+          0
         </el-descriptions-item>
         <el-descriptions-item label="叶片2">
           <template slot="label">
             <div>叶片2</div>
             <div>扭转角°</div>
           </template>
-          -0.33
+          0
         </el-descriptions-item>
         <el-descriptions-item label="叶片3">
           <template slot="label">
             <div>叶片3</div>
             <div>扭转角°</div>
           </template>
-          0.83
+          0
         </el-descriptions-item>
         <el-descriptions-item label="平均">
           <template slot="label">
             <div>平均</div>
             <div>扭转角°</div>
           </template>
-          1.33
+          0
         </el-descriptions-item>
       </el-descriptions>
       <el-descriptions
@@ -129,14 +129,14 @@
             <div>塔筒</div>
             <div>晃动幅值mm</div>
           </template>
-          -0.5
+          0
         </el-descriptions-item>
         <el-descriptions-item label="叶片2">
           <template slot="label">
             <div>塔筒</div>
             <div>晃动主频Hz</div>
           </template>
-          0.32
+          0
         </el-descriptions-item>
       </el-descriptions>
     </div>
@@ -149,10 +149,9 @@
       style="width: 100%"
     >
       <el-table-column type="index" label="排序"> </el-table-column>
-      <el-table-column prop="name" label="时间"> </el-table-column>
-
       <el-table-column prop="address" label="场站"> </el-table-column>
       <el-table-column prop="address" label="风机"> </el-table-column>
+      <el-table-column prop="name" label="时间"> </el-table-column>
       <el-table-column prop="address" label="叶片采集频率Hz"> </el-table-column>
       <el-table-column prop="address" label="塔筒采集频率Hz"> </el-table-column>
     </el-table>
@@ -160,13 +159,31 @@
 </template>
 <script>
 export default {
+  props: {},
   data() {
     return {
       currentIndex: 0,
       tableData: [
-        { name: "2024-11-01", address: "Location A" },
-        { name: "2024-11-02", address: "Location B" },
-        { name: "2024-11-03", address: "Location C" },
+        {
+          date: "2016-05-02",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-04",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1517 弄",
+        },
+        {
+          date: "2016-05-01",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1519 弄",
+        },
+        {
+          date: "2016-05-03",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1516 弄",
+        },
       ],
       currentRow: null, // 用于存储当前选中的行
       currentIndex: 0,
@@ -187,7 +204,7 @@ export default {
       this.currentRow = val; // 处理当前选中行
       const index = this.tableData.indexOf(val); // 获取当前选中行的索引
       this.currentIndex = index; // 更新当前索引
-      console.log("currentIndex updated to:", this.currentIndex);
+      this.$emit("handleCurrentChange", val);
     },
   },
 };

+ 241 - 0
src/views/laserRangeFinder/components/initCharts.vue

@@ -0,0 +1,241 @@
+<template>
+  <div class="chartsContent">
+    <el-card shadow="never">
+      <div slot="header" class="clearfix">
+        <h4 style="color: black; font-size: 16px; font-weight: 700">
+          叶片轮廓图
+        </h4>
+        <div style="font-size: 12px; color: #666">
+          测点路径:XX公司\XX电场\XX风机 &nbsp; 采样时间:2024/3/10 12:23:33
+        </div>
+      </div>
+      <div class="line-chart" ref="chart"></div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import * as echarts from "echarts"; // 导入 echarts 库
+import screenfull from "screenfull";
+
+export default {
+  data() {
+    return {
+      currentIndex: 0, // 默认索引
+      tableData: [], // 数据
+      originalChartStyle: {}, // 用于存储原始样式
+    };
+  },
+  mounted() {
+    this.initializeChart();
+    // 监听键盘事件
+    window.addEventListener("keydown", this.handleKeyDown);
+  },
+  destroyed() {
+    // 移除键盘事件监听
+    window.removeEventListener("keydown", this.handleKeyDown);
+  },
+  methods: {
+    // 初始化图表
+    initializeChart() {
+      const chartDom = this.$refs.chart;
+      this.chartInstance = echarts.init(chartDom);
+      const defaultData = [
+        Math.floor(Math.random() * 300),
+        Math.floor(Math.random() * 300),
+        Math.floor(Math.random() * 300),
+      ];
+      const defaultLabels = ["2024/1/1", "2024/1/2", "2024/1/3"];
+      this.updateChart(defaultData, defaultLabels);
+
+      // 保存初始样式
+      this.originalChartStyle = {
+        width: chartDom.style.width,
+        height: chartDom.style.height,
+        backgroundColor: chartDom.style.backgroundColor,
+      };
+    },
+    addExitFullScreenButton() {
+      const toolbox = {
+        feature: {
+          dataZoom: { yAxisIndex: "none" },
+          restore: {},
+          saveAsImage: {},
+        },
+      };
+      // 添加退出全屏按钮
+      toolbox.feature.myCustomTool4 = {
+        show: true,
+        title: "退出全屏",
+        icon: `image://${require("@/assets/analyse/exitFullScreen.png")}`, // 替换为你自己的图标路径
+        onclick: () => this.exitFullScreen(),
+      };
+      // 更新工具栏配置
+      this.chartInstance.setOption({
+        toolbox,
+      });
+    },
+    // 更新图表数据
+    updateChart(data, labels) {
+      const option = {
+        toolbox: {
+          feature: {
+            dataZoom: { yAxisIndex: "none" },
+            restore: {},
+            saveAsImage: {},
+            myCustomTool: {
+              show: true,
+              title: "上一条",
+              icon: `image://${require("@/assets/analyse/08.png")}`,
+              onclick: () => this.previousRow(),
+            },
+            myCustomTool2: {
+              show: true,
+              title: "下一条",
+              icon: `image://${require("@/assets/analyse/09.png")}`,
+              onclick: () => this.nextRow(),
+            },
+            myCustomTool3: {
+              show: true,
+              title: "全屏",
+              icon: `image://${require("@/assets/analyse/fullScreen.png")}`,
+              onclick: () => this.fullScreen(),
+            },
+          },
+        },
+        xAxis: {
+          type: "category",
+          boundaryGap: false,
+          data: labels,
+        },
+        yAxis: {
+          type: "value",
+          boundaryGap: [0, "100%"],
+        },
+        tooltip: {
+          trigger: "axis",
+          position: function (pt) {
+            return [pt[0], "10%"];
+          },
+        },
+        series: [
+          {
+            name: "数据系列",
+            type: "line",
+            symbol: "none",
+            sampling: "lttb",
+            itemStyle: { color: "rgb(255, 70, 131)" },
+            areaStyle: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                { offset: 0, color: "rgb(255, 158, 68)" },
+                { offset: 1, color: "rgb(255, 70, 131)" },
+              ]),
+            },
+            data: data,
+          },
+        ],
+      };
+      this.chartInstance.setOption(option);
+    },
+    previousRow() {
+      let newIndex =
+        this.currentIndex > 0
+          ? this.currentIndex - 1
+          : this.tableData.length - 1;
+      this.$emit("update:currentIndex", newIndex);
+    },
+    nextRow() {
+      let newIndex =
+        this.currentIndex < this.tableData.length - 1
+          ? this.currentIndex + 1
+          : 0;
+      this.$emit("update:currentIndex", newIndex);
+    },
+    toggleFullScreen() {
+      const chartDom = this.$refs.chart;
+      if (screenfull.isEnabled) {
+        screenfull.toggle(chartDom);
+      }
+    },
+    fullScreen() {
+      const chartDom = this.$refs.chart;
+      if (screenfull.isEnabled) {
+        // 设置全屏样式
+        chartDom.style.position = "absolute";
+        chartDom.style.top = 0;
+        chartDom.style.left = 0;
+        chartDom.style.width = "100vw";
+        chartDom.style.height = "100vh";
+        chartDom.style.backgroundColor = "#ffffff";
+        // 在工具栏添加退出全屏按钮
+        this.addExitFullScreenButton();
+        // 进入全屏
+        screenfull.request(chartDom);
+        this.chartInstance.resize();
+
+        // 监听全屏变化
+        screenfull.on("change", this.handleFullScreenChange);
+      }
+    },
+    exitFullScreen() {
+      const chartDom = this.$refs.chart;
+      if (screenfull.isEnabled) {
+        screenfull.exit();
+        // 监听全屏变化
+        screenfull.on("change", this.handleFullScreenChange);
+      }
+    },
+
+    // 处理全屏变化的回调
+    handleFullScreenChange() {
+      const chartDom = this.$refs.chart;
+      if (!screenfull.isFullscreen) {
+        // 退出全屏时恢复样式
+        chartDom.style.position = this.originalChartStyle.position || "";
+        chartDom.style.top = this.originalChartStyle.top || "";
+        chartDom.style.left = this.originalChartStyle.left || "";
+        chartDom.style.width = this.originalChartStyle.width || "100%";
+        chartDom.style.height = this.originalChartStyle.height || "250px";
+        chartDom.style.backgroundColor =
+          this.originalChartStyle.backgroundColor || "#fff";
+
+        // 调整图表尺寸
+        this.chartInstance.resize();
+
+        // 可选:移除事件监听(如果不再需要)
+        screenfull.off("change", this.handleFullScreenChange);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-card__body {
+  width: 100%;
+  height: 250px;
+  position: relative;
+}
+.line-chart {
+  width: 100%;
+  height: 250px;
+  background-color: #fff;
+  position: relative;
+}
+
+.eigenvalue {
+  position: absolute;
+  top: 0;
+  right: 0;
+  font-size: 10px;
+  width: 100px;
+  border: 1px solid black;
+  padding: 5px;
+  background: #fff;
+  z-index: 99;
+  h5 {
+    line-height: 16px;
+    height: 16px;
+  }
+}
+</style>

+ 132 - 38
src/views/laserRangeFinder/index.vue

@@ -16,47 +16,47 @@
           </template>
           <el-form :inline="true" :model="formInline" class="demo-form-inline">
             <el-row :gutter="10">
-              <el-col :xs="16" :sm="8" :md="7" :lg="5" :xl="4">
+              <el-col :xs="16" :sm="8" :md="7" :lg="6" :xl="4">
                 <el-form-item label="单位">
-                  <el-select
-                    size="small"
-                    v-model="formInline.region"
-                    placeholder="请选择区域"
-                  >
-                    <el-option label="区域一" value="shanghai"></el-option>
-                    <el-option label="区域二" value="beijing"></el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="16" :sm="8" :md="7" :lg="5" :xl="4">
-                <el-form-item label="场站">
-                  <el-select
-                    size="small"
-                    v-model="formInline.region"
-                    placeholder="请选择场站"
+                  <selecttree
+                    style="width: 220px"
+                    placeholder="请选择上级单位"
+                    :list="parentOpt"
+                    type="1"
+                    v-model="formInline.companyCode"
+                    @change="parentChange"
+                    :defaultParentProps="{
+                      children: 'children',
+                      label: 'companyName',
+                      value: 'codeNumber',
+                    }"
                   >
-                    <el-option label="区域一" value="shanghai"></el-option>
-                    <el-option label="区域二" value="beijing"></el-option>
-                  </el-select>
+                  </selecttree>
                 </el-form-item>
               </el-col>
-              <el-col :xs="16" :sm="8" :md="7" :lg="5" :xl="4">
+              <el-col :xs="16" :sm="8" :md="7" :lg="6" :xl="4">
                 <el-form-item label="风机">
                   <el-select
+                    v-model="formInline.unitvalue"
+                    @change="getchedian"
                     size="small"
-                    v-model="formInline.region"
-                    placeholder="请选择风机"
+                    placeholder="请选择"
                   >
-                    <el-option label="区域一" value="shanghai"></el-option>
-                    <el-option label="区域二" value="beijing"></el-option>
+                    <el-option
+                      v-for="item in unitoptions"
+                      :key="item.engineCode"
+                      :label="item.engineName"
+                      :value="item.engineCode"
+                    >
+                    </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :xs="24" :sm="14" :md="12" :lg="8" :xl="6">
+              <el-col :xs="24" :sm="14" :md="12" :lg="10" :xl="6">
                 <el-form-item label="时间">
                   <el-date-picker
                     size="small"
-                    v-model="timevalue"
+                    v-model="formInline.timevalue"
                     type="daterange"
                     range-separator="至"
                     start-placeholder="开始日期"
@@ -88,10 +88,15 @@
                   :image-size="200"
                   v-if="currentRow === null"
                 ></el-empty>
-                <div v-else>原始图</div>
+                <div v-else>
+                  <InitCharts></InitCharts>
+                </div>
               </div>
               <div class="right">
-                <DescrBox></DescrBox>
+                <DescrBox
+                  ref="initTable"
+                  @handleCurrentChange="handleCurrentChange"
+                ></DescrBox>
               </div>
             </div>
           </el-tab-pane>
@@ -113,7 +118,10 @@
                 <div v-else>拟合图</div>
               </div>
               <div class="right">
-                <DescrBox></DescrBox>
+                <DescrBox
+                  ref="copyTable"
+                  @handleCurrentChange="handleCurrentChange"
+                ></DescrBox>
               </div>
             </div>
           </el-tab-pane>
@@ -138,13 +146,26 @@
 
 <script>
 import * as echarts from "echarts";
+import {
+  getSysOrganizationAuthTreeByRoleId,
+  windEngineGrouPage,
+  queryDetectionDic,
+} from "@/api/ledger.js";
 import DescrBox from "./components/descrBox.vue";
+import selecttree from "../../components/selecttree.vue";
 import MultilevelTable from "./components/MultilevelTable.vue";
+import InitCharts from "./components/initCharts.vue";
 export default {
   data() {
     return {
       activeNames: ["1"],
-      formInline: {},
+      formInline: {
+        companyCode: "", //单位
+        unitvalue: "", //风机
+        timevalue: "", //时间
+      },
+      companyCode: "", //单位表格中展示
+      parentOpt: [],
       chartData: [],
       chartLabels: [],
       tableData: [],
@@ -160,12 +181,7 @@ export default {
       monitoringvalue: "",
       monitoringoptions: [],
       timevalue: "",
-      tableData: [
-        { name: "2024-11-01", address: "Location A" },
-        { name: "2024-11-02", address: "Location B" },
-        { name: "2024-11-03", address: "Location C" },
-      ],
-
+      tableData: [],
       fourList: [],
       currentRow: null, // 用于存储当前选中的行
       currentIndex: 0,
@@ -175,8 +191,87 @@ export default {
   components: {
     DescrBox,
     MultilevelTable,
+    selecttree,
+    InitCharts,
+  },
+  created() {
+    this.GETtree();
   },
   methods: {
+    // 获取风场
+    async GETtree() {
+      try {
+        const res = await getSysOrganizationAuthTreeByRoleId();
+        const treedata = res.data;
+        const processedData = this.processTreeData(treedata);
+        this.parentOpt = processedData;
+        this.defaultdata = res.data[0];
+      } catch (err) {
+        this.$message.error(err);
+      }
+    },
+    processTreeData(treeData) {
+      const processedData = [];
+      function processNode(node) {
+        if (node.codeType === "field") {
+          node.companyName = node.fieldName;
+        }
+        if (node.children && node.children.length > 0) {
+          node.children.forEach((child) => {
+            processNode(child);
+          });
+        }
+      }
+      treeData.forEach((root) => {
+        processNode(root);
+        processedData.push(root);
+      });
+      return processedData;
+    },
+    parentChange(data) {
+      this.maplist = data;
+      this.maplistArr = data;
+      let paramsData = {
+        fieldCode: this.maplist.codeNumber,
+        pageNum: 1,
+        pageSize: 99,
+      };
+      this.unitvalue = "";
+      // 获取风机
+      windEngineGrouPage(paramsData).then((res) => {
+        this.unitoptions = res.data.list;
+      });
+      if (data.codeType === "field") {
+        if (this.parseCoordinates(data.longitudeAndLatitudeString).length > 0) {
+          return;
+        }
+      } else {
+        const dataMapList = data.children;
+        dataMapList.forEach((element) => {
+          console.log(element);
+          if (
+            this.parseCoordinates(element.longitudeAndLatitudeString).length >
+              0 &&
+            element.codeType === "field"
+          ) {
+            return;
+          }
+        });
+      }
+    },
+    parseCoordinates(input) {
+      if (input && typeof input === "string") {
+        return input.split(",").map(Number);
+      }
+      // debugger;
+      return [];
+    },
+    // 获取测点
+    getchedian(value) {
+      queryDetectionDic({ engineCodes: value }).then((res) => {
+        this.monitoringoptions = res.data;
+      });
+    },
     handleCurrentIndexUpdate(newIndex) {
       this.currentIndex = newIndex;
     },
@@ -193,7 +288,6 @@ export default {
       this.currentRow = val; // 处理当前选中行
       const index = this.tableData.indexOf(val); // 获取当前选中行的索引
       this.currentIndex = index; // 更新当前索引
-      console.log("currentIndex updated to:", this.currentIndex);
     },
 
     generate(type) {

+ 0 - 5
src/views/ledger/modules.vue

@@ -2,7 +2,6 @@
   <div class="global-variable">
     <h2 class="TitleH2">主轴</h2>
     <zhuzhou
-      v-if="bearingBrandOptions.length > 0 && lubricantBrandOptions.length > 0"
       :rhyPP="lubricantBrandOptions"
       :rhyZC="bearingBrandOptions"
       :unitBearingsVo="unitBearingsVo"
@@ -11,9 +10,6 @@
     <div v-if="clxShow">
       <h2 class="TitleH2">齿轮箱</h2>
       <Chilunxiang
-        v-if="
-          bearingBrandOptions.length > 0 && lubricantBrandOptions.length > 0
-        "
         :clxPP="lubricantBrandOptions"
         :clxZC="bearingBrandOptions"
         :unitGearDto="unitGearDto"
@@ -23,7 +19,6 @@
 
     <h2 class="TitleH2">发电机</h2>
     <Fadianji
-      v-if="bearingBrandOptions.length > 0 && lubricantBrandOptions.length > 0"
       :fdjPP="lubricantBrandOptions"
       :fdjZC="bearingBrandOptions"
       :unitDynamoDto="unitDynamoDto"

Some files were not shown because too many files changed in this diff