From d835d1b51f832889929cdf69010034a30ef44d02 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期四, 17 十月 2024 13:57:29 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/drawer/index.jsx |   98 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 94 insertions(+), 4 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/drawer/index.jsx b/zy-asrs-flow/src/pages/map/drawer/index.jsx
index 1394379..ba06a3b 100644
--- a/zy-asrs-flow/src/pages/map/drawer/index.jsx
+++ b/zy-asrs-flow/src/pages/map/drawer/index.jsx
@@ -1,9 +1,14 @@
 import React, { useState, useRef, useEffect } from 'react';
-import { Drawer } from 'antd';
+import { Drawer, Space, Button } from 'antd';
 import { FormattedMessage, useIntl, useModel } from '@umijs/max';
 import { createStyles } from 'antd-style';
 import * as Utils from '../utils'
-import Http from '@/utils/http';
+import ShelfDrawer from './shelf';
+import ConveyorDrawer from './conveyor';
+import AgvDrawer from './agv';
+import PointDrawer from './point'
+import ShuttleDrawer from './shuttle'
+import LiftDrawer from './lift'
 
 const useStyles = createStyles(({ token, css }) => {
 
@@ -12,12 +17,97 @@
 const MapDrawer = (props) => {
     const intl = useIntl();
     const { styles } = useStyles();
+    const { curSprite, curFloor } = props;
+
+    const [drawerTitle, setDrawerTitle] = useState('');
+    const [drawerWidth, setDrawerWidth] = useState(() => {
+        return window.innerWidth * 0.35;
+    })
+
+    useEffect(() => {
+    }, [props.curSprite]);
+
+    const handleCancel = () => {
+        props.onCancel();
+    };
 
     return (
         <>
             <Drawer
-
-            />
+                title={drawerTitle}
+                open={props.open}
+                onClose={handleCancel}
+                getContainer={props.refCurr}
+                rootStyle={{ position: "absolute" }}
+                mask={false}
+                width={drawerWidth}
+                style={{
+                    opacity: 1
+                }}
+                extra={
+                    <Space>
+                        <Button onClick={handleCancel}>
+                            <FormattedMessage id='common.cancel' defaultMessage='鍙栨秷' />
+                        </Button>
+                    </Space>
+                }
+            >
+                {(props.curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && props.curSprite?.data?.shelfType !== Utils.SHELF_TYPE.LIFT) && (
+                    <>
+                        <ShelfDrawer
+                            curSprite={curSprite}
+                            curFloor={curFloor}
+                            setDrawerTitle={setDrawerTitle}
+                            setDrawerWidth={setDrawerWidth}
+                        />
+                    </>
+                )}
+                {(props.curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && props.curSprite?.data?.shelfType === Utils.SHELF_TYPE.LIFT) && (
+                    <>
+                        <LiftDrawer
+                            curSprite={curSprite}
+                            curFloor={curFloor}
+                            setDrawerTitle={setDrawerTitle}
+                            setDrawerWidth={setDrawerWidth}
+                        />
+                    </>
+                )}
+                {props.curSprite?.data?.type === Utils.SENSOR_TYPE.CONVEYOR && (
+                    <>
+                        <ConveyorDrawer
+                            curSprite={curSprite}
+                            curFloor={curFloor}
+                            setDrawerTitle={setDrawerTitle}
+                            setDrawerWidth={setDrawerWidth}
+                        />
+                    </>
+                )}
+                {props.curSprite?.data?.type === Utils.SENSOR_TYPE.SHUTTLE && (
+                    <>
+                        <ShuttleDrawer
+                            curSprite={curSprite}
+                            curFloor={curFloor}
+                            setDrawerTitle={setDrawerTitle}
+                            setDrawerWidth={setDrawerWidth}
+                            refCurr={props.refCurr}
+                        />
+                    </>
+                )}
+                {props.curSprite?.data?.type === Utils.SENSOR_TYPE.POINT && (
+                    <>
+                        <PointDrawer
+                            curSprite={curSprite}
+                        />
+                    </>
+                )}
+                {props.curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
+                    <>
+                        <AgvDrawer
+                            curSprite={curSprite}
+                        />
+                    </>
+                )}
+            </Drawer>
         </>
     )
 }

--
Gitblit v1.9.1