From cf4ed06dea0076e518319de24c5120bb3fe0dae9 Mon Sep 17 00:00:00 2001 From: guonan <guonan201020@163.com> Date: 星期五, 06 六月 2025 14:41:25 +0800 Subject: [PATCH] 提交 --- src/api/hpApi.js | 85 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 82 insertions(+), 3 deletions(-) diff --git a/src/api/hpApi.js b/src/api/hpApi.js index 2cba069..d1f77ab 100644 --- a/src/api/hpApi.js +++ b/src/api/hpApi.js @@ -69,8 +69,8 @@ return response.data; } -// 鑾峰彇鐩戞祴璁惧淇℃伅 -export async function getDeviceInfo(data) { +// 鑾峰彇鐞夌拑搴欓晣鐩戞祴璁惧淇℃伅 +export async function getDeviceInfoShg(data) { const response = await axios.post("/hp/deviceInfo/getData", { filterObject: { "dictDeviceType": data, @@ -81,18 +81,97 @@ return response.data; } +// 鑾峰彇鍖椾含甯傜洃娴嬭澶囦俊鎭� +export async function getDeviceInfo(data) { + const response = await axios.post("/hp/deviceInfo/getData", { + + "currentPage": 1, + "pageSize": 10000, + "filterObject": { + "belongObjList": [ + "1797461961110261762" + ] + // "id": "", + // "deviceName": "", + // "deviceCode": "", + // "deviceClientId": "", + // "dictDeviceType": "", + // "hdName": "", + // "installUnit": "", + // "rtuUnit": "", + // "dictDisasterType": "", + // "dictCommunicationType": "", + // "dictDeviceStatus": "", + // "divisionDistrict": "", + // "townCode": "" + }, + "sortedList": [ + { + "sorted": "createTime", + "type": "desc" + } + ] + }) + + return response.data; +} + + // 鑾峰彇闅愭偅鐐逛俊鎭� export async function getDangerPoint(data) { const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", { filterObject: { "divisionCounty": "110116000000", - "divisionTown": "110116110000" + "divisionTown": "110116110000", + // "divisionCounty": null, + // "divisionTown": null, + "year": 2025 }, "pageSize": 10000 }); return response.data; } +export async function fetchAndLoadDangerPoints(loadCallback) { + let currentPage = 1; + const pageSize = 100; // 姣忔璇锋眰鐨勬暟鎹噺 + + while (true) { + try { + const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", { + filterObject: { + divisionCounty: "110111000000", + divisionTown: null, + year: 2025 + }, + pageSize: pageSize, + currentPage: currentPage // 娣诲姞褰撳墠椤电爜鍙傛暟 + }); + + const pageData = response.data?.data?.pageData; + + if (!Array.isArray(pageData)) { + console.error("Expected an array in 'pageData', but got:", typeof pageData, pageData); + break; + } + + if (pageData.length === 0) break; // 娌℃湁鏇村鏁版嵁浜� + + // 璋冪敤浼犲叆鐨勫洖璋冨嚱鏁帮紝鐢ㄤ簬鏇存柊椤甸潰鍐呭 + loadCallback(pageData); + + if (pageData.length < pageSize) break; // 濡傛灉鏈杩斿洖鐨勬暟鎹皯浜巔ageSize锛岃鏄庡凡鑾峰彇瀹屾墍鏈夋暟鎹� + + currentPage++; // 鏇存柊涓嬩竴椤电殑椤电爜 + } catch (error) { + console.error("Error fetching danger points:", error); + break; + } + } +} + + + // 鏍规嵁骞翠唤鑾峰彇闆ㄩ噺鏁版嵁 export async function getRainfallDataYears(data) { const response = await axios.post("/hp/rainfallCountyCity/getData", { -- Gitblit v1.9.3