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/SatelliteTelemetry.vue | 94 ++++++++++++++++++++++++++--------------------- 1 files changed, 52 insertions(+), 42 deletions(-) diff --git a/src/views/satellitetelemetry/SatelliteTelemetry.vue b/src/views/satellitetelemetry/SatelliteTelemetry.vue index 9260b30..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="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'; @@ -36,13 +52,14 @@ import SatelliteManage from './component/SatelliteManage.vue'; import SatelliteProxy from './SatelliteProxy'; import { useFetchData } from '@/composables/fetchData'; +import { useSatelliteGridStore } from '@/stores/satellite-grid'; + +const satelliteGridStore = useSatelliteGridStore(); const { loading, fetchData } = useFetchData(10000); const animaLoading = ref(true); -// 缃戞牸淇℃伅 -let gridInfo = []; -// 缃戞牸鏁版嵁缁� -const gridDataList = ref([]); +const show = ref(true); + let count = 0, max = 0; // 缃戞牸鏁版嵁璇︽儏 @@ -53,28 +70,10 @@ // 鏌ヨ缃戞牸淇℃伅鍜岄仴鎰熸暟鎹粍 function onSearch(options) { - fetchGridCell(options.id); - fetchGridData(options.id); -} - -// 鑾峰彇缃戞牸淇℃伅 -function fetchGridCell(groupId) { - return fetchData(() => { - return gridApi.fetchGridCell(groupId).then((res) => { - gridInfo = res.data; - drawGrid(gridInfo); - }); + satelliteGridStore.fetchGridCell(options.id).then(() => { + drawGrid(satelliteGridStore.gridInfo); }); -} - -// 鑾峰彇閬ユ劅鏁版嵁缁� -function fetchGridData(groupId) { - return gridApi.fetchGridData(groupId).then((res) => { - gridDataList.value = res.data; - count = 0; - max = res.data.length; - fetchGridDataDetail(res.data); - }); + satelliteGridStore.fetchGridData(options.id); } function fetchGridDataDetail(dataList) { @@ -113,11 +112,14 @@ function drawTextAndColor(gridData) { // SatelliteProxy.clearText(mapViews); // 鏂囨湰鏍囪 - mapViews.textViews = SatelliteProxy.drawDataText( - mapViews.points, - gridData, - mapViews.textViews - ); + const { textViews: dataTxt, labelsLayer: dataLayer } = + 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, mapViews.rankLayer); + mapViews.rankTxt = rankTxt; + mapViews.rankLayer = rankLayer; SatelliteProxy.drawColor(mapViews.gridViews, gridData); } @@ -133,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 { -- Gitblit v1.9.3