| | |
| | | console.log("getSafeLocation:", response); |
| | | return response.data; |
| | | } |
| | | |
| | | // 获取避险线路 |
| | | export async function getEscapeRoute(data) { |
| | | const response = await axios.post("/hp/escapeRoute/getData", { |
| | |
| | | console.log("getEscapeRoute:", response); |
| | | return response.data; |
| | | } |
| | | |
| | | // 获取传感器列表 |
| | | export async function getSensor(data) { |
| | | const response = await axios.post("/hp/sensor/getData", { |
| | |
| | | console.log("getSensor:", response); |
| | | return response.data; |
| | | } |
| | | |
| | | // 获取雨量数据 |
| | | export async function getRainfallData() { |
| | | const response = await axios.post("/hp/rainfallCountyCity/getData", { |
| | |
| | | return response.data; |
| | | } |
| | | |
| | | // 获取琉璃庙镇监测设备信息 |
| | | export async function getDeviceInfoShg(data) { |
| | | const response = await axios.post("/hp/deviceInfo/getData", { |
| | | filterObject: { |
| | | "dictDeviceType": data, |
| | | "townCode": "110116110000" |
| | | }, |
| | | "pageSize": 10000 |
| | | // 按照北京市code查询行政区code |
| | | export async function getAeraCode() { |
| | | const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerCountByDistrict", { |
| | | "dictDisasterGrade": "", |
| | | "dictDisasterType": "", |
| | | "dictRiskLevel": "", |
| | | "districtCode": "110000000000", |
| | | "dictThreatObj": "", |
| | | "year": "2025" |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | // 获取北京市监测设备信息 |
| | | export async function getDeviceInfo(data) { |
| | | const response = await axios.post("/hp/deviceInfo/getData", { |
| | | |
| | | "currentPage": 1, |
| | | "pageSize": 10000, |
| | | "filterObject": { |
| | | "belongObjList": [ |
| | | "1797461961110261762" |
| | | ], |
| | | "townCode": data |
| | | // "id": "", |
| | | // "deviceName": "", |
| | | // "deviceCode": "", |
| | | // "deviceClientId": "", |
| | | // "dictDeviceType": "", |
| | | // "hdName": "", |
| | | // "installUnit": "", |
| | | // "rtuUnit": "", |
| | | // "dictDisasterType": "", |
| | | // "dictCommunicationType": "", |
| | | // "dictDeviceStatus": "", |
| | | // "divisionDistrict": "", |
| | | }, |
| | | "sortedList": [ |
| | | { |
| | | "sorted": "createTime", |
| | | "type": "desc" |
| | | } |
| | | ] |
| | | }) |
| | | |
| | | // 按照行政区code查询乡镇code(此接口包含隐患点数量查询) |
| | | export async function getAeraTownCode(data) { |
| | | const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerTownCount", { |
| | | "dictDisasterGrade": "", |
| | | "dictDisasterType": "", |
| | | "dictRiskLevel": "", |
| | | "districtCode": data, |
| | | "dictThreatObj": "", |
| | | "year": "2025" |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | |
| | | // 获取隐患点信息 |
| | | // 根据乡镇Code获取隐患点(此接口包含隐患点数量查询) |
| | | export async function getDangerPoint(data) { |
| | | |
| | | const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", { |
| | | |
| | | filterObject: { |
| | | // divisionCounty其实可以不传 |
| | | // "divisionCounty": divisionCounty, |
| | | "divisionTown": data, |
| | | "year": 2025 |
| | | }, |
| | |
| | | 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 // 添加当前页码参数 |
| | | // }); |
| | | // 分页获取行政区划隐患点信息 |
| | | export async function getDangerPointByPage(data, pageNum) { |
| | | const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", { |
| | | filterObject: { |
| | | "divisionCounty": data, |
| | | "year": 2025 |
| | | }, |
| | | "pageSize": 50, |
| | | "pageNum": pageNum, |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | // const pageData = response.data?.data?.pageData; |
| | | |
| | | // if (!Array.isArray(pageData)) { |
| | | // console.error("Expected an array in 'pageData', but got:", typeof pageData, pageData); |
| | | // break; |
| | | // } |
| | | // 监测设备接口 |
| | | /** |
| | | * @param {string} data - 雨量计设备类型id |
| | | * @param {string} townCode - 乡镇code,可以查询乡镇监测设备信息 |
| | | */ |
| | | export async function getDeviceInfo(data, townCode) { |
| | | const response = await axios.post("/hp/deviceInfo/getData", { |
| | | filterObject: { |
| | | "dictCommunicationType": data, |
| | | "townCodeList": [townCode], |
| | | "year": 2025, |
| | | // 所属项目 |
| | | "belongObjList": [ |
| | | "1797461961110261762" |
| | | ], |
| | | }, |
| | | "pageSize": 10000 |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | // if (pageData.length === 0) break; // 没有更多数据了 |
| | | // 接口多写几个应该无妨吧 |
| | | export async function getDeviceNWJ(data, townCode) { |
| | | const response = await axios.post("/hp/deviceInfo/getData", { |
| | | filterObject: { |
| | | "dictDeviceTypeList": [data], |
| | | "townCodeList": [townCode], |
| | | "year": 2025, |
| | | }, |
| | | "pageSize": 10000 |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | // // 调用传入的回调函数,用于更新页面内容 |
| | | // loadCallback(pageData); |
| | | // 查询孙胡沟监测设备,dictCommunicationType为查询孙胡沟的雨量计 |
| | | export async function getDeviceInfoSHG(data) { |
| | | const response = await axios.post("/hp/deviceInfo/getData", { |
| | | filterObject: { |
| | | "dictCommunicationType": data, |
| | | "townCodeList": ["110116110000"], |
| | | "year": 2025, |
| | | }, |
| | | "pageSize": 10000 |
| | | |
| | | // if (pageData.length < pageSize) break; // 如果本次返回的数据少于pageSize,说明已获取完所有数据 |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | // currentPage++; // 更新下一页的页码 |
| | | // } catch (error) { |
| | | // console.error("Error fetching danger points:", error); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // 分页查询行政区划监测设备信息 |
| | | export async function getDeviceInfoByPage(data, pageNum) { |
| | | const response = await axios.post("/hp/deviceInfo/getData", { |
| | | filterObject: { |
| | | "divisionDistrictList": [data], |
| | | // 所属项目 |
| | | // 如果不加这个,则返回的全是强震仪(1933099069385355265) |
| | | "belongObjList": [ |
| | | "1797461961110261762" |
| | | ], |
| | | }, |
| | | "pageSize": 50, |
| | | "pageNum": pageNum |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | |
| | | // 根据年份获取雨量数据 |
| | |
| | | }, |
| | | "pageSize": 1000 |
| | | }); |
| | | console.log("getRainfallData:", response); |
| | | return response.data; |
| | | } |
| | | |
| | |
| | | return response.data; |
| | | } |
| | | |
| | | // 按照北京市code查询行政区code |
| | | export async function getAeraCode() { |
| | | const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerCountByDistrict", { |
| | | "dictDisasterGrade": "", |
| | | "dictDisasterType": "", |
| | | "dictRiskLevel": "", |
| | | "districtCode": "110000000000", |
| | | "dictThreatObj": "", |
| | | "year": "2025" |
| | | |
| | | |
| | | // 查询北京市监测设备的数量 |
| | | export async function getDeviceCount(params = {}) { |
| | | const response = await axios.get("/hp/device/statisticsCountyByDeviceType", { |
| | | params |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | // 按照行政区code查询乡镇code |
| | | export async function getAeraTownCode(data) { |
| | | const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getHiddenDangerTownCount", { |
| | | "dictDisasterGrade": "", |
| | | "dictDisasterType": "", |
| | | "dictRiskLevel": "", |
| | | "districtCode": data, |
| | | "dictThreatObj": "", |
| | | "year": "2025" |
| | | // 查询北京市避险场所 |
| | | export async function getSafePoint(data) { |
| | | const response = await axios.get("/hp/safeHavenLocation/getDataSelect", { |
| | | params: { |
| | | divisionId: data |
| | | } |
| | | }); |
| | | return response.data; |
| | | } |
| | | // 110116110218 |
| | | |
| | | |
| | | |
| | | // 查询北京市 |
| | | export async function getAllCode() { |
| | | const response = await axios.get("/hp/district/getAll"); |
| | | return response.data; |
| | | } |
| | | |
| | | // 获取天气预报 |
| | | export async function getWeather() { |
| | | // 获取当前时间戳 |
| | | const currentTimestamp = Date.now(); |
| | | |
| | | // 创建Date对象 |
| | | const currentDate = new Date(currentTimestamp); |
| | | |
| | | // 格式化为年-月-日(YYYY-MM-DD) |
| | | const year = currentDate.getFullYear(); |
| | | const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以要+1 |
| | | const day = String(currentDate.getDate()).padStart(2, '0'); |
| | | const formattedDate = `${year}-${month}-${day}`; |
| | | |
| | | const response = await axios.get("/hp/weatherForecast/getSevenDaysWeather", { |
| | | params: { |
| | | inputDate: formattedDate |
| | | } |
| | | }); |
| | | return response.data; |
| | | } |
| | | |
| | | // 监测设备中关联的隐患点的具体信息 |
| | | export async function hdByDevice(data) { |
| | | const response = await axios.get("/hp/sinoDzHiddenDangerPoint/getDetail", { |
| | | params: { |
| | | unifiedCode: data |
| | | } |
| | | }); |
| | | return response.data; |
| | | } |