Kaynağa Gözat

feat:修改接口请求路径

wangsisi 2 hafta önce
ebeveyn
işleme
4e17396c57

+ 2 - 2
env.config.js

@@ -2,7 +2,7 @@
 const envConfig = {
   development: {
     NODE_ENV: 'development',
-    SERVER: 'https://feiniaotech-dev.sysuimars.cn/',
+    SERVER: 'http://mlxy-one-map-api.feiniaotech.com/',
     PYSERVER: 'https://birds-api-1-2.sysuimars.cn/',
     MOCK: 'True'
   },
@@ -20,7 +20,7 @@ const envConfig = {
   },
   production: {
     NODE_ENV: 'production',
-    SERVER: 'https://feiniaotech-dev.sysuimars.cn/',
+    SERVER: 'http://mlxy-one-map-api.feiniaotech.com/',
     PYSERVER: 'https://birds-api-1-2.sysuimars.cn/',
     MOCK: 'False'
   }

+ 1 - 1
src/api/config.js

@@ -3,7 +3,7 @@ let serverMock = "https://mock.apipark.cn/m1/4662471-4313509-default/"
 let pythonServe = VE_ENV.PYSERVER
 // let djiCloudBase = "http://127.0.0.1/";
 let djiCloudBase = "https://djiapi.sysuimars.com/";
-let oneMapServer = "https://zytt-one-map-api.feiniaotech.com/";
+let oneMapServer = "http://mlxy-one-map-api.feiniaotech.com/";
 
 export const base_url = server + "site/";
 export const base_dev_url = server + "mini/";

+ 1 - 2
src/api/modules/warning.js

@@ -104,5 +104,4 @@ export default {
         url: config.one_map_url + "village/list",
         type: "get",
     },
-}
-
+}

+ 1 - 6
src/components/static_map_change/Layers.js

@@ -54,13 +54,8 @@ class StaticMapLayers {
                 k: "static_map",
                 resultType: "json",
             }).then(({data}) => {
+                console.log('data', data)
                 that.initStaticMapLayer(map,data)
-                // that.autoTest()
-                // 时间轴
-                // eventBus.on("weatherTime:changeTime", ({index}) => {
-                //     this.timeIndex = index
-                //     this.show(this.layerName)
-                // })
             })
         }
     }

+ 2 - 63
src/views/warningHome/index.vue

@@ -126,74 +126,13 @@ onMounted(async () => {
 
     eventBus.emit("warningMap:init", warningMap.kmap);
 
-    // 检查是否从地块识别页面跳转过来
-    if (route.query.wkt) {
-        // 使用nextTick确保所有图层都已初始化
-        await nextTick();
-
-        // 解码WKT数据
-        const wkt = decodeURIComponent(route.query.wkt);
-        if (wkt) {
-            // 显示地块识别模式
-            isLandRecognition.value = true;
-
-            // 将WKT转换为distributionLayer需要的格式
-            const plotData = {
-                geom: wkt,
-                color: "#00A342", // 绿色,与地块识别页面的颜色一致
-                label: "识别地块",
-            };
-
-            // 在地图上显示地块
-            if (distributionLayer) {
-                try {
-                    distributionLayer.setAreaGeometry([plotData.geom]);
-                } catch (error) {
-                    console.error("初始化地块数据失败:", error);
-                }
-            }
-        }
-    }
-
+    staticMapLayers.initStaticMapLayers(warningMap.kmap);
+    
     // 图例数据
     eventBus.on("alarmList:warningLayers", (data) => {
         warningLayers.value = data;
     });
 
-    // 监听图表组件的地图更新事件
-    eventBus.on("chartList:updateMap", async ({ statType }) => {
-        if (!distributionLayer) return;
-        // 使用 statType 参数请求地图数据
-        getDistributionData(statType);
-    });
-
-    // 预警分布图层联动:仅在"预警分布"tab 显示时,才在地图上显示对应图层
-    eventBus.on("alarmList:changeMapLayer", ({ name, legendUrl }) => {
-        // 47 行:只在 activeBaseTab === '预警分布' 时显示预警列表
-        // 这里保持一致:只有在该 tab 下才显示地图图层,否则直接隐藏
-        if (activeBaseTab.value !== "预警分布") {
-            staticMapLayers && staticMapLayers.hideAll();
-            return;
-        }
-
-        if (legendUrl) {
-            staticMapLayers && staticMapLayers.showSingle(name, true);
-        } else {
-            let text = "";
-            if (name === "日间温度") {
-                text = "从化地块日温";
-            } else if (name === "夜间温度") {
-                text = "从化地块夜温";
-            } else if (name === "土壤水分") {
-                text = "从化地块水分";
-            }
-            if (text !== "") {
-                staticMapLayers && staticMapLayers.showSingle(text, true);
-            } else {
-                staticMapLayers && staticMapLayers.hideAll();
-            }
-        }
-    });
 
     // 窗口大小改变时更新地图尺寸
     const handleResize = () => {

+ 12 - 12
src/views/warningHome/warningMap.js

@@ -63,19 +63,19 @@ class HomeMap {
         const params = {
           point: `POINT(${currentLonLat[0]} ${currentLonLat[1]})`
         }
-        VE_API.mini_farm.weather_warning_land_check(params).then(async (res) => {
-          await that.getLocation(currentLonLat)
-          if (res.code == 0) {
+        // VE_API.mini_farm.weather_warning_land_check(params).then(async (res) => {
+        //   await that.getLocation(currentLonLat)
+        //   if (res.code == 0) {
 
-            // 在这里可以获取feature的属性,并显示在弹窗中
-            let content = '<div>' + res.data?.content + '</div>';
-            document.getElementById('popup-title').innerHTML = that.address;
-            document.getElementById('popup-content').innerHTML = content;
-            that.popup.setPosition(event.coordinate); // 设置弹窗位置为点击位置
-          } else {
-            that.popup.setPosition(undefined)
-          }
-        })
+        //     // 在这里可以获取feature的属性,并显示在弹窗中
+        //     let content = '<div>' + res.data?.content + '</div>';
+        //     document.getElementById('popup-title').innerHTML = that.address;
+        //     document.getElementById('popup-content').innerHTML = content;
+        //     that.popup.setPosition(event.coordinate); // 设置弹窗位置为点击位置
+        //   } else {
+        //     that.popup.setPosition(undefined)
+        //   }
+        // })
       } else {
         that.popup.setPosition(undefined); // 如果没有点击到feature,则隐藏弹窗
       }