- {
- (checkedObj.label === '预警'||checkedObj.label === '雨情')?
-
- :null
+
+ // 设置地图视角
+ dispatch.runtime.setCameraTarget({
+ center: [item.lgtd, item.lttd],
+ zoom: 18,
+ pitch: 60
+ });
+
+ }
+
+ useEffect(() => {
+ dispatch.runtime.closeFeaturePopAll()
+ // 如果是搜索结果,不要关闭图层
+ if (checkedObj.label === '搜索结果') {
+ // 主动设置相关图层可见
+
+ return;
+ }
+ if (checkedObj.label === '水库' || checkedObj.label === '大坝' || checkedObj.label === '溢洪道' || checkedObj.label === '视频点') {
+ dispatch.map.setLayerVisible({ PicStLayer: true })
+ } else {
+ dispatch.map.setLayerVisible({ PicStLayer: false })
+ }
+
+ if (checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户') {
+ dispatch.map.setLayerVisible({ AZDLayer: true })
+ dispatch.map.setLayerVisible({ QSYDWLayer: true })
+ dispatch.map.setLayerVisible({ YHJMHLayer: true })
+ } else {
+ dispatch.map.setLayerVisible({ AZDLayer: false })
+ dispatch.map.setLayerVisible({ QSYDWLayer: false })
+ dispatch.map.setLayerVisible({ YHJMHLayer: false })
+ }
+
+ return () => {
+ dispatch.runtime.closeFeaturePopAll()
+ dispatch.map.setLayerVisible({ PicStLayer: false })
+ dispatch.map.setLayerVisible({ AZDLayer: false })
+ dispatch.map.setLayerVisible({ QSYDWLayer: false })
+ dispatch.map.setLayerVisible({ YHJMHLayer: false })
+ }
+ }, [checkedObj])
+
+ useEffect(() => {
+ setCheckedObj({ key: '12', label: '雨情', labelRight: '统计', icon: 'yuqing' })
+ getGeoJsonData()
+ }, [])
+
+
+ return (
+
+
+
setSearchVal(e.target.value)}
+ />
+ 综合展示
+ {
+ // 清空搜索输入框
+ setSearchVal('')
+ dispatch.runtime.closeFeaturePopAll()
+ dispatch.map.setLayerVisible({ ShuiKuLayer: false })
+ mapObj && mapObj.getLayers().getArray().forEach(layer => {
+ if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
+ layer.getSource().clear()
}
+ });
+ dispatch.runtime.setHome()
+ if (a === undefined) {
+ setCheckedObj({ key: '12', label: '雨情', labelRight: '统计', icon: 'yuqing' })
+ setShowTable(false)
+ } else if (a === '1') {
+ setShowTable(true)
+ // dispatch.runtime.setHome()
+ setCheckedObj({ key: '11', label: '预警', labelRight: '预警', icon: 'yujing' })
+ } else if (a === '2') {
+ setShowTable(true)
+ // dispatch.runtime.setHome()
+ setCheckedObj({ key: '21', label: '巡查巡检', labelRight: '工程巡检', icon: 'shuiku' })
+ } else if (a === '3') {
+ dispatch.runtime.setCameraTarget({
+ center: [114.75, 31.493],
+ zoom: 13.5,
+ pitch: 60
+ })
+ setShowTable(true)
+ setCheckedObj({ key: '31', label: '危险区', labelRight: '危险区列表', icon: 'weixianqu' })
+ } else if (a === '4') {
+ setCheckedObj({ key: '41', label: '供水', labelRight: '今日供水实况', icon: 'gongshui' })
+ } else if (a === '5') {
+ setCheckedObj({ key: '51', label: '水库', labelRight: '基本信息', icon: 'shuiku' })
+ setShowTable(true)
+ } else {
+ }
+ }} expandIconPosition="end" accordion={true} bordered={false}>
+ {
+ items.map((item, index) =>
+
+
+ >
+ }
+ >
+ {
+ item.children.map((item) =>
+ {
+ // 清空搜索输入框
+ setSearchVal('')
+ setCheckedObj(item)
+ setShowTable(true)
+ dispatch.map.setLayerVisible({ ShuiKuLayer: false })
+ mapObj && mapObj.getLayers().getArray().forEach(layer => {
+ if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
+ layer.getSource().clear()
+ }
+ });
+ dispatch.runtime.setHome()
+ }}>
+
+ {item.label}
+ {
+ (checkedObj.key === item.key && showTable) ?
+
+ : null
+ }
+
+ )
+ }
+
+ )
+ }
+
+
+ {
+ (checkedObj.label === '预警' || checkedObj.label === '雨情') ?
+
+ : null
+ }
+ {
+ checkedObj.labelRight ?
+
{
- checkedObj.labelRight?
-
- {
- showTable?
-
-
-

- {checkedObj.labelRight}
-
-
- {/*

*/}
-
-
:null
- }
- { checkedObj.label === '预警' ? <>
>:null }
- { checkedObj.label === '雨情' ? :null }
- { checkedObj.label === '水库水情' ? :null }
- { checkedObj.label === '土壤墒情' ? :null }
- { checkedObj.label === '供水' ? :null }
- { checkedObj.label === '工程安全' ? :null }
- { checkedObj.label === '监测设备状态' ? :null }
- {/* { checkedObj.label === '水质' ? :null } */}
- { checkedObj.label === '视频点' ? :null }
+ showTable ?
+
+ {
+ checkedObj.key != 'search' ?
+
+

+ {checkedObj.labelRight}
+
:
+
+
+
{checkedObj.labelRight}
+
+ }
- { checkedObj.label === '巡查巡检' ?
:null }
-
- { checkedObj.label === '水库' ?
:null }
- { checkedObj.label === '大坝' ?
:null }
- { checkedObj.label === '溢洪道' ?
:null }
-
- { checkedObj.label === '危险区' ?
:null }
- { checkedObj.label === '安置点' ?
:null }
- { checkedObj.label === '企事业单位' ?
:null }
- { checkedObj.label === '沿河居民户' ?
:null }
-
- { checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户'?
:null }
-
- :null
+
+ {/*

*/}
+
+ : null
}
+ {checkedObj.label === '搜索结果' ?
+ clickItem(item)}
+ />
+
: null}
+ {checkedObj.label === '预警' ? <>
> : null}
+ {checkedObj.label === '雨情' ?
: null}
+ {checkedObj.label === '水库水情' ?
: null}
+ {checkedObj.label === '土壤墒情' ?
: null}
+ {checkedObj.label === '供水' ?
: null}
+ {checkedObj.label === '工程安全' ?
: null}
+ {checkedObj.label === '监测设备状态' ?
: null}
+ {/* { checkedObj.label === '水质' ?
:null } */}
+ {checkedObj.label === '视频点' ?
: null}
- {
- checkedObj.label === '工程安全' ?
-
-
:null
- }
+ {checkedObj.label === '巡查巡检' ?
: null}
-
- { checkedObj.label==='雨情'?:null }
- { checkedObj.label==='水库水情'?:null }
- { checkedObj.label==='供水'?:null }
- { (checkedObj.label==='水库'||checkedObj.label==='大坝'||checkedObj.label==='溢洪道'||checkedObj.label==='视频点')?:null }
- { (checkedObj.label==='危险区'||checkedObj.label==='安置点'||checkedObj.label==='企事业单位'||checkedObj.label==='沿河居民户')?:null }
-
-
-
- )
+ {checkedObj.label === '水库' ?
: null}
+ {checkedObj.label === '大坝' ?
: null}
+ {checkedObj.label === '溢洪道' ?
: null}
+
+ {checkedObj.label === '危险区' ?
: null}
+ {checkedObj.label === '安置点' ?
: null}
+ {checkedObj.label === '企事业单位' ?
: null}
+ {checkedObj.label === '沿河居民户' ?
: null}
+
+ {checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户' ?
: null}
+ {checkedObj.label === '搜索结果' ?
{ }} /> : null}
+
+