feat():安全监测需求更改

master
李神峰 2026-01-05 17:34:06 +08:00
parent b96bdc2426
commit 08f2ff9348
18 changed files with 353 additions and 216 deletions

View File

@ -33,6 +33,12 @@ const SiderMenu: React.FC<{
const navigate = useNavigate(); const navigate = useNavigate();
// 当menuIndexes[1]变化时更新openKeys
useEffect(() => {
if (menuIndexes[1]) {
setOpenKeys([`${menuIndexes[1]}`]);
}
}, [menuIndexes[1]]);
function goto(url: string) { function goto(url: string) {
setIr(url) setIr(url)
if (pathname !== url) { if (pathname !== url) {
@ -179,3 +185,4 @@ const SiderMenu: React.FC<{
} }
export default React.memo(SiderMenu); export default React.memo(SiderMenu);

View File

@ -0,0 +1,105 @@
import React,{useState,useMemo,useEffect} from 'react'
import { TreeSelect } from "antd"
import apiurl from '../../service/apiurl'
import { xyt_httpget2 } from '../../utils/request'
export default function PersonTree({ value, onChange, allowClear = true, multiple = false, maxTagCount = 1, disabled, style, placeholder = '请选择人员', status }) {
const [deptList, setDeptList] = useState([])
const [deptUserList, setDeptUserList] = useState([])
const buildTree = (data, parentId) => {
let tree = [];
data.forEach((node) => {
node.title = node.deptName;
node.key = node.deptId;
if (node.parentId === parentId) {
let children = buildTree(data, node.deptId);
if (children.length) {
node.children = children;
}
tree.push(node);
}
});
return tree;
}
const handleTreeList = (dept, user) => {
const deptArr = dept.map(item => {
return {
...item,
value: item.deptId,
title: item.deptName,
disabled: item.userId ? false : true,
children: user.filter(u => u.deptId == item.deptId).map(u => ({
...u,
value: u.userId,
title: u.nickName || u.userName
}))
}
})
const treelist = buildTree(deptArr,0)
return treelist
}
const treeList = useMemo(() => {
if (deptUserList?.length > 0 && deptList?.length > 0) {
return handleTreeList(deptList,deptUserList)
} else {
return []
}
}, [deptUserList, deptList])
// 获取部门数据
const getDeptList = async() => {
try {
const result = await xyt_httpget2(apiurl.rcgl.xcxj.xjrw.deptlist);
if (result.code == 200) {
setDeptList(result.data);
getDeptUser()
}
} catch (error) {
console.log(error);
}
}
const getDeptUser = async() => {
try {
const result = await xyt_httpget2(apiurl.rcgl.xcxj.xjrw.userList, {pageNum:1,pageSize:9999});
if (result.code == 200) {
setDeptUserList(result.rows)
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getDeptList()
}, [])
return (
<>
<TreeSelect
value={value}
onChange={onChange}
showSearch
style={{
width: '100%',
...style
}}
dropdownStyle={{
maxHeight: 400,
overflow: 'auto',
}}
allowClear={allowClear}
disabled={disabled}
placeholder={placeholder}
status={status}
treeDefaultExpandAll
treeData={treeList}
treeNodeFilterProp='title'
treeCheckable={multiple}
maxTagCount={multiple ? maxTagCount : undefined}
/>
</>
)
}

View File

@ -120,6 +120,7 @@ const apiurl = {
page: service_ykz + '/osmoticProfileRel/page', page: service_ykz + '/osmoticProfileRel/page',
save: service_ykz + '/osmoticProfileRel/insert', save: service_ykz + '/osmoticProfileRel/insert',
delete: service_ykz + '/osmoticProfileRel/del', delete: service_ykz + '/osmoticProfileRel/del',
edit: service_ykz + '/osmoticProfileRel/update',
}, },
yjjl: { yjjl: {
page: service_ykz + '/osmoticWarnRecord/page', page: service_ykz + '/osmoticWarnRecord/page',

View File

@ -51,13 +51,14 @@ const Page = () => {
{title: '监测值', key: 'data', dataIndex: 'data', width: 120, align: "center",} {title: '监测值', key: 'data', dataIndex: 'data', width: 120, align: "center",}
]; ];
const yearColumns = [ const yearColumns = [
// { title: '日期', key: 'date', dataIndex: 'date', width: 120, align: "center", fixed: "left" }, { title: '序号', key: 'date', dataIndex: 'date', width: 120, align: "center", fixed: "left" },
...Array(12).fill(0).map((item, index) => ({ ...Array(12).fill(0).map((item, index) => ({
title: `${index + 1}`, title: `${index + 1}`,
key: `drpM${index + 1}`, key: `drpM${index + 1}`,
dataIndex: `drpM${index + 1}`, dataIndex: `drpM${index + 1}`,
width: 100, width: 100,
align: "center", align: "center",
render: (v) => <span>{v === null ? '':v}</span>
})) }))
]; ];
@ -208,6 +209,7 @@ const Page = () => {
} }
if (searchVal.type1 == 1) { if (searchVal.type1 == 1) {
getStaData(searchVal) getStaData(searchVal)
getData(searchVal)
} }
if (searchVal.type1 == 2) { if (searchVal.type1 == 2) {
@ -238,7 +240,7 @@ const Page = () => {
formatDate(searchVal.year):formatDate(searchVal.yearMonth) formatDate(searchVal.year):formatDate(searchVal.yearMonth)
} }
{projectType[searchVal.type]}{bbType[searchVal.type1]}</h2> {projectType[searchVal.type]}{bbType[searchVal.type1]}</h2>
<div style={{ textAlign: "right" }}>单位{searchVal?.type != 1 ? 'm' : 'mm'}</div> <div style={{ textAlign: "right" }}>单位{searchVal?.type == 0 ? 'm³/s' :searchVal?.type == 1? 'mm':'m'}</div>
</> </>
)} )}
columns={searchVal.type1 == 0 ? newTimeColumns : searchVal.type1 == 1 ? yearColumns : dayColumns} columns={searchVal.type1 == 0 ? newTimeColumns : searchVal.type1 == 1 ? yearColumns : dayColumns}
@ -313,11 +315,11 @@ const Page = () => {
</Table.Summary.Row> </Table.Summary.Row>
<Table.Summary.Row> <Table.Summary.Row>
<Table.Summary.Cell index={200} align='center' >年统计</Table.Summary.Cell> <Table.Summary.Cell index={200} align='center' >年统计</Table.Summary.Cell>
<Table.Summary.Cell index={1} align='center' >最高水位</Table.Summary.Cell> <Table.Summary.Cell index={1} align='center' >{searchVal.type == 0 ? '最高流量':'最高水位'}</Table.Summary.Cell>
<Table.Summary.Cell index={2} align='center' colSpan={3}>{staData?.max}</Table.Summary.Cell> <Table.Summary.Cell index={2} align='center' colSpan={3}>{staData?.max}</Table.Summary.Cell>
<Table.Summary.Cell index={3} align='center'>最低水位</Table.Summary.Cell> <Table.Summary.Cell index={3} align='center'>{searchVal.type == 0 ? '最低流量':'最低水位'}</Table.Summary.Cell>
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.min}</Table.Summary.Cell> <Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.min}</Table.Summary.Cell>
<Table.Summary.Cell index={3} align='center'>平均水位</Table.Summary.Cell> <Table.Summary.Cell index={3} align='center'>{searchVal.type == 0 ? '平均流量':'平均水位'}</Table.Summary.Cell>
<Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.avg}</Table.Summary.Cell> <Table.Summary.Cell index={4} align='center' colSpan={3}>{staData?.avg}</Table.Summary.Cell>
</Table.Summary.Row> </Table.Summary.Row>
</Table.Summary> : </Table.Summary> :

View File

@ -75,7 +75,7 @@ const Page = () => {
<CrudOpRender_text <CrudOpRender_text
edit={(editBtn && tabs == 0) ? true : false} edit={(editBtn && tabs == 0) ? true : false}
del={(delBtn && tabs == 0) ? true : false} del={(delBtn && tabs == 0) ? true : false}
detail={viewBtn ? true : false} view={viewBtn ? true : false}
command={(cmd) => () => command(cmd)(row)} />) command={(cmd) => () => command(cmd)(row)} />)
}, },
]; ];

View File

@ -6,35 +6,35 @@
export const gateMarkersConfig = [ export const gateMarkersConfig = [
{ {
id: 1, id: 1,
name: '1号闸', name: '1号闸',
workGate: '-', workGate: '-',
repairGate: '-', repairGate: '-',
position: { left: 33, top: 45 } // 根据实际图片调整这些值 position: { left: 33, top: 45 } // 根据实际图片调整这些值
}, },
{ {
id: 2, id: 2,
name: '2号闸', name: '2号闸',
workGate: '-', workGate: '-',
repairGate: '-', repairGate: '-',
position: { left: 40, top: 45 } // 根据实际图片调整这些值 position: { left: 40, top: 45 } // 根据实际图片调整这些值
}, },
{ {
id: 3, id: 3,
name: '3号闸', name: '3号闸',
workGate: '-', workGate: '-',
repairGate: '-', repairGate: '-',
position: { left: 47, top: 45 } // 根据实际图片调整这些值 position: { left: 47, top: 45 } // 根据实际图片调整这些值
}, },
{ {
id: 4, id: 4,
name: '4号闸', name: '4号闸',
workGate: '-', workGate: '-',
repairGate: '-', repairGate: '-',
position: { left: 54, top: 45 } // 根据实际图片调整这些值 position: { left: 54, top: 45 } // 根据实际图片调整这些值
}, },
{ {
id: 5, id: 5,
name: '5号闸', name: '5号闸',
workGate: '-', workGate: '-',
repairGate: '-', repairGate: '-',
position: { left: 61, top: 45 } // 根据实际图片调整这些值 position: { left: 61, top: 45 } // 根据实际图片调整这些值

View File

@ -421,7 +421,7 @@ export default function Home() {
<div className='content-right'> <div className='content-right'>
{/* 操作日志 */} {/* 操作日志 */}
<div className='operate-log'> <div className='operate-log'>
<div className='project-title'>七天操作日志</div> <div className='project-title'>近7日操作日志</div>
<div className='project-content'> <div className='project-content'>
<table style={{ width: '100%' }}> <table style={{ width: '100%' }}>
<thead> <thead>
@ -467,7 +467,7 @@ export default function Home() {
<th style={{ width: 129 }}>报警时间</th> <th style={{ width: 129 }}>报警时间</th>
</tr> </tr>
</thead> </thead>
<tbody style={{ height: 170, overflow: policeData.length > 6 ? 'scroll' : 'hidden' }} > <tbody style={{ height: 170, overflowY: policeData.length > 6 ? 'scroll' : 'hidden' }} >
{policeData.length > 0 ? policeData.map((item, i) => ( {policeData.length > 0 ? policeData.map((item, i) => (
<tr style={{ borderBottom: '2px solid #536cc6', textAlign: 'center' }} className={clsx({ 'odd_row': i % 2 })} key={i}> <tr style={{ borderBottom: '2px solid #536cc6', textAlign: 'center' }} className={clsx({ 'odd_row': i % 2 })} key={i}>
<td style={{ width: 58 }}>{jcdType[item.type]}</td> <td style={{ width: 58 }}>{jcdType[item.type]}</td>

View File

@ -10,10 +10,10 @@ const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => { const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const types = [ const types = [
{ // {
label: "位移", // label: "位移",
value: 0, // value: 0,
}, // },
{ {
label: "结构缝", label: "结构缝",
value: 1, value: 1,

View File

@ -4,6 +4,9 @@ import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayo
import apiurl from '../../../service/apiurl'; import apiurl from '../../../service/apiurl';
import "./index.less" import "./index.less"
import moment from 'moment'; import moment from 'moment';
import NormalSelect from '../../../components/Form/NormalSelect';
import { httpget2 } from '../../../utils/request';
const { RangePicker } = DatePicker const { RangePicker } = DatePicker
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => { const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
@ -18,6 +21,23 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
} }
} }
const [cdList, setCdList] = useState([])
// 测点类型
const getCdList = async (type) => {
try {
const res = await httpget2(apiurl.aqjc.dmgl.info + type)
if (res.code == 200) {
setCdList(res.data.map(item => ({ label: item.stationCode, value: item.stationCode })))
}
} catch (error) {
console.log(error);
}
}
useEffect(() => {
getCdList(0)
}, [])
return ( return (
<> <>
@ -30,11 +50,11 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Row> <Row>
<Col span={12}> <Col span={12}>
<Form.Item <Form.Item
label="测点" label="测点"
name="stationCode" name="stationCode"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear /> <NormalSelect allowClear style={{ width: '100%' }} options={cdList} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>

View File

@ -9,10 +9,10 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const onfinish = (values) => { const onfinish = (values) => {
if (mode === 'edit') { if (mode === 'edit') {
onEdit(apiurl.aqjc.dmgl.edit,{...record,...values}) onEdit(apiurl.aqjc.gl.edit,{...record,...values})
} }
if (mode === 'save') { if (mode === 'save') {
onSave(apiurl.aqjc.dmgl.save,values) onSave(apiurl.aqjc.gl.save,values)
} }
} }
@ -36,7 +36,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
try { try {
const res = await httpget2(apiurl.aqjc.dmgl.info + type) const res = await httpget2(apiurl.aqjc.dmgl.info + type)
if (res.code == 200) { if (res.code == 200) {
setCdList(res.data.map(item => ({label: item.stationCode,value: item.stationCode}))) setCdList(res.data.map(item => ({label: item.stationCode,value: item.id})))
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
@ -71,7 +71,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={24}> <Col span={24}>
<Form.Item <Form.Item
label="测点名称" label="测点名称"
name="stationCode" name="stationId"
> >
<NormalSelect disabled={mode === 'view'} style={{ width: '100%' }} allowClear options={cdList} /> <NormalSelect disabled={mode === 'view'} style={{ width: '100%' }} allowClear options={cdList} />
</Form.Item> </Form.Item>

View File

@ -29,7 +29,6 @@ const Page = () => {
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center', title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
render: (value, row, index) => ( render: (value, row, index) => (
<CrudOpRender_text <CrudOpRender_text
edit={ true }
del={ true } del={ true }
command={(cmd) => () => command(cmd)(row)} />) command={(cmd) => () => command(cmd)(row)} />)
}, },

View File

@ -122,7 +122,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
name="quantity" name="quantity"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<InputNumber isabled={mode==='view'} style={{width:'100%'}} allowClear/> <InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear/>
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>

View File

@ -50,6 +50,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
showTime showTime
style={{ width: "330px" }} style={{ width: "330px" }}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
placeholder={['开始时间','结束时间']}
/> />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>

View File

@ -25,8 +25,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
let dateTimeRangeSo; let dateTimeRangeSo;
if (values.tm) { if (values.tm) {
dateTimeRangeSo = { dateTimeRangeSo = {
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'), start: moment(values.tm[0]).format('YYYY-MM-DD 00:00:00'),
end: moment(values.tm[1]).format('YYYY-MM-DD HH:mm:ss') end: moment(values.tm[1]).format('YYYY-MM-DD 23:59:59')
} }
} }
delete values.tm delete values.tm
@ -44,9 +44,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
<Form.Item label="记录时间" name="tm"> <Form.Item label="记录时间" name="tm">
<RangePicker <RangePicker
allowClear allowClear
showTime
style={{ width: "330px" }} style={{ width: "330px" }}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
/> />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>

View File

@ -5,6 +5,7 @@ import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayo
import {getCurrentQuarter,getQuarterStartEndDates} from "../../../utils/tools" import {getCurrentQuarter,getQuarterStartEndDates} from "../../../utils/tools"
import apiurl from '../../../service/apiurl'; import apiurl from '../../../service/apiurl';
import NormalSelect from '../../../components/Form/NormalSelect'; import NormalSelect from '../../../components/Form/NormalSelect';
import PersonTree from '../../../components/MultiPersonTree';
import "./index.less" import "./index.less"
import moment from 'moment'; import moment from 'moment';
const { RangePicker } = DatePicker const { RangePicker } = DatePicker
@ -88,6 +89,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear /> <Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
{/* <PersonTree multiple maxTagCount={5}/> */}
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>

View File

@ -6,7 +6,7 @@ const ToolBar = ({ setSearchVal, onSave, dispatchBtn = false, setDashOpen }) =>
<div style={{display:'flex',justifyContent:'space-between'}}> <div style={{display:'flex',justifyContent:'space-between'}}>
<Form className='toolbarBox' layout="inline" onFinish={(v) => setSearchVal(v)}> <Form className='toolbarBox' layout="inline" onFinish={(v) => setSearchVal(v)}>
<Form.Item label="用户" name="userName"> <Form.Item label="用户" name="userName">
<Input allowClear placeholder='请输入账号/姓名/手机号查询' style={{ width: '250px' }} /> <Input allowClear placeholder='请输入账号查询' style={{ width: '250px' }} />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">查询</Button> <Button type="primary" htmlType="submit">查询</Button>

View File

@ -38,7 +38,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
} }
useEffect(() => { useEffect(() => {
const start = moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00') const start = moment().subtract(6, 'days').format('YYYY-MM-DD 00:00:00')
const end = moment().format('YYYY-MM-DD 23:59:59') const end = moment().format('YYYY-MM-DD 23:59:59')
form.setFieldsValue({ form.setFieldsValue({
tm: [moment(start), moment(end)] tm: [moment(start), moment(end)]
@ -62,6 +62,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
showTime showTime
style={{ width: "330px" }} style={{ width: "330px" }}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
placeholder={['开始时间','结束时间']}
/> />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>