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 ( <>