diff --git a/src/views/Home/InfoPops/RealSkPop/index.js b/src/views/Home/InfoPops/RealSkPop/index.js index a7045f0..fe60e86 100644 --- a/src/views/Home/InfoPops/RealSkPop/index.js +++ b/src/views/Home/InfoPops/RealSkPop/index.js @@ -174,19 +174,26 @@ function RealSkTip({ record, dispatch,view }) { const changePic = () => { setpicidx([picidx[0] === 1 ? 2 : 1, picidx[1] === 1 ? 2 : 1]) } + const openSw = () => { + window.open("http://local.gunshiiot.com:18083/zhtmp/#/mgr/home") + } return ( <>
{record.stnm} - { + {record.stnm == '浮桥河水库' ? record?.setView&&view===200? - { + { dispatch.map.setView(203) sessionStorage.setItem('lastCenter',JSON.stringify(record)) }}> 进入水库模块 - :null + : null : + record.stnm == '小玉潭水库' ? + + 进入三维模块 + :null }
详细
diff --git a/src/views/Home/MapCtrl/index.js b/src/views/Home/MapCtrl/index.js index 03c30e9..d6f2653 100644 --- a/src/views/Home/MapCtrl/index.js +++ b/src/views/Home/MapCtrl/index.js @@ -143,7 +143,7 @@ export default function MapCtrl({ initParams, onLoad }) { dispatch?.runtime.setInfoDlg({ layerId: 'SyjcLayer', properties: record }) }else if (record.cd_nm == 'WE1') { dispatch?.runtime.setInfoDlg({ layerId: 'SljcLayer', properties: record }) - }else if (record.cd_nm == '0EA5DE') { + }else if (record.cd == '0AB3ED') { dispatch?.runtime.setInfoDlg({ layerId: 'ByjcLayer', properties: record }) }else if (record.stnm == '浮桥河水库') { dispatch?.runtime.setInfoDlg({ layerId: 'RealSkLayer', properties: record }) diff --git a/src/views/Home/panels/Byjc/index.js b/src/views/Home/panels/Byjc/index.js index cd87264..aae5cba 100644 --- a/src/views/Home/panels/Byjc/index.js +++ b/src/views/Home/panels/Byjc/index.js @@ -1,4 +1,4 @@ -import React, { useMemo, useState,useEffect } from 'react'; +import React, { useMemo, useState, useEffect } from 'react'; import useRequest from '../../../../utils/useRequest'; import { useDispatch, useSelector } from 'react-redux'; import PanelBox from '../../components/PanelBox'; @@ -19,23 +19,23 @@ import { parseGeoJSON } from "../../../../utils/tools"; function DrpReal({ style }) { - const [tab,setTab] = useState('1') + const [tab, setTab] = useState('1') const dispatch = useDispatch(); - const [dimension, setDimension] = useState('浮桥河水库'); + const [dimension, setDimension] = useState('浮桥河水库'); const onChange = (event) => { const value = event.target.value; setDimension(value); } - + const data1 = [ -{ + { "res_cd": "42118140035", "lgtd": 114.88089, "lttd": 31.171467, "cd": "01", - "cd_nm": "GN1", - 'stnm':'GN1', - dm:"0+60", + "cd_nm": "GN1", + 'stnm': 'GN1', + dm: "0+60", "res_reg_cd": "42118140006-A4", "ch": "0+000", "province_cd": "420000000000", @@ -62,15 +62,15 @@ function DrpReal({ style }) { "max_du": 113.8833, "dt": "2025-05-25", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140035", "lgtd": 115.14137, "lttd": 31.55095, "cd": "02", - "cd_nm": "GN2", - 'stnm':'GN2', - dm:"0+60", + "cd_nm": "GN2", + 'stnm': 'GN2', + dm: "0+60", "res_reg_cd": "42118140006-A4", "ch": "0+000", "province_cd": "420000000000", @@ -97,14 +97,14 @@ function DrpReal({ style }) { "max_du": 132.4892, "dt": "2025-05-20", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140035", "lgtd": 115.14137, "lttd": 31.55095, "cd": "04", "cd_nm": "GN3", - dm:"0+60", + dm: "0+60", "res_reg_cd": "42118140006-A4", "ch": "0+000", "province_cd": "420000000000", @@ -131,14 +131,14 @@ function DrpReal({ style }) { "max_du": 132.4892, "dt": "2025-05-20", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140011", "lgtd": 115.11878, "lttd": 30.88904, "cd": "01", "cd_nm": "GN1", - dm:"0+120", + dm: "0+120", "res_reg_cd": "42118140019-A4", "ch": "0+000", "province_cd": "420000000000", @@ -165,14 +165,14 @@ function DrpReal({ style }) { "max_du": -11.1644, "dt": "2025-05-20", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140011", "lgtd": 115.11878, "lttd": 30.88904, "cd": "02", "cd_nm": "GN2", - dm:"0+120", + dm: "0+120", "res_reg_cd": "42118140019-A4", "ch": "0+000", "province_cd": "420000000000", @@ -199,14 +199,14 @@ function DrpReal({ style }) { "max_du": -11.1644, "dt": "2025-05-20", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140017", "lgtd": 115.14545, "lttd": 30.95398, "cd": "03", "cd_nm": "GN3", - dm:"0+120", + dm: "0+120", "res_reg_cd": "42118140031-A4", "ch": "0+000", "province_cd": "420000000000", @@ -233,14 +233,14 @@ function DrpReal({ style }) { "max_du": 11.5948, "dt": "2025-05-20", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140011", "lgtd": 115.11878, "lttd": 30.88904, "cd": "03", "cd_nm": "GN1", - dm:"0+180", + dm: "0+180", "res_reg_cd": "42118140019-A4", "ch": "0+000", "province_cd": "420000000000", @@ -267,14 +267,14 @@ function DrpReal({ style }) { "max_du": -11.1644, "dt": "2025-05-20", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140022", "lgtd": 115.39612, "lttd": 31.1526, "cd": "02", "cd_nm": "GN2", - dm:"0+180", + dm: "0+180", "res_reg_cd": "42118140014-A4", "ch": "0+000", "province_cd": "420000000000", @@ -301,14 +301,14 @@ function DrpReal({ style }) { "max_du": -10.0925, "dt": "2025-05-20", "is_has_data": "y" - }, - { + }, + { "res_cd": "42118140011", "lgtd": 115.11878, "lttd": 30.88904, "cd": "04", "cd_nm": "GN3", - dm:"0+180", + dm: "0+180", "res_reg_cd": "42118140019-A4", "ch": "0+000", "province_cd": "420000000000", @@ -335,18 +335,18 @@ function DrpReal({ style }) { "max_du": -11.1644, "dt": "2025-05-20", "is_has_data": "y" - }, + }, ] const data2 = [ - { + { "cd": "1", "cd_nm": "UPD1", - stnm:'UPD1', + stnm: 'UPD1', "ch": "0+060", - dm:"0+70", + dm: "0+70", "res_reg_cd": "42118140011-A4", "res_cd": "42118140038", - "lgtd": 114.87929+ 0.0019, + "lgtd": 114.87929 + 0.0019, "lttd": 31.171467, "res_nm": "浮桥河水库", "province_cd": "420000000000", @@ -377,12 +377,12 @@ function DrpReal({ style }) { "trend10": -1, "diff30_value": -0.0633, "trend30": -1 - }, - { + }, + { "cd": "1", "cd_nm": "UPD2", "ch": "0+027", - dm:"0+70", + dm: "0+70", "res_reg_cd": "42118140006-A4", "res_cd": "42118140035", "lgtd": 115.14137, @@ -416,12 +416,12 @@ function DrpReal({ style }) { "trend10": -1, "diff30_value": -0.0954, "trend30": -1 - }, - { + }, + { "cd": "3", "cd_nm": "UPD3", "ch": "0+070", - dm:"0+70", + dm: "0+70", "res_reg_cd": "42118140011-A4", "res_cd": "42118140038", "lgtd": 115.01664, @@ -455,12 +455,12 @@ function DrpReal({ style }) { "trend10": -1, "diff30_value": -0.0588, "trend30": -1 - }, - { + }, + { "cd": "1", "cd_nm": "UPD1", "ch": "0+038", - dm:"0+140", + dm: "0+140", "res_reg_cd": "42118140014-A4", "res_cd": "42118140022", "lgtd": 115.39612, @@ -494,13 +494,13 @@ function DrpReal({ style }) { "trend10": -1, "diff30_value": -0.0342, "trend30": -1 - }, + }, - { + { "cd": "4", "cd_nm": "UPD2", "ch": "0+085", - dm:"0+140", + dm: "0+140", "res_reg_cd": "42118140020-A4", "res_cd": "42118140032", "lgtd": 115.13073, @@ -534,12 +534,12 @@ function DrpReal({ style }) { "trend10": -1, "diff30_value": -0.1708, "trend30": -1 - }, - { + }, + { "cd": "1", "cd_nm": "UPD3", "ch": "0+51.6", - dm:"0+140", + dm: "0+140", "res_reg_cd": "42118140042-A4", "res_cd": "42118140004", @@ -574,19 +574,19 @@ function DrpReal({ style }) { "trend10": 1, "diff30_value": 0.0683, "trend30": 1 - }, - + }, + ] const data3 = [ { "cd": "1", "cd_nm": "WE1", "ch": "1", - 'stnm':'WE1', + 'stnm': 'WE1', "res_reg_cd": "42118140042-A4", "res_cd": "42118140004", "res_nm": "浮桥河水库", - "lgtd": 114.88429- 0.0029, + "lgtd": 114.88429 - 0.0029, "lttd": 31.172700, "province_cd": "420000000000", "province_nm": "湖北省", @@ -609,12 +609,44 @@ function DrpReal({ style }) { }, ] const data4 = [ - { + { + "res_cd": "42118140015", + "res_nm": "麻城坳水库", + "cd": '0AB3ED', + "stnm": "0AB3ED", + "province_cd": "420000000000", + "province_nm": "湖北省", + "city_cd": "421100000000", + "city_nm": "黄冈市", + "county_cd": "421181000000", + "county_nm": "麻城市", + "town_cd": "421181107000", + "town_nm": "盐田河镇", + "rv_name": "举水", + "bas_guid": "鄂东五河片区", + "lgtd": 114.88299 - 0.0019, + "lttd": 31.172700 - 0.0001, + "res_reg_cd": "42118140025-A4", + "eng_scal": "小(1)型", + "eng_g": "IV", + "children": [ + { + "res_cd": "42118140015", + "res_nm": "麻城坳水库", + "cd": "0AB3ED", + "cd_nm": "麻城坳水库", + "termite_status": "y", + "tm": "2025-05-21 04:27:18", + "is_main_cd": "y" + } + ] + }, + { "res_cd": "42118140035", - "lgtd": 114.88299- 0.0019, - "lttd": 31.172700- 0.0001, + "lgtd": 114.88299 - 0.0019, + "lttd": 31.172700 - 0.0001, "cd": "01", - "cd_nm": "0EA5DE", + "cd_nm": "0EA5DE", "stnm": "0EA5DE", "res_reg_cd": "42118140006-A4", "ch": "0+000", @@ -643,19 +675,19 @@ function DrpReal({ style }) { "dt": "2025-05-25", "is_has_data": "y", 'cd': '0EA5DE', - "children": [ - { - "res_cd": "42118140023", - "res_nm": "游家冲水库", - "cd": "0EA5DE", - "cd_nm": "游家冲水库", - "termite_status": "n", - "tm": "2025-05-21 04:25:56", - "is_main_cd": "y" - } + "children": [ + { + "res_cd": "42118140023", + "res_nm": "游家冲水库", + "cd": "0EA5DE", + "cd_nm": "游家冲水库", + "termite_status": "n", + "tm": "2025-05-21 04:25:56", + "is_main_cd": "y" + } ] - }, - { + }, + { "res_cd": "42118140004", "res_nm": "永丰水库", "province_cd": "420000000000", @@ -674,19 +706,19 @@ function DrpReal({ style }) { "eng_scal": "小(1)型", "eng_g": "IV", "children": [ - { - "res_cd": "42118140004", - "res_nm": "永丰水库", - "cd": '0FA5DE', - "cd_nm": "永丰水库", - "termite_status": "n", - "tm": "2025-05-21 09:18:28", - "is_main_cd": "y" - } + { + "res_cd": "42118140004", + "res_nm": "永丰水库", + "cd": '0FA5DE', + "cd_nm": "永丰水库", + "termite_status": "n", + "tm": "2025-05-21 09:18:28", + "is_main_cd": "y" + } ] - }, + }, - { + { "res_cd": "42118140023", "res_nm": "游家冲水库", "province_cd": "420000000000", @@ -705,19 +737,19 @@ function DrpReal({ style }) { "eng_scal": "小(1)型", "eng_g": "IV", "children": [ - { - "res_cd": "42118140023", - "res_nm": "游家冲水库", - "cd": "0BB7ED", - "cd_nm": "游家冲水库", - "termite_status": "n", - "tm": "2025-05-21 04:25:56", - "is_main_cd": "y" - } + { + "res_cd": "42118140023", + "res_nm": "游家冲水库", + "cd": "0BB7ED", + "cd_nm": "游家冲水库", + "termite_status": "n", + "tm": "2025-05-21 04:25:56", + "is_main_cd": "y" + } ] - }, - - { + }, + + { "res_cd": "42118140039", "res_nm": "姚家河水库", "province_cd": "420000000000", @@ -736,83 +768,54 @@ function DrpReal({ style }) { "eng_scal": "小(1)型", "eng_g": "IV", "children": [ - { - "res_cd": "42118140023", - "res_nm": "姚家河水库", - "cd": "0B663D", - "cd_nm": "姚家河水库", - "termite_status": "n", - "tm": "2025-05-21 04:25:56", - "is_main_cd": "y" - } + { + "res_cd": "42118140023", + "res_nm": "姚家河水库", + "cd": "0B663D", + "cd_nm": "姚家河水库", + "termite_status": "n", + "tm": "2025-05-21 04:25:56", + "is_main_cd": "y" + } ] }, - { - "res_cd": "42118140015", - "res_nm": "麻城坳水库", - "province_cd": "420000000000", - "province_nm": "湖北省", - "city_cd": "421100000000", - "city_nm": "黄冈市", - "county_cd": "421181000000", - "county_nm": "麻城市", - "town_cd": "421181107000", - "town_nm": "盐田河镇", - "rv_name": "举水", - "bas_guid": "鄂东五河片区", - "lgtd": 115.22541, - "lttd": 30.98156, - "res_reg_cd": "42118140025-A4", - "eng_scal": "小(1)型", - "eng_g": "IV", - "children": [ - { - "res_cd": "42118140015", - "res_nm": "麻城坳水库", - "cd": "0AB3ED", - "cd_nm": "麻城坳水库", - "termite_status": "y", - "tm": "2025-05-21 04:27:18", - "is_main_cd": "y" - } - ] - }, + ] const skdata = [ { - "stcd": "61614200", - "type": "sk", - "hasRz": true, - "stnm": "浮桥河水库", - "adcd": "421181100000", - "wscd": null, - "importancy": 0, - "lgtd": 114.875, - "lttd": 31.166667, - "elev": 0, - "damel": 71.33, - "dsflz": 68.04, - "fsltdz": 64.89, - "ddz": 51.78, - "zcxsw": 64.89, - "drpTm": "2025-06-03T02:00:00.000Z", - "today": 0, - "h1": 5, - "h3": 6, - "h6": 7.5, - "h12": 8, - "h24": 9, - "h48": 26, - "drpState": 1, - "rz": 60.71, - "w": 162.8, - "a_fsltdz": -4.18, - "rzTm": "2025-06-03T02:00:00.000Z", - "rzWarning": 0, - "rzState": 1, - "aRz": -4.18 + "stcd": "61614200", + "type": "sk", + "hasRz": true, + "stnm": "浮桥河水库", + "adcd": "421181100000", + "wscd": null, + "importancy": 0, + "lgtd": 114.875, + "lttd": 31.166667, + "elev": 0, + "damel": 71.33, + "dsflz": 68.04, + "fsltdz": 64.89, + "ddz": 51.78, + "zcxsw": 64.89, + "drpTm": "2025-06-03T02:00:00.000Z", + "today": 0, + "h1": 5, + "h3": 6, + "h6": 7.5, + "h12": 8, + "h24": 9, + "h48": 26, + "drpState": 1, + "rz": 60.71, + "w": 162.8, + "a_fsltdz": -4.18, + "rzTm": "2025-06-03T02:00:00.000Z", + "rzWarning": 0, + "rzState": 1, + "aRz": -4.18 }, - { + { "stcd": "61613010", "type": "sk", "hasRz": true, @@ -844,8 +847,8 @@ function DrpReal({ style }) { "rzWarning": 0, "rzState": 1, "aRz": -8.57 - }, - { + }, + { "stcd": "61612610", "type": "sk", "hasRz": true, @@ -877,8 +880,8 @@ function DrpReal({ style }) { "rzWarning": 0, "rzState": 1, "aRz": -7.55 - }, - { + }, + { "stcd": "61612700", "type": "sk", "hasRz": true, @@ -910,277 +913,277 @@ function DrpReal({ style }) { "rzWarning": 0, "rzState": 2, "aRz": -17.4 - } -] - + } + ] + const [showbx, setShowdbx] = useState(0) const [showsy, setShowdsy] = useState(0) const [showsl, setShowdsl] = useState(0) - const [showby, setShowdby] = useState(0) - useEffect(()=>{ - const map = window.__mapref; - if (map) { - if(tab==='1'&&data1 && showbx){ - setLayer(data1,'变形') - } - if (tab === '2' && data2 && showsy) { - - setLayer(data2,'渗压') - } - if(tab==='3'&&data3 && showsl){ - setLayer(data3,'渗流') - } - if(tab==='4'&&data4&& showby){ - setLayer(data4,'白蚁') - } + const [showby, setShowdby] = useState(0) + useEffect(() => { + const map = window.__mapref; + if (map) { + if (tab === '1' && data1 && showbx) { + setLayer(data1, '变形') } - else { - const dsq = setInterval(() => { - const map = window.__mapref; - if(map && skdata.length>0){ - clearInterval(dsq) - setLayer(skdata,'sk') - } - }, 500); + if (tab === '2' && data2 && showsy) { + + setLayer(data2, '渗压') } - - },[data1,data2,data3,data4,tab,showbx,showsy,showsl,showby]) - - const setLayer = (data=[],type)=>{ - const map = window.__mapref; - const layer = map.getLayer('关联站点') - if(layer){ - map.removeLayer('关联站点'); - map.removeSource('关联站点'); + if (tab === '3' && data3 && showsl) { + setLayer(data3, '渗流') } - if(data.length===0){return} - if(type==='变形'){ - map.addLayer({ - 'id': '关联站点',//+new Date().getTime(), - 'type': 'symbol', - 'source': { - 'type': 'geojson', - 'data': { - 'type': 'FeatureCollection', - 'features': [], - }, - }, - 'layout': { - 'icon-allow-overlap': true, - 'text-allow-overlap': true, - 'icon-image': '变形监测', - 'icon-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 0.4, - 14, 0.8, - ], - - 'text-allow-overlap': true, - 'text-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 10, - 14, 14, - ], - 'text-font': ['Roboto Black'], - 'text-field': [ - 'step', - ['zoom'], - '', - 12, ['get', 'stnm'] - ], - 'text-anchor': 'top', - 'text-offset': [0, 1], - }, - 'paint': { - 'text-color': '#fff' - }, - 'visibility': 'visible', - }); + if (tab === '4' && data4 && showby) { + setLayer(data4, '白蚁') } - if(type==='渗压'){ - map.addLayer({ - 'id': '关联站点',//+new Date().getTime(), - 'type': 'symbol', - 'source': { - 'type': 'geojson', - 'data': { - 'type': 'FeatureCollection', - 'features': [], - }, - }, - 'layout': { - 'icon-allow-overlap': true, - 'text-allow-overlap': true, - 'icon-image': '渗压监测', - 'icon-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 0.4, - 14, 0.8, - ], - - 'text-allow-overlap': true, - 'text-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 10, - 14, 14, - ], - 'text-font': ['Roboto Black'], - 'text-field': [ - 'step', - ['zoom'], - '', - 12, ['get', 'stnm'] - ], - 'text-anchor': 'top', - 'text-offset': [0, 1], - }, - 'paint': { - 'text-color': '#fff' - }, - 'visibility': 'visible', - }); - } - if(type==='渗流'){ - map.addLayer({ - 'id': '关联站点',//+new Date().getTime(), - 'type': 'symbol', - 'source': { - 'type': 'geojson', - 'data': { - 'type': 'FeatureCollection', - 'features': [], - }, - }, - 'layout': { - 'icon-allow-overlap': true, - 'text-allow-overlap': true, - 'icon-image': '渗流监测', - 'icon-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 0.4, - 14, 0.8, - ], - - 'text-allow-overlap': true, - 'text-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 10, - 14, 14, - ], - 'text-font': ['Roboto Black'], - 'text-field': [ - 'step', - ['zoom'], - '', - 12, ['get', 'stnm'] - ], - 'text-anchor': 'top', - 'text-offset': [0, 1], - - }, - 'paint': { - 'text-color': '#fff' - }, - 'visibility': 'visible', - }); - } - if (type === '白蚁') { - map.addLayer({ - 'id': '关联站点',//+new Date().getTime(), - 'type': 'symbol', - 'source': { - 'type': 'geojson', - 'data': { - 'type': 'FeatureCollection', - 'features': [], - }, - }, - 'layout': { - 'icon-allow-overlap': true, - 'text-allow-overlap': true, - 'icon-image': '白蚁监测', - 'icon-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 0.4, - 14, 0.8, - ], - - 'text-allow-overlap': true, - 'text-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 10, - 14, 14, - ], - 'text-font': ['Roboto Black'], - 'text-field': [ - 'step', - ['zoom'], - '', - 12, ['get', 'stnm'] - ], - 'text-anchor': 'top', - 'text-offset': [0, 1], - }, - 'paint': { - 'text-color': '#fff' - }, - 'visibility': 'visible', - }); - } - if(type==='sk'){ - map.addLayer({ - 'id': '关联站点',//+new Date().getTime(), - 'type': 'symbol', - 'source': { - 'type': 'geojson', - 'data': { - 'type': 'FeatureCollection', - 'features': [], - }, - }, - 'layout': { - 'icon-allow-overlap': true, - 'text-allow-overlap': true, - 'icon-image': '水库-离线', - 'icon-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 0.4, - 14, 0.8, - ], - - 'text-allow-overlap': true, - 'text-size': [ - 'interpolate', ['linear'], ['zoom'], - 10, 10, - 14, 14, - ], - 'text-font': ['Roboto Black'], - 'text-field': [ - 'step', - ['zoom'], - '', - 12, ['get', 'stnm'] - ], - 'text-anchor': 'top', - 'text-offset': [0, 1], - - }, - 'paint': { - 'text-color': '#fff' - }, - 'visibility': 'visible', - }); - } - - map.getSource('关联站点').setData(parseGeoJSON(data)) } -useEffect(() => { + else { + const dsq = setInterval(() => { + const map = window.__mapref; + if (map && skdata.length > 0) { + clearInterval(dsq) + setLayer(skdata, 'sk') + } + }, 500); + } + + }, [data1, data2, data3, data4, tab, showbx, showsy, showsl, showby]) + + const setLayer = (data = [], type) => { + const map = window.__mapref; + const layer = map.getLayer('关联站点') + if (layer) { + map.removeLayer('关联站点'); + map.removeSource('关联站点'); + } + if (data.length === 0) { return } + if (type === '变形') { + map.addLayer({ + 'id': '关联站点',//+new Date().getTime(), + 'type': 'symbol', + 'source': { + 'type': 'geojson', + 'data': { + 'type': 'FeatureCollection', + 'features': [], + }, + }, + 'layout': { + 'icon-allow-overlap': true, + 'text-allow-overlap': true, + 'icon-image': '变形监测', + 'icon-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 0.4, + 14, 0.8, + ], + + 'text-allow-overlap': true, + 'text-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 10, + 14, 14, + ], + 'text-font': ['Roboto Black'], + 'text-field': [ + 'step', + ['zoom'], + '', + 12, ['get', 'stnm'] + ], + 'text-anchor': 'top', + 'text-offset': [0, 1], + }, + 'paint': { + 'text-color': '#fff' + }, + 'visibility': 'visible', + }); + } + if (type === '渗压') { + map.addLayer({ + 'id': '关联站点',//+new Date().getTime(), + 'type': 'symbol', + 'source': { + 'type': 'geojson', + 'data': { + 'type': 'FeatureCollection', + 'features': [], + }, + }, + 'layout': { + 'icon-allow-overlap': true, + 'text-allow-overlap': true, + 'icon-image': '渗压监测', + 'icon-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 0.4, + 14, 0.8, + ], + + 'text-allow-overlap': true, + 'text-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 10, + 14, 14, + ], + 'text-font': ['Roboto Black'], + 'text-field': [ + 'step', + ['zoom'], + '', + 12, ['get', 'stnm'] + ], + 'text-anchor': 'top', + 'text-offset': [0, 1], + }, + 'paint': { + 'text-color': '#fff' + }, + 'visibility': 'visible', + }); + } + if (type === '渗流') { + map.addLayer({ + 'id': '关联站点',//+new Date().getTime(), + 'type': 'symbol', + 'source': { + 'type': 'geojson', + 'data': { + 'type': 'FeatureCollection', + 'features': [], + }, + }, + 'layout': { + 'icon-allow-overlap': true, + 'text-allow-overlap': true, + 'icon-image': '渗流监测', + 'icon-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 0.4, + 14, 0.8, + ], + + 'text-allow-overlap': true, + 'text-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 10, + 14, 14, + ], + 'text-font': ['Roboto Black'], + 'text-field': [ + 'step', + ['zoom'], + '', + 12, ['get', 'stnm'] + ], + 'text-anchor': 'top', + 'text-offset': [0, 1], + + }, + 'paint': { + 'text-color': '#fff' + }, + 'visibility': 'visible', + }); + } + if (type === '白蚁') { + map.addLayer({ + 'id': '关联站点',//+new Date().getTime(), + 'type': 'symbol', + 'source': { + 'type': 'geojson', + 'data': { + 'type': 'FeatureCollection', + 'features': [], + }, + }, + 'layout': { + 'icon-allow-overlap': true, + 'text-allow-overlap': true, + 'icon-image': '白蚁监测', + 'icon-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 0.4, + 14, 0.8, + ], + + 'text-allow-overlap': true, + 'text-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 10, + 14, 14, + ], + 'text-font': ['Roboto Black'], + 'text-field': [ + 'step', + ['zoom'], + '', + 12, ['get', 'stnm'] + ], + 'text-anchor': 'top', + 'text-offset': [0, 1], + }, + 'paint': { + 'text-color': '#fff' + }, + 'visibility': 'visible', + }); + } + if (type === 'sk') { + map.addLayer({ + 'id': '关联站点',//+new Date().getTime(), + 'type': 'symbol', + 'source': { + 'type': 'geojson', + 'data': { + 'type': 'FeatureCollection', + 'features': [], + }, + }, + 'layout': { + 'icon-allow-overlap': true, + 'text-allow-overlap': true, + 'icon-image': '水库-离线', + 'icon-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 0.4, + 14, 0.8, + ], + + 'text-allow-overlap': true, + 'text-size': [ + 'interpolate', ['linear'], ['zoom'], + 10, 10, + 14, 14, + ], + 'text-font': ['Roboto Black'], + 'text-field': [ + 'step', + ['zoom'], + '', + 12, ['get', 'stnm'] + ], + 'text-anchor': 'top', + 'text-offset': [0, 1], + + }, + 'paint': { + 'text-color': '#fff' + }, + 'visibility': 'visible', + }); + } + + map.getSource('关联站点').setData(parseGeoJSON(data)) + } + useEffect(() => { setShowdbx(0) - setShowdsy(0) - setShowdsl(0) - setShowdby(0) - -}, [tab]) + setShowdsy(0) + setShowdsl(0) + setShowdby(0) + + }, [tab]) return ( { color="green" extra={ <> - - { - setTab('1') - }}>变形 + + { + setTab('1') + }}>变形 { - setTab('2') - }}>渗压 - { - setTab('3') - }}>渗流 - { - - setTab('4') - }}>白蚁 - + setTab('2') + }}>渗压 + { + setTab('3') + }}>渗流 + { + + setTab('4') + }}>白蚁 + } > @@ -1221,23 +1224,27 @@ useEffect(() => { - {data1.map((row,index) => ( - - -
{ - const {lgtd, lttd,res_nm:stnm } = row; - if (stnm == '浮桥河水库') { - setShowdbx(1) - if (lgtd && lttd) { - dispatch.runtime.setCameraTarget({ - center: [lgtd, lttd], - zoom: 17, - pitch: 60, - bearing: 0 - }); - } + {data1.map((row, index) => ( + { + const { lgtd, lttd, res_nm: stnm } = row; + if (stnm == '浮桥河水库') { + setShowdbx(1) + if (lgtd && lttd) { + dispatch.runtime.setCameraTarget({ + center: [lgtd, lttd], + zoom: 17, + pitch: 60, + bearing: 0 + }); } - }}>{row.dm}
+ } + }} + > + +
{row.dm}
{row.cd_nm} {row.du_value} @@ -1250,10 +1257,10 @@ useEffect(() => { : null } { - tab == '2' ? + tab == '2' ?
- + 断面 测点 渗压水位 @@ -1262,23 +1269,27 @@ useEffect(() => { - {data2.map((row,index) => ( - - -
{ - const { lgtd, lttd,res_nm:stnm } = row; - if (stnm == '浮桥河水库') { - setShowdsy(1) - if (lgtd && lttd) { - dispatch.runtime.setCameraTarget({ - center: [lgtd, lttd], - zoom: 17, - pitch: 60, - bearing: 0 - }); - } + {data2.map((row, index) => ( + { + const { lgtd, lttd, res_nm: stnm } = row; + if (stnm == '浮桥河水库') { + setShowdsy(1) + if (lgtd && lttd) { + dispatch.runtime.setCameraTarget({ + center: [lgtd, lttd], + zoom: 17, + pitch: 60, + bearing: 0 + }); } - }}>{row.dm}
+ } + }} + > + +
{row.dm}
{row.cd_nm} {row.value} @@ -1287,10 +1298,10 @@ useEffect(() => {
))}
-
:null + : null } { - tab == '3' ? + tab == '3' ?
测点 @@ -1299,24 +1310,28 @@ useEffect(() => { - {data3.map((row,index) => ( - - -
{ - const { lgtd, lttd } = row; - setShowdsl(1) - if (row.cd == 1) { - if (lgtd && lttd) { - dispatch.runtime.setCameraTarget({ - center: [lgtd, lttd], - zoom: 17, - pitch: 60, - bearing: 0 - }); - } - + {data3.map((row, index) => ( + { + const { lgtd, lttd } = row; + setShowdsl(1) + if (row.cd == 1) { + if (lgtd && lttd) { + dispatch.runtime.setCameraTarget({ + center: [lgtd, lttd], + zoom: 17, + pitch: 60, + bearing: 0 + }); } - }}>{row.cd_nm}
+ + } + }} + > + +
{row.cd_nm}
{/* {row.cd_nm} */} {row.value} @@ -1324,7 +1339,7 @@ useEffect(() => {
))}
-
:null + : null } { tab == '4' ? @@ -1337,36 +1352,39 @@ useEffect(() => { - {data4.map((row,index) => ( - - -
{ - const { lgtd, lttd } = row; - setShowdby(1) - if (row.cd == '0EA5DE') { - - if (lgtd && lttd) { - dispatch.runtime.setCameraTarget({ - center: [lgtd, lttd], - zoom: 17, - pitch: 60, - bearing: 0 - }); - } + {data4.map((row, index) => ( + { + const { lgtd, lttd } = row; + setShowdby(1) + if (row.cd == '0AB3ED') { + if (lgtd && lttd) { + dispatch.runtime.setCameraTarget({ + center: [lgtd, lttd], + zoom: 17, + pitch: 60, + bearing: 0 + }); } - }}>{row?.children?.[0]?.cd}
+ } + }} + > + +
{row?.children?.[0]?.cd}
{/* {row?.children?.[0]?.cd} */} - {row?.children?.[0]?.termite_status==='y'?
有白蚁
:
无白蚁
}
+ {row?.children?.[0]?.termite_status === 'y' ?
有白蚁
:
无白蚁
}
{row?.children?.[0]?.tm}
))}
-
:null + : null } - + - {/*
+ {/*