547 lines
13 KiB
JavaScript
547 lines
13 KiB
JavaScript
import { httppost1, httppost2, httpget, httpget2 } from "../utils/request";
|
|
import { message } from 'antd';
|
|
import apiurl from './apiurl';
|
|
import appconsts from '../service/appconsts';
|
|
|
|
//监测预警的列表数据
|
|
export async function page(params = {}) {
|
|
const myParams = {
|
|
countycode:localStorage.getItem('ADCD6') + '000000',
|
|
...params
|
|
}
|
|
|
|
const { data, code, msg } = await httppost2(apiurl.warn.mWPeriodQuery,myParams) || {};
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return { list: [], totalRow: 0 };
|
|
}
|
|
return { list: data.records, totalRow: data.total };
|
|
}
|
|
export async function getVideoTreeData(params = {}) {
|
|
const { data, code, msg } = await httppost2(apiurl.rcgl.aqgl.fxgkqd.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
return data;
|
|
}
|
|
|
|
export async function getXjTreeData(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.rcgl.xcxj.xjxpz.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
return data;
|
|
}
|
|
|
|
export async function getjdTreeData(params = {}) {
|
|
const { data, code, msg } = await httppost2(apiurl.sbwh.spbjgl.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
return data;
|
|
}
|
|
//获取行政区划树下拉 中电科接口
|
|
export async function getAdcdTreeData() {
|
|
const { data, code, msg } = await httpget(apiurl.getTreeData);
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
return data;
|
|
}
|
|
|
|
//获取行政区划树下拉 外协接口
|
|
export async function getAdcdTreeData1(params = {}) {
|
|
const myParams = {
|
|
adcd:localStorage.getItem('ADCD6'),
|
|
...params
|
|
}
|
|
|
|
const { data, code, msg } = await httppost2(apiurl.selectList,myParams) || {};
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
return data;
|
|
}
|
|
|
|
//获取行政区划树下拉
|
|
export async function getAdcdTreeData2(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.adcdTree.zqTree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
let newData = data.map(item => ({
|
|
sname:item.adnm,
|
|
code:item.adcd,
|
|
tag:1
|
|
}))
|
|
const list = [
|
|
{
|
|
sname:'咸丰县',
|
|
code: '422826',
|
|
status:1,
|
|
// disabled: true,
|
|
children:newData
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
|
|
//获取预案修编行政区划树下拉
|
|
export async function getYaxbAdcdTreeData(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.yaxb.adcdTree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
let newData = data.children?.map(item => ({
|
|
sname:item.adnm,
|
|
code: item.adcd,
|
|
status: item.status,
|
|
tag:1
|
|
}))
|
|
const list = [
|
|
{
|
|
sname:data.adnm,
|
|
code: data.adcd,
|
|
status:1,
|
|
// disabled: true,
|
|
children:newData
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
//获取组织机构行政区划树下拉
|
|
export async function getZzjgAdcdTreeData(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.zzjg.zq.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
let newData = data.children?.map(item => ({
|
|
sname:item.adnm,
|
|
code:item.adcd,
|
|
tag:1
|
|
}))
|
|
const list = [
|
|
{
|
|
sname:data.adnm,
|
|
code: data.adcd,
|
|
status:1,
|
|
// disabled: true,
|
|
children:newData
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
|
|
//获取行政区划树下拉
|
|
export async function getAdcdTreeData3(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.qswl.zq.zqTree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
const list = [
|
|
{
|
|
adnm: data.adnm,
|
|
adcd: data.adcd,
|
|
status: data.status,
|
|
children: data.children
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
|
|
//获取行政区划树下拉
|
|
export async function getAdcdTreeData6(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.qsdw.zq.zqTree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
const list = [
|
|
{
|
|
adnm: data.adnm,
|
|
adcd: data.adcd,
|
|
status: data.status,
|
|
children: data.children
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
|
|
export async function getAdcdTreeData7(params = {}) {
|
|
const { data, code, msg } = await httppost2(apiurl.gcaqjc.sjtjcx.czcx.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
|
|
return data;
|
|
}
|
|
//获取工程树下拉
|
|
export async function getGcTreeData4(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.qswl.zq.gcTree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
const list = [
|
|
{
|
|
name:'水库工程',
|
|
code:'0000001',
|
|
disabled: true,
|
|
children:data['1']
|
|
},
|
|
{
|
|
name:'水电站工程',
|
|
code:'0000002',
|
|
disabled: true,
|
|
children:data['2']
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
|
|
|
|
//获取工程树下拉
|
|
export async function getGcTreeData5(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.qsdw.zq.gcTree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
const list = [
|
|
{
|
|
name:'水库工程',
|
|
code:'0000001',
|
|
disabled: true,
|
|
children:data['1']
|
|
},
|
|
{
|
|
name:'水电站工程',
|
|
code:'0000002',
|
|
disabled: true,
|
|
children:data['2']
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
//获取通讯人员树下拉
|
|
export async function getTxTreeData(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.adcdTree.txTree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
return data;
|
|
}
|
|
|
|
const handleTreeData = (arr) => {
|
|
let newArr1=[];
|
|
let newArr2=[];
|
|
if (!Array.isArray(arr)) return
|
|
arr.forEach(item => {
|
|
if (item.type == 1) {
|
|
// debugger
|
|
newArr1.push({
|
|
sname:item.name + `${item.isDanger == 1 ? '(病)' :''}`,
|
|
code: item.code,
|
|
status: item.status,
|
|
type:item.type
|
|
})
|
|
} else {
|
|
newArr2.push({
|
|
sname:item.name + `${item.isDanger == 1 ? '(病)': ''}`,
|
|
code: item.code,
|
|
status: item.status ,
|
|
type:item.type
|
|
})
|
|
}
|
|
})
|
|
return {
|
|
"1": newArr1,
|
|
"2": newArr2
|
|
}
|
|
}
|
|
|
|
const handleTreeData1 = (arr) => {
|
|
let newArr1=[];
|
|
let newArr2=[];
|
|
if (!Array.isArray(arr)) return
|
|
arr.forEach(item => {
|
|
if (item.type == 1) {
|
|
newArr1.push({
|
|
sname:item.name + `${item.isDandger == 1 ? '(病)' :''}`,
|
|
code: item.code,
|
|
type: item.type,
|
|
status:1
|
|
})
|
|
} else {
|
|
newArr2.push({
|
|
sname:item.name + `${item.isDandger == 1 ? '(病)': ''}`,
|
|
code: item.code,
|
|
type: item.type,
|
|
status:1
|
|
})
|
|
}
|
|
})
|
|
return {
|
|
"1": newArr1,
|
|
"2": newArr2
|
|
}
|
|
}
|
|
//获取工程树下拉
|
|
export async function getGcTreeData(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.gcTree.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
const list = [
|
|
{
|
|
sname:'水库工程',
|
|
code:'0000001',
|
|
disabled: true,
|
|
status:1,
|
|
children:handleTreeData1(data)["1"]
|
|
},
|
|
{
|
|
sname:'水电站工程',
|
|
code:'0000002',
|
|
disabled: true,
|
|
status:1,
|
|
children:handleTreeData1(data)["2"]
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
|
|
//获取工程整修树下拉
|
|
export async function getGczxGcTreeData(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.gczx.ytygc.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
const list = [
|
|
{
|
|
sname:'水库工程',
|
|
code:'0000001',
|
|
disabled: true,
|
|
status: 1,
|
|
type:1,
|
|
children:handleTreeData(data)["1"]
|
|
},
|
|
{
|
|
sname:'水电站工程',
|
|
code:'0000002',
|
|
disabled: true,
|
|
status: 1,
|
|
type:2,
|
|
children:handleTreeData(data)["2"]
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
|
|
//获取预案修编树下拉
|
|
export async function getYaxbGcTreeData(params = {}) {
|
|
const { data, code, msg } = await httpget2(apiurl.fxzb.yaxb.tree) || {};
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return [];
|
|
}
|
|
const list = [
|
|
{
|
|
sname:'水库工程',
|
|
code:'0000001',
|
|
disabled: true,
|
|
status:1,
|
|
children:handleTreeData(data)["1"]
|
|
},
|
|
{
|
|
sname:'水电站工程',
|
|
code:'0000002',
|
|
disabled: true,
|
|
status:1,
|
|
children:handleTreeData(data)["2"]
|
|
}
|
|
]
|
|
return list;
|
|
}
|
|
//发布内部预警
|
|
export async function issueAlertNBApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.InternalWarning,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//发布外部预警
|
|
export async function issueAlertWBApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.ExternalEarlyWarning,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//灾情上报
|
|
export async function disasterReporteApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.disasterReporting,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//关闭预警
|
|
export async function closeAlertApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.closeAlert,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//查询处置完成后的数据
|
|
export async function disposalProcessApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.disposalProcess,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//根据warnid查这条预警数据的所有短信发送记录 httppost1
|
|
export async function getAllWarnMsg(warnid) {
|
|
const { data, code, msg } = await httppost1(apiurl.warn.getAllWarnMsgByWarnid, { warnid }) || {};
|
|
|
|
return { data, code, msg };
|
|
}
|
|
|
|
//监测预警关联防灾对象查询
|
|
export async function warnDisasterPreventionInfoApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.WarnDisasterPreventionInfo,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//预警发送记录
|
|
export async function queryWarningSendingRecordApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.queryWarningSendingRecord,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//监测预警短信添加接收人(内部)
|
|
export async function queryJcyjdxjsrNbListApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.queryJcyjdxjsrNbList,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//监测预警短信添加接收人(外部)
|
|
export async function queryJcyjdxjsrWbListApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.queryJcyjdxjsrWbList,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//预警配置信息
|
|
export async function warnConfigInfoApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.WarnConfigInfo,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//自定义发送短信
|
|
export async function sendMessageApi(params = {}) {
|
|
const res = await httppost2(apiurl.customSMS.sendMessage,params) || {};
|
|
|
|
return res;
|
|
}
|
|
//行政区、部门、人员树
|
|
export async function selectListByAdcdForeachApi(params = {}) {
|
|
const myParams = {
|
|
adcd:localStorage.getItem('ADCD6'),
|
|
...params
|
|
}
|
|
|
|
const res = await httppost2(apiurl.customSMS.selectListByAdcdForeach,myParams) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//行政区、部门
|
|
export async function selectAdcdDeptApi(params = {}) {
|
|
const myParams = {
|
|
adcd:localStorage.getItem('ADCD6'),
|
|
...params
|
|
}
|
|
|
|
const res = await httppost2(apiurl.informationManagement.warningPersonConfig.selectAdcdDept,myParams) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//自定义短信管理 分页查询
|
|
export async function customsmsPage(params = {}) {
|
|
const myParams = {
|
|
countycode:localStorage.getItem('ADCD6') + '000000',
|
|
...params,
|
|
"sortField": "SENDTM",
|
|
"sortOrder": "desc",
|
|
type: 5
|
|
};
|
|
|
|
const { data, code, msg } = await httppost2(apiurl.customSMS.findMessageInfo,myParams) || {};
|
|
|
|
if (code !== 200) {
|
|
message.error(msg || '请求失败');
|
|
return { list: [], totalRow: 0 };
|
|
}
|
|
return { list: data.records, totalRow: data.total };
|
|
}
|
|
|
|
//根据foreignid查短信发送记录
|
|
export async function findMessageDetailsApi(params) {
|
|
const data = await httppost2(apiurl.customSMS.findMessageDetails, params) || {};
|
|
|
|
return data;
|
|
}
|
|
|
|
//新增监测预警
|
|
export async function newWarnApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.newWarn,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//关联防灾对象雨情
|
|
export async function getFZDXYLApi(params = {}) {
|
|
const res = await httppost2(apiurl.warn.getFZDXYL,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//动态预警指标
|
|
export async function getWarnTarget(params = {}) {
|
|
const res = await httpget2(apiurl.warn.getWarnTarget,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//动态预警指标
|
|
export async function getWarnTargetItem(params = {}) {
|
|
const res = await httppost2(apiurl.warn.getWarnTargetItem+params.adcd+'/'+params.lwater,params) || {};
|
|
|
|
return res;
|
|
}
|
|
|
|
//动态预警指标雨量
|
|
export async function getWarnRainData(params = {}) {
|
|
const res = await httpget2(apiurl.warn.getWarnRainData,params) || {};
|
|
|
|
return res;
|
|
} |