| | |
| | | }); |
| | | }, intervalTime); |
| | | } |
| | | |
| | | // 获取隐患点清单 |
| | | export async function getDangerPoint(data) { |
| | | const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", { |
| | | filterObject: { |
| | | year: 2024, // 动态传入的年份参数 |
| | | }, |
| | | }); |
| | | console.log("getDangerPoint:", response); |
| | | return response.data; |
| | | } |
| | | // 获取避险位置 |
| | | export async function getSafeLocation(data) { |
| | | const response = await axios.post("/hp/safeHavenLocation/getData", { |
| | | filterObject: { |
| | | year: 2024, // 动态传入的年份参数 |
| | | }, |
| | | }); |
| | | console.log("getSafeLocation:", response); |
| | | return response.data; |
| | | } |
| | | // 获取避险线路 |
| | | export async function getEscapeRoute(data) { |
| | | const response = await axios.post("/hp/escapeRoute/getData", { |
| | | filterObject: { |
| | | year: 2024, // 动态传入的年份参数 |
| | | }, |
| | | }); |
| | | console.log("getEscapeRoute:", response); |
| | | return response.data; |
| | | } |
| | | // 获取传感器列表 |
| | | export async function getSensor(data) { |
| | | const response = await axios.post("/hp/sensor/getData", { |
| | | filterObject: { |
| | | year: 2024, // 动态传入的年份参数 |
| | | }, |
| | | }); |
| | | console.log("getSensor:", response); |
| | | return response.data; |
| | | } |
| | | // 获取雨量数据 |
| | | export async function getRainfallData(year) { |
| | | try { |
| | | const response = await axios.post("/hp/rainfallCountyCity/getData", { |
| | | filterObject: { |
| | | year: 2024, // 动态传入的年份参数 |
| | | }, |
| | | }); |
| | | console.log("Response:", response); // 打印完整响应(调试用) |
| | | return response.data; // 假设后端返回的数据在 response.data 中 |
| | | } catch (error) { |
| | | console.error( |
| | | "Error fetching rainfall data:", |
| | | error.response ? error.response.data : error.message |
| | | ); |
| | | throw error; // 抛出错误以便调用方处理 |
| | | } |
| | | export async function getRainfallData(data) { |
| | | const response = await axios.post("/hp/rainfallCountyCity/getData", { |
| | | filterObject: { |
| | | year: 2024, // 动态传入的年份参数 |
| | | }, |
| | | }); |
| | | console.log("getRainfallData:", response); |
| | | return response.data; |
| | | } |