调整面板

This commit is contained in:
JIANG
2025-11-06 16:52:26 +08:00
parent eebac8f8b0
commit 2a48e1f6df
2 changed files with 25 additions and 17 deletions

View File

@@ -135,7 +135,7 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
const debounceTimerRef = useRef<NodeJS.Timeout | null>(null);
const filterBoxRef = useRef<HTMLDivElement | null>(null);
const [listHeight, setListHeight] = useState<number>(500);
const [listHeight, setListHeight] = useState<number>(560);
// 清洗对话框状态
const [cleanDialogOpen, setCleanDialogOpen] = useState<boolean>(false);
@@ -748,13 +748,13 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
useEffect(() => {
const updateListHeight = () => {
if (filterBoxRef.current) {
const drawerHeight = 760; // Drawer 总高度
const drawerHeight = 820; // Drawer 总高度
const headerHeight = 73; // 头部高度(估算)
const dividerHeight = 1; // 分隔线高度
const filterBoxHeight = filterBoxRef.current.offsetHeight;
const availableHeight =
drawerHeight - headerHeight - filterBoxHeight - dividerHeight - 8; // 减去一些边距
setListHeight(Math.max(availableHeight, 200)); // 最小高度 200
setListHeight(Math.max(availableHeight, 260)); // 最小高度 260
}
};
@@ -777,8 +777,6 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
showCleaning,
]);
const drawerWidth = 360;
return (
<>
{/* 收起时的触发按钮 */}
@@ -808,11 +806,11 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
variant="persistent"
hideBackdrop
sx={{
width: isExpanded ? drawerWidth : 0,
width: isExpanded ? 360 : 0,
flexShrink: 0,
"& .MuiDrawer-paper": {
width: drawerWidth,
height: "760px",
width: 360,
height: "820px",
boxSizing: "border-box",
position: "absolute",
top: 80,