rui.jiang 3 місяців тому
батько
коміт
9500a4d7bc

BIN
src/assets/analyse/12.png


BIN
src/assets/analyse/13.png


+ 40 - 42
src/components/map/index.vue

@@ -237,50 +237,48 @@ export default {
       controls: defaultControls().extend([new ZoomSlider()]),
     });
 
-    // -------------【添加山西省真实边界线】-------------
-    if (this.$route.path === "/home/cockpitManage") {
-      // 通过导入的 JSON 文件加载边界数据(GeoJSON 格式),并解析成矢量要素
-      const shanxiSource = new Vector({
-        features: new GeoJSON().readFeatures(shanxiBoundary, {
-          featureProjection: "EPSG:4326",
-        }),
-      });
-      // 创建矢量图层,仅显示边界线(填充颜色设为透明)
-      const shanxiLayer = new VectorLayer({
-        source: shanxiSource,
-        style: new Style({
-          stroke: new Stroke({
-            color: "rgba(59, 130, 246, 0.5)",
-            width: 3,
-          }),
-          fill: new Fill({
-            color: "rgba(59, 130, 246, 0.05)", // 透明填充
-          }),
-        }),
-      });
-      this.map.addLayer(shanxiLayer);
+    // -------------【添加山西省真实边界线】------------- 定位全国的时候注释这个代码
+    // if (this.$route.path === "/home/cockpitManage") {
+    //   // 通过导入的 JSON 文件加载边界数据(GeoJSON 格式),并解析成矢量要素
+    //   const shanxiSource = new Vector({
+    //     features: new GeoJSON().readFeatures(shanxiBoundary, {
+    //       featureProjection: "EPSG:4326",
+    //     }),
+    //   });
+    //   // 创建矢量图层,仅显示边界线(填充颜色设为透明)
+    //   const shanxiLayer = new VectorLayer({
+    //     source: shanxiSource,
+    //     style: new Style({
+    //       stroke: new Stroke({
+    //         color: "rgba(59, 130, 246, 0.5)",
+    //         width: 3,
+    //       }),
+    //       fill: new Fill({
+    //         color: "rgba(59, 130, 246, 0.05)", // 透明填充
+    //       }),
+    //     }),
+    //   });
+    //   this.map.addLayer(shanxiLayer);
 
-      const markerLayer = this.map
-        .getLayers()
-        .getArray()
-        .find((layer) => {
-          return layer.get("id") === "marker";
-        });
-      if (markerLayer) {
-        markerLayer.setZIndex(10);
-      }
+    //   const markerLayer = this.map
+    //     .getLayers()
+    //     .getArray()
+    //     .find((layer) => {
+    //       return layer.get("id") === "marker";
+    //     });
+    //   if (markerLayer) {
+    //     markerLayer.setZIndex(10);
+    //   }
 
-      // 同时设置高亮图层 zIndex 较低
-      shanxiLayer.setZIndex(1);
-      // -------------【结束】-------------
-
-      // if (this.$route.path === "/home/cockpitManage") {
-        const targetExtent = [106.8, 34.3, 118.6, 41.2];
-        this.map.getView().fit(targetExtent, { duration: 2000 });
-      // }
-
-      this.initEvent();
-    }
+    //   // 同时设置高亮图层 zIndex 较低
+    //   shanxiLayer.setZIndex(1);
+    //   // -------------【结束】-------------
+    //     const targetExtent = [106.8, 34.3, 118.6, 41.2];
+    //     this.map.getView().fit(targetExtent, { duration: 2000 });
+    
+    // }
+// 这个放在外面
+    this.initEvent();
   },
   methods: {
     addMarker(data = { point: [120.2, 30.35], val: "1" }) {

+ 69 - 7
src/views/health/components/spectrogramcharts.vue

@@ -5,7 +5,7 @@
         <el-checkbox
           v-for="(item, index) in checkList"
           :key="index"
-  v-model="checked[index]"
+          v-model="checked[index]"
           >{{ item.val }}</el-checkbox
         >
         <!-- <h5>特征值</h5>
@@ -21,6 +21,23 @@
         <p>偏度指标:{{ this.spectrumList.Cw }}</p>
         <p>峭度指标:{{ this.spectrumList.Cq }}</p> -->
       </div>
+
+      <div v-if="BGshow" class="eigenvalue">
+        <el-checkbox
+          v-for="(item, index) in GBcheckList"
+          :key="index"
+          v-model="checked[index]"
+          >{{ item.val }}</el-checkbox
+        >
+      </div>
+      <div v-if="PXshow" class="eigenvalue">
+        <el-checkbox
+          v-for="(item, index) in PXcheckList"
+          :key="index"
+          v-model="checked[index]"
+          >{{ item.val }}</el-checkbox
+        >
+      </div>
     </div>
     <!-- ECharts 图表容器 -->
 
@@ -31,6 +48,7 @@
 <script>
 import axios from "axios";
 import * as echarts from "echarts"; // 导入 echarts 库
+import { e } from "plotly.js-dist";
 
 export default {
   name: "TimedomainCharts", // 组件名称
@@ -65,9 +83,30 @@ export default {
       chartInstance: null,
       option: null,
       TZshow: false,
+      BGshow: false,
+      PXshow: false,
       spectrumList: {},
-      checkList: [{ val: "BPFI" }, { val: "BPFO" }, { val: "BPO" }, { val: "FT" }],
-      checked:""
+      checkList: [
+        { val: "BPFI" },
+        { val: "BPFO" },
+        { val: "BPO" },
+        { val: "FT" },
+      ],
+      GBcheckList: [
+        { val: "添加光标" },
+        { val: "谐波光标" },
+        { val: "边带光标" },
+        { val: "移动峰值" },
+      ],
+      PXcheckList: [
+        { val: "Fr" },
+        { val: "BPFI" },
+        { val: "BPFO" },
+        { val: "FT" },
+        { val: "GMF" },
+        { val: "±5Fr" },
+      ],
+      checked: "",
     };
   },
   watch: {
@@ -157,9 +196,21 @@ export default {
             },
             myCustomTool3: {
               show: true,
-              title: "特征值",
+              title: "齿轮特征值",
               icon: `image://${require("@/assets/analyse/11.png")}`,
-              onclick: () => this.Show(),
+              onclick: () => this.Show("1"),
+            },
+            myCustomTool4: {
+              show: true,
+              title: "光标",
+              icon: `image://${require("@/assets/analyse/12.png")}`,
+              onclick: () => this.Show("2"),
+            },
+            myCustomTool5: {
+              show: true,
+              title: "特征频率",
+              icon: `image://${require("@/assets/analyse/13.png")}`,
+              onclick: () => this.Show("3"),
             },
           },
         },
@@ -278,8 +329,19 @@ export default {
       this.$emit("update-next-row", 2, this.activeIndex);
     },
 
-    Show() {
-      this.TZshow = !this.TZshow;
+    Show(value) {
+      const stateMap = {
+        1: { TZshow: true, BGshow: false, PXshow: false },
+        2: { TZshow: false, BGshow: true, PXshow: false },
+        3: { TZshow: false, BGshow: false, PXshow: true },
+      };
+
+      if (stateMap[value]) {
+        // Toggle the state for the given value
+        this.TZshow = value === "1" ? !this.TZshow : false;
+        this.BGshow = value === "2" ? !this.BGshow : false;
+        this.PXshow = value === "3" ? !this.PXshow : false;
+      }
     },
   },
 };