feat():安全监测需求更改
parent
b96bdc2426
commit
08f2ff9348
|
|
@ -33,6 +33,12 @@ const SiderMenu: React.FC<{
|
|||
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 当menuIndexes[1]变化时,更新openKeys
|
||||
useEffect(() => {
|
||||
if (menuIndexes[1]) {
|
||||
setOpenKeys([`${menuIndexes[1]}`]);
|
||||
}
|
||||
}, [menuIndexes[1]]);
|
||||
function goto(url: string) {
|
||||
setIr(url)
|
||||
if (pathname !== url) {
|
||||
|
|
@ -179,3 +185,4 @@ const SiderMenu: React.FC<{
|
|||
}
|
||||
|
||||
export default React.memo(SiderMenu);
|
||||
|
||||
|
|
@ -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}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
@ -120,6 +120,7 @@ const apiurl = {
|
|||
page: service_ykz + '/osmoticProfileRel/page',
|
||||
save: service_ykz + '/osmoticProfileRel/insert',
|
||||
delete: service_ykz + '/osmoticProfileRel/del',
|
||||
edit: service_ykz + '/osmoticProfileRel/update',
|
||||
},
|
||||
yjjl: {
|
||||
page: service_ykz + '/osmoticWarnRecord/page',
|
||||
|
|
|
|||
|
|
@ -51,13 +51,14 @@ const Page = () => {
|
|||
{title: '监测值', key: 'data', dataIndex: 'data', width: 120, align: "center",}
|
||||
];
|
||||
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) => ({
|
||||
title: `${index + 1}月`,
|
||||
key: `drpM${index + 1}`,
|
||||
dataIndex: `drpM${index + 1}`,
|
||||
width: 100,
|
||||
align: "center",
|
||||
render: (v) => <span>{v === null ? '':v}</span>
|
||||
}))
|
||||
];
|
||||
|
||||
|
|
@ -208,6 +209,7 @@ const Page = () => {
|
|||
}
|
||||
if (searchVal.type1 == 1) {
|
||||
getStaData(searchVal)
|
||||
getData(searchVal)
|
||||
}
|
||||
|
||||
if (searchVal.type1 == 2) {
|
||||
|
|
@ -238,7 +240,7 @@ const Page = () => {
|
|||
formatDate(searchVal.year):formatDate(searchVal.yearMonth)
|
||||
}
|
||||
{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}
|
||||
|
|
@ -313,11 +315,11 @@ const Page = () => {
|
|||
</Table.Summary.Row>
|
||||
<Table.Summary.Row>
|
||||
<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={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={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.Row>
|
||||
</Table.Summary> :
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ const Page = () => {
|
|||
<CrudOpRender_text
|
||||
edit={(editBtn && tabs == 0) ? true : false}
|
||||
del={(delBtn && tabs == 0) ? true : false}
|
||||
detail={viewBtn ? true : false}
|
||||
view={viewBtn ? true : false}
|
||||
command={(cmd) => () => command(cmd)(row)} />)
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,35 +6,35 @@
|
|||
export const gateMarkersConfig = [
|
||||
{
|
||||
id: 1,
|
||||
name: '1号闸门',
|
||||
name: '1号闸孔',
|
||||
workGate: '-',
|
||||
repairGate: '-',
|
||||
position: { left: 33, top: 45 } // 根据实际图片调整这些值
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '2号闸门',
|
||||
name: '2号闸孔',
|
||||
workGate: '-',
|
||||
repairGate: '-',
|
||||
position: { left: 40, top: 45 } // 根据实际图片调整这些值
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '3号闸门',
|
||||
name: '3号闸孔',
|
||||
workGate: '-',
|
||||
repairGate: '-',
|
||||
position: { left: 47, top: 45 } // 根据实际图片调整这些值
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '4号闸门',
|
||||
name: '4号闸孔',
|
||||
workGate: '-',
|
||||
repairGate: '-',
|
||||
position: { left: 54, top: 45 } // 根据实际图片调整这些值
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '5号闸门',
|
||||
name: '5号闸孔',
|
||||
workGate: '-',
|
||||
repairGate: '-',
|
||||
position: { left: 61, top: 45 } // 根据实际图片调整这些值
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ export default function Home() {
|
|||
<div className='content-right'>
|
||||
{/* 操作日志 */}
|
||||
<div className='operate-log'>
|
||||
<div className='project-title'>七天操作日志</div>
|
||||
<div className='project-title'>近7日操作日志</div>
|
||||
<div className='project-content'>
|
||||
<table style={{ width: '100%' }}>
|
||||
<thead>
|
||||
|
|
@ -467,7 +467,7 @@ export default function Home() {
|
|||
<th style={{ width: 129 }}>报警时间</th>
|
||||
</tr>
|
||||
</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) => (
|
||||
<tr style={{ borderBottom: '2px solid #536cc6', textAlign: 'center' }} className={clsx({ 'odd_row': i % 2 })} key={i}>
|
||||
<td style={{ width: 58 }}>{jcdType[item.type]}</td>
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
|
|||
|
||||
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
||||
const types = [
|
||||
{
|
||||
label: "位移",
|
||||
value: 0,
|
||||
},
|
||||
// {
|
||||
// label: "位移",
|
||||
// value: 0,
|
||||
// },
|
||||
{
|
||||
label: "结构缝",
|
||||
value: 1,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayo
|
|||
import apiurl from '../../../service/apiurl';
|
||||
import "./index.less"
|
||||
import moment from 'moment';
|
||||
import NormalSelect from '../../../components/Form/NormalSelect';
|
||||
import { httpget2 } from '../../../utils/request';
|
||||
|
||||
const { RangePicker } = DatePicker
|
||||
|
||||
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 (
|
||||
<>
|
||||
|
|
@ -30,11 +50,11 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
<Row>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="监测点"
|
||||
label="测点"
|
||||
name="stationCode"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
|
||||
<NormalSelect allowClear style={{ width: '100%' }} options={cdList} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
const [form] = Form.useForm();
|
||||
const onfinish = (values) => {
|
||||
if (mode === 'edit') {
|
||||
onEdit(apiurl.aqjc.dmgl.edit,{...record,...values})
|
||||
onEdit(apiurl.aqjc.gl.edit,{...record,...values})
|
||||
}
|
||||
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 {
|
||||
const res = await httpget2(apiurl.aqjc.dmgl.info + type)
|
||||
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) {
|
||||
console.log(error);
|
||||
|
|
@ -71,7 +71,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
<Col span={24}>
|
||||
<Form.Item
|
||||
label="测点名称"
|
||||
name="stationCode"
|
||||
name="stationId"
|
||||
>
|
||||
<NormalSelect disabled={mode === 'view'} style={{ width: '100%' }} allowClear options={cdList} />
|
||||
</Form.Item>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ const Page = () => {
|
|||
title: '操作', key: 'operation', width: 200, fixed: 'right',align: 'center',
|
||||
render: (value, row, index) => (
|
||||
<CrudOpRender_text
|
||||
edit={ true }
|
||||
del={ true }
|
||||
command={(cmd) => () => command(cmd)(row)} />)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
name="quantity"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<InputNumber isabled={mode==='view'} style={{width:'100%'}} allowClear/>
|
||||
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
|||
showTime
|
||||
style={{ width: "330px" }}
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder={['开始时间','结束时间']}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
|||
let dateTimeRangeSo;
|
||||
if (values.tm) {
|
||||
dateTimeRangeSo = {
|
||||
start: moment(values.tm[0]).format('YYYY-MM-DD HH:mm:ss'),
|
||||
end: moment(values.tm[1]).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 23:59:59')
|
||||
}
|
||||
}
|
||||
delete values.tm
|
||||
|
|
@ -44,9 +44,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
|||
<Form.Item label="记录时间" name="tm">
|
||||
<RangePicker
|
||||
allowClear
|
||||
showTime
|
||||
style={{ width: "330px" }}
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
format="YYYY-MM-DD"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayo
|
|||
import {getCurrentQuarter,getQuarterStartEndDates} from "../../../utils/tools"
|
||||
import apiurl from '../../../service/apiurl';
|
||||
import NormalSelect from '../../../components/Form/NormalSelect';
|
||||
import PersonTree from '../../../components/MultiPersonTree';
|
||||
import "./index.less"
|
||||
import moment from 'moment';
|
||||
const { RangePicker } = DatePicker
|
||||
|
|
@ -88,6 +89,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
|
|||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
|
||||
{/* <PersonTree multiple maxTagCount={5}/> */}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const ToolBar = ({ setSearchVal, onSave, dispatchBtn = false, setDashOpen }) =>
|
|||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||
<Form className='toolbarBox' layout="inline" onFinish={(v) => setSearchVal(v)}>
|
||||
<Form.Item label="用户" name="userName">
|
||||
<Input allowClear placeholder='请输入账号/姓名/手机号查询' style={{ width: '250px' }} />
|
||||
<Input allowClear placeholder='请输入账号查询' style={{ width: '250px' }} />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">查询</Button>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
|||
}
|
||||
|
||||
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')
|
||||
form.setFieldsValue({
|
||||
tm: [moment(start), moment(end)]
|
||||
|
|
@ -62,6 +62,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, exportFile1 }) => {
|
|||
showTime
|
||||
style={{ width: "330px" }}
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder={['开始时间','结束时间']}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue