165 lines
4.7 KiB
JavaScript
165 lines
4.7 KiB
JavaScript
|
|
import {httpgetPlan1, httppost3, httpget2, httpgetPlan, httppost2} from "../utils/request";
|
||
|
|
import { message } from 'antd';
|
||
|
|
import apiurl from './apiurl';
|
||
|
|
import appconsts from "./appconsts";
|
||
|
|
|
||
|
|
//预案管理-防御预案列表
|
||
|
|
export async function queryDefensePlanApi(params = {}) {
|
||
|
|
const { data, code, msg } = await httpgetPlan(apiurl.preplan.queryDefensePlan,params);
|
||
|
|
if (code !== 200) {
|
||
|
|
message.error(msg || '请求失败');
|
||
|
|
return { list: [], totalRow: 0 };
|
||
|
|
}
|
||
|
|
return { list: data.list, totalRow: data.total };
|
||
|
|
}
|
||
|
|
|
||
|
|
//根据流域编码获取流域信息
|
||
|
|
export async function qryBasicWatershedDetailApi() {
|
||
|
|
const res = await httpget2(apiurl.qryBasicWatershedDetail);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预演预案-预演方案列表
|
||
|
|
export async function getPreviewPlanVOListApi(params = {}) {
|
||
|
|
const res = await httpget2(apiurl.preplan.getPreviewPlanVOList, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预演预案-预案管理文字展示加echarts图表
|
||
|
|
export async function previewPlanDetailsApi(params = {}) {
|
||
|
|
const res = await httppost3(apiurl.preplan.previewPlanDetails,params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预演预案-降雨监测
|
||
|
|
export async function statisticsApi(params = {}) {
|
||
|
|
const res = await httppost3(apiurl.preplan.statistics,params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预演预案-对照信息
|
||
|
|
export async function getPreviewPlanComparisonInfoApi(params = {}) {
|
||
|
|
const res = await httpget2(apiurl.preplan.getPreviewPlanComparisonInfo, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预演预案-防御建议
|
||
|
|
export async function getPreviewPlanDefenseSuggestionApi(params = {}) {
|
||
|
|
const res = await httpget2(apiurl.preplan.getPreviewPlanDefenseSuggestion, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//预案 县级树
|
||
|
|
export async function getAdcdTreeByAdcdApi(params = {}) {
|
||
|
|
const res = await httpgetPlan(apiurl.preplan.getAdcdTreeByAdcd, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res.data;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案 行政区划查询树
|
||
|
|
export async function queryAdcdTreeHBByADCDApi(params = {}) {
|
||
|
|
const res = await httpgetPlan(apiurl.preplan.queryAdcdTreeHBByADCD, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res.data || [];
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案删除
|
||
|
|
export async function planDeleteAttachApi(params = {}) {
|
||
|
|
const res = await httpgetPlan1(apiurl.preplan.planDeleteAttach, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案可视化-预案列表
|
||
|
|
export async function queryDefensePlanKshApi(params = {}) {
|
||
|
|
const { data, code, msg } = await httpgetPlan(apiurl.preplan.queryDefensePlanKsh,params);
|
||
|
|
if (code !== 200) {
|
||
|
|
message.error(msg || '请求失败');
|
||
|
|
return { list: [], totalRow: 0 };
|
||
|
|
}
|
||
|
|
return { list: data.list, totalRow: data.total };
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案可视化-点击预案列表的某一条数据看详情
|
||
|
|
export async function getInfoByAdcdApi(params = {}) {
|
||
|
|
const res = await httpgetPlan(apiurl.preplan.getInfoByAdcd, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案可视化-风险网格-风险统计
|
||
|
|
export async function getRiskInfoApi(params = {}) {
|
||
|
|
const res = await httpgetPlan(apiurl.preplan.getRiskInfo, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案可视化-组织架构-机构详情
|
||
|
|
export async function getStructure(params = {}) {
|
||
|
|
const res = await httpgetPlan(apiurl.preplan.getStructure, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案可视化-结构化预案-防汛值班电话
|
||
|
|
export async function getBasicFloodControl(params = {}) {
|
||
|
|
const res = await httppost3(apiurl.preplan.getBasicFloodControl, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
//预案可视化-结构化预案-基本情况
|
||
|
|
export async function getStructuredPlan(params = {}) {
|
||
|
|
const res = await httpgetPlan(apiurl.preplan.getStructuredPlan, params);
|
||
|
|
if (res.code !== 200) {
|
||
|
|
message.error(res.msg || '请求失败');
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|