From 14946ddf178021fb65fdfd0cb50aba73ae0a1aa9 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 09 十月 2024 11:17:15 +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