From bb9fcf136d23b8624e44ed6458caaa605f72af91 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期三, 01 一月 2025 20:24:20 +0800
Subject: [PATCH] 开始添加数据融合功能

---
 src/views/satellitetelemetry/component/SatelliteManage.vue  |   76 ++++++++++---------------
 src/views/satellitetelemetry/component/SatelliteDataMix.vue |   10 +++
 src/views/satellitetelemetry/SatelliteTelemetry.vue         |   54 +++++++++++++----
 src/components.d.ts                                         |    1 
 src/views/satellitetelemetry/SatelliteProxy.js              |    4 
 5 files changed, 82 insertions(+), 63 deletions(-)

diff --git a/src/components.d.ts b/src/components.d.ts
index f0ccb89..cdfa990 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -40,7 +40,6 @@
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElText: typeof import('element-plus/es')['ElText']
-    ElUpload: typeof import('element-plus/es')['ElUpload']
     FactorCheckbox: typeof import('./components/monitor/FactorCheckbox.vue')['default']
     FactorLegend: typeof import('./components/monitor/FactorLegend.vue')['default']
     FactorRadio: typeof import('./components/monitor/FactorRadio.vue')['default']
diff --git a/src/views/satellitetelemetry/SatelliteProxy.js b/src/views/satellitetelemetry/SatelliteProxy.js
index bc6be57..f11cabe 100644
--- a/src/views/satellitetelemetry/SatelliteProxy.js
+++ b/src/views/satellitetelemetry/SatelliteProxy.js
@@ -35,7 +35,7 @@
   const data = gridData.map((v, i) => {
     return {
       lnglat_GD: points[i],
-      data: v.pm25
+      data: v.pm25 ? (v.pm25 + '渭g/m鲁') : ''
     };
   });
   return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'bottom');
@@ -46,7 +46,7 @@
   const data = gridData.map((v, i) => {
     return {
       lnglat_GD: points[i],
-      data: v.rank
+      data: v.pm25 ? ('鎺掑悕: ' + v.rank) : ''
     };
   });
   return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'top');
diff --git a/src/views/satellitetelemetry/SatelliteTelemetry.vue b/src/views/satellitetelemetry/SatelliteTelemetry.vue
index 6b37603..d5a43cd 100644
--- a/src/views/satellitetelemetry/SatelliteTelemetry.vue
+++ b/src/views/satellitetelemetry/SatelliteTelemetry.vue
@@ -1,6 +1,7 @@
 <template>
-  <div>
-    <!-- <el-button
+  <el-row class="wrap">
+    <el-col span="2">
+      <!-- <el-button
       class="p-events-auto"
       type="info"
       icon="Memo"
@@ -9,21 +10,36 @@
     >
       缁樺埗缃戞牸
     </el-button> -->
-    <SatelliteManage
-      class="satellite-manage"
-      :gridDataList="satelliteGridStore.gridDataList"
-      :loading="loading"
-      @search="onSearch"
-      @row-click="handleRowClick"
-    ></SatelliteManage>
-    <el-row class="historical" justify="center">
+      <el-row>
+        <SatelliteManage
+          v-show="show"
+          class="satellite-manage"
+          :gridDataList="satelliteGridStore.gridDataList"
+          :loading="loading"
+          @search="onSearch"
+          @row-click="handleRowClick"
+          @show-rank="handleRankClick"
+          @show-data="handleDataClick"
+        ></SatelliteManage>
+      </el-row>
+    </el-col>
+    <el-col span="2">
+      <el-row>
+        <CardButton
+          name="鍗槦閬ユ祴鏁版嵁"
+          direction="right"
+          @click="() => (show = !show)"
+        ></CardButton>
+      </el-row>
+    </el-col>
+    <!-- <el-row class="historical" justify="center">
       <SatelliteAnimation
         :loading="animaLoading"
         :grid-data="gridDataDetailList"
         :mapViews="mapViews"
       ></SatelliteAnimation>
-    </el-row>
-  </div>
+    </el-row> -->
+  </el-row>
 </template>
 <script setup>
 import { map } from '@/utils/map/index_old';
@@ -38,9 +54,11 @@
 import { useFetchData } from '@/composables/fetchData';
 import { useSatelliteGridStore } from '@/stores/satellite-grid';
 
+
 const satelliteGridStore = useSatelliteGridStore();
 const { loading, fetchData } = useFetchData(10000);
 const animaLoading = ref(true);
+const show = ref(true);
 
 let count = 0,
   max = 0;
@@ -95,11 +113,11 @@
   // SatelliteProxy.clearText(mapViews);
   // 鏂囨湰鏍囪
   const { textViews: dataTxt, labelsLayer: dataLayer } =
-    SatelliteProxy.drawDataText(mapViews.points, gridData, mapViews.dataTxt);
+    SatelliteProxy.drawDataText(mapViews.points, gridData, mapViews.dataTxt, mapViews.dataLayer);
   mapViews.dataTxt = dataTxt;
   mapViews.dataLayer = dataLayer;
   const { textViews: rankTxt, labelsLayer: rankLayer } =
-    SatelliteProxy.drawRankText(mapViews.points, gridData, mapViews.rankTxt);
+    SatelliteProxy.drawRankText(mapViews.points, gridData, mapViews.rankTxt, mapViews.rankLayer);
   mapViews.rankTxt = rankTxt;
   mapViews.rankLayer = rankLayer;
   SatelliteProxy.drawColor(mapViews.gridViews, gridData);
@@ -117,6 +135,14 @@
     });
   }
 }
+
+function handleRankClick(rankVisible) {
+  rankVisible ? map.add(mapViews.rankLayer) : map.remove(mapViews.rankLayer);
+}
+
+function handleDataClick(dataVisible) {
+  dataVisible ? map.add(mapViews.dataLayer) : map.remove(mapViews.dataLayer);
+}
 </script>
 <style scoped>
 .satellite-manage {
diff --git a/src/views/satellitetelemetry/component/SatelliteDataMix.vue b/src/views/satellitetelemetry/component/SatelliteDataMix.vue
new file mode 100644
index 0000000..b096d53
--- /dev/null
+++ b/src/views/satellitetelemetry/component/SatelliteDataMix.vue
@@ -0,0 +1,10 @@
+<template>
+    <el-row class="wrap">
+      <BaseCard size="medium" direction="left">
+        <template #content>
+          
+        </template>
+        <template #footer> </template>
+      </BaseCard>
+    </el-row>
+  </template>
\ No newline at end of file
diff --git a/src/views/satellitetelemetry/component/SatelliteManage.vue b/src/views/satellitetelemetry/component/SatelliteManage.vue
index 749292d..75ba069 100644
--- a/src/views/satellitetelemetry/component/SatelliteManage.vue
+++ b/src/views/satellitetelemetry/component/SatelliteManage.vue
@@ -6,7 +6,22 @@
           :loading="loading"
           @search="onSearch"
         ></SatelliteSearchBar>
-
+        <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-table
           :data="gridDataList"
           table-layout="fixed"
@@ -52,9 +67,9 @@
 import { ref } from 'vue';
 import moment from 'moment';
 import SatelliteSearchBar from './SatelliteSearchBar.vue';
-import { useFetchData } from '@/composables/fetchData';
-import gridApi from '@/api/gridApi';
-import SatelliteProxy from '../SatelliteProxy';
+// import { useFetchData } from '@/composables/fetchData';
+// import gridApi from '@/api/gridApi';
+// import SatelliteProxy from '../SatelliteProxy';
 
 // eslint-disable-next-line no-unused-vars
 function timeFormatter(row, col, cellValue, index) {
@@ -81,56 +96,25 @@
   }
 });
 
-const emits = defineEmits(['search', 'rowClick']);
+const rankVisible = ref(true);
+const dataVisible = ref(true);
 
-// const { loading, fetchData } = useFetchData(10000);
-// // 缃戞牸淇℃伅
-// let gridInfo = [];
-// // 缃戞牸鏁版嵁缁�
-// const gridDataList = ref([]);
-// // 缃戞牸鏁版嵁璇︽儏
-// const gridDataDetailMap = new Map();
-// // 鍦板浘缃戞牸鐩稿叧瀵硅薄
-// let mapViews;
+const emits = defineEmits(['search', 'rowClick', 'showRank', 'showData']);
 
 // 鏌ヨ缃戞牸淇℃伅鍜岄仴鎰熸暟鎹粍
 function onSearch(options) {
   emits('search', options);
 }
 
-// // 鑾峰彇缃戞牸淇℃伅
-// function fetchGridCell(groupId) {
-//   return fetchData(() => {
-//     return gridApi.fetchGridCell(groupId).then((res) => {
-//       gridInfo = res.data;
-//       drawGrid(gridInfo);
-//     });
-//   });
-// }
+function handleRankClick() {
+  rankVisible.value = !rankVisible.value
+  emits('showRank', rankVisible.value);
+}
 
-// // 鑾峰彇閬ユ劅鏁版嵁缁�
-// function fetchGridData(groupId) {
-//   return gridApi.fetchGridData(groupId).then((res) => {
-//     gridDataList.value = res.data;
-//   });
-// }
-
-// function drawGrid(gridInfo) {
-//   SatelliteProxy.clearAll(mapViews);
-//   mapViews = SatelliteProxy.drawPolyline(gridInfo);
-// }
-
-// // 缁樺埗缃戞牸閬ユ劅鏁版嵁鍊煎拰缃戞牸棰滆壊
-// function drawTextAndColor(gridData) {
-//   // SatelliteProxy.clearText(mapViews);
-//   // 鏂囨湰鏍囪
-//   mapViews.textViews = SatelliteProxy.drawDataText(
-//     mapViews.points,
-//     gridData,
-//     mapViews.textViews
-//   );
-//   SatelliteProxy.drawColor(mapViews.gridViews, gridData);
-// }
+function handleDataClick() {
+  dataVisible.value = !dataVisible.value
+  emits('showData', dataVisible.value);
+}
 
 function handleRowClick(row, col, event) {
   emits('rowClick', row);

--
Gitblit v1.9.3