From 4f4567087895bbb0d7c5b36a54eab2c1bb6fe567 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 28 三月 2024 13:46:28 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx b/zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx
index 00eeb62..4afd377 100644
--- a/zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx
+++ b/zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx
@@ -1,6 +1,7 @@
 import React, { useState, useRef, useEffect } from 'react';
-import { Card, Form, Button } from 'antd';
+import { Spin, Form, 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';
@@ -12,7 +13,7 @@
             zIndex: 99,
             width: '500px',
             height: '600px',
-        }
+        },
     }
 })
 
@@ -21,23 +22,31 @@
 const ShelfView = (props) => {
     const intl = useIntl();
     const { styles } = useStyles();
-
-    // console.log(props.data);
-
     const refContainer = useRef();
+    const [loading, setLoading] = React.useState(true);
 
     useEffect(() => {
-        shelfThree = new ShelfThree(refContainer.current);
-        shelfThree.startup();
+        console.log(props);
+        setTimeout(() => {
+            setLoading(false);
+            shelfThree = new ShelfThree(refContainer.current);
+            shelfThree.startup();
+        }, 1000)
 
         return () => {
             shelfThree?.destroy();
         }
-    }, []);
+    }, [props]);
 
     return (
         <>
-            <div className={styles.threeContainer} ref={refContainer}></div>
+            <Spin
+                spinning={loading}
+                indicator={<LoadingOutlined spin />}
+                size={'large'}
+            >
+                <div ref={refContainer} className={styles.threeContainer}></div>
+            </Spin>
         </>
     )
 }

--
Gitblit v1.9.1