feat(): 白蚁普查修改

qzc-dev-demo
李神峰 2025-03-27 14:37:31 +08:00
parent ae58cfa58e
commit b54341ea7a
6 changed files with 167 additions and 90 deletions

View File

@ -62,7 +62,7 @@ const TopMenu: React.FC<{
const menuClicked = (id: any) => {
const menuItem:any = menu.find(m => m.id == id);
if (menuItem.title === "雨水工灾情") {
getReadStatus()
// getReadStatus()
}
const url = getMenuUrl(menuItem);
@ -74,17 +74,17 @@ const TopMenu: React.FC<{
* @description
*
*/
const getReadStatus = () => {
createCrudService(apiurl.ssyq.status).delGet().then((res) => {
if (res.code === 200) {
dispatch.runtime.setIsReadObject(res.data)
}
})
}
// const getReadStatus = () => {
// createCrudService(apiurl.ssyq.status).delGet().then((res) => {
// if (res.code === 200) {
// dispatch.runtime.setIsReadObject(res.data)
// }
// })
// }
useEffect(() => {
getReadStatus()
}, [])
// useEffect(() => {
// getReadStatus()
// }, [])
return (
<div className='app-top-menu'>

View File

@ -1,5 +1,4 @@
import { config } from '../config'
import Zfzl from '../views/gxsl/zfzl'
const pubapi_old = 'https://owrsvr.cloudowr.cn/svr'
const pubapi = 'https://owrsvr.cloudowr.cn/pubapi'
@ -342,7 +341,9 @@ const apiurl = {
},
byfz: {
bypc: {
page: service_fxdd + "/termite/survey/page",
// page: service_fxdd + "/termite/survey/page",
page: service_fxdd + "/termite/survey/pageDetail",
count:service_fxdd + "/termite/survey/count",
save: service_fxdd + "/termite/survey/insert",
edit: service_fxdd + "/termite/survey/update",
delete: service_fxdd + "/termite/survey/del",
@ -972,6 +973,10 @@ const apiurl = {
update: service_fxdd + "/attResBase/update",
getFile:service_fxdd + "/attResBase/file/get"
},
buildInfo: {
detail: service_fxdd + "/attResBuilding/info",
update: service_fxdd + "/attResBuilding/update",
},
kr: {
list: service_fxdd + "/stZvarlB/list",
save: service_fxdd + "/stZvarlB/insert",

View File

@ -5,11 +5,11 @@ module.exports = function (app) {
app.use(
'/gunshiApp',
createProxyMiddleware({
// target: 'http://local.gunshiiot.com:18083/',//测试
target: 'http://local.gunshiiot.com:18083/',//测试
// target: 'http://192.168.66.199:24105/',//正式
// target: 'http://36.139.207.50:18083/',//移动云
// target: 'http://192.168.66.49:24105/',//移动云
target: 'http://192.168.66.32:24105/', //ls
// target: 'http://192.168.66.32:24105/', //ls
changeOrigin: true,
})
);

View File

@ -8,6 +8,7 @@ import ModalForm from './form';
import apiurl from '../../../../service/apiurl';
import usePageTable from '../../../../components/crud/usePageTable2';
import { createCrudService } from '../../../../components/crud/_';
import { httppost2 } from '../../../../utils/request';
import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
import './index.less';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
@ -40,6 +41,7 @@ const Page = () => {
}
const refModal = useRef();
const [searchVal, setSearchVal] = useState({})
const [count, setCount] = useState({})
// const columns = [
// { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
// {title: '填报日期', key: 'reportDate', dataIndex: 'reportDate', width: 140,},
@ -74,26 +76,42 @@ const Page = () => {
const columns = [
{
title: '监测时间',
dataIndex: 'time',
key: 'time',
width: 180
dataIndex: 'reportDate',
key: 'reportDate',
width: 180,
align:'center'
},
{
title: '测点编号',
dataIndex: 'code',
key: 'code',
width: 120
dataIndex: 'pileNumber',
key: 'pileNumber',
width: 120,
align:'center'
},
{
title: '有无白蚁',
dataIndex: 'hasMosquito',
key: 'hasMosquito',
dataIndex: 'isHarm',
align:'center',
key: 'isHarm',
width: 100,
render: (text) => (
<Tag color={text ? 'red' : 'green'} style={{borderRadius: '50%', padding: '4px 8px'}}>
{text ? '有' : '无'}
render:(text, record) => {
// 如果 isHarm 为 null 或 undefined显示无
if (text == null) {
return <Tag color="#04d919" style={{borderRadius: '50%', padding: '4px 8px'}}></Tag>;
}
// 如果 isHandle 为 null 或 undefined当作 false 处理
const isHandle = record.isHandle ?? false;
return (
<Tag
color={text ? (isHandle ? '#04d919' : '#d9001b') : '#04d919'}
style={{borderRadius: '50%', padding: '4px 8px'}}
>
{text ? (isHandle ? '无' : '有') : '无'}
</Tag>
)
);
}
}
];
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
@ -119,7 +137,27 @@ const Page = () => {
*/
const successCallback = () => {
refresh()
}
}
// 获取白蚁统计数量
const getCount = async () => {
const params = {
pageSo: {
pageNumber: 1,
pageSize: 99999,
}
}
try {
const res = await httppost2(apiurl.rcgl.byfz.bypc.count, params);
setCount(res.data);
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getCount();
}, [])
useEffect(() => {
if (searchVal) {
const params = {
@ -140,7 +178,7 @@ const Page = () => {
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#722ed1' }}>{stats.total}</span>
<span className='number' style={{ color: '#722ed1' }}>{count.totalPoint}</span>
<span className="unit"></span>
</div>
<span className='label'>总监测点数</span>
@ -149,7 +187,7 @@ const Page = () => {
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#f5222d' }}>{stats.withMosquito}</span>
<span className='number' style={{ color: '#f5222d' }}>{count.hasAnt}</span>
<span className="unit"></span>
</div>
<span className='label'>有白蚁</span>
@ -158,7 +196,7 @@ const Page = () => {
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#52c41a' }}>{stats.withoutMosquito}</span>
<span className='number' style={{ color: '#52c41a' }}>{count.notAnt}</span>
<span className="unit"></span>
</div>
<span className='label'>无白蚁</span>
@ -167,7 +205,7 @@ const Page = () => {
<Col span={6}>
<div className='statItem'>
<div className='valueWrapper'>
<span className='number' style={{ color: '#8c8c8c' }}>{stats.noData}</span>
<span className='number' style={{ color: '#8c8c8c' }}>{count.noData}</span>
<span className="unit"></span>
</div>
<span className='label'>无数据</span>

View File

@ -12,10 +12,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const onFinish = (values) => {
let dateSo;
if (values.year) {
dateSo = moment(values.year).format('YYYY')
dateSo = moment(values.year).format('YYYY-MM-DD')
}
delete values.year
setSearchVal({...values, year:Number(dateSo)});
setSearchVal({...values, searchDate:dateSo});
}
// useEffect(() => {
@ -34,13 +34,13 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
<Form.Item label="监测日期" name="year">
<DatePicker
allowClear
style={{ width: "150px" }}
style={{ width: "240px" }}
/>
</Form.Item>
<Form.Item label="测点编号" name="year">
<Form.Item label="测点编号" name="pileNumber">
<Input
allowClear
style={{ width: "150px" }}
style={{ width: "240px" }}
/>
</Form.Item>
{/* <Form.Item label="" name="isHarm">

View File

@ -1,13 +1,47 @@
import React, { useState, useEffect } from 'react'
import { Row, Col, Form, Input, Divider, DatePicker, Button, Upload, message, Modal } from "antd"
import { formItemLayout } from '../../../../../components/crud/FormLayoutProps'
import { httpget2, httppost2 } from '../../../../../utils/request';
import apiurl from '../../../../../service/apiurl';
import './index.less'
export default function BuildInfo() {
const [form] = Form.useForm();
const [skdisabled, setSkDisabled] = useState(true)
const [data, setData] = useState()
const getData = async () => {
try {
const res = await httpget2(apiurl.dataResourcesCenter.projectAndWater.buildInfo.detail)
if (res.code == 200) {
form.setFieldsValue(res.data)
setData(res.data)
}
} catch (error) {
console.log(error);
}
}
const onFinish = async () => {
try {
const values = form.getFieldsValue();
const params = {
...data,
...values,
}
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.buildInfo.update, params)
if (res.code == 200) {
message.success("修改成功")
setSkDisabled(true)
getData()
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getData()
}, [])
return (
<div className='basic-info-content'>
<Form
@ -22,7 +56,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝型"
name="resName"
name="mainType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -31,7 +65,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶高程(m)"
name="resName"
name="mainCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -40,7 +74,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶长度(m)"
name="resName"
name="mainCrestLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -49,7 +83,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶宽度(m)"
name="resName"
name="mainCrestWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -57,7 +91,7 @@ export default function BuildInfo() {
</Col><Col span={8}>
<Form.Item
label="最大坝高(m)"
name="resName"
name="mainMaxHeight"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -72,7 +106,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝型"
name="resName"
name="auxType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -81,7 +115,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶高程(m)"
name="resName"
name="auxCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -90,7 +124,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶长度(m)"
name="resName"
name="auxCrestLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -99,7 +133,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶宽度(m)"
name="resName"
name="auxCrestWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -107,7 +141,7 @@ export default function BuildInfo() {
</Col><Col span={8}>
<Form.Item
label="最大坝高(m)"
name="resName"
name="auxMaxHeight"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -122,7 +156,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="型式"
name="resName"
name="spillwayType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -131,7 +165,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="堰顶型式"
name="resName"
name="spillwayCrestType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -140,7 +174,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="地基特性"
name="resName"
name="spillwayFoundation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -149,7 +183,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="溢流堰顶高程(m)"
name="resName"
name="spillwayCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -158,7 +192,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="溢流堰净宽(m)"
name="resName"
name="spillwayNetWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -167,31 +201,31 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="消能型式"
name="resName"
name="spillwayEnergyDissipation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="校核洪水下泄流量(m3/s)"
name="resName"
label="校核洪水下泄流量(m³/s)"
name="spillwayCheckFloodDischarge"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="设计洪水下泄流量(m3/s)"
name="resName"
label="设计洪水下泄流量(m³/s)"
name="spillwayDesignFloodDischarge"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="消能防冲下泄流量(m3/s)"
name="resName"
label="消能防冲下泄流量(m³/s)"
name="spillwayScouringDischarge"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -206,7 +240,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="型式"
name="resName"
name="irrigationType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -215,7 +249,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="衬砌型式"
name="resName"
name="irrigationLiningType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -224,7 +258,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="地基特性"
name="resName"
name="irrigationFoundation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -233,7 +267,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="进口底板高程(m)"
name="resName"
name="irrigationInletElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -242,7 +276,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="断面尺寸(m)"
name="resName"
name="irrigationCrossSection"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -251,15 +285,15 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="洞长(m)"
name="resName"
name="irrigationLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="设计流量(m3/s)"
name="resName"
label="设计流量(m³/s)"
name="irrigationDesignFlow"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -267,7 +301,7 @@ export default function BuildInfo() {
</Col> <Col span={8}>
<Form.Item
label="进口闸门型式"
name="resName"
name="irrigationGateType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -275,7 +309,7 @@ export default function BuildInfo() {
</Col> <Col span={8}>
<Form.Item
label="进口启闭机型式"
name="resName"
name="irrigationHoistType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -290,7 +324,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="型式"
name="resName"
name="emptyingType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -299,7 +333,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="衬砌型式"
name="resName"
name="emptyingLiningType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -308,7 +342,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="地基特性"
name="resName"
name="emptyingFoundation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -317,7 +351,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="进口底板高程(m)"
name="resName"
name="emptyingInletElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -326,7 +360,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="断面尺寸(m)"
name="resName"
name="emptyingCrossSection"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -335,15 +369,15 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="洞长(m)"
name="resName"
name="emptyingLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
</Form.Item>
</Col> <Col span={8}>
<Form.Item
label="设计流量(m3/s)"
name="resName"
label="设计流量(m³/s)"
name="emptyingDesignFlow"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -351,7 +385,7 @@ export default function BuildInfo() {
</Col> <Col span={8}>
<Form.Item
label="进口闸门型式"
name="resName"
name="emptyingGateType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -359,7 +393,7 @@ export default function BuildInfo() {
</Col> <Col span={8}>
<Form.Item
label="进口启闭机型式"
name="resName"
name="emptyingHoistType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -374,7 +408,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝型"
name="resName"
name="floodControlType"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -383,7 +417,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶高程(m)"
name="resName"
name="floodControlCrestElevation"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -392,7 +426,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶长度(m)"
name="resName"
name="floodControlCrestLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -401,7 +435,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="坝顶宽度(m)"
name="resName"
name="floodControlCrestWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -409,7 +443,7 @@ export default function BuildInfo() {
</Col><Col span={8}>
<Form.Item
label="最大坝高(m)"
name="resName"
name="floodControlMaxHeight"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -424,7 +458,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="防汛路长度(m)"
name="resName"
name="roadLength"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />
@ -433,7 +467,7 @@ export default function BuildInfo() {
<Col span={8}>
<Form.Item
label="路面宽度(m)"
name="resName"
name="roadWidth"
>
<Input allowClear style={{ width: '300px' }} disabled={skdisabled} />