68 lines
2.5 KiB
JavaScript
68 lines
2.5 KiB
JavaScript
|
|
import React from 'react';
|
||
|
|
|
||
|
|
import Dialog from '@material-ui/core/Dialog';
|
||
|
|
import DialogContent from '@material-ui/core/DialogContent';
|
||
|
|
import DpPaperComponent from '../../../../layouts/mui/DpPaperCompanent';
|
||
|
|
import { FormGroup, MenuItem, Select, Switch, Typography } from '@material-ui/core';
|
||
|
|
import DpDialogTitle from '../../../../layouts/mui/DpDialogTitle';
|
||
|
|
import { useDispatch, useSelector } from 'react-redux';
|
||
|
|
import { getLayerSetting, getLayerVisible } from '../../../../models/map/selectors';
|
||
|
|
import DpBackgroundDrop from '../../../../layouts/mui/DpBackdrop';
|
||
|
|
|
||
|
|
|
||
|
|
function Setting({ onClose }) {
|
||
|
|
const layerVisible = useSelector(getLayerVisible);
|
||
|
|
const layerSetting = useSelector(getLayerSetting);
|
||
|
|
|
||
|
|
const dispath = useDispatch();
|
||
|
|
|
||
|
|
return (
|
||
|
|
<Dialog
|
||
|
|
open={true}
|
||
|
|
onClose={onClose}
|
||
|
|
maxWidth="xl"
|
||
|
|
style={{ borderRadius: 0 }}
|
||
|
|
PaperComponent={DpPaperComponent}
|
||
|
|
BackdropComponent={DpBackgroundDrop}
|
||
|
|
>
|
||
|
|
<div className="boxhead"></div>
|
||
|
|
|
||
|
|
<DpDialogTitle>实时雨量显示设置</DpDialogTitle>
|
||
|
|
<DialogContent>
|
||
|
|
<div style={{ width: 320, padding: '1rem 0' }}>
|
||
|
|
<FormGroup>
|
||
|
|
<div style={{ marginBottom: '2rem' }}>
|
||
|
|
<Typography variant="subtitle2">地图实时雨量显示雨量时段</Typography>
|
||
|
|
<Select
|
||
|
|
style={{ fontSize: '1.2rem' }}
|
||
|
|
fullWidth
|
||
|
|
value={layerSetting.drplabel}
|
||
|
|
onChange={(event) => dispath.map.setLayerSetting({ drplabel: event.target.value })}
|
||
|
|
>
|
||
|
|
<MenuItem value="h1">小时雨量</MenuItem>
|
||
|
|
<MenuItem value="h3">3小时雨量</MenuItem>
|
||
|
|
<MenuItem value="h6">6小时雨量</MenuItem>
|
||
|
|
<MenuItem value="h12">12小时雨量</MenuItem>
|
||
|
|
<MenuItem value="h24">24小时雨量</MenuItem>
|
||
|
|
<MenuItem value="h48">48小时雨量</MenuItem>
|
||
|
|
</Select>
|
||
|
|
</div>
|
||
|
|
<div style={{ marginBottom: '1rem' }}>
|
||
|
|
<Typography variant="subtitle2">显示实时雨量图层</Typography>
|
||
|
|
<Switch
|
||
|
|
checked={!!layerVisible.RealDrpLayer}
|
||
|
|
color="primary"
|
||
|
|
edge="start"
|
||
|
|
onChange={(e) => dispath.map.setLayerVisible({ RealDrpLayer: e.target.checked })}
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
</FormGroup>
|
||
|
|
</div>
|
||
|
|
</DialogContent>
|
||
|
|
<div className="boxfoot"></div>
|
||
|
|
</Dialog>
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
export default Setting;
|