From c48e3aabf2947e45a9db2eac3ef91190e8647655 Mon Sep 17 00:00:00 2001 From: skyouc <958836976@qq.com> Date: 星期二, 02 九月 2025 17:03:34 +0800 Subject: [PATCH] agv站点功能调整 --- rsf-admin/src/page/basicInfo/basStation/CrossZoneAreaField.jsx | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/basStation/CrossZoneAreaField.jsx b/rsf-admin/src/page/basicInfo/basStation/CrossZoneAreaField.jsx index 115901a..e8f9de3 100644 --- a/rsf-admin/src/page/basicInfo/basStation/CrossZoneAreaField.jsx +++ b/rsf-admin/src/page/basicInfo/basStation/CrossZoneAreaField.jsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { useState, useRef, useEffect, useMemo, useCallback } from 'react'; import { Stack, Chip, Dialog, DialogTitle, DialogContent, IconButton, CircularProgress } from '@mui/material'; import { useTranslate, useRecordContext } from 'react-admin'; import CloseIcon from '@mui/icons-material/Close'; @@ -7,9 +7,9 @@ const CrossZoneAreaField = () => { const translate = useTranslate(); const record = useRecordContext(); - const [open, setOpen] = React.useState(false); - const [areaNames, setAreaNames] = React.useState([]); - const [loading, setLoading] = React.useState(false); + const [open, setOpen] = useState(false); + const [areaNames, setAreaNames] = useState([]); + const [loading, setLoading] = useState(false); const handleOpen = () => { setOpen(true); @@ -35,11 +35,11 @@ } }; - React.useEffect(() => { - if (record?.areaIds && record.areaIds.length > 0) { + useEffect(() => { + if (record?.areaIds && record.areaIds.length !== 0 && record.areaIds.length > 0) { fetchAreaNames(); } - }, [record]); + }, [record]); if (loading) { return <CircularProgress size={20} />; -- Gitblit v1.9.1