From 151d3aee0218a3eb6b928b0b327be6cd9ac7652c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 01 七月 2021 16:02:07 +0800
Subject: [PATCH] 2021-07-01

---
 src/views/pcdesign/index.jsx |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 584f7b0..bc7ea8b 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -68,6 +68,7 @@
     customComponents: [],
     settingshow: sessionStorage.getItem('settingshow') !== 'false',
     controlshow: sessionStorage.getItem('controlshow') !== 'false',
+    comloading: false
   }
 
   UNSAFE_componentWillMount() {
@@ -379,10 +380,11 @@
     })
 
     this.setState({
-      config: {...config, components: []}
+      config: {...config, components},
+      comloading: true
     }, () => {
       this.setState({
-        config: {...config, components: components}
+        comloading: false
       })
     })
   }
@@ -1130,6 +1132,7 @@
           config.open_edition = res.open_edition || ''
 
           this.setState({
+            config,
             oriConfig: fromJS(config).toJS(),
           })
 
@@ -1248,10 +1251,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({
@@ -1465,7 +1468,7 @@
   }
 
   render () {
-    const { localedict, loading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents } = this.state
+    const { localedict, loading, comloading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents } = this.state
 
     return (
       <ConfigProvider locale={localedict}>
@@ -1523,7 +1526,7 @@
               <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
             </div>
             <div className={'menu-body ' + (menuloading ? 'saving' : '')}>
-              {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} /> : null}
+              {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null}
             </div>
           </DndProvider>
           <StyleController />

--
Gitblit v1.8.0