From 7eba8548b33582af3e985b826679f54e31a3479f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 09 十月 2024 11:17:24 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/map/Device.jsx | 46 ++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/zy-acs-flow/src/map/Device.jsx b/zy-acs-flow/src/map/Device.jsx
index e65cf4e..56a2ebb 100644
--- a/zy-acs-flow/src/map/Device.jsx
+++ b/zy-acs-flow/src/map/Device.jsx
@@ -1,11 +1,49 @@
+import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
+import { Drawer, Box, Typography, Card, IconButton, Stack } from '@mui/material';
+import CloseIcon from '@mui/icons-material/Close';
+import * as Common from '@/utils/common';
+import { PAGE_DRAWER_WIDTH } from '@/config/setting';
+const Device = (props) => {
+ const {
+ title = 'Drawer',
+ open,
+ onCancel,
+ closeCallback,
+ width = PAGE_DRAWER_WIDTH,
+ children
+ } = props;
-const Device = () => {
+ const handleClose = () => {
+ onCancel();
+ if (closeCallback) {
+ closeCallback();
+ }
+ }
return (
- <>
-
- </>
+ <Drawer
+ variant="persistent"
+ open={open}
+ anchor="right"
+ onClose={handleClose}
+ sx={{ zIndex: 100 }}
+ >
+ {open && (
+ <Box pt={12} width={{ xs: '100vW', sm: width }} height={'calc(100vh - 200px);'} mt={{ xs: 2, sm: 1 }} sx={{
+ }}>
+ <Stack direction="row" p={2}>
+ <Typography variant="h6" flex="1">
+ {title}
+ </Typography>
+ <IconButton onClick={handleClose} size="small">
+ <CloseIcon />
+ </IconButton>
+ </Stack>
+ {children}
+ </Box>
+ )}
+ </Drawer>
)
}
--
Gitblit v1.9.1