137 lines
2.9 KiB
JavaScript
137 lines
2.9 KiB
JavaScript
import {
|
|
httppost,
|
|
httppost1,
|
|
httppost2,
|
|
httpget,
|
|
httpget2
|
|
} from '../utils/request'
|
|
import { message } from 'antd'
|
|
import apiurl from './apiurl'
|
|
|
|
//山洪预警
|
|
export async function shWarn (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.dqxsfx.shwarn, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
|
|
//水库预警
|
|
export async function skWarn (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.dqxsfx.skwarn, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
|
|
//河道预警
|
|
export async function hdWarn (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.dqxsfx.hdwarn, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
|
|
// 降雨分析
|
|
export async function rainfallAnalysis (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.fxdd.dqxsfx.list, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
// 山洪预警
|
|
export async function floodWarn (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.fxdd.warnSH.list, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
// 山洪预警
|
|
export async function warnSK (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.fxdd.warnSK.list, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
|
|
// 7天天气预报
|
|
export async function sevenDays (params) {
|
|
const { data, code, msg } =
|
|
(await httpget2(apiurl.tqyb.sevenDays, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
// 24小时水库
|
|
export async function weatherRes (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.tqyb.weatherRes, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
|
|
export async function weatherasin (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.tqyb.weatherasin, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
|
|
export async function weatherArea (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.tqyb.weatherArea, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
|
|
export async function weatherLevel (params) {
|
|
const { data, code, msg } =
|
|
(await httppost(apiurl.tqyb.weatherLevel, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败')
|
|
}
|
|
return data
|
|
}
|
|
// short
|
|
|
|
export async function short (params) {
|
|
const { data, code, msg, description } =
|
|
(await httppost(apiurl.tqyb.short, params)) || {}
|
|
|
|
if (code !== 200) {
|
|
message.error(description || '请求失败')
|
|
return { data: [] }
|
|
}
|
|
return { data, code, msg }
|
|
}
|