From 980d5a22b3f9ff3b110a8fd74b51c4a86df73c9b Mon Sep 17 00:00:00 2001 From: guanj Date: Thu, 30 Oct 2025 10:08:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=B0=E5=9C=BA=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + src/utils/request.ts | 2 +- src/utils/request_wx.ts | 2 +- .../SagTraceResult_WX/components/bdMap.vue | 18 +++--- src/views/VoltageSag_BJ/components/bdMap.vue | 62 +++++++++---------- 5 files changed, 44 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 3b0e150..cf7305b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ node_modules dist offline +# tiles +# tiles1 dist-ssr *.local # Editor directories and files diff --git a/src/utils/request.ts b/src/utils/request.ts index 6f00e3d..d4035f9 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -5,7 +5,7 @@ import store from "@/store/index"; const service = axios.create({ baseURL: "/api", - timeout: 60 * 1000, + timeout: 60 * 1000 * 3, headers: { "Content-Type": "application/json;charset=utf-8" }, }); diff --git a/src/utils/request_wx.ts b/src/utils/request_wx.ts index bbc366d..8ba31dc 100644 --- a/src/utils/request_wx.ts +++ b/src/utils/request_wx.ts @@ -10,7 +10,7 @@ class HttpRequest { getInsideConfig() { const config = { baseURL: this.baseUrl, // 所有的请求地址前缀部分(没有后端请求不用写) - timeout: 80000, // 请求超时时间(毫秒) + timeout: 60 * 1000 * 3, // 请求超时时间(毫秒) }; return config; } diff --git a/src/views/SagTraceResult_WX/components/bdMap.vue b/src/views/SagTraceResult_WX/components/bdMap.vue index ba46ab8..345274c 100644 --- a/src/views/SagTraceResult_WX/components/bdMap.vue +++ b/src/views/SagTraceResult_WX/components/bdMap.vue @@ -129,7 +129,7 @@ const handler = async ({ BMap, map }: any) => { const markerClick = (e: any) => { zoom.value = 15; infoWindowPoint.value = e; - infoWindowPoint.value.show = true; + // infoWindowPoint.value.show = true; center.value.lng = 120.124367; center.value.lat = 31.555421; @@ -167,11 +167,11 @@ const init = () => { lineCount: 1, eventCount: 1, lineEventDetails: [ - { - gdName: "检修分公司", - pictureId: "5debb8bd0ce26527675eedffd74a3198", - pictureName: "无锡线上", - }, + // { + // gdName: "检修分公司", + // pictureId: "5debb8bd0ce26527675eedffd74a3198", + // pictureName: "无锡线上", + // }, { gdName: "检修分公司", pictureId: "35b1301833e3fdfc872b1a27a17c7245", @@ -267,12 +267,12 @@ const checkMapData = () => { if (!hasOfflineTiles) { console.warn("当前区域无离线地图数据,将返回默认位置"); - // 使用正确的BMap.Point创建方式 - const point = new BMapInstance.value.Point(116.404367, 39.915421); + // 使用正确的BMap.Point创建方式 + const point = new BMapInstance.value.Point(120.124367,31.555421); // 平滑移动并设置合适缩放级别 mapInstance.value.panTo(point); - mapInstance.value.setZoom(12); + mapInstance.value.setZoom(11); // zoom.value = 12; } } catch (error) { diff --git a/src/views/VoltageSag_BJ/components/bdMap.vue b/src/views/VoltageSag_BJ/components/bdMap.vue index 7daaa85..580d912 100644 --- a/src/views/VoltageSag_BJ/components/bdMap.vue +++ b/src/views/VoltageSag_BJ/components/bdMap.vue @@ -113,7 +113,7 @@ v-for="(value, index) in infoWindowPoint.objName.split( ';' )" - style="white-space: nowrap" + style="white-space: nowrap; font-size: 13px" > {{ value }} @@ -198,8 +198,8 @@ const markerClick = (e: any) => { zoom.value = 15; infoWindowPoint.value = e; infoWindowPoint.value.show = true; - center.value.lng = 116.404367; - center.value.lat = 39.915421; + center.value.lng = e.lng; + center.value.lat = e.lat+ 0.01000001;; setTimeout(() => { center.value.lng = e.lng; @@ -285,41 +285,41 @@ const init = () => { const moveenFlag = ref(true); const checkMapData = () => { - if (!mapInstance.value || !BMapInstance.value || !moveenFlag.value) return; + // if (!mapInstance.value || !BMapInstance.value || !moveenFlag.value) return; - // 获取地图容器 - const container = mapInstance.value.getContainer(); + // // 获取地图容器 + // const container = mapInstance.value.getContainer(); - setTimeout(() => { - try { - // 1. 获取所有图片瓦片 - const tiles = Array.from(container.querySelectorAll("img")); + // setTimeout(() => { + // try { + // // 1. 获取所有图片瓦片 + // const tiles = Array.from(container.querySelectorAll("img")); - // 2. 检查是否有离线地图瓦片 - const hasOfflineTiles = tiles.some((tile: any) => { - // 确保tile是有效的DOM元素 - if (!tile || !tile.src) return false; + // // 2. 检查是否有离线地图瓦片 + // const hasOfflineTiles = tiles.some((tile: any) => { + // // 确保tile是有效的DOM元素 + // if (!tile || !tile.src) return false; - // 检查是否是离线瓦片 - return tile.src.includes("/plugin/offline/tiles/"); - }); + // // 检查是否是离线瓦片 + // return tile.src.includes("/plugin/offline/tiles/"); + // }); - // 3. 如果没有离线瓦片,回到默认位置 - if (!hasOfflineTiles) { - console.warn("当前区域无离线地图数据,将返回默认位置"); + // // 3. 如果没有离线瓦片,回到默认位置 + // if (!hasOfflineTiles) { + // console.warn("当前区域无离线地图数据,将返回默认位置"); - // 使用正确的BMap.Point创建方式 - const point = new BMapInstance.value.Point(116.404367, 39.915421); + // // 使用正确的BMap.Point创建方式 + // const point = new BMapInstance.value.Point(116.404367, 39.915421); - // 平滑移动并设置合适缩放级别 - mapInstance.value.panTo(point); - mapInstance.value.setZoom(12); - // zoom.value = 12; - } - } catch (error) { - console.error("地图检测出错:", error); - } - }, 1000); // 适当缩短延迟时间 + // // 平滑移动并设置合适缩放级别 + // mapInstance.value.panTo(point); + // mapInstance.value.setZoom(12); + // // zoom.value = 12; + // } + // } catch (error) {/ + // console.error("地图检测出错:", error); + // } + // }, 1000); // 适当缩短延迟时间 }; // 处理地图滚轮缩放,修正scale导致的坐标偏移