Explorar el Código

激光测距仪页面开发

liujiejie hace 6 meses
padre
commit
015b458322

BIN
src/assets/analyse/dataList.png


BIN
src/assets/analyse/dataList1.png


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
src/icons/svg/dataList.svg


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
src/icons/svg/dataList1.svg


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
src/icons/svg/laserRangeFinder.svg


+ 1 - 1
src/utils/vuexIndexedDBPlugin.js

@@ -1,5 +1,5 @@
 import { saveData, getData, openDB } from "@/utils/indexedDb";
-import { stringify, parse } from "flatted"; // 用于处理循环引用
+import { stringify, parse } from "flatted"; // 用于处理循环引用 压缩数据处理
 import pako from "pako";
 import { Message } from "element-ui";
 // 通用分片函数

+ 7 - 1
src/views/home/components/Menu.vue

@@ -80,9 +80,15 @@
           @click="handleChangeMenuUrl(item, `${item.path}?id=${item.id}`)"
         >
           <i v-if="isElPrefix(item.iconName)" class="el-icon-menu"></i>
-          <i v-else class="svnIcon">
+          <i v-else-if="item.iconName" class="svnIcon">
             <svg-icon :icon-class="item.iconName" />
           </i>
+          <i class="svnIcon" v-else-if="item.path === '/home/laserRangeFinder'">
+            <svg-icon
+              style="width: 22px; height: 22px"
+              icon-class="laserRangeFinder"
+            />
+          </i>
           <span>{{ item.name }}</span>
         </el-menu-item>
       </template>

+ 108 - 0
src/views/laserRangeFinder/components/MultilevelTable.vue

@@ -0,0 +1,108 @@
+<!--
+ * @Author: your name
+ * @Date: 2024-12-09 16:41:31
+ * @LastEditTime: 2024-12-09 16:51:10
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/laserRangeFinder/components/MultilevelTable.vue
+-->
+<template>
+  <el-table :data="tableData">
+    <el-table-column prop="date" label="序号"> </el-table-column>
+    <el-table-column prop="date" label="时间" min-width="120">
+    </el-table-column>
+    <el-table-column prop="date" label="场站"> </el-table-column>
+    <el-table-column prop="date" label="风机"> </el-table-column>
+    <el-table-column label="叶片角度偏差(°)">
+      <el-table-column prop="name" label="叶片1"> </el-table-column>
+      <el-table-column label="叶片2"> </el-table-column>
+      <el-table-column prop="zip" label="叶片3"> </el-table-column>
+      <el-table-column prop="zip" label="相对偏差"> </el-table-column>
+    </el-table-column>
+    <el-table-column label="叶片净空值(m)">
+      <el-table-column prop="name" label="叶片1"> </el-table-column>
+      <el-table-column label="叶片2"> </el-table-column>
+      <el-table-column prop="zip" label="叶片3"> </el-table-column>
+      <el-table-column prop="zip" label="平均"> </el-table-column>
+    </el-table-column>
+    <el-table-column label="叶片扭转变形(°)">
+      <el-table-column prop="name" label="叶片1"> </el-table-column>
+      <el-table-column label="叶片2"> </el-table-column>
+      <el-table-column prop="zip" label="叶片3"> </el-table-column>
+      <el-table-column prop="zip" label="平均"> </el-table-column>
+    </el-table-column>
+    <el-table-column label="塔筒晃动">
+      <el-table-column prop="name" label="晃动幅值(mm)"> </el-table-column>
+      <el-table-column label="晃动主频(Hz)"> </el-table-column>
+    </el-table-column>
+    <el-table-column prop="date" label="叶片采集频率(Hz)"> </el-table-column>
+    <el-table-column prop="date" label="塔筒采集频率(Hz)"> </el-table-column>
+  </el-table>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      tableData: [
+        {
+          date: "2016-05-03",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-02",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-04",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-01",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-08",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-06",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          date: "2016-05-07",
+          name: "王小虎",
+          province: "上海",
+          city: "普陀区",
+          address: "上海市普陀区金沙江路 1518 弄",
+          zip: 200333,
+        },
+      ],
+    };
+  },
+};
+</script>

+ 210 - 0
src/views/laserRangeFinder/components/descrBox.vue

@@ -0,0 +1,210 @@
+<!--
+ * @Author: your name
+ * @Date: 2024-12-09 16:24:28
+ * @LastEditTime: 2024-12-09 16:35:23
+ * @LastEditors: bogon
+ * @Description: In User Settings Edit
+ * @FilePath: /performance-test/src/views/laserRangeFinder/components/descrBox.vue
+-->
+<template>
+  <div class="data-origin">
+    <div class="descrBox">
+      <el-descriptions
+        class="margin-top"
+        title="叶片角度偏差"
+        :column="4"
+        size="small"
+        border
+      >
+        <el-descriptions-item label="叶片1">
+          <template slot="label">
+            <div>叶片1</div>
+            <div>角度偏差°</div>
+          </template>
+          -0.5
+        </el-descriptions-item>
+        <el-descriptions-item label="叶片2">
+          <template slot="label">
+            <div>叶片2</div>
+            <div>角度偏差°</div>
+          </template>
+          -0.33
+        </el-descriptions-item>
+        <el-descriptions-item label="叶片3">
+          <template slot="label">
+            <div>叶片3</div>
+            <div>角度偏差°</div>
+          </template>
+          0.83
+        </el-descriptions-item>
+        <el-descriptions-item label="相对">
+          <template slot="label">
+            <div>相对</div>
+            <div>角度偏差°</div>
+          </template>
+          1.33
+        </el-descriptions-item>
+      </el-descriptions>
+      <el-descriptions
+        class="margin-top"
+        title="叶片净空值"
+        :column="4"
+        size="small"
+        border
+      >
+        <el-descriptions-item label="叶片1">
+          <template slot="label">
+            <div>叶片1</div>
+            <div>净空值m</div>
+          </template>
+          -0.5
+        </el-descriptions-item>
+        <el-descriptions-item label="叶片2">
+          <template slot="label">
+            <div>叶片2</div>
+            <div>净空值m</div>
+          </template>
+          -0.33
+        </el-descriptions-item>
+        <el-descriptions-item label="叶片3">
+          <template slot="label">
+            <div>叶片3</div>
+            <div>净空值m</div>
+          </template>
+          0.83
+        </el-descriptions-item>
+        <el-descriptions-item label="平均">
+          <template slot="label">
+            <div>平均</div>
+            <div>净空值m</div>
+          </template>
+          1.33
+        </el-descriptions-item>
+      </el-descriptions>
+      <el-descriptions
+        class="margin-top"
+        title="叶片扭转变形"
+        :column="4"
+        size="small"
+        border
+      >
+        <el-descriptions-item label="叶片1">
+          <template slot="label">
+            <div>叶片1</div>
+            <div>扭转角°</div>
+          </template>
+          -0.5
+        </el-descriptions-item>
+        <el-descriptions-item label="叶片2">
+          <template slot="label">
+            <div>叶片2</div>
+            <div>扭转角°</div>
+          </template>
+          -0.33
+        </el-descriptions-item>
+        <el-descriptions-item label="叶片3">
+          <template slot="label">
+            <div>叶片3</div>
+            <div>扭转角°</div>
+          </template>
+          0.83
+        </el-descriptions-item>
+        <el-descriptions-item label="平均">
+          <template slot="label">
+            <div>平均</div>
+            <div>扭转角°</div>
+          </template>
+          1.33
+        </el-descriptions-item>
+      </el-descriptions>
+      <el-descriptions
+        class="margin-top"
+        title="塔筒晃动"
+        :column="3"
+        size="small"
+        border
+      >
+        <el-descriptions-item label="塔筒">
+          <template slot="label">
+            <div>塔筒</div>
+            <div>晃动幅值mm</div>
+          </template>
+          -0.5
+        </el-descriptions-item>
+        <el-descriptions-item label="叶片2">
+          <template slot="label">
+            <div>塔筒</div>
+            <div>晃动主频Hz</div>
+          </template>
+          0.32
+        </el-descriptions-item>
+      </el-descriptions>
+    </div>
+    <el-table
+      ref="singleTable"
+      :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="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="叶片采集频率Hz"> </el-table-column>
+      <el-table-column prop="address" label="塔筒采集频率Hz"> </el-table-column>
+    </el-table>
+  </div>
+</template>
+<script>
+export default {
+  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" },
+      ],
+      currentRow: null, // 用于存储当前选中的行
+      currentIndex: 0,
+    };
+  },
+
+  methods: {
+    setCurrent(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.currentIndex = index; // 更新当前索引
+      console.log("currentIndex updated to:", this.currentIndex);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.data-origin {
+  width: 100%;
+  //   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
+  .descrBox {
+    margin: 20px;
+    ::v-deep .el-descriptions__header {
+      margin: 10px !important;
+    }
+    ::v-deep .el-descriptions-item__cell {
+      color: #666 !important;
+    }
+  }
+}
+</style>

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

@@ -0,0 +1,344 @@
+<template>
+  <div class="global-variable">
+    <div class="searchbox">
+      <el-collapse v-model="activeNames">
+        <el-collapse-item title="数据筛选" name="1">
+          <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-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="请选择场站"
+                  >
+                    <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="请选择风机"
+                  >
+                    <el-option label="区域一" value="shanghai"></el-option>
+                    <el-option label="区域二" value="beijing"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :sm="14" :md="12" :lg="8" :xl="6">
+                <el-form-item label="时间">
+                  <el-date-picker
+                    size="small"
+                    v-model="timevalue"
+                    type="daterange"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="8" :sm="2" :md="4" :lg="1" :xl="2">
+                <el-form-item>
+                  <el-button type="primary" @click="onSubmit" size="small"
+                    >查询</el-button
+                  >
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-collapse-item>
+      </el-collapse>
+    </div>
+    <div class="main-body">
+      <div class="data-map">
+        <el-tabs type="border-card">
+          <el-tab-pane>
+            <span slot="label">
+              <img
+                style="width: 30px; height: 20px; display: inline-block"
+                src="@/assets/analyse/04.png"
+                alt=""
+              />
+              原始图
+            </span>
+            <div class="boxContent">
+              <div class="left">
+                <el-empty
+                  :image-size="200"
+                  v-if="currentRow === null"
+                ></el-empty>
+                <div v-else>原始图</div>
+              </div>
+              <div class="right">
+                <DescrBox></DescrBox>
+              </div>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="拟合图" class="picture">
+            <span slot="label">
+              <img
+                style="width: 25px; height: 20px; display: inline-block"
+                src="@/assets/analyse/01.png"
+                alt=""
+              />
+              拟合图
+            </span>
+            <div class="boxContent">
+              <div class="left">
+                <el-empty
+                  :image-size="200"
+                  v-if="currentRow === null"
+                ></el-empty>
+                <div v-else>拟合图</div>
+              </div>
+              <div class="right">
+                <DescrBox></DescrBox>
+              </div>
+            </div>
+          </el-tab-pane>
+          <el-tab-pane label="数据列表" class="picture">
+            <span slot="label">
+              <img
+                style="width: 20px; height: 20px; display: inline-block"
+                src="@/assets/analyse/dataList1.png"
+                alt=""
+              />
+              数据列表
+            </span>
+            <div>
+              <MultilevelTable></MultilevelTable>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import * as echarts from "echarts";
+import DescrBox from "./components/descrBox.vue";
+import MultilevelTable from "./components/MultilevelTable.vue";
+export default {
+  data() {
+    return {
+      activeNames: ["1"],
+      formInline: {},
+      chartData: [],
+      chartLabels: [],
+      tableData: [],
+      data: [10, 20, 30, 40], // 假设是图表的数据
+      labels: ["2024/1/1", "2024/1/2", "2024/1/3", "2024/1/4"], // 假设是时间轴数据
+      currentIndex: 0,
+      tableData: [], // 假设是来自父组件的数据
+
+      company: "",
+      companyoptions: [],
+      unitvalue: "",
+      unitoptions: [],
+      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" },
+      ],
+
+      fourList: [],
+      currentRow: null, // 用于存储当前选中的行
+      currentIndex: 0,
+      isChartVisible: false,
+    };
+  },
+  components: {
+    DescrBox,
+    MultilevelTable,
+  },
+  methods: {
+    handleCurrentIndexUpdate(newIndex) {
+      this.currentIndex = newIndex;
+    },
+    setCurrent(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.currentIndex = index; // 更新当前索引
+      console.log("currentIndex updated to:", this.currentIndex);
+    },
+
+    generate(type) {
+      if (!this.currentRow) {
+        this.$message.warning("请先选择数据");
+        return;
+      }
+    },
+
+    // 缩小
+    lessen(index) {
+      if (!this.fourList[index].isMinimized) {
+        this.fourList[index].isMinimized = true;
+      }
+      console.log("1");
+    },
+    // 放大
+    amplifier(index) {
+      const item = this.fourList[index];
+      if (item.isMinimized) {
+        item.isMinimized = false;
+      }
+      console.log("2");
+    },
+    // 关闭
+    close(index) {
+      this.fourList.splice(index, 1);
+      console.log("3");
+    },
+    zhankai() {
+      this.fourList.forEach((item) => {
+        item.isMinimized = false;
+      });
+    },
+    suoxiao() {
+      this.fourList.forEach((item) => {
+        item.isMinimized = true;
+      });
+    },
+    guanbi() {
+      this.fourList = [];
+    },
+    onSubmit() {},
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.head {
+  // border-top: 5px solid #088080;
+  // border-bottom: 5px solid #088080;
+  padding: 5px 0;
+  display: flex;
+  justify-content: space-between;
+  .headleft {
+    display: flex;
+    .picture {
+      cursor: pointer;
+      display: inline-block;
+      text-align: center;
+      margin: 0 20px;
+      font-size: 12px;
+      img {
+        width: 50px;
+        height: 20px;
+      }
+    }
+  }
+  .headright {
+    img {
+      width: 20px;
+      height: 20px;
+      margin: 0 10px;
+      cursor: pointer;
+    }
+  }
+}
+.searchbox {
+  // display: flex;
+  margin: 20px 0 0 0;
+  p {
+    margin-right: 20px;
+  }
+  .el-select {
+    width: 180px;
+  }
+}
+.dialog-actions {
+  text-align: right;
+  padding: 0 10px;
+  display: flex;
+  justify-content: space-between;
+  position: relative;
+}
+
+.subject {
+  height: 280px;
+  transition: all 0.3s ease;
+  padding: 0 10px;
+  p {
+    font-size: 10px;
+  }
+}
+
+.main-body {
+  display: flex;
+  justify-content: space-between;
+  .data-map {
+    width: 100%;
+    // height: 620px;
+    overflow-y: auto;
+    .chart-area {
+      margin-bottom: 10px;
+      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
+    }
+    .boxContent {
+      display: flex;
+      justify-content: space-between;
+      .left {
+        width: 60%;
+      }
+      .right {
+        width: 39%;
+        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
+      }
+    }
+    .el-tabs--border-card {
+      height: 100%;
+    }
+    ::v-deep .el-tabs--border-card > .el-tabs__content {
+      padding: 0 !important;
+    }
+  }
+  .data-map::-webkit-scrollbar {
+    display: none; /* 隐藏滚动条 */
+  }
+}
+
+.subject.minimized {
+  height: 0px; /* Adjust height when minimized */
+  overflow: hidden;
+}
+
+#main {
+  width: 100%;
+  height: 280px;
+}
+
+// .line-chart {
+//   position: relative;
+// }
+</style>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio