feiyu02
2025-03-26 da0d06cb06ef3fc55d88cb4a9a52505ac35c03e6
走航融合(待完成)
已修改6个文件
491 ■■■■■ 文件已修改
src/api/gridApi.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/model/SatelliteGrid.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/underwaymix/UnderwayMixMode.vue 409 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/underwaymix/component/GridStyleTool.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/gridApi.js
@@ -148,5 +148,20 @@
    return $http.get(`air/satellite/import/grid/aod/download/template`, {
      responseType: 'blob'
    });
  },
  buildUnderwayHeatmap(groupId, gridDataDetailList, searchLength) {
    return $http
      .post(
        `air/satellite/product/underway/heatmap/build`,
        gridDataDetailList,
        {
          params: {
            groupId: groupId,
            searchLength: 4
          }
        }
      )
      .then((res) => res.data);
  }
};
src/api/index.js
@@ -1,7 +1,7 @@
import axios from 'axios';
import { ElMessage } from 'element-plus';
const debug = false;
const debug = true;
let ip1 = 'http://47.100.191.150:9029/';
// console.log(import.meta.env);
@@ -10,7 +10,7 @@
}
if (debug) {
  ip1 = 'http://192.168.0.138:8084/';
  ip1 = 'http://192.168.0.110:8084/';
}
const $http = axios.create({
src/components.d.ts
@@ -45,6 +45,7 @@
    ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
    ElSelect: typeof import('element-plus/es')['ElSelect']
    ElSlider: typeof import('element-plus/es')['ElSlider']
    ElSpace: typeof import('element-plus/es')['ElSpace']
    ElSwitch: typeof import('element-plus/es')['ElSwitch']
    ElTable: typeof import('element-plus/es')['ElTable']
    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
src/model/SatelliteGrid.js
@@ -629,6 +629,26 @@
    return heatTag;
  }
  drawHeatGrid2(tag, headGridDataDetailList) {
    const heatTag = `heat-${tag}`;
    if (this.mapViewsMap.has(heatTag)) {
      this.changeVisibility({
        tags: [heatTag],
        showGridViews: true
      });
    } else {
      this.drawTagGrid({
        tag: heatTag,
        data: headGridDataDetailList,
        extData: {
          name: `走航热力图 - ${heatTag}`,
          type: 2
        }
      });
    }
    return heatTag;
  }
  search(gdd, width, height, eachwidth, eachheight, searchLength) {
    function getCellWidthRange(cellId, width, height) {
      const total = width * height;
src/views/underwaymix/UnderwayMixMode.vue
@@ -8,7 +8,7 @@
            <template #content>
              <el-row>
                <el-form :inline="true">
                  <el-form-item label="走航融合">
                  <!-- <el-form-item label="走航融合">
                    <el-select
                      v-model="selectedfusionData"
                      multiple
@@ -26,8 +26,8 @@
                        :value="i"
                      />
                    </el-select>
                  </el-form-item>
                  <el-form-item>
                  </el-form-item> -->
                  <!-- <el-form-item>
                    <el-button
                      type="primary"
                      class="el-button-custom"
@@ -37,13 +37,125 @@
                      "
                      @click="handleFusionClick"
                    >
                      {{ '叠加融合' }}
                      {{ '叠加走航' }}
                    </el-button>
                  </el-form-item>
                  </el-form-item> -->
                </el-form>
              </el-row>
              <div class="m-t-8">筛选辅助</div>
              <el-form :inline="false">
                <el-form-item label="时段筛选">
                  <el-select
                    v-model="selectedTimeSection"
                    multiple
                    clearable
                    placeholder="选择时段"
                    size="small"
                    style="width: 300px"
                  >
                    <el-option
                      v-for="(v, i) in timeSectionList"
                      :key="i"
                      :label="v"
                      :value="v"
                    />
                  </el-select>
                </el-form-item>
                <el-form-item label="区域筛选">
                  <el-select
                    v-model="selectedZone"
                    multiple
                    clearable
                    placeholder="选择区域"
                    size="small"
                    style="width: 300px"
                  >
                    <el-option
                      v-for="(v, i) in zoneList"
                      :key="i"
                      :label="v"
                      :value="v"
                    />
                  </el-select>
                </el-form-item>
                <el-form-item label="背景筛选">
                  <el-select
                    v-model="selectedPollutionDegree"
                    multiple
                    clearable
                    placeholder="选择背景"
                    size="small"
                    style="width: 300px"
                  >
                    <el-option
                      v-for="(v, i) in pollutionDegreeList"
                      :key="i"
                      :label="v"
                      :value="v"
                    />
                  </el-select>
                </el-form-item>
              </el-form>
              <el-table
                :data="showFusionDataList"
                table-layout="fixed"
                size="small"
                :show-overflow-tooltip="true"
                border
                height="50vh"
                row-class-name="t-row-normal"
                cell-class-name="t-cell"
                header-row-class-name="t-header-row"
                header-cell-class-name="t-header-cell"
                :highlight-current-row="false"
                @row-click="handleRowClick"
                @selection-change="handleSelectionChange"
              >
                <el-table-column type="selection" width="40" />
                <!-- <el-table-column
                  type="index"
                  label="序号"
                  width="30"
                /> -->
                <el-table-column
                  prop="dataTime"
                  label="时间"
                  align="center"
                  :formatter="timeFormatter"
                  width="100"
                />
                <el-table-column
                  prop="missionCode"
                  label="任务编号"
                  align="center"
                  width="150"
                />
                <el-table-column
                  prop="zone"
                  label="区域"
                  align="center"
                  width="50"
                />
                <el-table-column
                  prop="pollutionDegree"
                  label="污染背景"
                  align="center"
                  width="50"
                />
              </el-table>
              <div class="m-t-8">操作</div>
              <el-row class="m-t-8">
              <el-space class="m-t-8 m-b-8">
                <el-button
                  type="primary"
                  class="el-button-custom"
                  size="small"
                  :disabled="!gridCellList || selectedfusionData.length == 0"
                  @click="handleFusionClick"
                >
                  {{ '叠加走航' }}
                </el-button>
                <CheckButton
                  active-text="开启融合"
                  inactive-text="隐藏融合"
@@ -51,80 +163,7 @@
                  @change="handleMixClick"
                >
                </CheckButton>
                <CheckButton
                  :disabled="!mixActive"
                  active-text="风险热力图"
                  inactive-text="风险热力图"
                  :default-value="false"
                  @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">
                <CheckButton
                  active-text="显示网格"
                  inactive-text="隐藏网格"
                  :default-value="true"
                  @change="handleGridClick"
                >
                </CheckButton>
                <el-button
                  type="primary"
                  class="el-button-custom"
                  size="small"
                  @click="handleRankClick"
                >
                  {{ rankVisible ? '隐藏排名' : '显示排名' }}
                </el-button>
                <el-button
                  type="primary"
                  class="el-button-custom"
                  size="small"
                  @click="handleDataClick"
                >
                  {{ dataVisible ? '隐藏数据' : '显示数据' }}
                </el-button>
              </el-row>
              <div class="m-t-8">网格样式</div>
              <el-row class="m-t-8">
                <el-button
                  type="primary"
                  class="el-button-custom"
                  size="small"
                  @click="handleOpacityClick"
                >
                  {{ !isOpacity ? '透明化' : '取消透明化' }}
                </el-button>
                <el-button
                  type="primary"
                  class="el-button-custom"
                  size="small"
                  @click="handleColorClick"
                >
                  {{ isStandardColor ? '绘制对比色' : '绘制标准色' }}
                </el-button>
              </el-row>
              <div class="m-t-8">走航要素</div>
              <el-row class="m-t-8">
                <el-button
                  type="primary"
                  class="el-button-custom"
                  size="small"
                  :loading="missionLoading || loading"
                  @click="handleUnderwayClick"
                >
                  {{ underwayVisible ? '隐藏走航路线' : '显示走航路线' }}
                </el-button>
              </el-row> -->
              </el-space>
            </template>
            <template #footer> </template>
          </BaseCard>
@@ -181,6 +220,77 @@
const gridDataDetailMap = new Map();
const selectedTimeSection = ref([]);
const selectedZone = ref([]);
const selectedPollutionDegree = ref([]);
const timeSectionList = computed(() => {
  const res = [];
  fusionDataList.value.forEach((e) => {
    const t = moment(e.dataTime).format('YYYY-MM-DD');
    if (res.indexOf(t) == -1) {
      res.push(t);
    }
  });
  return res;
});
const zoneList = computed(() => {
  const res = [];
  fusionDataList.value.forEach((e) => {
    const t = e.zone;
    if (res.indexOf(t) == -1) {
      res.push(t);
    }
  });
  return res;
});
const pollutionDegreeList = computed(() => {
  const res = [];
  fusionDataList.value.forEach((e) => {
    const t = e.pollutionDegree;
    if (res.indexOf(t) == -1) {
      res.push(t);
    }
  });
  return res;
});
const showFusionDataList = computed(() => {
  return fusionDataList.value.filter((v) => {
    const b1 =
      selectedTimeSection.value.length == 0 ||
      selectedTimeSection.value.indexOf(
        moment(v.dataTime).format('YYYY-MM-DD')
      ) != -1;
    const b2 =
      selectedZone.value.length == 0 ||
      selectedZone.value.indexOf(v.zone) != -1;
    const b3 =
      selectedPollutionDegree.value.length == 0 ||
      selectedPollutionDegree.value.indexOf(v.pollutionDegree) != -1;
    return b1 && b2 && b3;
  });
});
// if (
//       selectedTimeSection.value.length == 0 &&
//       selectedZone.value.length == 0 &&
//       selectedPollutionDegree.value.length == 0
//     ) {
//       return true;
//     } else {
//       const b1 =
//         selectedTimeSection.value.indexOf(
//           moment(v.dataTime).format('YYYY-MM-DD')
//         ) != -1;
//       const b2 = selectedZone.value.indexOf(v.zone) != -1;
//       const b3 = selectedPollutionDegree.value.indexOf(v.pollutionDegree) != -1;
//       return b1 && b2 || b3;
//     }
const mixActive = ref(false);
const heatActive = ref(false);
const gridVisible = ref(true);
@@ -190,8 +300,8 @@
const isStandardColor = ref(true);
const isOpacity = ref(false);
function timeFormatter(value) {
  return moment(value).format('YYYY-MM-DD');
function timeFormatter(row, col, cellValue, index) {
  return moment(cellValue).format('YYYY-MM-DD');
}
function fetchFusionData() {
@@ -215,15 +325,6 @@
//     }
//   });
// }
function resetButton() {
  gridVisible.value = true;
  underwayVisible.value = false;
  rankVisible.value = false;
  dataVisible.value = false;
  isStandardColor.value = true;
  isOpacity.value = false;
}
function prepareGrid(gridInfo) {
  satelliteGrid.gridPrepare(gridInfo, (polygon) => {
@@ -281,7 +382,8 @@
  // resetButton();
  satelliteGrid.changeVisibility({ showGridViews: false });
  selectedfusionData.value.forEach((i) => {
    const d = fusionDataList.value[i];
    // const d = fusionDataList.value[i];
    const d = i;
    if (gridDataDetailMap.has(d.id)) {
      satelliteGrid.changeVisibility({ tags: [d.id], showGridViews: true });
      // gridCtrls.value = Array.from(satelliteGrid.mapViewsMap);
@@ -357,18 +459,34 @@
    showRankTxt: false
  });
  if (heatActive.value) {
    heatTag = satelliteGrid.drawHeatGrid(mixTag);
    satelliteGrid.setGridEvent(
      [heatTag],
      'click',
      (gridCell, gridDataDetail) => {
        gridStore.selectedGridCellAndDataDetail = {
          gridCell,
          gridDataDetail
        };
      }
    );
    gridCtrls.value = [satelliteGrid];
    // heatTag = satelliteGrid.drawHeatGrid(mixTag);
    // satelliteGrid.setGridEvent(
    //   [heatTag],
    //   'click',
    //   (gridCell, gridDataDetail) => {
    //     gridStore.selectedGridCellAndDataDetail = {
    //       gridCell,
    //       gridDataDetail
    //     };
    //   }
    // );
    // gridCtrls.value = [satelliteGrid];
    const data = satelliteGrid.gridDataDetailMap.get(mixTag);
    gridApi.buildUnderwayHeatmap(3, data, 10).then((res) => {
      heatTag = satelliteGrid.drawHeatGrid2(mixTag, res.data);
      satelliteGrid.setGridEvent(
        [heatTag],
        'click',
        (gridCell, gridDataDetail) => {
          gridStore.selectedGridCellAndDataDetail = {
            gridCell,
            gridDataDetail
          };
        }
      );
      gridCtrls.value = [satelliteGrid];
    });
  } else {
    satelliteGrid.changeVisibility({
      tags: [mixTag],
@@ -394,17 +512,6 @@
  console.log(res);
}
function handleGridClick() {
  gridVisible.value = !gridVisible.value;
  selectedfusionData.value.forEach((i) => {
    const d = fusionDataList.value[i];
    satelliteGrid.changeVisibility({
      tags: [d.id],
      showGridViews: gridVisible.value
    });
  });
}
function handleUnderwayClick({ isShow, dataId }) {
  underwayVisible.value = !underwayVisible.value;
@@ -419,46 +526,8 @@
  }
}
function handleRankClick() {
  rankVisible.value = !rankVisible.value;
  selectedfusionData.value.forEach((i) => {
    const d = fusionDataList.value[i];
    satelliteGrid.changeVisibility({
      tags: [d.id],
      showRankTxt: rankVisible.value
    });
  });
}
function handleDataClick() {
  dataVisible.value = !dataVisible.value;
  selectedfusionData.value.forEach((i) => {
    const d = fusionDataList.value[i];
    satelliteGrid.changeVisibility({
      tags: [d.id],
      showDataTxt: dataVisible.value
    });
  });
}
function handleColorClick() {
  isStandardColor.value = !isStandardColor.value;
  selectedfusionData.value.forEach((i) => {
    const d = fusionDataList.value[i];
    if (gridDataDetailMap.has(d.id)) {
      satelliteGrid.changeGridColor({
        tag: d.id,
        useCustomColor: !isStandardColor.value,
        opacity: 1,
        zIndex: 11
      });
    }
  });
}
function handleOpacityClick() {
  isOpacity.value = !isOpacity.value;
  satelliteGrid.changeGridOpacity({ opacityValue: isOpacity.value ? 0.1 : 1 });
function handleSelectionChange(val) {
  selectedfusionData.value = val;
}
/**走航轨迹*******************************************************************/
@@ -565,4 +634,32 @@
  mapLine.drawTagLine(missionCode, fd, factor);
}
</script>
<style scoped></style>
<style scoped>
:deep(.el-table) {
  --el-table-bg-color: transparent;
  --el-table-row-hover-bg-color: var(--select_color);
  --el-table-current-row-bg-color: var(--select_color);
  /* --el-table-current-row-bg-color: #7dff5d96; */
  --el-table-text-color: var(--font-color);
}
:deep(.t-row-normal) {
  cursor: pointer;
  background-color: transparent !important;
}
:deep(.t-cell) {
  /* background: red !important; */
  /* height: 40px;
  border: 1px solid black; */
}
:deep(.t-header-row) {
}
:deep(.t-header-cell) {
  background-color: var(--bg-color-2) !important;
  /* text-align: center !important; */
  color: white !important;
}
</style>
src/views/underwaymix/component/GridStyleTool.vue
@@ -53,6 +53,13 @@
                  >
                  </CheckButton>
                  <CheckButton
                    active-text="风险热力图"
                    inactive-text="风险热力图"
                    :default-value="false"
                    @change="(e) => handleHeatMapClick(e, i, value)"
                  >
                  </CheckButton>
                  <CheckButton
                    v-if="value.extData.type == 0"
                    active-text="显示走航轨迹"
                    inactive-text="隐藏走航轨迹"
@@ -105,6 +112,10 @@
 * 网格样式控制工具
 */
import { ref, reactive, onMounted, onUnmounted, computed, toRaw } from 'vue';
import gridApi from '@/api/gridApi';
import { useGridStore } from '@/stores/grid-info';
const gridStore = useGridStore()
const props = defineProps({
  // 网格管理对象[SatelliteGrid]数组
@@ -200,6 +211,37 @@
function handleHighlightGridClick(e, index, value) {
  toRaw(props.gridCtrls[index]).mixGrid(value.tag.split('-'), e);
}
let heatTag
function handleHeatMapClick(e, index, value) {
  const _satelliteGrid = toRaw(props.gridCtrls[index])
  _satelliteGrid.changeVisibility({
    showGridViews: false,
    showDataTxt: false,
    showRankTxt: false
  });
  if (e) {
    const data = _satelliteGrid.gridDataDetailMap.get(value.tag);
    gridApi.buildUnderwayHeatmap(3, data).then((res) => {
      heatTag = _satelliteGrid.drawHeatGrid2(value.tag, res.data);
      _satelliteGrid.setGridEvent(
        [heatTag],
        'click',
        (gridCell, gridDataDetail) => {
          gridStore.selectedGridCellAndDataDetail = {
            gridCell,
            gridDataDetail
          };
        }
      );
    });
  } else {
    _satelliteGrid.changeVisibility({
      tags: [value.tag],
      showGridViews: true
    });
  }
}
</script>
<style scoped>
.content-wrap {