import clsx from 'clsx'; import React, { useState, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { hdyjUnclose } from '../../../../models/_/hdyj'; import { OverallPromise } from '../../../../models/_/real'; import { ShqxYjhisLatest } from '../../../../models/_/shqxjs'; import { RealShWarnListPromise } from '../../../../models/_/shwarn'; import { yjLevelColor } from '../../../../utils/renutils'; import useRefresh from '../../../../utils/useRefresh'; import useRequest from '../../../../utils/useRequest'; import PanelBox from '../../components/PanelBox'; import ARzSk from './ARzSk'; import Hdyj from './Hdyj'; import Shqx from './Shqx'; import ShYj from './ShYj'; import { styled } from '@material-ui/styles'; import { RadioGroup, Radio, Switch, FormControlLabel, InputLabel, Select, MenuItem, FormControl } from '@material-ui/core/index'; import { backgroundColor } from 'echarts/lib/theme/dark'; import { Description } from '@material-ui/icons'; import DescriptionItem from '../../components/DescrptionItem'; export default function Warn({ style }) { const dispatch = useDispatch(); const res = useSelector(s => s.runtime.yyObj) const [value, setValue] = React.useState(res.yy ?? ''); const [yyValue, setYyValue] = React.useState(false); const StyledFormControlLabel = styled(FormControlLabel)({ display: 'flex', // justifyContent: 'space-around', width: '100%', margin: '4px 0', padding: '4px 0', '.MuiFormControlLabel-label': { width: "100%", color: '#fff', order: -1 // 让文字在前面 }, '.MuiRadio-root': { color: '#fff', padding: '4px' } }); const CustomSwitch = styled(Switch)({ '& .MuiSwitch-switchBase': { color: '#fff', '&.Mui-checked': { color: '#1890ff', '& + .MuiSwitch-track': { backgroundColor: '#1890ff', opacity: 0.5, }, }, }, '& .MuiSwitch-track': { backgroundColor: 'rgba(255, 255, 255, 0.3)', }, }); const StyledFormControlLabel1 = styled(FormControlLabel)({ '& .MuiFormControlLabel-label': { color: '#fff' } }); const [dimension, setDimension] = useState('fqh'); const [checked, setChecked] = React.useState(false); const fayy = () => { setYyValue(true) if (value) { dispatch.runtime.setYyfa({ yy: value }) } } // useEffect(() => { // setValue(res.yy) // }, [res]) const switchChange = (e) => { const val = e.target.checked setChecked(val) if (val) { dispatch.runtime.setCameraTarget({ center: [114.81944, 31.12068], zoom: 13, pitch: 60, }); } else { dispatch.runtime.setHome(); } } const schemes = [ { id: '2025001', name: '2025001预案' }, { id: '2025002', name: '2025002预案' }, { id: '2025003', name: '2025003预案' }, ]; const [selectedSchemes, setSelectedSchemes] = useState([]); const handleCompare = (schemeId) => { if (selectedSchemes.includes(schemeId)) { setSelectedSchemes(selectedSchemes.filter(id => id !== schemeId)); } else if (selectedSchemes.length < 2) { setSelectedSchemes([...selectedSchemes, schemeId]); } // dispatch.runtime.setYyfa({}) }; useEffect(() => { dispatch.runtime.setDuibifx(selectedSchemes) }, [selectedSchemes]) const productFa = () => { dispatch?.runtime.setInfoDlg({ layerId: 'YuananLayer', properties: {} }) dispatch.runtime.setYyfa({}) } const changeYY = (e) => { setValue(e.target.value) dispatch.runtime.setYyfa({}) } return ( 自动生成方案 加载方案 } >
{ schemes.map(item => ( } label={} style={{ color: "#fff" }} /> )) } {res.yy &&
{/*
最大淹没范围
淹没耕地:1824.8(公顷) 淹没面积:48.9(平方公里)
淹没人口:3.211(万人)
*/} {/*
*/}
}
) }