feat(): 白蚁监测调整

qzc-dev
李神峰 2025-09-30 15:49:30 +08:00
parent f391494d10
commit 256a7035bf
2 changed files with 11 additions and 11 deletions

View File

@ -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'),
])

View File

@ -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 (
<>
<div className='content-root clearFloat xybm' style={{ paddingRight: "0", paddingBottom: "0" }}>