增加网格雨量按钮

lsf-dev
秦子超 2025-06-13 15:20:02 +08:00
parent 2783cab920
commit b37ff83c10
3 changed files with 33 additions and 14 deletions

View File

@ -601,15 +601,15 @@ const map = {
map.setLayoutProperty('灌区图', 'visibility', 'none');
}
}
if(id === 5){
if(map){
map.setLayoutProperty('网格雨量', 'visibility', 'visible');
}
}else{
if(map){
map.setLayoutProperty('网格雨量', 'visibility', 'none');
}
}
// if(id === 5){
// if(map){
// map.setLayoutProperty('网格雨量', 'visibility', 'visible');
// }
// }else{
// if(map){
// map.setLayoutProperty('网格雨量', 'visibility', 'none');
// }
// }
if (id != 504) {

View File

@ -118,8 +118,8 @@ function Page({jbqkKey}) {
<TableRow>
<DpTableCell style={{ minWidth: '1rem' }} align="left">序号</DpTableCell>
<DpTableCell style={{ minWidth: '5rem' }} align="center">水库名称</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">类型</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">类型</DpTableCell>
{/* <DpTableCell style={{ minWidth: '8rem' }} align="center">类型</DpTableCell> */}
<DpTableCell style={{ minWidth: '8rem' }} align="center">库容</DpTableCell>
</TableRow>
</TableHead>
{
@ -135,7 +135,7 @@ function Page({jbqkKey}) {
{tableRow.stnm}
</div>
</DpTableCell>
<DpTableCell align="center" >{tableRow.name}</DpTableCell>
{/* <DpTableCell align="center" >{tableRow.name}</DpTableCell> */}
<DpTableCell align="center" >{tableRow.w}</DpTableCell>
</DpTableRow>
</TableBody>

View File

@ -32,9 +32,10 @@ const useStyles = makeStyles({
export default function AreaDrp({ style }) {
const classes = useStyles();
const [show,setShow] = useState(false)
const dispatch = useDispatch();
const [tab,setTab] = useState('1')
useEffect(()=>{
useEffect(()=>{
// if(tab==='1'){
// dispatch.rcview.showRealContour('h24')
// }else{
@ -46,7 +47,18 @@ export default function AreaDrp({ style }) {
// dispatch.runtime.setLayerSetting({ planeArea: null });
// dispatch.map.setLayerVisible({ ContourLayer: false });
// }
},[tab])
const map = window.__mapref
if(map){
map.setLayoutProperty('网格雨量', 'visibility', show?'visible':'none');
}
return ()=>{
const map = window.__mapref
if(map){
map.setLayoutProperty('网格雨量', 'visibility', 'none');
}
}
},[show])
return (
@ -54,6 +66,13 @@ export default function AreaDrp({ style }) {
style={style}
title="天气预报"
color="blue"
extra={
<>
<div style={{color:show?"#29b6f6":'#ffffff',marginTop:"0.1rem",cursor:'pointer'}} onClick={()=>{
setShow(!show)
}}>显示网格</div>
</>
}
>
<div className={classes.root} style={{marginBottom:'-1.5rem'}}>
<Grid container className={classes.tool}>