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/shuttle/index.jsx |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/drawer/shuttle/index.jsx b/zy-asrs-flow/src/pages/map/drawer/shuttle/index.jsx
index dfaaf50..f7344e2 100644
--- a/zy-asrs-flow/src/pages/map/drawer/shuttle/index.jsx
+++ b/zy-asrs-flow/src/pages/map/drawer/shuttle/index.jsx
@@ -5,20 +5,38 @@
 import * as Utils from '../../utils'
 import Http from '@/utils/http';
 import ShowJson from '../showJson';
-
-const useStyles = createStyles(({ token, css }) => {
-
-})
+import ShuttleView from './view'
 
 const ShuttleDrawer = (props) => {
     const intl = useIntl();
-    const { styles } = useStyles();
-    const [activeTabKey, setActiveTabKey] = useState('json');
+    const { curSprite, curFloor } = props;
+
+    const [activeTabKey, setActiveTabKey] = useState('view');
+    const [curNo, setCurNo] = React.useState(''); // just used to modify the drawer title
+
+    props.setDrawerWidth(window.innerWidth * 0.4);
+
+    useEffect(() => {
+        if (!curSprite) {
+            return
+        }
+        const deviceNo = curSprite?.data?.no;
+        props.setDrawerTitle(intl.formatMessage({ id: 'map.shuttle.no', defaultMessage: '绌挎杞﹀彿' }) + ': ' + deviceNo);
+        setCurNo(deviceNo)
+    }, [curNo]);
 
     const contentList = {
+        view: (
+            <ShuttleView
+                curNo={curNo}
+                data={curSprite.data}
+                curFloor={curFloor}
+                refCurr={props.refCurr}
+            />
+        ),
         json: (
             <ShowJson
-                data={props.curSprite.data}
+                data={curSprite.data}
             />
         ),
     };
@@ -32,6 +50,10 @@
                 type='inner'
                 tabList={[
                     {
+                        key: 'view',
+                        tab: intl.formatMessage({ id: 'map.drawer.shuttle.view.title', defaultMessage: '绌挎杞︿俊鎭�' }),
+                    },
+                    {
                         key: 'json',
                         tab: intl.formatMessage({ id: 'map.drawer.json', defaultMessage: 'JSON' }),
                     },

--
Gitblit v1.9.1