From 68ba3376731aa7a5760ba5fce1dc6ba0c80982b4 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 03 一月 2025 17:28:18 +0800
Subject: [PATCH] 调整网格文本样式

---
 src/views/satellitetelemetry/SatelliteTelemetry.vue |   65 +++++++++++++++++---------------
 1 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/src/views/satellitetelemetry/SatelliteTelemetry.vue b/src/views/satellitetelemetry/SatelliteTelemetry.vue
index fc74865..66ed9cc 100644
--- a/src/views/satellitetelemetry/SatelliteTelemetry.vue
+++ b/src/views/satellitetelemetry/SatelliteTelemetry.vue
@@ -50,32 +50,34 @@
 import { useSatelliteGridStore } from '@/stores/satellite-grid';
 
 // 鏌ヨ闀垮畞鍖鸿鏀垮尯鍒�
-onMapMounted(()=>{
-  // eslint-disable-next-line no-undef
-  var district = new AMap.DistrictSearch({
-    extensions: "all", //杩斿洖琛屾斂鍖鸿竟鐣屽潗鏍囩瓑鍏蜂綋淇℃伅
-    level: "district", //璁剧疆鏌ヨ琛屾斂鍖虹骇鍒负鍖�
-  });
-  district.search("闀垮畞鍖�", function (status, result) {
-    var bounds = result.districtList[0].boundaries; //鑾峰彇鏈濋槼鍖虹殑杈圭晫淇℃伅
-    if (bounds) {
-      for (var i = 0; i < bounds.length; i++) {
-        //鐢熸垚琛屾斂鍖哄垝 polygon
-        // eslint-disable-next-line no-undef
-        var polygon = new AMap.Polygon({
-          map: map, //鏄剧ず璇ヨ鐩栫墿鐨勫湴鍥惧璞�
-          strokeWeight: 3, //杞粨绾垮搴�
-          path: bounds[i], //澶氳竟褰㈣疆寤撶嚎鐨勮妭鐐瑰潗鏍囨暟缁�
-          fillOpacity: 0.1, //澶氳竟褰㈠~鍏呴�忔槑搴�
-          fillColor: "#CCF3FF", //澶氳竟褰㈠~鍏呴鑹�
-          // strokeColor: "#CC66CC", //绾挎潯棰滆壊
-          strokeColor: "#0066ff", //绾挎潯棰滆壊      
-        });
+function initDistrict() {
+  onMapMounted(() => {
+    // eslint-disable-next-line no-undef
+    var district = new AMap.DistrictSearch({
+      extensions: 'all', //杩斿洖琛屾斂鍖鸿竟鐣屽潗鏍囩瓑鍏蜂綋淇℃伅
+      level: 'district' //璁剧疆鏌ヨ琛屾斂鍖虹骇鍒负鍖�
+    });
+    district.search('闀垮畞鍖�', function (status, result) {
+      var bounds = result.districtList[0].boundaries; //鑾峰彇鏈濋槼鍖虹殑杈圭晫淇℃伅
+      if (bounds) {
+        for (var i = 0; i < bounds.length; i++) {
+          //鐢熸垚琛屾斂鍖哄垝 polygon
+          // eslint-disable-next-line no-undef
+          var polygon = new AMap.Polygon({
+            map: map, //鏄剧ず璇ヨ鐩栫墿鐨勫湴鍥惧璞�
+            strokeWeight: 3, //杞粨绾垮搴�
+            path: bounds[i], //澶氳竟褰㈣疆寤撶嚎鐨勮妭鐐瑰潗鏍囨暟缁�
+            fillOpacity: 0.1, //澶氳竟褰㈠~鍏呴�忔槑搴�
+            fillColor: '#CCF3FF', //澶氳竟褰㈠~鍏呴鑹�
+            // strokeColor: '#ffffff' //绾挎潯棰滆壊
+            strokeColor: '#0077ff' //绾挎潯棰滆壊
+          });
+        }
+        map.setFitView(); //灏嗚鐩栫墿璋冩暣鍒板悎閫傝閲�
       }
-      map.setFitView(); //灏嗚鐩栫墿璋冩暣鍒板悎閫傝閲�
-    }
+    });
   });
-})
+}
 
 const satelliteGridStore = useSatelliteGridStore();
 const { loading, fetchData } = useFetchData(10000);
@@ -94,10 +96,11 @@
 function onSearch(options) {
   satelliteGridStore.fetchGridCell(options.id).then(() => {
     drawGrid(satelliteGridStore.gridInfo);
+    initDistrict();
   });
-  satelliteGridStore.fetchGridData(options.id).then(()=>{
-    max = satelliteGridStore.gridDataList.length
-    fetchGridDataDetail(satelliteGridStore.gridDataList)
+  satelliteGridStore.fetchGridData(options.id).then(() => {
+    max = satelliteGridStore.gridDataList.length;
+    // fetchGridDataDetail(satelliteGridStore.gridDataList);
   });
 }
 
@@ -175,11 +178,13 @@
 }
 
 function handleRankClick(rankVisible) {
-  rankVisible ? map.add(mapViews.rankLayer) : map.remove(mapViews.rankLayer);
+  // rankVisible ? map.add(mapViews.rankLayer) : map.remove(mapViews.rankLayer);
+  rankVisible ? map.add(mapViews.rankTxt) : map.remove(mapViews.rankTxt);
 }
 
 function handleDataClick(dataVisible) {
-  dataVisible ? map.add(mapViews.dataLayer) : map.remove(mapViews.dataLayer);
+  // dataVisible ? map.add(mapViews.dataLayer) : map.remove(mapViews.dataLayer);
+  dataVisible ? map.add(mapViews.dataTxt) : map.remove(mapViews.dataTxt);
 }
 
 function handleColorClick(isStandardColor) {
@@ -203,7 +208,7 @@
   bottom: 10px;
   left: 0;
   right: 0;
-  color: #0066ff;
+  color: #0077ff;
 }
 
 .data-mix {

--
Gitblit v1.9.3