From 1ca8fdb15bfe2daa5c6bd22fd913a1718bca116d Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期二, 15 七月 2025 16:19:07 +0800 Subject: [PATCH] 123 --- src/components/monifangzhen/schemeCard.vue | 61 +++++++++++++++++++++++++++++- 1 files changed, 58 insertions(+), 3 deletions(-) diff --git a/src/components/monifangzhen/schemeCard.vue b/src/components/monifangzhen/schemeCard.vue index 0447eeb..ed91fdf 100644 --- a/src/components/monifangzhen/schemeCard.vue +++ b/src/components/monifangzhen/schemeCard.vue @@ -184,13 +184,68 @@ ? mergedPageData : mergedPageData.filter((device) => device.deviceName.includes("瀛欒儭娌�")); + // 瀛欒儭娌熻澶囩粡绾害鏄犲皠 + const deviceMapping = { + 鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熸偿浣嶈5007: { + lon: 116.598891, + lat: 40.554979, + }, + 鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熸偿浣嶈5006: { + lon: 116.593215, + lat: 40.554399, + }, + }; + + let displayedData = filteredPageData; + + if (!areaName.includes("鍖�")) { + // 娣诲姞 lon 鍜� lan 瀛楁 + displayedData = filteredPageData.map((device) => { + const mapping = deviceMapping[device.deviceName]; + return { + ...device, + ...(mapping && { lon: mapping.lon, lat: mapping.lat }), // 濡傛灉 mapping 瀛樺湪锛屾墠娣诲姞 + }; + }); + + // 娣诲姞棰濆鐨勪袱涓偣浣� + const extraPoint1 = { + deviceName: "寮矡1", + longitude: 116.597836, + latitude: 40.564962, + // height: 530.14, + type: "娉ヤ綅璁�", + lon: 116.597836, + lat: 40.564962, + dictDeviceType: "1437295811", + deviceId: "custom_extraPoint1", // 鎵嬪姩鍔犱竴涓敮涓� ID + }; + + const extraPoint2 = { + deviceName: "寮矡2", + longitude: 116.591571, + latitude: 40.573093, + // height: 483.89, + type: "娉ヤ綅璁�", + lon: 116.591571, + lat: 40.573093, + dictDeviceType: "1437295811", + deviceId: "custom_extraPoint2", // 鎵嬪姩鍔犱竴涓敮涓� ID + }; + + displayedData = [...displayedData, extraPoint1, extraPoint2]; + // displayedData = [...displayedData, extraPoint1]; + } + console.log( - filteredPageData, - areaName.includes("鍖�") ? "鍏ㄩ儴娉ヤ綅璁¤澶囧垪琛�" : "瀛欒儭娌熸偿浣嶈璁惧鍒楄〃" + displayedData, + areaName.includes("鍖�") + ? "鍏ㄩ儴娉ヤ綅璁¤澶囧垪琛�" + : "瀛欒儭娌熸偿浣嶈 + 棰濆鐐逛綅鍒楄〃" ); // 7. 鍒涘缓鐐� - filteredPageData.forEach((item) => { + displayedData.forEach((item) => { // 鏍规嵁闇�姹傚彲澧炲垹 item.type = getDictName(deviceDictList, item.dictDeviceType); item.name = item.deviceName; -- Gitblit v1.9.3