From cc23ebd63e2aec82db0a43965f4731789316fb78 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 22 七月 2021 09:25:19 +0800
Subject: [PATCH] 2021-07-22

---
 src/views/menudesign/index.jsx |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index b162520..85e7fe4 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -68,7 +68,8 @@
     config: null,
     popBtn: null,             // 寮圭獥鏍囩椤�
     visible: false,
-    customComponents: []
+    customComponents: [],
+    comloading: false
   }
 
   UNSAFE_componentWillMount() {
@@ -203,10 +204,11 @@
     })
 
     this.setState({
-      config: {...config, components: []}
+      config: {...config, components},
+      comloading: true
     }, () => {
       this.setState({
-        config: {...config, components: components}
+        comloading: false
       })
     })
   }
@@ -656,7 +658,8 @@
         if (res.status) {
           config.open_edition = res.open_edition || ''
           this.setState({
-            oriConfig: fromJS(config).toJS()
+            config,
+            oriConfig: fromJS(config).toJS(),
           })
 
           if (btnParam.LText) {
@@ -774,10 +777,10 @@
             copyButtons: [],
             thawButtons: [],
             menuloading: false,
-            config: {...config, components: []}
+            comloading: true
           }, () => {
             this.setState({
-              config: {...this.state.config, components: this.state.oriConfig.components}
+              comloading: false
             })
           })
           notification.success({
@@ -902,10 +905,11 @@
 
   resetConfig = (config) => {
     this.setState({
-      config: {...config, components: []}
+      config,
+      comloading: true
     }, () => {
       this.setState({
-        config: config
+        comloading: false
       })
     })
     window.GLOB.customMenu = config
@@ -921,7 +925,7 @@
   }
 
   render () {
-    const { activeKey, MenuType, popBtn, visible, dict, MenuId, config, ParentId, MenuName, MenuNo, menuloading, customComponents } = this.state
+    const { activeKey, comloading, MenuType, popBtn, visible, dict, MenuId, config, ParentId, MenuName, MenuNo, menuloading, customComponents } = this.state
 
     return (
       <ConfigProvider locale={_locale}>
@@ -990,7 +994,7 @@
                     <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
                   </div>
                 } style={{ width: '100%' }}>
-                  {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} /> : null}
+                  {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null}
                 </Card>
               </div>
             </div>

--
Gitblit v1.8.0