feat(): 登录接口调试

master
李神峰 2025-02-08 17:57:44 +08:00
parent a77dade83a
commit 585bf6ccd5
51 changed files with 692 additions and 286 deletions

View File

@ -278,7 +278,7 @@ const AdcdTree = ({ setAdInfo, showNum, treeUpData, disabled = [], audit, adcd,
if (disabled.indexOf(e.node.adlevel) !== -1) {
return;
}
if (e.node.adlevel <= user.adlevel) {
if (e.node.adlevel < user.adlevel) {
return;
}
const list = [...expandedKeys]

View File

@ -177,11 +177,10 @@ const OlMap = ({position, getPoint, getPointGeoJson, style, current, mode, adcd,
//加载行政边界
const createBoundary = async (adcd) => {
let params = {adcd : adcd}
let geometry = {}
let zoom = 8
const getBoundary = ()=>{ httppost(apiurl.service.adcd.boua,params).then(res => {
const getBoundary = (adcd)=>{ httppost(apiurl.service.adcd.boua,{adcd}).then(res => {
if (res.data){ //是否有行政边界,
try{
geometry = res.data.geometry
@ -199,18 +198,27 @@ const OlMap = ({position, getPoint, getPointGeoJson, style, current, mode, adcd,
// maxZoom : zoom
})
}catch{}
} else { //没有就显示上一级
params.adcd = params.adcd.replace(/\.?0+$/, "")
params.adcd = params.adcd.slice(0,params.adcd.length -3)
params.adcd = params.adcd.padEnd(15,'0')
const a = adcd.replace(/\.?0+$/, "")
const b = a.substring(0,a.length-3)
let c = b
for (let i=0; i<(15-b.length);i++){
c = c+'0'
}
// params.adcd = params.adcd.replace(/\.?0+$/, "")
// params.adcd = params.adcd.slice(0,params.adcd.length -3)
// params.adcd = params.adcd.padEnd(15,'0')
// console.log(params.adcd,'params')
getBoundary()
if(c!=='000000000000000'){
getBoundary(c)
}
}
// console.log(geometry,'ceshi')
}, err => {console.log(err.message)})
}
getBoundary()
getBoundary(adcd)
}

View File

@ -0,0 +1,211 @@
import React,{useState,useEffect} from 'react'
import { Upload, Row, Col,Image,message } from "antd"
import { DeleteOutlined, FileWordOutlined, FilePdfOutlined,FileJpgOutlined, FileZipOutlined, FilePptOutlined, FileExcelOutlined } from '@ant-design/icons';
import './index.less'
import { httpget, httpGetFile, httppost } from '../../utils/request';
import apiurl from '../../models/apiurl.js'
const { Dragger } = Upload;
export default function FileUpload({ mode,businessId,groupId,ids,onCrudSuccess }) {
const user = JSON.parse(sessionStorage.getItem('user'))
const [fileList, setFileList] = useState([]) //上传文件列表
const [fileIds, setFileIds] = useState([])
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const [loading, setLoading] = useState(false)
/**
* @description 删除上传的图片
* @param {string} id 删除的id
*/
const deleteFile = async(fileId) => {
let filterFile = fileList.filter(item => item.response?.data?.fileId !== fileId);
setFileList(filterFile)
// const res = await httppost(apiurl.service.xly.saveFileNotDel, {
// files: filterFile.map(item => ({ ...item, response: undefined, name: undefined })),
// businessId: businessId,
// groupId: groupId,
// });
// if (res.code == 200) {
// setFileList(filterFile)
// message.success("删除成功")
// }
}
const fileChange = (info) => {
if (info.file.status === "done") {
setLoading(false);
}
if (info.file.status === "uploading") {
setLoading(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
}
let fileIds = info.fileList.map(file => {
return file.response?.data?.fileId
})
setFileIds(fileIds)
setFileList(info.fileList)
console.log("info.fileList",info.fileList);
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (params) => {
let downloadLink = document.createElement("a");
// downloadLink.href = `http://192.168.66.7:20010/fileAssociations/downloadFile/${params?.fileId}`;
// downloadLink.href = `http://192.168.66.199:20010/fileAssociations/downloadFile/${params?.fileId}`;
downloadLink.href = `http://223.75.53.141:81/shzh/jcsj/fileAssociations/downloadFile/${params?.fileId}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
/**
* @description pdf文件预览
* @param {String} params 文件预览url
*/
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
}
// 获取文件列表
const getFileData = async () => {
try {
const res = await httpget(apiurl.service.xly.getFiles, {
businessId: businessId,
groupId:groupId
})
if (res.code == 200) {
setFileList(res.data.map(file => ({...file,name:file.fileName,response:{data:{name:file.fileName,fileId:file.fileId}}})))
setFileIds(res.data.map(item => item.response?.data?.fileId))
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
if (mode != "save") {
getFileData()
}
}, [mode])
useEffect(() => {
if (ids && mode != "view") {
const res = httppost(apiurl.service.xly.saveFileNotDel, {
files: fileList.map(item => ({ ...item.response.data})),
businessId: ids,
groupId: groupId,
}).then((res)=>{
if(onCrudSuccess){
onCrudSuccess()
}
});
}
}, [ids,mode])
return (
<div>
{mode !== "view" &&
<Dragger
name='file'
// multiple
action="/shzh/jcsj/fileAssociations/uploadFile"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
disabled={loading}
showUploadList={false}
data={{
groupId: groupId,
// businessId:businessId,
userId:user.userId
}}
// onSuccess={handleSuccess}
>
<p className="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p className="ant-upload-hint">
支持扩展名.rar .zip .doc .docx .pdf .jpg .png .ppt
</p>
</Dragger>
}
<Row gutter={[16]}>
{
loading ? <span>文件正在上传中请等待</span> :
fileList.length > 0 && fileList.map(file => {
return (
<Col span={12}>
<div className={mode == "view" ? 'file-item view-file' : 'file-item'}>
<div className='file-description'>
{file.name.indexOf('.docx') > -1 ?
<div
onClick={() => { download(file.response?.data) }}
style={{ cursor: 'pointer' }}
>
<FileWordOutlined
style={{ fontSize: 40 }}
/>
</div>
:
file.name.indexOf('.pdf') > -1 ?
<div
onClick={() => { download(file.response?.data) }}
style={{ cursor: 'pointer' }}
>
<FilePdfOutlined style={{ fontSize: 40 }} />
</div>
:
file.name.indexOf('.zip') > -1 ?
<div
onClick={() => { download(file.response?.data) }}
style={{ cursor: 'pointer' }}
>
<FileZipOutlined style={{ fontSize: 40 }} />
</div>
:
file.name.indexOf('.ppt') > -1 ?
<div
onClick={() => { download(file.response?.data) }}
style={{ cursor: 'pointer' }}
>
<FilePptOutlined style={{ fontSize: 40 }} />
</div> :
file.name.indexOf('.xlsx') > -1 ?
<div
onClick={() => { download(file.response?.data) }}
style={{ cursor: 'pointer' }}
>
<FileExcelOutlined style={{ fontSize: 40 }} />
</div>
:
<FileJpgOutlined style={{ fontSize: 40 }} onClick={() => { download(file.response?.data) }} />
}
<span>{file.name}</span>
</div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
<DeleteOutlined />
</div>
</div>
</Col>
)
})
}
</Row>
</div>
)
}

View File

@ -0,0 +1,23 @@
.file-item{
display: flex;
width: 100%;
margin-top: 10px !important;
align-items: center;
border: 1px solid #dedede;
justify-content: space-between;
padding: 1%;
.file-description{
display: flex;
align-items: center;
column-gap: 10px;
img{
width: 40px;
height: 40px;
// margin-right: 10px;
}
}
.delete-icon{
// margin-left: 1%;
cursor: pointer;
}
}

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import { Form, Button, Input, Row, Col, message, Select, Switch, Table } from 'antd';
import { formItemLayout, btnItemLayout } from '../Crud/FormLayoutProps'
import { validPhone } from '../../utils/validators'
@ -14,13 +14,14 @@ import { useDispatch, useSelector } from 'react-redux';
const EditInfo = ({ mode, record, url, add, detailUrl, onCrudSuccess, close, onSelect, getForm,isApproval }) => {
// console.log(mode,'mode');
console.log(record,'record-----------');
const [form] = Form.useForm();
const [showMap, setShowMap] = useState(false)
const [splitAdcdCode,setAdcd] = useState(false)
const [beforeData,setBeforeData] = useState('')
const [beforeData,setBeforeData] = useState(record?.adcd?.substring(12,15)==='000'?record?.vigcd?.substring(0,12):record?.vigcd?.substring(0,15))
const [endData,setEndData] = useState('')
const formParams = useSelector(state => state.session.formParams)
console.log(formParams,'formParams');
let mapObj={
0:[[0,2],[2,15]],
@ -40,32 +41,46 @@ const EditInfo = ({ mode, record, url, add, detailUrl, onCrudSuccess, close, onS
]
const splitAdcd=()=>{
let adcd = ''
let arr=[]
debugger;
mapObj[record.adlevel].forEach(item=>{
const codeShen = record.dand.slice(item[0], item[1])
// const splitAdcd=()=>{
// let adcd = ''
// let arr=[]
// debugger;
// mapObj[record.adlevel].forEach(item=>{
// const codeShen = record.dand.slice(item[0], item[1])
arr.push(codeShen)
})
setAdcd(arr)
if(record.adlevel == 0){
setBeforeData('')
setEndData(arr[1])
adcd=arr[0]
}else if(record.adlevel == 5){
setBeforeData(arr[0])
setEndData('')
adcd=arr[1]
// arr.push(codeShen)
// })
// setAdcd(arr)
// if(record.adlevel == 0){
// setBeforeData('')
// setEndData(arr[1])
// adcd=arr[0]
// }else if(record.adlevel == 5){
// setBeforeData(arr[0])
// setEndData('')
// adcd=arr[1]
// }else{
// setBeforeData(arr[0])
// setEndData(arr[2])
// adcd=arr[1]
// }
// return adcd
// }
const getDand = (rule, value, callback)=> {
if(record?.adcd?.substring(12,15)==='000'){
//是行政村12位
if(value.length!==8){
callback('请补充8位危险区编码位');
}
}else{
setBeforeData(arr[0])
setEndData(arr[2])
adcd=arr[1]
if(value.length!==5){
callback('请补充5位危险区编码位');
}
}
return adcd
}
}
const onFinish = (values) => {
@ -161,7 +176,7 @@ const EditInfo = ({ mode, record, url, add, detailUrl, onCrudSuccess, close, onS
<Form.Item
label="危险区编码"
name="dand"
rules={[{ required: true }]}
rules={[{ validator: getDand , required: true }]}
>
<Input addonBefore={<span>{beforeData}</span>} suffix={<span>{endData}</span>} disabled={ mode === 'view'} style={{ width: '100%' }} />
</Form.Item>

View File

@ -5,7 +5,7 @@ import EditInfo from './editInfo'
import TransformRoute from './transformRoute'
import Settlements from './settlements'
import './index.less'
import { useEffect, useState, useRef, createRef } from 'react'
import { useEffect, useState, useMemo, createRef } from 'react'
import apiUrl from '../../models/apiurl'
import { arr } from './data'
import { Row, Col, Button, Alert, message } from 'antd'
@ -20,6 +20,9 @@ const XzqhbgForm = (props) => {
const formParams = useSelector(state => state.session.formParams)
const geometry = useSelector(state => state.session.geometry)
const dispatch = useDispatch()
const isXzc = useMemo(()=>{
return props?.record?.adcd?.substring(12,15)==='000'
},[props]) //是行政村12位
const onSelect = (index) => {
setCurrent(index)
@ -32,17 +35,18 @@ const XzqhbgForm = (props) => {
}
const audit = () => {
const myDand = (isXzc?formParams?.vigcd?.substring(0,12):formParams?.vigcd?.substring(0,15)) + formParams.dand
try {
if(formParams.dand.length !== 18){
message.error('危险区编码应为18位')
return;
if(myDand.length !== 20){
message.error('请正确填写危险区编码')
return
}
if ((Object.keys(formParams).length != 0) && (Object.keys(geometry).length != 0)) {
let params = formParams
let params = {...formParams}
params.geometry = JSON.stringify(geometry)
params.adcd = props.record.adcd
console.log(params, '传参')
params.dand = myDand
console.log(params, '提交1')///
httppost(apiUrl.service.wxq.addAudit, params).then(res => {
console.log(res)
close()
@ -58,16 +62,18 @@ const XzqhbgForm = (props) => {
}
const save = () => {
if (props.mode == 'save') {
const myDand = (isXzc?formParams?.vigcd?.substring(0,12):formParams?.vigcd?.substring(0,15)) + formParams?.dand
try {
if(formParams.dand.length !== 18){
message.error('危险区编码应为18位')
return;
if(myDand.length !== 20){
message.error('请正确填写危险区编码')
return
}
if ((Object.keys(formParams).length != 0) && (Object.keys(geometry).length != 0)) {
let params = formParams
let params = {...formParams}
params.geometry = JSON.stringify(geometry)
params.adcd = props.record.adcd
console.log(params, '传参')
params.dand = myDand
console.log(params, '保存1')
httppost(apiUrl.service.wxq.add, params).then(res => {
console.log(res)
close()
@ -80,16 +86,24 @@ const XzqhbgForm = (props) => {
} catch { }
} else if (props.mode == 'edit') {
let myDand = ''
if(Object.keys(formParams).length===0){
myDand = (isXzc?props?.record?.vigcd?.substring(0,12):props?.record?.vigcd?.substring(0,15)) + props?.record?.dand
}else{
myDand = (isXzc?formParams?.vigcd?.substring(0,12):formParams?.vigcd?.substring(0,15)) + formParams?.dand
}
try {
if(formParams.dand.length !== 18){
message.error('危险区编码应为18位')
return;
if(myDand.length !== 20){
message.error('请正确填写危险区编码')
return
}
let params = {
...props.record,
}
if ((Object.keys(formParams).length != 0)) {
params = formParams
params = {...formParams}
params.adcd = props.record.adcd
params.id = props.record.id
}
@ -98,7 +112,8 @@ const XzqhbgForm = (props) => {
// console.log(params,'传参')
}
// console.log(params,props.record,'传参')
params.dand = myDand
console.log(params,'保存1')
if ((Object.keys(formParams).length != 0) && (Object.keys(geometry).length != 0)) {
}
@ -112,9 +127,16 @@ const XzqhbgForm = (props) => {
const submit = () => {
if (props.mode == 'edit') {
let myDand = ''
if(Object.keys(formParams).length===0){
myDand = (isXzc?props?.record?.vigcd?.substring(0,12):props?.record?.vigcd?.substring(0,15)) + props?.record?.dand
}else{
myDand = (isXzc?formParams?.vigcd?.substring(0,12):formParams?.vigcd?.substring(0,15)) + formParams?.dand
}
try {
if(formParams.dand.length !== 18){
message.error('危险区编码应为18位')
if(myDand.length !== 20){
message.error('请正确填写危险区编码')
return;
}
let params = {
@ -122,17 +144,18 @@ const XzqhbgForm = (props) => {
reviewStatus: 1
}
if ((Object.keys(formParams).length != 0)) {
params = formParams
params = {...formParams}
params.adcd = props.record.adcd
params.id = props.record.id
params.reviewStatus = 1
}
params.dand = myDand
if ((Object.keys(geometry).length != 0)) {
params.geometry = JSON.stringify(geometry)
console.log(params, '传参')
}
// console.log(params,props.record,'传参')
console.log(params,'提交2')
httppost(apiUrl.service.wxq.update, params).then(res => {
console.log(res)
close()

View File

@ -47,46 +47,46 @@ const optionsVal = {
jhgldw:{
arr:[
{value: 1, label:'1-部水文局'},
{value: 2, label:'2-长江委水文局'},
{value: 3, label:'3-黄委水文局'},
{value: 4, label:'4-淮委水文局'},
{value: 5, label:'5-松辽委水文局'},
{value: 6, label:'6-珠江委水文局'},
{value: 7, label:'7-海委水文局'},
{value: 8, label:'8-太湖局水文局'},
{value: 9, label:'9-北京水文局'},
{value: 10, label:'10-天津水文局'},
{value: 11, label:'11-河北水文局'},
{value: 12, label:'12-山西水文局'},
{value: 13, label:'13-内蒙古水文局'},
{value: 14, label:'14-辽宁水文局'},
{value: 15, label:'15-吉林水文局'},
{value: 16, label:'16-黑龙江水文局'},
{value: 17, label:'17-上海水文局'},
{value: 18, label:'18-江苏水文局'},
{value: 19, label:'19-浙江水文局'},
{value: 20, label:'20-安徽水文局'},
{value: 21, label:'21-福建水文局'},
{value: 22, label:'22-江西水文局'},
{value: 23, label:'23-山东水文局'},
{value: 24, label:'24-河南水文局'},
{value: 25, label:'25-湖北水文局'},
{value: 26, label:'26-湖南水文局'},
{value: 27, label:'27-广东水文局'},
{value: 28, label:'28-广西水文局'},
{value: 29, label:'29-海南水文局'},
{value: 30, label:'30-重庆水文局'},
{value: 31, label:'31-四川水文局'},
{value: 32, label:'32-贵州水文局'},
{value: 33, label:'33-云南水文局'},
{value: 34, label:'34-西藏水文局'},
{value: 35, label:'35-陕西水文局'},
{value: 36, label:'36-甘肃水文局'},
{value: 37, label:'37-青海水文局'},
{value: 38, label:'38-宁夏水文局'},
{value: 39, label:'39-新疆水文局'},
{value: 40, label:'40-兵团水文局'},
{value: '1', label:'1-部水文局'},
{value: '2', label:'2-长江委水文局'},
{value: '3', label:'3-黄委水文局'},
{value: '4', label:'4-淮委水文局'},
{value: '5', label:'5-松辽委水文局'},
{value: '6', label:'6-珠江委水文局'},
{value: '7', label:'7-海委水文局'},
{value: '8', label:'8-太湖局水文局'},
{value: '9', label:'9-北京水文局'},
{value: '10', label:'10-天津水文局'},
{value: '11', label:'11-河北水文局'},
{value: '12', label:'12-山西水文局'},
{value: '13', label:'13-内蒙古水文局'},
{value: '14', label:'14-辽宁水文局'},
{value: '15', label:'15-吉林水文局'},
{value: '16', label:'16-黑龙江水文局'},
{value: '17', label:'17-上海水文局'},
{value: '18', label:'18-江苏水文局'},
{value: '19', label:'19-浙江水文局'},
{value: '20', label:'20-安徽水文局'},
{value: '21', label:'21-福建水文局'},
{value: '22', label:'22-江西水文局'},
{value: '23', label:'23-山东水文局'},
{value: '24', label:'24-河南水文局'},
{value: '25', label:'25-湖北水文局'},
{value: '26', label:'26-湖南水文局'},
{value: '27', label:'27-广东水文局'},
{value: '28', label:'28-广西水文局'},
{value: '29', label:'29-海南水文局'},
{value: '30', label:'30-重庆水文局'},
{value: '31', label:'31-四川水文局'},
{value: '32', label:'32-贵州水文局'},
{value: '33', label:'33-云南水文局'},
{value: '34', label:'34-西藏水文局'},
{value: '35', label:'35-陕西水文局'},
{value: '36', label:'36-甘肃水文局'},
{value: '37', label:'37-青海水文局'},
{value: '38', label:'38-宁夏水文局'},
{value: '39', label:'39-新疆水文局'},
{value: '40', label:'40-兵团水文局'},
]
}

View File

@ -1,4 +1,4 @@
import { Layout } from 'antd';
import { Layout, message, Spin } from 'antd';
import React, { Suspense, useEffect, useMemo,useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { renderRoutes } from 'react-router-config';
@ -9,6 +9,8 @@ import TopMenu from './TopMenu';
import SiderMenu from './SiderMenu';
import HeaderUser from './HeaderUser';
import './index.less'
import { getParameter } from '../../utils/tools';
import Loading from '../../components/common/Loading';
const { Header, Footer, Sider, Content } = Layout;
@ -30,47 +32,79 @@ function LayoutPage(props) {
const menu = useSelector(state => state.session.menu);
const menuIndexes = useMemo(() => findMenu(menu, pathname), [menu, pathname]);
const subMenu = useMemo(() => selectedMenu(menu, menuIndexes), [menu, menuIndexes]);
const token = getParameter('token');
const oldToken = sessionStorage.getItem("token")
const myLayout = getParameter('Layout')
const loading = useMemo(()=>user!==null&&menu.length!==0,[user,menu])
useEffect(()=>{
if (user === null) {
history.push('/auth/login');
}else{
dispatch.session.loadMenu(user);
if(token){
if(oldToken!==token){
dispatch.session.byToken(token)
}else{
dispatch.session.loadMenu(user);
}
} else {
dispatch.session.loadMenu();
// if (user === null) {
// history.push('/auth/login');
// }else{
// dispatch.session.loadMenu(user);
// }
}
},[user])
},[user,token])
return (
<>
<Layout className="app-root">
<Header className="app-header">
<a className='app-icon-a' href='http://www.baidu.com'>
<img alt="..." className="app-icon" src={Icon1} />
<span className="app-title">{config.shorttitle}</span>
</a>
<TopMenu menu={menu} menuIndexes={menuIndexes} />
<div className='app-user'>
<HeaderUser user={user} />
</div>
</Header>
<Layout>
<Layout className="app-root">
{
subMenu && subMenu.length > 0 ? (
<Sider className="app-sider" width={208}>
<SiderMenu subMenu={subMenu} menuIndexes={menuIndexes} />
</Sider>
) : null
}
!loading?<Loading />:
<>
{
myLayout === 'noLayout'?
<Content className="app-content">
<div className='content-root'>
<Suspense fallback={null}>
{renderRoutes(route.routes)}
</Suspense>
</div>
</Content>:
<>
<Header className="app-header">
<a className='app-icon-a' href='http://www.baidu.com'>
<img alt="..." className="app-icon" src={Icon1} />
<span className="app-title">{config.shorttitle}</span>
</a>
<TopMenu menu={menu} menuIndexes={menuIndexes} />
<div className='app-user'>
<HeaderUser user={user} />
</div>
</Header>
<Layout>
{
subMenu && subMenu.length > 0 ? (
<Sider className="app-sider" width={208}>
<SiderMenu subMenu={subMenu} menuIndexes={menuIndexes} />
</Sider>
) : null
}
<Content className="app-content">
<div className='content-root'>
<Suspense fallback={null}>
{renderRoutes(route.routes)}
</Suspense>
</div>
</Content>
<Content className="app-content">
<div className='content-root'>
<Suspense fallback={null}>
{renderRoutes(route.routes)}
</Suspense>
</div>
</Content>
</Layout>
</>
}
</>
}
</Layout>
</Layout>
</>
);
}

View File

@ -6,7 +6,11 @@ const shengUrl2 = 'service28080'
// const nmjPro = '/nmj'
// const shengUrlPro = 'http://223.75.53.141:28080'
const shengUrlPro = 'http://223.75.53.141:8000'
// const shengUrlPro = 'http://223.75.53.141:8000' //正式
const shengUrlPro = 'http://223.75.53.141:9001' //正式
// const shengUrlPro = 'http://223.75.53.141:9001'
const shengUrl2Pro = ''
@ -34,6 +38,7 @@ const jsapi = {
downloadYear : nmjPro + '/adinfo/downloadYear',
downloadYearAll : nmjPro + '/adinfo/downloadAllYear',
upload: nmjPro + '/adinfo/upload',
upload2: nmjPro + '/stbprp/upload',
templateSave: nmjPro + '/adinfo/template',
updated: nmjPro + '/adinfo/udpate',
detail: nmjPro + '/adinfo/get/',
@ -201,6 +206,8 @@ const jsapi = {
treeXz: nmjPro + '/adinfo/townTree',
getFiles: nmjPro + "/fileAssociations/getFiles",
saveFiles:nmjPro + "/fileAssociations/saveFiles",
saveFileNotDel:nmjPro + "/fileAssociations/saveFileNotDel",
fwjg: {
page: nmjPro + '/fwjg/page',
add: nmjPro + '/fwjg/add',

View File

@ -68,19 +68,26 @@ const session = {
}
const tokenData = await httppost(apiurl.service.sysuser.getToken, params) || {};
if (!tokenData.data) {
message.error('登陆失败')
if (tokenData.code == 200) {
sessionStorage.setItem('token', tokenData.data.access_token);
return true
} else {
message.error('登陆失败')
return false;
}
const access_token = tokenData.data.access_token
const userData = await httpget(apiurl.service.sysuser.getUser + access_token) || {};
// if (!tokenData.data) {
// message.error('登陆失败')
// return false;
// }
// const access_token = tokenData.data.access_token
// const userData = await httpget(apiurl.service.sysuser.getUser + access_token) || {};
// // this.getData(userData)
// const { data } = await httpget(`${apiurl.service.adcd.tree}/${userData.adcd}`) || {}
// dbStorage.setItem('dataTree',data)
await setTree('dataTree',userData)
await setTree123('dataTree123',userData)
// await setTree('dataTree',userData)
// await setTree123('dataTree123',userData)
// const im = new IMSDK();
// im.init({
@ -97,11 +104,11 @@ const session = {
// });
// openDB(userData.adcd).then(res => addData(res, 'link', data))
if (userData) {
setLoginInfo(userData);
this.setUser(userData);
return userData;
}
// if (userData) {
// setLoginInfo(userData);
// this.setUser(userData);
// return userData;
// }
return false;
},
async byToken(access_token) {
@ -165,7 +172,7 @@ const session = {
this.setUser(null);
},
async loadMenu(user) {
async loadMenu(user=2) {
// debugger;
if (!user) {
return;

View File

@ -69,7 +69,12 @@ async function send(url, options) {
// message.info(res.data.msg);
}
if (code === 401) {
//没token时处理
//没token时处理,向上层发送token失效消息
let params = {
type: "logout",
data: "token失效",
};
window.parent.postMessage(params, "*");
// window.location.href = `${process.env.PUBLIC_URL}#/auth/login`;
// window.location.href = config.NOAUTH_REDIRECT + encodeURIComponent(window.location.href); //xc
return;

View File

@ -122,14 +122,14 @@ const Page = ({ showTree = true, info }) => {
}
const download=(params)=>{
httpPostFile(apiurl.service.adcd.downloadAll, params).then((res) => {
httpPostFile(apiurl.service.adcd.save, params).then((res) => {
if (res) {
exportFile('行政区划.xlsx', res.data)
}
})
}
const downloadYearAll=(params)=>{
httpPostFile(apiurl.service.adcd.downloadYearAll, params).then((res) => {
httpPostFile(apiurl.service.adcd.save, params).then((res) => {
if (res) {
exportFile('行政区划归档.xlsx', res.data)
}

View File

@ -84,9 +84,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal, onSave, onUpload,getInfo
<Form.Item>
<Button size='Default' onClick={onExport}>导出</Button>
</Form.Item>
<Form.Item>
{/* <Form.Item>
<Button size='Default' onClick={onExportTemplate}>下载模版</Button>
</Form.Item>
</Form.Item> */}
{/* {
onSave && (
<Form.Item>

View File

@ -391,8 +391,8 @@ const ModalForm = ({ mode, record, close, onCrudSuccess}) => {
style={{width:'100%'}}
allowClear
options={[
{value:0,label:'0-观测站房位于河流左岸'},
{value:1,label:'1-观测站房位于河流右岸'},
{value:'0',label:'0-观测站房位于河流左岸'},
{value:'1',label:'1-观测站房位于河流右岸'},
{value:null,label:'空-测站并不在河流上'},
]}
/>
@ -467,10 +467,10 @@ const ModalForm = ({ mode, record, close, onCrudSuccess}) => {
defaultValue={0}
options={
[
{value:0,label:'未提交'},
{value:1,label:'未审核'},
{value:2,label:'审核通过'},
{value:3,label:'审核未通过'}
{value:'0',label:'未提交'},
{value:'1',label:'未审核'},
{value:'2',label:'审核通过'},
{value:'3',label:'审核未通过'}
]}
/>
</Form.Item>

View File

@ -257,7 +257,7 @@ const Page = () => {
</Card>
</div>
<BasicCrudModal
width={1100}
width={1400}
ref={refModal}
title="山洪灾害自动监测站点"
component={ModalForm}
@ -271,7 +271,7 @@ const Page = () => {
onCancel={handleCancel}
destroyOnClose
>
<UploadFile url={apiurl.service.adcd.upload} refresh={refresh}/>
<UploadFile url={apiurl.service.adcd.upload2} refresh={refresh}/>
</Modal>
</div>
);

View File

@ -25,7 +25,9 @@ const Login = ({ isModal = false }) => {
if (result) {
// debugger;
setLoadings(false)
history.push(getMainPage(result));
debugger
// history.push(getMainPage(result));
history.push('/fyzrr/zrrbg');
}else{
setLoadings(false)
message.error('登录失败');

View File

@ -103,21 +103,22 @@ const Page = ({showTree=true,info, isApproval=1}) => {
if(type === 'save'){
dbStorage.getItem('dataTree').then(res=>{
const res1 = (getParentId(res,adInfo.adcd));
const res1 = (getParentId(res,adInfo.adcd)||[]);
console.log(res1,'00000000000');
const level4 = res1.filter(i => i.adlevel===4)[0]||{}
const level3 = res1.filter(i => i.adlevel===3)[0]||{}
const level2 = res1.filter(i => i.adlevel===2)[0]||{}
let params={
vigcd:res1[0].adcd,
vignm:res1[0].adnm,
tncd:res1[1]?.adcd,
tnnm:res1[1]?.adnm,
cncd:res1[2]?.adcd,
cnnm:res1[2]?.adnm,
vigcd:level4.adcd,//行政村
vignm:level4.adnm,//行政村
tncd:level3?.adcd,//乡镇
tnnm:level3?.adnm,//乡镇
cncd:level2?.adcd,//县
cnnm:level2?.adnm,//县
}
if(adInfo){
console.log({...params,...adInfo});
console.log({...params,...adInfo});
refModal.current.showSave({...params,...adInfo})
}else{
message.info('请选择行政区划后新增')
@ -127,8 +128,26 @@ const Page = ({showTree=true,info, isApproval=1}) => {
})
}else if(type === 'edit'){
if(row?.dand?.length===20){
if(row?.adcd?.substring(12,15)==='000'){
const str1 = row.dand.substring(12,20)
row.dand = str1
}else{
const str2 = row.dand.substring(15,20)
row.dand = str2
}
}
refModal.current.showEdit(row)
}else if(type === 'view'){
if(row?.dand?.length===20){
if(row?.adcd?.substring(12,15)==='000'){
const str1 = row.dand.substring(12,20)
row.dand = str1
}else{
const str2 = row.dand.substring(15,20)
row.dand = str2
}
}
refModal.current.showView(row)
}else if(type === 'del'){
let delParams = {
@ -340,7 +359,7 @@ const params = {
<BasicCrudModal
width={1100}
ref={refModal}
showTree={showTree}
showTree={true}
title="危险区"
component={wxqbgForm}
onCrudSuccess={refresh}

View File

@ -265,7 +265,7 @@ const ModalForm = ({ mode, record}) => {
<Col span={8}>
<Form.Item
label="最后建设年"
name="year"
name="buildYear"
style={{width:'100%'}}
>

View File

@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave,
<Form.Item label="小流域编码" name="wscd">
<Input allowClear style={{width: 160}}/>
</Form.Item> */}
<Form.Item>
{/* <Form.Item>
<Button type="primary" htmlType="submit" size='Default' onClick={getInfo}>查询</Button>
</Form.Item>
</Form.Item> */}
{/* <Form.Item>
<Button size='Default' onClick={()=>form.resetFields()}>重置</Button>
</Form.Item> */}

View File

@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave,
<Form.Item label="小流域编码" name="wscd">
<Input allowClear style={{width: 160}}/>
</Form.Item> */}
<Form.Item>
{/* <Form.Item>
<Button type="primary" htmlType="submit" size='Default' onClick={getInfo}>查询</Button>
</Form.Item>
</Form.Item> */}
{/* <Form.Item>
<Button size='Default' onClick={()=>form.resetFields()}>重置</Button>
</Form.Item> */}

View File

@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave,
<Form.Item label="小流域编码" name="wscd">
<Input allowClear style={{width: 160}}/>
</Form.Item> */}
<Form.Item>
{/* <Form.Item>
<Button type="primary" htmlType="submit" size='Default' onClick={getInfo}>查询</Button>
</Form.Item>
</Form.Item> */}
{/* <Form.Item>
<Button size='Default' onClick={()=>form.resetFields()}>重置</Button>
</Form.Item> */}

View File

@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave,
<Form.Item label="小流域编码" name="wscd">
<Input allowClear style={{width: 160}}/>
</Form.Item> */}
<Form.Item>
{/* <Form.Item>
<Button type="primary" htmlType="submit" size='Default' onClick={getInfo}>查询</Button>
</Form.Item>
</Form.Item> */}
{/* <Form.Item>
<Button size='Default' onClick={()=>form.resetFields()}>重置</Button>
</Form.Item> */}

View File

@ -280,7 +280,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
</Form.Item>
</Col>
<Divider orientation="center">风险隐患要素类别</Divider>
<Divider orientation="center">风险隐患影响类型</Divider>
<Col span={12}>
<Form.Item

View File

@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave,
<Form.Item label="小流域编码" name="wscd">
<Input allowClear style={{width: 160}}/>
</Form.Item> */}
<Form.Item>
{/* <Form.Item>
<Button type="primary" htmlType="submit" size='Default' onClick={getInfo}>查询</Button>
</Form.Item>
</Form.Item> */}
{/* <Form.Item>
<Button size='Default' onClick={()=>form.resetFields()}>重置</Button>
</Form.Item> */}

View File

@ -10,7 +10,7 @@ import apiurl from '../../../models/apiurl.js'
import AdcdTreeSelect from '../../../components/Form/AdcdTreeSelect.js'
import FzdxSelect from '../../../components/Form/FzdxSelect.js'
import NormalSelect from '../../../components/Form/NormalSelect.js'
import FileUpload from '../../../components/fileUpload/index.js';
import FileUpload2 from '../../../components/fileUpload2/index.js';
import { validlgtd, validlttd } from '../../../utils/validators.js'
import dayjs from 'dayjs';
const { TextArea } = Input;
@ -80,7 +80,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<FileUpload
<FileUpload2
mode={mode}
businessId={record.adcd}
groupId="ADCD"

View File

@ -50,16 +50,19 @@ const Page = ({showTree=true,info}) => {
const oprate = (type, row) => {
if (type === 'save') {
setTitle('新增居民户')
setTitle('文件上传')
console.log(tableProps.pagination.total
);
refModal.current.showSave({adcd:adInfo.adcd })
} else if (type === 'edit') {
setTitle('编辑居民户')
refModal.current.showEdit(row)
// setTitle('编辑居民户')
// refModal.current.showEdit(row)
} else if (type === 'download') {
let downloadLink = document.createElement("a");
// downloadLink.href = `http://192.168.66.7:20010/fileAssociations/downloadFile/${row?.fileId}`;
// downloadLink.href = `http://192.168.66.199:20010/fileAssociations/downloadFile/${row?.fileId}`;
downloadLink.href = `http://223.75.53.141:81/shzh/jcsj/fileAssociations/downloadFile/${row?.fileId}`;
downloadLink.download = `${row.fileName}`;
downloadLink.style.display = "none";

View File

@ -10,7 +10,7 @@ import dayjs from 'dayjs'
import apiurl from '../../../models/apiurl.js'
import UploadFile from '../../../components/uploadFile/index'
import AdcdTree from '../../../components/FormZdy1/AdcdTree/index.js';
import { httpget, httpPostFile } from '../../../utils/request.js';
import { httpget, httpPostFile, httpGetFile } from '../../../utils/request.js';
import { exportFile } from '../../../utils/tools.js';
import { upload } from '@testing-library/user-event/dist/upload.js';
@ -32,7 +32,7 @@ const YuanList = () => {
}
const downtmp = ()=>{
httpPostFile(apiurl.service.yuan.template).then((res) => {
httpGetFile(apiurl.service.yuan.template).then((res) => {
if (res) {
exportFile('预案模板.xlsx', res.data)
}

View File

@ -138,7 +138,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
</Col>
<Col span={12}>
<Form.Item
label="测站名称"
label="关联测站名称"
name="stnm"
rules={[{ required: true }]}
>
@ -151,7 +151,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
</Col>
<Col span={12}>
<Form.Item
label="测站编码"
label="关联测站编码"
name="stcd"
rules={[{ required: true }]}
@ -163,7 +163,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
</Select>
</Form.Item>
</Col>
<Col span={12}>
{/* <Col span={12}>
<Form.Item
label="来源"
name="source"
@ -175,7 +175,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
<Select.Option value='SK'>水库</Select.Option>
</Select>
</Form.Item>
</Col>
</Col> */}
</Row>
<Row>
{

View File

@ -34,6 +34,12 @@ const statusTypeTitle={
'edit':'编辑',
'view':'查看',
}
const prevtp = {
0:'非防治区',
1:'防治区',
2:'重点防治区'
}
function getParentId(list,adcd) {
for (let i in list) {
if(list[i].adcd==adcd){
@ -63,12 +69,14 @@ const Page = () => {
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
{ title: '预警对象名称', key: 'adnm', dataIndex: 'adnm', width: 180 , align:'center'},
{ title: '预警对象编码', key: 'adcd', dataIndex: 'adcd', width: 100 , align:'center'},
{ title: '区(县)名称', key: 'countyname', dataIndex: 'countyname', width: 100 , align:'center'},
{ title: '区(县)编码', key: 'countycode', dataIndex: 'countycode', width: 100 , align:'center'},
{ title: '测站名称', key: 'stnm', dataIndex: 'stnm', width: 100, align:'center' },
{ title: '测站编码', key: 'stcd', dataIndex: 'stcd', width: 100 , align:'center'},
{ title: '来源', key: 'source', dataIndex: 'source', width: 200 , align:'center',render:(value)=>sourceMap[value]},
{ title: '预警对象代码', key: 'adcd', dataIndex: 'adcd', width: 120 , align:'center'},
{ title: '县区', key: 'cnnm', dataIndex: 'cnnm', width: 100 , align:'center'},
{ title: '乡镇', key: 'tnnm', dataIndex: 'tnnm', width: 100 , align:'center'},
{ title: '行政村', key: 'vinm', dataIndex: 'vinm', width: 100 , align:'center'},
{ title: '预警对象类型', key: 'prevtp', dataIndex: 'prevtp', width: 120 , align:'center',render:(text)=>prevtp[text]},
{ title: '关联测站名称', key: 'stnm', dataIndex: 'stnm', width: 120, align:'center' },
{ title: '关联测站编码', key: 'stcd', dataIndex: 'stcd', width: 120 , align:'center'},
// { title: '来源', key: 'source', dataIndex: 'source', width: 200 , align:'center',render:(value)=>sourceMap[value]},
{ title: '状态', key: 'reviewStatus', dataIndex: 'reviewStatus', width: 200 , align:'center',render:(value)=>statusType[value]},
{
title: '操作', key: 'operation', width: 120, fixed: 'right',align: 'center',

View File

@ -26,6 +26,11 @@ const statusType ={
2:'生效',
3:'审核不通过'
}
const prevtp = {
0:'非防治区',
1:'防治区',
2:'重点防治区'
}
const Page = () => {
const refModal = useRef(null);
const [adInfo, setAdInfo] = useState('')
@ -41,12 +46,13 @@ const Page = () => {
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
{ title: '预警对象名称', key: 'adnm', dataIndex: 'adnm', width: 180 , align:'center'},
{ title: '预警对象编码', key: 'adcd', dataIndex: 'adcd', width: 100 , align:'center'},
{ title: '区(县)名称', key: 'countyname', dataIndex: 'countyname', width: 100 , align:'center'},
{ title: '区(县)编码', key: 'countycode', dataIndex: 'countycode', width: 100 , align:'center'},
{ title: '测站名称', key: 'stnm', dataIndex: 'stnm', width: 100, align:'center' },
{ title: '测站编码', key: 'stcd', dataIndex: 'stcd', width: 100 , align:'center'},
{ title: '来源', key: 'source', dataIndex: 'source', width: 200 , align:'center',render:(value)=>sourceMap[value]},
{ title: '预警对象代码', key: 'adcd', dataIndex: 'adcd', width: 120 , align:'center'},
{ title: '县区', key: 'cnnm', dataIndex: 'cnnm', width: 100 , align:'center'},
{ title: '乡镇', key: 'tnnm', dataIndex: 'tnnm', width: 100 , align:'center'},
{ title: '行政村', key: 'vinm', dataIndex: 'vinm', width: 100 , align:'center'},
{ title: '预警对象类型', key: 'prevtp', dataIndex: 'prevtp', width: 120 , align:'center',render:(text)=>prevtp[text]},
{ title: '关联测站名称', key: 'stnm', dataIndex: 'stnm', width: 120, align:'center' },
{ title: '关联测站编码', key: 'stcd', dataIndex: 'stcd', width: 120 , align:'center'},
// { title: '状态', key: 'reviewStatus', dataIndex: 'reviewStatus', width: 200 , align:'center',render:(value)=>statusType[value]},
{
title: '操作', key: 'operation', width: 120, fixed: 'right',align: 'center',

View File

@ -36,15 +36,21 @@ const Page = () => {
2:'生效',
3:'审核不通过'
}
const prevtp = {
0:'非防治区',
1:'防治区',
2:'重点防治区'
}
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
{ title: '预警对象名称', key: 'adnm', dataIndex: 'adnm', width: 180 , align:'center'},
{ title: '预警对象编码', key: 'adcd', dataIndex: 'adcd', width: 100 , align:'center'},
{ title: '区(县)名称', key: 'countyname', dataIndex: 'countyname', width: 100 , align:'center'},
{ title: '区(县)编码', key: 'countycode', dataIndex: 'countycode', width: 100 , align:'center'},
{ title: '测站名称', key: 'stnm', dataIndex: 'stnm', width: 100, align:'center' },
{ title: '测站编码', key: 'stcd', dataIndex: 'stcd', width: 100 , align:'center'},
{ title: '来源', key: 'source', dataIndex: 'source', width: 200 , align:'center',render:(value)=>sourceMap[value]},
{ title: '预警对象代码', key: 'adcd', dataIndex: 'adcd', width: 120 , align:'center'},
{ title: '县区', key: 'cnnm', dataIndex: 'cnnm', width: 100 , align:'center'},
{ title: '乡镇', key: 'tnnm', dataIndex: 'tnnm', width: 100 , align:'center'},
{ title: '行政村', key: 'vinm', dataIndex: 'vinm', width: 100 , align:'center'},
{ title: '预警对象类型', key: 'prevtp', dataIndex: 'prevtp', width: 120 , align:'center',render:(text)=>prevtp[text]},
{ title: '关联测站名称', key: 'stnm', dataIndex: 'stnm', width: 120, align:'center' },
{ title: '关联测站编码', key: 'stcd', dataIndex: 'stcd', width: 120 , align:'center'},
// { title: '状态', key: 'reviewStatus', dataIndex: 'reviewStatus', width: 200 , align:'center',render:(value)=>statusType[value]},
{
title: '操作', key: 'operation', width: 120, fixed: 'right',align: 'center',

View File

@ -13,20 +13,26 @@ import usePageTable from '../../../components/Crud/usePageTable.js'
const { TextArea } = Input;
const warnType={
0: '准备转移' ,
1: '立即转移'
30: '准备转移' ,
31: '立即转移'
}
const prevtp = {
0:'非防治区',
1:'防治区',
2:'重点防治区'
}
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
{ title: '预警对象名称', key: 'adnm', dataIndex: 'adnm', width: 180 , align:'center'},
{ title: '预警对象编码', key: 'adcd', dataIndex: 'adcd', width: 180 , align:'center'},
{ title: '小流域代码', key: 'wscd', dataIndex: 'wscd', width: 100 , align:'center'},
{ title: '预警对象代码', key: 'adcd', dataIndex: 'adcd', width: 180 , align:'center'},
{ title: '县区', key: 'countyname', dataIndex: 'countyname', width: 100 , align:'center'},
{ title: '乡镇', key: 'tnnm', dataIndex: 'tnnm', width: 100 , align:'center'},
{ title: '行政村', key: 'vinm', dataIndex: 'vinm', width: 100 , align:'center'},
{ title: '预警对象类型', key: 'prevtp', dataIndex: 'prevtp', width: 120 , align:'center',render:(text)=>prevtp[text]},
{ title: '预警等级', key: 'warngradeid', dataIndex: 'warngradeid', width: 100 , align:'center',render:(text)=>warnType[text]},
{ title: '土壤含水量(mm)', key: 'lwater', dataIndex: 'lwater', width: 100, align:'center' },
{ title: '阈值历时(h)', key: 'stdt', dataIndex: 'stdt', width: 100 , align:'center'},
{ title: '雨量阈值(mm)', key: 'drpt', dataIndex: 'drpt', width: 200 , align:'center'},
{ title: '临界雨量(mm)que', key: 'zbpv', dataIndex: 'zbpv', width: 200 , align:'center'},
{ title: '分析方法', key: 'calmath', dataIndex: 'calmath', width: 200 , align:'center'},
];
const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
const [form] = Form.useForm();
@ -73,7 +79,8 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
const SubmitForm = (record) => {
let params = form.getFieldsValue()
params.reviewStatus=1
if(!(params.wscd&&(params.warngradeid!==null||params.warngradeid!=undefined)&&params.stdt)){
// if(!(params.wscd&&(params.warngradeid!==null||params.warngradeid!=undefined)&&params.stdt)){
if(!((params.warngradeid!==null||params.warngradeid!=undefined)&&params.stdt)){
return;
}
if (mode === 'save') {
@ -99,7 +106,8 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
const SaveForm = () => {
let params = form.getFieldsValue()
params.reviewStatus=0
if(!(params.wscd&&(params.warngradeid!==null||params.warngradeid!=undefined)&&params.stdt)){
// if(!(params.wscd&&(params.warngradeid!==null||params.warngradeid!=undefined)&&params.stdt)){
if(!((params.warngradeid!==null||params.warngradeid!=undefined)&&params.stdt)){
return;
}
@ -136,7 +144,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
<Input disabled style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
{/* <Col span={12}>
<Form.Item
label="小流域名称"
name="wscd"
@ -159,7 +167,8 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
>
<Input disabled style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Col> */}
<Col span={12}>
<Form.Item
label="预警等级"
@ -171,8 +180,8 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
style={{ width: '100%' }}
allowClear
options={[
{ value: 0, label: '准备转移' },
{ value: 1, label: '立即转移' },
{ value: 30, label: '准备转移' },
{ value: 31, label: '立即转移' },
]}
/>
</Form.Item>
@ -206,7 +215,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
<InputNumber disabled={mode === 'view'} style={{ width: '100%' }} allowClear></InputNumber>
</Form.Item>
</Col>
<Col span={12}>
{/* <Col span={12}>
<Form.Item
label="临界雨量(mm)"
name="zbpv"
@ -232,7 +241,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => {
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear></Input>
</Form.Item>
</Col>
</Col> */}
</Row>
<Row>
<Table

View File

@ -27,8 +27,14 @@ const statusTypeTitle={
'view':'查看',
}
const warnType={
0: '准备转移' ,
1: '立即转移'
30: '准备转移' ,
31: '立即转移'
}
const prevtp = {
0:'非防治区',
1:'防治区',
2:'重点防治区'
}
function getParentId(list,adcd) {
for (let i in list) {
@ -56,15 +62,19 @@ const Page = () => {
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
{ title: '预警对象名称', key: 'adnm', dataIndex: 'adnm', width: 180 , align:'center'},
{ title: '预警对象编码', key: 'adcd', dataIndex: 'adcd', width: 180 , align:'center'},
{ title: '小流域名称', key: 'wsnm', dataIndex: 'wsnm', width: 100 , align:'center'},
{ title: '小流域代码', key: 'wscd', dataIndex: 'wscd', width: 100 , align:'center'},
{ title: '预警对象代码', key: 'adcd', dataIndex: 'adcd', width: 180 , align:'center'},
{ title: '县区', key: 'cnnm', dataIndex: 'cnnm', width: 100 , align:'center'},
{ title: '乡镇', key: 'tnnm', dataIndex: 'tnnm', width: 100 , align:'center'},
{ title: '行政村', key: 'vinm', dataIndex: 'vinm', width: 100 , align:'center'},
{ title: '预警对象类型', key: 'prevtp', dataIndex: 'prevtp', width: 120 , align:'center',render:(text)=>prevtp[text]},
{ title: '预警等级', key: 'warngradeid', dataIndex: 'warngradeid', width: 100 , align:'center',render:(text)=>warnType[text]},
{ title: '土壤含水量(mm)', key: 'lwater', dataIndex: 'lwater', width: 100, align:'center' },
{ title: '阈值历时(h)', key: 'stdt', dataIndex: 'stdt', width: 100 , align:'center'},
{ title: '雨量阈值(mm)', key: 'drpt', dataIndex: 'drpt', width: 200 , align:'center'},
{ title: '临界雨量(mm)', key: 'zbpv', dataIndex: 'zbpv', width: 200 , align:'center'},
{ title: '分析方法', key: 'calmath', dataIndex: 'calmath', width: 200 , align:'center'},
// { title: '小流域名称', key: 'wsnm', dataIndex: 'wsnm', width: 100 , align:'center'},
// { title: '小流域代码', key: 'wscd', dataIndex: 'wscd', width: 100 , align:'center'},
// { title: '土壤含水量(mm)', key: 'lwater', dataIndex: 'lwater', width: 100, align:'center' },
// { title: '临界雨量(mm)', key: 'zbpv', dataIndex: 'zbpv', width: 200 , align:'center'},
// { title: '分析方法', key: 'calmath', dataIndex: 'calmath', width: 200 , align:'center'},
{ title: '状态', key: 'reviewStatus', dataIndex: 'reviewStatus', width: 200 , align:'center',render: (text, record, index) => statusType[text] },
{
title: '操作', key: 'operation', width: 120, fixed: 'right',align: 'center',

View File

@ -63,8 +63,8 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave,
</Form.Item>
<Form.Item label="预警等级" name="warngradeid">
<Select style={{width: 160}} allowClear options={[
{ value: 0, label: '准备转移' },
{ value: 1, label: '立即转移' },
{ value: 30, label: '准备转移' },
{ value: 31, label: '立即转移' },
]}>
</Select>
</Form.Item>

View File

@ -11,8 +11,8 @@ import { findPage } from '../../../components/Crud/_.js'
import usePageTable from '../../../components/Crud/usePageTable.js'
const { TextArea } = Input;
const warnType={
0: '准备转移' ,
1: '立即转移'
30: '准备转移' ,
31: '立即转移'
}
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },

View File

@ -20,8 +20,13 @@ const statusTypeTitle={
'view':'查看',
}
const warnType={
0: '准备转移' ,
1: '立即转移'
30: '准备转移' ,
31: '立即转移'
}
const prevtp = {
0:'非防治区',
1:'防治区',
2:'重点防治区'
}
const Page = () => {
const refModal = useRef(null);
@ -40,14 +45,14 @@ const Page = () => {
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
{ title: '预警对象名称', key: 'adnm', dataIndex: 'adnm', width: 180 , align:'center'},
{ title: '预警对象编码', key: 'adcd', dataIndex: 'adcd', width: 180 , align:'center'},
{ title: '小流域代码', key: 'wscd', dataIndex: 'wscd', width: 100 , align:'center'},
{ title: '预警对象代码', key: 'adcd', dataIndex: 'adcd', width: 180 , align:'center'},
{ title: '县区', key: 'cnnm', dataIndex: 'cnnm', width: 100 , align:'center'},
{ title: '乡镇', key: 'tnnm', dataIndex: 'tnnm', width: 100 , align:'center'},
{ title: '行政村', key: 'vinm', dataIndex: 'vinm', width: 100 , align:'center'},
{ title: '预警对象类型', key: 'prevtp', dataIndex: 'prevtp', width: 120 , align:'center',render:(text)=>prevtp[text]},
{ title: '预警等级', key: 'warngradeid', dataIndex: 'warngradeid', width: 100 , align:'center',render:(text)=>warnType[text]},
{ title: '土壤含水量(mm)', key: 'lwater', dataIndex: 'lwater', width: 100, align:'center' },
{ title: '阈值历时(h)', key: 'stdt', dataIndex: 'stdt', width: 100 , align:'center'},
{ title: '雨量阈值(mm)', key: 'drpt', dataIndex: 'drpt', width: 200 , align:'center'},
{ title: '临界雨量(mm)', key: 'zbpv', dataIndex: 'zbpv', width: 200 , align:'center'},
{ title: '分析方法', key: 'calmath', dataIndex: 'calmath', width: 200 , align:'center'},
{
title: '操作', key: 'operation', width: 120, fixed: 'right',align: 'center',
render: (value, row, index) =>

View File

@ -65,8 +65,8 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal, isDel, setIsDel, onSave,
</Form.Item>
<Form.Item label="预警等级" name="warngradeid">
<Select style={{width: 160}} allowClear options={[
{ value: 0, label: '准备转移' },
{ value: 1, label: '立即转移' },
{ value: 30, label: '准备转移' },
{ value: 31, label: '立即转移' },
]}>
</Select>
</Form.Item>

View File

@ -11,8 +11,8 @@ import { findPage } from '../../../components/Crud/_.js'
import usePageTable from '../../../components/Crud/usePageTable.js'
const { TextArea } = Input;
const warnType={
0: '准备转移' ,
1: '立即转移'
30: '准备转移' ,
31: '立即转移'
}
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
@ -140,8 +140,8 @@ const ModalForm = ({ mode, record, close, onCrudSuccess,setTreeUpdate}) => {
style={{ width: '100%' }}
allowClear
options={[
{ value: 0, label: '准备转移' },
{ value: 1, label: '正在转移' },
{ value: 30, label: '准备转移' },
{ value: 31, label: '正在转移' },
]}
/>
</Form.Item>

View File

@ -20,8 +20,13 @@ const statusTypeTitle={
'view':'查看',
}
const warnType={
0: '准备转移' ,
1: '立即转移'
30: '准备转移' ,
31: '立即转移'
}
const prevtp = {
0:'非防治区',
1:'防治区',
2:'重点防治区'
}
const Page = () => {
const refModal = useRef(null);
@ -39,14 +44,14 @@ const Page = () => {
const columns = [
{ title: '序号', key: 'index', dataIndex: 'index', width: 60, fixed: 'left', align:'center',render: (text, record, index) => `${index + 1}` },
{ title: '预警对象名称', key: 'adnm', dataIndex: 'adnm', width: 180 , align:'center'},
{ title: '预警对象编码', key: 'adcd', dataIndex: 'adcd', width: 100 , align:'center'},
{ title: '小流域代码', key: 'wscd', dataIndex: 'wscd', width: 100 , align:'center'},
{ title: '预警对象代码', key: 'adcd', dataIndex: 'adcd', width: 180 , align:'center'},
{ title: '县区', key: 'cnnm', dataIndex: 'cnnm', width: 100 , align:'center'},
{ title: '乡镇', key: 'tnnm', dataIndex: 'tnnm', width: 100 , align:'center'},
{ title: '行政村', key: 'vinm', dataIndex: 'vinm', width: 100 , align:'center'},
{ title: '预警对象类型', key: 'prevtp', dataIndex: 'prevtp', width: 120 , align:'center',render:(text)=>prevtp[text]},
{ title: '预警等级', key: 'warngradeid', dataIndex: 'warngradeid', width: 100 , align:'center',render:(text)=>warnType[text]},
{ title: '土壤含水量(mm)', key: 'lwater', dataIndex: 'lwater', width: 100, align:'center' },
{ title: '阈值历时(h)', key: 'stdt', dataIndex: 'stdt', width: 100 , align:'center'},
{ title: '雨量阈值(mm)', key: 'drpt', dataIndex: 'drpt', width: 200 , align:'center'},
{ title: '临界雨量(mm)', key: 'zbpv', dataIndex: 'zbpv', width: 200 , align:'center'},
{ title: '分析方法', key: 'calmath', dataIndex: 'calmath', width: 200 , align:'center'},
{
title: '操作', key: 'operation', width: 120, fixed: 'right',align: 'center',
render: (value, row, index) =>

View File

@ -40,8 +40,8 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal, onSave, onUpload, getInf
</Form.Item>
<Form.Item label="预警等级" name="warngradeid">
<Select style={{width: 160}} allowClear options={[
{ value: 0, label: '准备转移' },
{ value: 1, label: '立即转移' },
{ value: 30, label: '准备转移' },
{ value: 31, label: '立即转移' },
]}>
</Select>
</Form.Item>

View File

@ -19,22 +19,22 @@ export const formJs = [
{ value: '4', label: '其他结构' },
]
},
{ label: '宅基经度', key: 'blgtd', type: 'input' },
{ label: '宅基纬度', key: 'blttd', type: 'input' },
{ label: '宅基经度', key: 'lgtd', type: 'input' },
{ label: '宅基纬度', key: 'lttd', type: 'input' },
{ label: '宅基高程', key: 'hele', type: 'input' },
{
label: '临水', key: 'bwater', type: 'select', option: [
{ value: '1', label: '是' },
{ value: '2', label: '否' },
{ value: '0', label: '否' },
]
},
{
label: '切坡', key: 'bhill', type: 'select', option: [
{ value: '1', label: '是' },
{ value: '2', label: '否' },
{ value: '0', label: '否' },
]
},
{ label: '基准点纬度', key: 'plarea', type: 'input' },
{ label: '基准点经度', key: 'pcount', type: 'input' },
{ label: '基准点纬度', key: 'blttd', type: 'input' },
{ label: '基准点经度', key: 'blgtd', type: 'input' },
{ label: '基准点高程', key: 'bele', type: 'input' },
]

View File

@ -93,8 +93,8 @@ const Page = ({ showTree = true, info }) => {
4: '其他结构'
}
const qpls = {
1: '是',
0: '否',
'1': '是',
'0': '否',
}
const columns = [
@ -114,8 +114,8 @@ const Page = ({ showTree = true, info }) => {
<>{obj1[row.stype]}</>
)
},
{ title: '宅基经度', key: 'blgtd', dataIndex: 'lgtd', width: 200 },
{ title: '宅基纬度', key: 'blttd', dataIndex: 'lttd', width: 200 },
{ title: '宅基经度', key: 'lgtd', dataIndex: 'lgtd', width: 200 },
{ title: '宅基纬度', key: 'lttd', dataIndex: 'lttd', width: 200 },
{ title: '宅基高程', key: 'hele', dataIndex: 'hele', width: 200 },
{
title: '临水', key: 'bwater', dataIndex: 'bwater', width: 200,
@ -129,8 +129,8 @@ const Page = ({ showTree = true, info }) => {
<>{qpls[row.bhill]}</>
)
},
{ title: '基准点纬度', key: 'plarea', dataIndex: 'blttd', width: 200 },
{ title: '基准点经度', key: 'pcount', dataIndex: 'blgtd', width: 200 },
{ title: '基准点纬度', key: 'blttd', dataIndex: 'blttd', width: 200 },
{ title: '基准点经度', key: 'blgtd', dataIndex: 'blgtd', width: 200 },
{ title: '基准点高程', key: 'bele', dataIndex: 'bele', width: 200 },
{ title: '变更日期', key: 'updateTime', dataIndex: 'updateTime', width: 200 },
@ -299,7 +299,7 @@ const Page = ({ showTree = true, info }) => {
open={openForm}
onOk={() => setOpenForm(false)}
onCancel={() => setOpenForm(false)}
width={1000}
width={1400}
>
<ModalForm columns={columnsMa} dataSource={dataSourceMa} formList={formJs} formData={formData} />
</Modal>

View File

@ -22,5 +22,5 @@ export const formJs = [
{ label: '总人口(人)', key: 'pcount', type: 'input' },
{ label: '总户数(户)', key: 'htcount', type: 'input' },
{ label: '房屋数量', key: 'house', type: 'input' },
{ label: '复核时间', key: 'updateTime', type: 'input'}
{ label: '复核时间', key: 'reviewTime', type: 'input'}
]

View File

@ -268,7 +268,7 @@ const Page = ({showTree=true,info}) => {
open={openForm}
onOk={()=>setOpenForm(false)}
onCancel={()=>setOpenForm(false)}
width={1000}
width={1400}
destroyOnClose={true}
>
<ModalForm columns={columnsMa} dataSource={dataSourceMa} formList={formJs} formData={formData} />

View File

@ -257,7 +257,7 @@ const Page = ({showTree=true,info}) => {
open={openForm}
onOk={() => setOpenForm(false)}
onCancel={() => setOpenForm(false)}
width={1000}
width={1400}
>
<ModalForm columns={columnsMa} dataSource={dataSourceMa} formList={formJs} formData={formData} showMap={true}/>
</Modal>

View File

@ -1,6 +1,6 @@
export const formJs = [
{ label: '预案文件', key: 'planName',type:'input',icon:'icon'},
{ label: '行政区划', key: 'adnm',type:'input' },
{ label: '行政区划名称', key: 'adName',type:'input' },
{ label: '行政区划', key: 'adcd',type:'input' },
{ label: '行政区划名称', key: 'adnm',type:'input' },
{ label: '预案年份', key: 'year',type:'input' },
]

View File

@ -263,7 +263,7 @@ const Page = ({ showTree = true, info }) => {
open={openForm}
onOk={() => setOpenForm(false)}
onCancel={() => setOpenForm(false)}
width={1000}
width={1400}
>
<ModalForm columns={columnsMa} dataSource={dataSourceMa} formList={formJs} formData={formData} />
</Modal>

View File

@ -267,7 +267,7 @@ const Page = ({showTree=true,info}) => {
open={openForm}
onOk={() => setOpenForm(false)}
onCancel={() => setOpenForm(false)}
width={1000}
width={1400}
destroyOnClose={true}
>
<ModalForm columns={columnsMa} dataSource={dataSourceMa} formList={formJs} formData={formData} getList={true}/>

View File

@ -128,7 +128,7 @@ const ModalForm = (props) => {
label={item.label}
name={item.key}
style={{ width: '30%', marginRight: 8, marginBottom: 10 }}
labelCol={{ flex: '100px' }}
labelCol={{ flex: '140px' }}
>
{item.type == 'input' && (
<>
@ -140,7 +140,7 @@ const ModalForm = (props) => {
<>
<Select
style={{
width: '100%',
width: '90%',
}}
allowClear
disabled
@ -154,7 +154,7 @@ const ModalForm = (props) => {
<Select
mode="multiple"
allowClear
style={{ width: '100%' }}
style={{ width: '90%' }}
options={tableProps.dataSource}
fieldNames={props.dataSource[0]?.adlevel !== 5 ? { label: 'adnm', value: 'adcd' } : { label: 'name', value: 'avrcd' }}
disabled

View File

@ -6,10 +6,10 @@ export const formJs = [
{ label: '小流域代码', key: 'wscd', type: 'input' },
{ label: '预警等级', key: 'warngradeid', type: 'select',option: [
{
label: '准备转移', value: 0
label: '准备转移', value: 30
},
{
label: '立即转移', value: 1
label: '立即转移', value: 31
},
] },
{ label: '土壤含水量(mm)', key: 'lwater', type: 'input' },

View File

@ -34,8 +34,8 @@ const Page = ({showTree=true,info}) => {
const user = useSelector(state => state.session.user);
const warnType={
0: '准备转移' ,
1: '立即转移'
30: '准备转移' ,
31: '立即转移'
}
const columnsMa = [