From 585bf6ccd53bc22cdaf9e9b3d8fc64048127711c Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Sat, 8 Feb 2025 17:57:44 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormZdy1/AdcdTree/index.js | 2 +- src/components/Openlayers/index.js | 24 ++- src/components/fileUpload2/index.js | 211 ++++++++++++++++++++++ src/components/fileUpload2/index.less | 23 +++ src/components/wxqbgForm/editInfo.js | 67 ++++--- src/components/wxqbgForm/index.js | 65 ++++--- src/config/formValue.js | 80 ++++---- src/layouts/Layout/index.js | 100 ++++++---- src/models/apiurl.js | 9 +- src/models/session/index.js | 33 ++-- src/utils/request.js | 7 +- src/views/Adcd/Cx/index.js | 4 +- src/views/Fzc/CX/toolbar.js | 4 +- src/views/Jczd/Bg/form.js | 12 +- src/views/Jczd/Bg/index.js | 4 +- src/views/Login/index.js | 4 +- src/views/Wxq/Bg/index.js | 43 +++-- src/views/Wxq/Cx/form.js | 2 +- src/views/Xly/Dccg2/toolbar.js | 4 +- src/views/Xly/Dccg3/toolbar.js | 4 +- src/views/Xly/Dccg4/toolbar.js | 4 +- src/views/Xly/Dccg5/toolbar.js | 4 +- src/views/Xly/Fzdx/form.js | 2 +- src/views/Xly/Fzdx/toolbar.js | 4 +- src/views/Xly/Wjsc/form.js | 4 +- src/views/Xly/Wjsc/index.js | 9 +- src/views/Yagl/Cx/index.js | 4 +- src/views/Yjgx/Bg/form.js | 8 +- src/views/Yjgx/Bg/index.js | 20 +- src/views/Yjgx/Cx/index.js | 18 +- src/views/Yjgx/Sp/index.js | 18 +- src/views/Yjyz/Bg/form.js | 39 ++-- src/views/Yjyz/Bg/index.js | 26 ++- src/views/Yjyz/Bg/toolbar.js | 4 +- src/views/Yjyz/Cx/form.js | 4 +- src/views/Yjyz/Cx/index.js | 19 +- src/views/Yjyz/Cx/toolbar.js | 4 +- src/views/Yjyz/Sp/form.js | 8 +- src/views/Yjyz/Sp/index.js | 19 +- src/views/Yjyz/Sp/toolbar.js | 4 +- src/views/fhrz/Jm/form.js | 12 +- src/views/fhrz/Jm/index.js | 14 +- src/views/fhrz/Qh/form.js | 2 +- src/views/fhrz/Qh/index.js | 2 +- src/views/fhrz/Xq/index.js | 2 +- src/views/fhrz/Ya/form.js | 4 +- src/views/fhrz/Ya/index.js | 2 +- src/views/fhrz/Zrr/index.js | 2 +- src/views/fhrz/modal/index.js | 6 +- src/views/fhrz/yjyz/form.js | 4 +- src/views/fhrz/yjyz/index.js | 4 +- 51 files changed, 692 insertions(+), 286 deletions(-) create mode 100644 src/components/fileUpload2/index.js create mode 100644 src/components/fileUpload2/index.less diff --git a/src/components/FormZdy1/AdcdTree/index.js b/src/components/FormZdy1/AdcdTree/index.js index 4d17bd8..6a87927 100644 --- a/src/components/FormZdy1/AdcdTree/index.js +++ b/src/components/FormZdy1/AdcdTree/index.js @@ -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] diff --git a/src/components/Openlayers/index.js b/src/components/Openlayers/index.js index 780ff90..cb5b33e 100644 --- a/src/components/Openlayers/index.js +++ b/src/components/Openlayers/index.js @@ -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) } diff --git a/src/components/fileUpload2/index.js b/src/components/fileUpload2/index.js new file mode 100644 index 0000000..88eb5ac --- /dev/null +++ b/src/components/fileUpload2/index.js @@ -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 ( +
+ {mode !== "view" && + { console.log(info.dataTransfer.files); }} + fileList={fileList} + disabled={loading} + showUploadList={false} + data={{ + groupId: groupId, + // businessId:businessId, + userId:user.userId + }} + // onSuccess={handleSuccess} + > +

点击或拖拽文件到此区域上传

+

+ 支持扩展名:.rar .zip .doc .docx .pdf .jpg .png .ppt +

+
+ } + + { + loading ? 文件正在上传中,请等待 : + fileList.length > 0 && fileList.map(file => { + return ( + +
+
+ {file.name.indexOf('.docx') > -1 ? +
{ download(file.response?.data) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.name.indexOf('.pdf') > -1 ? +
{ download(file.response?.data) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.name.indexOf('.zip') > -1 ? +
{ download(file.response?.data) }} + style={{ cursor: 'pointer' }} + > + +
+ : + file.name.indexOf('.ppt') > -1 ? +
{ download(file.response?.data) }} + style={{ cursor: 'pointer' }} + > + +
: + file.name.indexOf('.xlsx') > -1 ? +
{ download(file.response?.data) }} + style={{ cursor: 'pointer' }} + > + +
+ : + + { download(file.response?.data) }} /> + } + {file.name} +
+
deleteFile(file.response?.data?.fileId)}> + +
+
+ + ) + }) + } +
+
+ ) +} diff --git a/src/components/fileUpload2/index.less b/src/components/fileUpload2/index.less new file mode 100644 index 0000000..c84a09f --- /dev/null +++ b/src/components/fileUpload2/index.less @@ -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; + } +} diff --git a/src/components/wxqbgForm/editInfo.js b/src/components/wxqbgForm/editInfo.js index d3cbba0..3a916b3 100644 --- a/src/components/wxqbgForm/editInfo.js +++ b/src/components/wxqbgForm/editInfo.js @@ -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 {beforeData}} suffix={{endData}} disabled={ mode === 'view'} style={{ width: '100%' }} /> diff --git a/src/components/wxqbgForm/index.js b/src/components/wxqbgForm/index.js index 4ac1c19..bb002f7 100644 --- a/src/components/wxqbgForm/index.js +++ b/src/components/wxqbgForm/index.js @@ -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() diff --git a/src/config/formValue.js b/src/config/formValue.js index e00422d..4afda4a 100644 --- a/src/config/formValue.js +++ b/src/config/formValue.js @@ -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-兵团水文局'}, ] } diff --git a/src/layouts/Layout/index.js b/src/layouts/Layout/index.js index 44dc55b..5e78764 100644 --- a/src/layouts/Layout/index.js +++ b/src/layouts/Layout/index.js @@ -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 ( <> - -
- - ... - {config.shorttitle} - - -
- -
-
- + { - subMenu && subMenu.length > 0 ? ( - - - - ) : null - } + !loading?: + <> + { + myLayout === 'noLayout'? + +
+ + {renderRoutes(route.routes)} + +
+
: + <> +
+ + ... + {config.shorttitle} + + +
+ +
+
+ + { + subMenu && subMenu.length > 0 ? ( + + + + ) : null + } - -
- - {renderRoutes(route.routes)} - -
-
+ +
+ + {renderRoutes(route.routes)} + +
+
+
+ + } + + }
-
); } diff --git a/src/models/apiurl.js b/src/models/apiurl.js index 6b8547f..f4fcbd1 100644 --- a/src/models/apiurl.js +++ b/src/models/apiurl.js @@ -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', diff --git a/src/models/session/index.js b/src/models/session/index.js index 4408d26..9c0e9ec 100644 --- a/src/models/session/index.js +++ b/src/models/session/index.js @@ -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; diff --git a/src/utils/request.js b/src/utils/request.js index ccd6506..56c5dc0 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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; diff --git a/src/views/Adcd/Cx/index.js b/src/views/Adcd/Cx/index.js index 55945b5..44b3598 100644 --- a/src/views/Adcd/Cx/index.js +++ b/src/views/Adcd/Cx/index.js @@ -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) } diff --git a/src/views/Fzc/CX/toolbar.js b/src/views/Fzc/CX/toolbar.js index f3091d2..2edd6c8 100644 --- a/src/views/Fzc/CX/toolbar.js +++ b/src/views/Fzc/CX/toolbar.js @@ -84,9 +84,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal, onSave, onUpload,getInfo - + {/* - + */} {/* { onSave && ( diff --git a/src/views/Jczd/Bg/form.js b/src/views/Jczd/Bg/form.js index 4eb1458..3dbcb99 100644 --- a/src/views/Jczd/Bg/form.js +++ b/src/views/Jczd/Bg/form.js @@ -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:'审核未通过'} ]} /> diff --git a/src/views/Jczd/Bg/index.js b/src/views/Jczd/Bg/index.js index 9e643fa..3654e7e 100644 --- a/src/views/Jczd/Bg/index.js +++ b/src/views/Jczd/Bg/index.js @@ -257,7 +257,7 @@ const Page = () => { { onCancel={handleCancel} destroyOnClose > - + ); diff --git a/src/views/Login/index.js b/src/views/Login/index.js index 7e4db1e..4250d8c 100644 --- a/src/views/Login/index.js +++ b/src/views/Login/index.js @@ -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('登录失败'); diff --git a/src/views/Wxq/Bg/index.js b/src/views/Wxq/Bg/index.js index c0a2162..287469e 100644 --- a/src/views/Wxq/Bg/index.js +++ b/src/views/Wxq/Bg/index.js @@ -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 = { { diff --git a/src/views/Xly/Dccg2/toolbar.js b/src/views/Xly/Dccg2/toolbar.js index 2061796..5963f5b 100644 --- a/src/views/Xly/Dccg2/toolbar.js +++ b/src/views/Xly/Dccg2/toolbar.js @@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave, */} - + {/* - + */} {/* */} diff --git a/src/views/Xly/Dccg3/toolbar.js b/src/views/Xly/Dccg3/toolbar.js index 2061796..5963f5b 100644 --- a/src/views/Xly/Dccg3/toolbar.js +++ b/src/views/Xly/Dccg3/toolbar.js @@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave, */} - + {/* - + */} {/* */} diff --git a/src/views/Xly/Dccg4/toolbar.js b/src/views/Xly/Dccg4/toolbar.js index 2061796..5963f5b 100644 --- a/src/views/Xly/Dccg4/toolbar.js +++ b/src/views/Xly/Dccg4/toolbar.js @@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave, */} - + {/* - + */} {/* */} diff --git a/src/views/Xly/Dccg5/toolbar.js b/src/views/Xly/Dccg5/toolbar.js index 2061796..5963f5b 100644 --- a/src/views/Xly/Dccg5/toolbar.js +++ b/src/views/Xly/Dccg5/toolbar.js @@ -38,9 +38,9 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave, */} - + {/* - + */} {/* */} diff --git a/src/views/Xly/Fzdx/form.js b/src/views/Xly/Fzdx/form.js index db77b8f..a75ca46 100644 --- a/src/views/Xly/Fzdx/form.js +++ b/src/views/Xly/Fzdx/form.js @@ -280,7 +280,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => { - 风险隐患要素类别 + 风险隐患影响类型 */} - + {/* - + */} {/* */} diff --git a/src/views/Xly/Wjsc/form.js b/src/views/Xly/Wjsc/form.js index d0745f3..453782d 100644 --- a/src/views/Xly/Wjsc/form.js +++ b/src/views/Xly/Wjsc/form.js @@ -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 }} > - { 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"; diff --git a/src/views/Yagl/Cx/index.js b/src/views/Yagl/Cx/index.js index 22a72bb..498465b 100644 --- a/src/views/Yagl/Cx/index.js +++ b/src/views/Yagl/Cx/index.js @@ -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) } diff --git a/src/views/Yjgx/Bg/form.js b/src/views/Yjgx/Bg/form.js index ab99413..9743a1e 100644 --- a/src/views/Yjgx/Bg/form.js +++ b/src/views/Yjgx/Bg/form.js @@ -138,7 +138,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => { @@ -151,7 +151,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => { { - + {/* { 水库 - + */} { diff --git a/src/views/Yjgx/Bg/index.js b/src/views/Yjgx/Bg/index.js index 90f8b4e..9f3c61a 100644 --- a/src/views/Yjgx/Bg/index.js +++ b/src/views/Yjgx/Bg/index.js @@ -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', diff --git a/src/views/Yjgx/Cx/index.js b/src/views/Yjgx/Cx/index.js index 4369c50..7f3f930 100644 --- a/src/views/Yjgx/Cx/index.js +++ b/src/views/Yjgx/Cx/index.js @@ -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', diff --git a/src/views/Yjgx/Sp/index.js b/src/views/Yjgx/Sp/index.js index dc85f8d..3716416 100644 --- a/src/views/Yjgx/Sp/index.js +++ b/src/views/Yjgx/Sp/index.js @@ -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', diff --git a/src/views/Yjyz/Bg/form.js b/src/views/Yjyz/Bg/form.js index ab572ff..021ca0d 100644 --- a/src/views/Yjyz/Bg/form.js +++ b/src/views/Yjyz/Bg/form.js @@ -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)&¶ms.stdt)){ + // if(!(params.wscd&&(params.warngradeid!==null||params.warngradeid!=undefined)&¶ms.stdt)){ + if(!((params.warngradeid!==null||params.warngradeid!=undefined)&¶ms.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)&¶ms.stdt)){ + // if(!(params.wscd&&(params.warngradeid!==null||params.warngradeid!=undefined)&¶ms.stdt)){ + if(!((params.warngradeid!==null||params.warngradeid!=undefined)&¶ms.stdt)){ return; } @@ -136,7 +144,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => { - + {/* { > - + */} + { style={{ width: '100%' }} allowClear options={[ - { value: 0, label: '准备转移' }, - { value: 1, label: '立即转移' }, + { value: 30, label: '准备转移' }, + { value: 31, label: '立即转移' }, ]} /> @@ -206,7 +215,7 @@ const ModalForm = ({ mode, record, close, onCrudSuccess }) => { - + {/* { > - + */} { 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', diff --git a/src/views/Yjyz/Bg/toolbar.js b/src/views/Yjyz/Bg/toolbar.js index ba0d48f..b423ed9 100644 --- a/src/views/Yjyz/Bg/toolbar.js +++ b/src/views/Yjyz/Bg/toolbar.js @@ -63,8 +63,8 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal,isDel, setIsDel, onSave, diff --git a/src/views/Yjyz/Cx/form.js b/src/views/Yjyz/Cx/form.js index 6ba0e35..ab26e57 100644 --- a/src/views/Yjyz/Cx/form.js +++ b/src/views/Yjyz/Cx/form.js @@ -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}` }, diff --git a/src/views/Yjyz/Cx/index.js b/src/views/Yjyz/Cx/index.js index 6ccd878..43a17d3 100644 --- a/src/views/Yjyz/Cx/index.js +++ b/src/views/Yjyz/Cx/index.js @@ -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) => diff --git a/src/views/Yjyz/Cx/toolbar.js b/src/views/Yjyz/Cx/toolbar.js index 5aa8731..c5c1136 100644 --- a/src/views/Yjyz/Cx/toolbar.js +++ b/src/views/Yjyz/Cx/toolbar.js @@ -65,8 +65,8 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal, isDel, setIsDel, onSave, diff --git a/src/views/Yjyz/Sp/form.js b/src/views/Yjyz/Sp/form.js index 41bc355..19baa55 100644 --- a/src/views/Yjyz/Sp/form.js +++ b/src/views/Yjyz/Sp/form.js @@ -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: '正在转移' }, ]} /> diff --git a/src/views/Yjyz/Sp/index.js b/src/views/Yjyz/Sp/index.js index 3c62359..91ce4f0 100644 --- a/src/views/Yjyz/Sp/index.js +++ b/src/views/Yjyz/Sp/index.js @@ -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) => diff --git a/src/views/Yjyz/Sp/toolbar.js b/src/views/Yjyz/Sp/toolbar.js index fcca3a7..5ccf375 100644 --- a/src/views/Yjyz/Sp/toolbar.js +++ b/src/views/Yjyz/Sp/toolbar.js @@ -40,8 +40,8 @@ const ToolBar = ({ setToolVal, setIsChecked, setDelVal, onSave, onUpload, getInf diff --git a/src/views/fhrz/Jm/form.js b/src/views/fhrz/Jm/form.js index 8d4beaf..c7e32f0 100644 --- a/src/views/fhrz/Jm/form.js +++ b/src/views/fhrz/Jm/form.js @@ -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' }, ] \ No newline at end of file diff --git a/src/views/fhrz/Jm/index.js b/src/views/fhrz/Jm/index.js index 8f5de70..f7de115 100644 --- a/src/views/fhrz/Jm/index.js +++ b/src/views/fhrz/Jm/index.js @@ -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} > diff --git a/src/views/fhrz/Qh/form.js b/src/views/fhrz/Qh/form.js index b4bed1b..d8c8b4a 100644 --- a/src/views/fhrz/Qh/form.js +++ b/src/views/fhrz/Qh/form.js @@ -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'} ] diff --git a/src/views/fhrz/Qh/index.js b/src/views/fhrz/Qh/index.js index bfc924e..e9e716c 100644 --- a/src/views/fhrz/Qh/index.js +++ b/src/views/fhrz/Qh/index.js @@ -268,7 +268,7 @@ const Page = ({showTree=true,info}) => { open={openForm} onOk={()=>setOpenForm(false)} onCancel={()=>setOpenForm(false)} - width={1000} + width={1400} destroyOnClose={true} > diff --git a/src/views/fhrz/Xq/index.js b/src/views/fhrz/Xq/index.js index 070286e..56dfed2 100644 --- a/src/views/fhrz/Xq/index.js +++ b/src/views/fhrz/Xq/index.js @@ -257,7 +257,7 @@ const Page = ({showTree=true,info}) => { open={openForm} onOk={() => setOpenForm(false)} onCancel={() => setOpenForm(false)} - width={1000} + width={1400} > diff --git a/src/views/fhrz/Ya/form.js b/src/views/fhrz/Ya/form.js index 592769a..2c037f9 100644 --- a/src/views/fhrz/Ya/form.js +++ b/src/views/fhrz/Ya/form.js @@ -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' }, ] \ No newline at end of file diff --git a/src/views/fhrz/Ya/index.js b/src/views/fhrz/Ya/index.js index 1a7a00d..c379159 100644 --- a/src/views/fhrz/Ya/index.js +++ b/src/views/fhrz/Ya/index.js @@ -263,7 +263,7 @@ const Page = ({ showTree = true, info }) => { open={openForm} onOk={() => setOpenForm(false)} onCancel={() => setOpenForm(false)} - width={1000} + width={1400} > diff --git a/src/views/fhrz/Zrr/index.js b/src/views/fhrz/Zrr/index.js index 04e7441..04dad16 100644 --- a/src/views/fhrz/Zrr/index.js +++ b/src/views/fhrz/Zrr/index.js @@ -267,7 +267,7 @@ const Page = ({showTree=true,info}) => { open={openForm} onOk={() => setOpenForm(false)} onCancel={() => setOpenForm(false)} - width={1000} + width={1400} destroyOnClose={true} > diff --git a/src/views/fhrz/modal/index.js b/src/views/fhrz/modal/index.js index 61f3829..d050a2d 100644 --- a/src/views/fhrz/modal/index.js +++ b/src/views/fhrz/modal/index.js @@ -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) => { <> { const user = useSelector(state => state.session.user); const warnType={ - 0: '准备转移' , - 1: '立即转移' + 30: '准备转移' , + 31: '立即转移' } const columnsMa = [