mcfxkh-Web/src/views/Home/panels/Bjfx/index.js

38 lines
1.2 KiB
JavaScript
Raw Normal View History

2025-05-27 16:33:56 +08:00
import React, { useMemo, useState } from 'react';
2025-05-29 13:27:37 +08:00
import { useDispatch, useSelector } from 'react-redux';
2025-05-27 16:33:56 +08:00
import PanelBox from '../../components/PanelBox';
import AreaDrpChart from './chart';
2025-06-09 11:50:05 +08:00
import ShuiyuandiChart from './chart1'
import clsx from 'clsx';
2025-05-27 16:33:56 +08:00
function DrpReal({ style }) {
2025-06-09 11:50:05 +08:00
const [type, setType] = useState('sc')
const dispatch = useDispatch();
const toggleStType = (type) => {
setType(type)
}
2025-05-27 16:33:56 +08:00
return (
<PanelBox
style={style}
2025-06-09 11:50:05 +08:00
title="预警统计"
2025-05-27 16:33:56 +08:00
color="green"
2025-06-09 11:50:05 +08:00
tabs={
2025-05-29 13:27:37 +08:00
<>
2025-06-09 11:50:05 +08:00
{/* <div style={{cursor:'pointer',color:'#3c88f7'}} onClick={()=>dispatch?.runtime.setInfoDlg({ layerId: 'BjLayer', properties: {} })}>更多</div> */}
<span className="button-group">
<span className={clsx({ active: type == 'sc' })} onClick={() => toggleStType('sc')}>水厂</span>
<span className={clsx({ active: type == 'syd' })} onClick={() => toggleStType('syd')}>水源地</span>
</span>
2025-05-29 13:27:37 +08:00
</>
}
2025-06-09 11:50:05 +08:00
>{
type == 'sc' ?<AreaDrpChart />:<ShuiyuandiChart />
}
{/* <img src='/assets/报警分析.jpg' style={{width:'26.5rem', height:'13.5rem',marginLeft:'0rem',marginTop:'1rem'}}/> */}
2025-05-27 16:33:56 +08:00
</PanelBox>
)
}
export default DrpReal;