feiyu02
2025-03-21 da67648220f86993fac22b8199165995df3d8563
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() {