From 8ef2bb5e46d84594e6ed632c07ea0b47a1bf6c4d Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 11 十二月 2024 16:15:17 +0800
Subject: [PATCH] #path similarity

---
 zy-asrs-flow/src/pages/map/drawer/lift/view.jsx |  130 ++++++++++++++++++++-----------------------
 1 files changed, 60 insertions(+), 70 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/drawer/lift/view.jsx b/zy-asrs-flow/src/pages/map/drawer/lift/view.jsx
index f029e3e..a263ab6 100644
--- a/zy-asrs-flow/src/pages/map/drawer/lift/view.jsx
+++ b/zy-asrs-flow/src/pages/map/drawer/lift/view.jsx
@@ -1,7 +1,6 @@
 import React, { useState, useRef, useEffect } from 'react';
-import { Spin, Descriptions, Button } from 'antd';
+import { Descriptions, Button, Skeleton, Badge, Space } 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';
@@ -13,21 +12,9 @@
             display: 'flex',
             gap: '0px',
         },
-        threeInfo: {
-            height: '100%',
-            width: '60%',
-        },
-        spinWrapper: {
-            height: '100%',
-        },
-        threeContainer: {
-            zIndex: 99,
-            width: '100%',
-            height: '100%',
-        },
         tableInfo: {
             height: '100%',
-            width: '40%',
+            width: '100%',
             padding: '0 10px 0 15px',
             overflow: 'auto',
         },
@@ -46,70 +33,73 @@
 
     const { data } = props;
     const [loading, setLoading] = React.useState(false);
+    const [info, setInfo] = React.useState(null);
 
     useEffect(() => {
         setLoading(true);
-
-        setTimeout(() => {
-
+        const fetchLiftInfo = async (liftNo) => {
+            const res = await Http.doGet('/api/map/lift/info', { liftNo: liftNo });
+            if (res?.data) {
+                setInfo(res.data);
+            }
             setLoading(false);
-        }, 300)
+        }
+        fetchLiftInfo(data.no);
     }, [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>
+                {loading ? (
+                    <Skeleton active />
+                ) : (
+                    <div className={styles.tableInfo}>
+                        <Descriptions
+                            bordered
+                            title=''
+                            size='small'
+                            layout="vertical"
+                            column={3}
+                            items={
+                                [
+                                    {
+                                        key: '1',
+                                        label: intl.formatMessage({ id: 'map.loc.no', defaultMessage: '搴撲綅鍙�' }),
+                                        children: <Badge status="processing" text="Running" />,
+                                    },
+                                    {
+                                        key: '2',
+                                        label: intl.formatMessage({ id: 'map.pallet.barcode', defaultMessage: '鎵樼洏鏉$爜' }),
+                                        children: '80000010',
+                                        span: 1
+                                    },
+                                    {
+                                        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>
         </>
     )

--
Gitblit v1.9.1