From 7392de6c8d723378cf866445a9efc5f90e304c76 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 10 四月 2024 09:58:47 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/drawer/conveyor/index.jsx |   28 +++++++-
 zy-asrs-flow/src/pages/map/drawer/conveyor/view.jsx  |  118 +++++++++++++++++++++++++++++++++++++++
 zy-asrs-flow/src/pages/map/drawer/lift/index.jsx     |    1 
 3 files changed, 141 insertions(+), 6 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/drawer/conveyor/index.jsx b/zy-asrs-flow/src/pages/map/drawer/conveyor/index.jsx
index 4fa72cc..911b37b 100644
--- a/zy-asrs-flow/src/pages/map/drawer/conveyor/index.jsx
+++ b/zy-asrs-flow/src/pages/map/drawer/conveyor/index.jsx
@@ -5,17 +5,31 @@
 import * as Utils from '../../utils'
 import Http from '@/utils/http';
 import ShowJson from '../showJson';
+import ConveyorView from './view'
 
-const useStyles = createStyles(({ token, css }) => {
-
-})
 
 const ConveyorDrawer = (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
+
+    useEffect(() => {
+        if (!curSprite) {
+            return
+        }
+        props.setDrawerTitle(intl.formatMessage({ id: 'map.loc.no', defaultMessage: '搴撲綅鍙�' }) + ': ' + curNo);
+    }, [curNo]);
 
     const contentList = {
+        view: (
+            <ConveyorView
+                curNo={curNo}
+                data={curSprite.data}
+                curFloor={curFloor}
+            />
+        ),
         json: (
             <ShowJson
                 data={props.curSprite.data}
@@ -32,6 +46,10 @@
                 type='inner'
                 tabList={[
                     {
+                        key: 'view',
+                        tab: intl.formatMessage({ id: 'map.drawer.shelf.view.title', defaultMessage: '搴撲綅淇℃伅' }),
+                    },
+                    {
                         key: 'json',
                         tab: intl.formatMessage({ id: 'map.drawer.json', defaultMessage: 'JSON' }),
                     },
diff --git a/zy-asrs-flow/src/pages/map/drawer/conveyor/view.jsx b/zy-asrs-flow/src/pages/map/drawer/conveyor/view.jsx
new file mode 100644
index 0000000..d147168
--- /dev/null
+++ b/zy-asrs-flow/src/pages/map/drawer/conveyor/view.jsx
@@ -0,0 +1,118 @@
+import React, { useState, useRef, useEffect } from 'react';
+import { Spin, Descriptions, Button } from 'antd';
+import { FormattedMessage, useIntl, useModel } from '@umijs/max';
+import { LoadingOutlined } from '@ant-design/icons';
+import { createStyles } from 'antd-style';
+import * as Utils from '../../utils'
+import Http from '@/utils/http';
+
+const useStyles = createStyles(({ token, css }) => {
+    return {
+        infoBox: {
+            height: '100%',
+            display: 'flex',
+            gap: '0px',
+        },
+        threeInfo: {
+            height: '100%',
+            width: '60%',
+        },
+        spinWrapper: {
+            height: '100%',
+        },
+        threeContainer: {
+            zIndex: 99,
+            width: '100%',
+            height: '100%',
+        },
+        tableInfo: {
+            height: '100%',
+            width: '40%',
+            padding: '0 10px 0 15px',
+            overflow: 'auto',
+        },
+        tableButton: {
+            width: '100%',
+            marginBottom: '10px',
+            fontWeight: 'bold',
+            letterSpacing: '1px',
+        }
+    }
+})
+
+const ConveyorView = (props) => {
+    const intl = useIntl();
+    const { styles } = useStyles();
+
+    const { data } = props;
+    const [loading, setLoading] = React.useState(false);
+
+    useEffect(() => {
+        setLoading(true);
+
+        setTimeout(() => {
+
+            setLoading(false);
+        }, 300)
+    }, [data]);
+
+    return (
+        <>
+            <div className={styles.infoBox}>
+                <div className={`${styles.threeInfo} three-spin`}>
+                    <Spin
+                        spinning={loading}
+                        indicator={<LoadingOutlined spin />}
+                        size={'large'}
+                        wrapperClassName={styles.spinWrapper}
+                    >
+                    </Spin>
+                </div>
+                <div className={styles.tableInfo}>
+                    <Descriptions
+                        bordered
+                        layout="vertical"
+                        column={1}
+                        items={
+                            [
+                                {
+                                    key: '1',
+                                    label: intl.formatMessage({ id: 'map.loc.no', defaultMessage: '搴撲綅鍙�' }),
+                                },
+                                {
+                                    key: '2',
+                                    label: intl.formatMessage({ id: 'map.pallet.barcode', defaultMessage: '鎵樼洏鏉$爜' }),
+                                    children: '80000010',
+                                },
+                                {
+                                    key: '3',
+                                    label: intl.formatMessage({ id: 'map.is.enable', defaultMessage: '鏄惁鍚敤' }),
+                                    children: 'Disabled',
+                                },
+                                {
+                                    key: '4',
+                                    label: intl.formatMessage({ id: 'map.loc.operation', defaultMessage: '搴撲綅鎿嶄綔' }),
+                                    children: (
+                                        <>
+                                            <Button className={styles.tableButton} size='large' type="primary" danger>
+                                                <FormattedMessage id='map.loc.lock' defaultMessage='閿佸畾' />
+                                            </Button>
+                                            <Button className={styles.tableButton} size='large' disabled>
+                                                <FormattedMessage id='map.loc.unlock' defaultMessage='瑙i攣' />
+                                            </Button>
+                                            <Button className={styles.tableButton} size='large'>
+                                                <FormattedMessage id='map.loc.reset' defaultMessage='娓呴櫎搴撲綅' />
+                                            </Button>
+                                        </>
+                                    )
+                                },
+                            ]
+                        }
+                    />
+                </div>
+            </div>
+        </>
+    )
+}
+
+export default ConveyorView;
\ No newline at end of file
diff --git a/zy-asrs-flow/src/pages/map/drawer/lift/index.jsx b/zy-asrs-flow/src/pages/map/drawer/lift/index.jsx
index 518b67b..9e43797 100644
--- a/zy-asrs-flow/src/pages/map/drawer/lift/index.jsx
+++ b/zy-asrs-flow/src/pages/map/drawer/lift/index.jsx
@@ -12,7 +12,6 @@
     const { curSprite, curFloor } = props;
 
     const [activeTabKey, setActiveTabKey] = useState('view');
-
     const [curNo, setCurNo] = React.useState(''); // just used to modify the drawer title
 
     useEffect(() => {

--
Gitblit v1.9.1