From da67648220f86993fac22b8199165995df3d8563 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 21 三月 2025 17:35:51 +0800
Subject: [PATCH] 走航融合(待完成)

---
 src/views/underwaymix/UnderwayMixMode.vue |  108 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 102 insertions(+), 6 deletions(-)

diff --git a/src/views/underwaymix/UnderwayMixMode.vue b/src/views/underwaymix/UnderwayMixMode.vue
index 38a403a..c0dbe9b 100644
--- a/src/views/underwaymix/UnderwayMixMode.vue
+++ b/src/views/underwaymix/UnderwayMixMode.vue
@@ -59,6 +59,13 @@
                   @change="handleHeatMapClick"
                 >
                 </CheckButton>
+                <!-- <CheckButton
+                  active-text="鎼滅储缃戞牸"
+                  inactive-text="鎼滅储缃戞牸"
+                  :default-value="false"
+                  @change="handleHeatMapSearchClick"
+                >
+                </CheckButton> -->
               </el-row>
               <!-- <div class="m-t-8">缃戞牸瑕佺礌</div>
               <el-row class="m-t-8">
@@ -147,9 +154,11 @@
 import gridApi from '@/api/gridApi';
 import { SatelliteGrid } from '@/model/SatelliteGrid';
 import GridStyleTool from './component/GridStyleTool.vue';
+import { useGridStore } from '@/stores/grid-info';
+
+const gridStore = useGridStore();
 
 const satelliteGrid = new SatelliteGrid('璧拌埅铻嶅悎');
-
 const gridCtrls = ref([satelliteGrid]);
 
 // 鍊熺敤鍗槦閬ユ祴妯″潡涓殑100绫崇綉鏍�
@@ -173,6 +182,7 @@
 const gridDataDetailMap = new Map();
 
 const mixActive = ref(false);
+const heatActive = ref(false);
 const gridVisible = ref(true);
 const underwayVisible = ref(false);
 const rankVisible = ref(false);
@@ -216,7 +226,32 @@
 }
 
 function prepareGrid(gridInfo) {
-  satelliteGrid.gridPrepare(gridInfo);
+  satelliteGrid.gridPrepare(gridInfo, (polygon) => {
+    //榧犳爣绉诲叆浜嬩欢
+    polygon.on('mouseover', () => {
+      polygon.setOptions({
+        //淇敼澶氳竟褰㈠睘鎬х殑鏂规硶
+        strokeWeight: 2,
+        strokeColor: 'red'
+      });
+    });
+    //榧犳爣绉诲嚭浜嬩欢
+    polygon.on('mouseout', () => {
+      polygon.setOptions({
+        strokeWeight: 1,
+        strokeColor: 'white'
+      });
+    });
+  });
+  // satelliteGrid.setGridEvent('click', (gridCell, gridDataDetail) => {
+  //   // const polygon = e.target
+  //   // const { gridCell } = polygon.getExtData();
+  //   // const cellIndex = gridCell.cellIndex;
+  //   gridStore.selectedGridCellAndDataDetail = {
+  //     gridCell,
+  //     gridDataDetail
+  //   };
+  // });
 }
 
 // watch(mission, (nV, oV) => {
@@ -263,6 +298,16 @@
             type: 0
           }
         });
+        satelliteGrid.setGridEvent(
+          [d.id],
+          'click',
+          (gridCell, gridDataDetail) => {
+            gridStore.selectedGridCellAndDataDetail = {
+              gridCell,
+              gridDataDetail
+            };
+          }
+        );
         gridCtrls.value = [satelliteGrid];
         // gridCtrls.value = Array.from(satelliteGrid.mapViewsMap);
         // console.log(gridCtrls.value);
@@ -271,6 +316,7 @@
   });
 }
 
+let mixTag;
 function handleMixClick() {
   mixActive.value = !mixActive.value;
   const tags = fusionDataList.value
@@ -282,7 +328,17 @@
     showRankTxt: false
   });
   if (mixActive.value) {
-    satelliteGrid.mixGrid(tags);
+    mixTag = satelliteGrid.mixGrid(tags);
+    satelliteGrid.setGridEvent(
+      [mixTag],
+      'click',
+      (gridCell, gridDataDetail) => {
+        gridStore.selectedGridCellAndDataDetail = {
+          gridCell,
+          gridDataDetail
+        };
+      }
+    );
     gridCtrls.value = [satelliteGrid];
   } else {
     satelliteGrid.changeVisibility({
@@ -292,10 +348,50 @@
   }
 }
 
+let heatTag;
 function handleHeatMapClick() {
-  const tags = fusionDataList.value
-    .filter((v, i) => selectedfusionData.value.indexOf(i) != -1)
-    .map((v) => v.id);
+  heatActive.value = !heatActive.value;
+  satelliteGrid.changeVisibility({
+    showGridViews: false,
+    showDataTxt: false,
+    showRankTxt: false
+  });
+  if (heatActive.value) {
+    heatTag = satelliteGrid.drawHeatGrid(mixTag);
+    satelliteGrid.setGridEvent(
+      [heatTag],
+      'click',
+      (gridCell, gridDataDetail) => {
+        gridStore.selectedGridCellAndDataDetail = {
+          gridCell,
+          gridDataDetail
+        };
+      }
+    );
+    gridCtrls.value = [satelliteGrid];
+  } else {
+    satelliteGrid.changeVisibility({
+      tags: [mixTag],
+      showGridViews: true
+    });
+  }
+}
+
+function handleHeatMapSearchClick() {
+  const res = satelliteGrid.search(
+    {
+      groupId: 1,
+      cellId: 2893,
+      pm25: 50
+    },
+    120,
+    90,
+    10,
+    10,
+    3
+  );
+
+  console.log(res);
 }
 
 function handleGridClick() {

--
Gitblit v1.9.3