2025-10-09 17:22:42 +08:00
|
|
|
|
import React, { useEffect, useState, useRef, useMemo } from 'react'
|
2025-10-09 09:49:16 +08:00
|
|
|
|
import { useLocation } from 'react-router'
|
|
|
|
|
|
import { useDispatch, useSelector } from 'react-redux'
|
|
|
|
|
|
import {Form, Input, DatePicker, Popover, Collapse , Button, message, Table, Col, Modal} from 'antd';
|
|
|
|
|
|
import { createCrudService } from '../../../components/crud/_';
|
|
|
|
|
|
import apiurl from '../../../service/apiurl';
|
|
|
|
|
|
import ModalForm from './information';
|
2025-10-09 17:22:42 +08:00
|
|
|
|
import { getTableData } from './service';
|
|
|
|
|
|
import moment from 'moment';
|
2025-10-09 09:49:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-09 17:22:42 +08:00
|
|
|
|
const Page = ({ setCtx }) => {
|
2025-10-09 09:49:16 +08:00
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
let mapObj = useSelector(s => s.map.map)
|
|
|
|
|
|
const [index,setIndex] = useState(0)
|
|
|
|
|
|
const [data,setData] = useState([])
|
2025-10-27 09:16:28 +08:00
|
|
|
|
const [project, setProject] = useState(null)
|
2025-10-09 09:49:16 +08:00
|
|
|
|
const [open, setOpen] = useState(false)
|
2025-10-09 17:22:42 +08:00
|
|
|
|
const [name, setName] = useState('')
|
|
|
|
|
|
const [tms,setTms] = useState([])
|
|
|
|
|
|
const listData = useMemo(()=>{
|
|
|
|
|
|
let list = [...data]
|
|
|
|
|
|
if(name){
|
|
|
|
|
|
list = list.filter((i)=>i.name.indexOf(name)>-1)
|
|
|
|
|
|
}
|
|
|
|
|
|
if(tms&&tms.length>0){
|
|
|
|
|
|
list = list.filter((i)=>{
|
|
|
|
|
|
const stm = moment(tms[0])
|
|
|
|
|
|
const etm = moment(tms[1])
|
|
|
|
|
|
const tm = moment(i.updateTm)
|
|
|
|
|
|
if(tm.isAfter(stm)&&etm.isAfter(tm)){
|
|
|
|
|
|
return true
|
|
|
|
|
|
}else{
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
return list
|
|
|
|
|
|
},[data,name,tms])
|
2025-10-09 09:49:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
getData()
|
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
|
|
const getData = async()=>{
|
2025-10-09 17:22:42 +08:00
|
|
|
|
const data = await getTableData()
|
2025-10-27 17:55:38 +08:00
|
|
|
|
|
|
|
|
|
|
const data1 = {
|
|
|
|
|
|
...data[0],
|
|
|
|
|
|
ymtj:{
|
|
|
|
|
|
count:{
|
|
|
|
|
|
xhl:2.98,//泄洪量
|
|
|
|
|
|
zgymss:0.8,//最高淹没水深
|
|
|
|
|
|
ymls:48,//淹没历时
|
|
|
|
|
|
szmj:1.18,//受灾面积
|
|
|
|
|
|
szcz:2,//受灾村庄
|
|
|
|
|
|
szrk:217,//受灾人口
|
|
|
|
|
|
},
|
|
|
|
|
|
czList:[
|
|
|
|
|
|
{
|
|
|
|
|
|
cznm:'檀树岗村',
|
|
|
|
|
|
rk:98,
|
|
|
|
|
|
sd:0.3,
|
|
|
|
|
|
tm:'2024-06-21 18:00:00',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
cznm:'程维德村',
|
|
|
|
|
|
rk:99,
|
|
|
|
|
|
sd:0.5,
|
|
|
|
|
|
tm:'2024-06-21 18:20:00',
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
qsydwList:[
|
|
|
|
|
|
{
|
|
|
|
|
|
dw:'七里坪镇檀树中学',
|
|
|
|
|
|
rk:20,
|
|
|
|
|
|
sd:0.5,
|
|
|
|
|
|
tm:'2024-06-21 18:00:00'
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const data2 = {
|
|
|
|
|
|
...data[1],
|
|
|
|
|
|
ymtj:{
|
|
|
|
|
|
count:{
|
|
|
|
|
|
xhl:4.56,//泄洪量
|
|
|
|
|
|
zgymss:0.8,//最高淹没水深
|
|
|
|
|
|
ymls:49,//淹没历时
|
|
|
|
|
|
szmj:2.88,//受灾面积
|
|
|
|
|
|
szcz:3,//受灾村庄
|
|
|
|
|
|
szrk:219,//受灾人口
|
|
|
|
|
|
},
|
|
|
|
|
|
czList:[
|
|
|
|
|
|
{
|
|
|
|
|
|
cznm:'檀树岗村',
|
|
|
|
|
|
rk:96,
|
|
|
|
|
|
sd:0.3,
|
|
|
|
|
|
tm:'2024-11-13 18:00:00',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
cznm:'程维德村',
|
|
|
|
|
|
rk:99,
|
|
|
|
|
|
sd:0.5,
|
|
|
|
|
|
tm:'2024-11-13 18:20:00',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
cznm:'戴世英村',
|
|
|
|
|
|
rk:12,
|
|
|
|
|
|
sd:0.8,
|
|
|
|
|
|
tm:'2024-11-13 18:50:00',
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
qsydwList:[
|
|
|
|
|
|
{
|
|
|
|
|
|
dw:'七里坪镇檀树中学',
|
|
|
|
|
|
rk:20,
|
|
|
|
|
|
sd:0.5,
|
|
|
|
|
|
tm:'2024-06-21 18:00:00'
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
setData([data1,data2])
|
2025-10-09 09:49:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-09 17:22:42 +08:00
|
|
|
|
|
|
|
|
|
|
const openModal = (item)=>{
|
2025-10-27 09:16:28 +08:00
|
|
|
|
if(index===0){ item.czmlPath = `${process.env.PUBLIC_URL}/data/json/czml1.json` }
|
|
|
|
|
|
if(index===1){ item.czmlPath = `${process.env.PUBLIC_URL}/data/json/czml2.json` }
|
2025-10-09 17:22:42 +08:00
|
|
|
|
setOpen(true)
|
2025-10-27 09:16:28 +08:00
|
|
|
|
setProject(item)
|
2025-10-09 17:22:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
const closeModal = ()=>{
|
2025-10-09 09:49:16 +08:00
|
|
|
|
setOpen(false)
|
2025-10-27 09:16:28 +08:00
|
|
|
|
setProject(null)
|
2025-10-09 09:49:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<div className='hsyyBox'>
|
2025-10-09 17:22:42 +08:00
|
|
|
|
<div className='homePage_head2'>
|
|
|
|
|
|
<div className='homePage_head2_Bg'>
|
|
|
|
|
|
<img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/titleBg2.png`} width="14" height="14" alt="" style={{ margin: '0 10px' }} />
|
|
|
|
|
|
预报方案
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<Form className='toolbarBox'>
|
|
|
|
|
|
<Form.Item label="预报方案名称" name='name' style={{ margin: '0 0 0 5px' }}>
|
|
|
|
|
|
<Input style={{width:'90%',height:'28px',lineHeight:'28px'}} value={'222'} onChange={(e)=>setName(e.nativeEvent.target.value)}/>
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item label='方案制作时间' name='tm' style={{ margin: '0 0 4px 5px' }}>
|
|
|
|
|
|
<RangePicker
|
|
|
|
|
|
style={{ width: '90%',height:'28px',lineHeight:'28px' }}
|
|
|
|
|
|
onChange={(v)=>setTms(v)}
|
|
|
|
|
|
value={tms}
|
|
|
|
|
|
format='YYYY-MM-DD HH:mm'
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
<div className='hsyyScrollBox'>
|
2025-10-09 09:49:16 +08:00
|
|
|
|
{
|
2025-10-09 17:22:42 +08:00
|
|
|
|
listData?.map((item,listIndex)=>(
|
|
|
|
|
|
<>
|
|
|
|
|
|
<div
|
|
|
|
|
|
style={{height:listIndex===index?'200px':'45px',cursor:'pointer'}}
|
|
|
|
|
|
className='hsyylistBox'
|
|
|
|
|
|
onClick={()=>setIndex(listIndex)}
|
|
|
|
|
|
>
|
|
|
|
|
|
<div className='hsyylistBoxTitle'>{(listIndex+1)+'.'+item.name}{
|
|
|
|
|
|
listIndex===index?
|
|
|
|
|
|
<span onClick={()=>openModal(item)}>方案配置</span>:
|
|
|
|
|
|
<span style={{color:'#8FAFC4',borderColor:'#8FAFC4'}}>方案配置</span>
|
|
|
|
|
|
}</div>
|
|
|
|
|
|
<div className='hsyylistBoxLabel'>预报时段:<div className='hsyylistBoxValue'>{item.startTm}至{item.endTm}</div></div>
|
|
|
|
|
|
<div className='hsyylistBoxLabel'>预报最高调洪水位(m):<div className='hsyylistBoxValue'>{item.ycMaxSwH||'-'}</div></div>
|
|
|
|
|
|
<div className='hsyylistBoxLabel'>预报最大入库流量(m³/s):<div className='hsyylistBoxValue'>{item.ycMaxRkQ||'-'}</div></div>
|
|
|
|
|
|
<div className='hsyylistBoxLabel'>预报最大下泄流量(m³/s):<div className='hsyylistBoxValue'>{item.ycMaxCkQ||'-'}</div></div>
|
|
|
|
|
|
<div className='hsyylistBoxLabel'>预报洪水总量(万m³):<div className='hsyylistBoxValue'>{item.ycSumFlood||'-'}</div></div>
|
|
|
|
|
|
<div className='hsyylistBoxLabel'>方案制作时间:<div className='hsyylistBoxValue'>{item.updateTm}</div></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</>
|
|
|
|
|
|
))
|
2025-10-09 09:49:16 +08:00
|
|
|
|
}
|
2025-10-09 17:22:42 +08:00
|
|
|
|
</div>
|
2025-10-09 09:49:16 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-10-09 17:22:42 +08:00
|
|
|
|
<Modal width={1500} wrapClassName='home_modal' bodyStyle={{padding:0}} title={null} closable={false} footer={null} open={open} onCancel={closeModal} destroyOnClose={true}>
|
2025-10-27 09:16:28 +08:00
|
|
|
|
<ModalForm project={project} index={index} onCancel={closeModal} setCtx={setCtx}/>
|
2025-10-09 09:49:16 +08:00
|
|
|
|
</Modal>
|
|
|
|
|
|
</>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default Page
|