From 256a7035bfd489ecdbd8e35f58f0d5b3c8346b3c Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Tue, 30 Sep 2025 15:49:30 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E7=99=BD=E8=9A=81=E7=9B=91=E6=B5=8B?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homePanelsLayoutPage/item_yujing/index.js | 6 ++---- src/views/rcgl/byfz/bypc/index.js | 16 +++++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/views/Home/homePanelsLayoutPage/item_yujing/index.js b/src/views/Home/homePanelsLayoutPage/item_yujing/index.js index 7b6461aa7..f266f241e 100644 --- a/src/views/Home/homePanelsLayoutPage/item_yujing/index.js +++ b/src/views/Home/homePanelsLayoutPage/item_yujing/index.js @@ -20,10 +20,8 @@ const Page = ({ mySetTms }) => { const [ open, setOpen ] = useState(false) const [ key , setkey ] = useState('') const [ tms , setTms ] = useState([ - // moment().add(-1,'days').format('YYYY-MM-DD HH:mm:ss'), - // moment().format('YYYY-MM-DD HH:mm:ss'), - moment('2025-09-16').format('YYYY-MM-DD HH:mm:ss'), - moment('2025-09-17').format('YYYY-MM-DD HH:mm:ss') + moment().add(-1,'days').format('YYYY-MM-DD HH:mm:ss'), + moment().format('YYYY-MM-DD HH:mm:ss'), ]) diff --git a/src/views/rcgl/byfz/bypc/index.js b/src/views/rcgl/byfz/bypc/index.js index 3666465ed..5f84f6abb 100644 --- a/src/views/rcgl/byfz/bypc/index.js +++ b/src/views/rcgl/byfz/bypc/index.js @@ -209,10 +209,10 @@ const Page = () => { } // 获取白蚁所有测点 - const getCdList = async () => { - + const getCdList = async (params) => { + try { - const res = await httpget2(apiurl.rcgl.byfz.bypc.allCd); + const res = await httppost2(apiurl.rcgl.byfz.bypc.allCd,params); if (res.code == 200) { setAllCdList(res.data); // 添加标记点到地图 @@ -249,7 +249,9 @@ const Page = () => { }); // 根据status设置样式 - const color = point.status === 1 ? '#d9001b' : '#04d919'; // 1为红色,0为绿色 + const color = point.status === 1 ? '#d9001b' : + point.status === 0 ? '#04d919':'#8c8c8c' + ; // 1为红色,0为绿色 null 为灰色 feature.setStyle(new Style({ image: new CircleStyle({ @@ -456,10 +458,10 @@ const Page = () => { // 当地图实例创建完成后获取测点数据 useEffect(() => { - if (map) { - getCdList(); + if (map && searchVal) { + getCdList(searchVal); } - }, [map]); + }, [map,searchVal]); return ( <>