From 547e5fe219ee7bee309ecd67db74bc8df66b5433 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 23 八月 2023 11:47:45 +0800
Subject: [PATCH] 2023-08-23

---
 src/components/mkIcon/index.jsx |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/components/mkIcon/index.jsx b/src/components/mkIcon/index.jsx
index fd157d7..3427f4b 100644
--- a/src/components/mkIcon/index.jsx
+++ b/src/components/mkIcon/index.jsx
@@ -46,12 +46,8 @@
   }
 
   componentDidMount() {
-    if (!window.GLOB.designView) {
-      if (window.GLOB.systemIcons) {
-        this.setState({cusicons: window.GLOB.systemIcons})
-      } else {
-        this.getIcons()
-      }
+    if (!window.GLOB.designView && window.GLOB.systemIcons) {
+      this.setState({cusicons: window.GLOB.systemIcons})
     }
   }
 
@@ -65,6 +61,8 @@
   }
 
   getIcons = () => {
+    const { selectIcon } = this.state
+    
     Api.getCloudConfig({ func: 's_get_icons' }).then(res => {
       if (!res.status) {
         notification.warning({
@@ -84,6 +82,13 @@
       window.GLOB.systemIcons = icons
 
       this.setState({cusicons: icons})
+
+      if (icons.length > 0 && selectIcon && /<svg/.test(selectIcon)) {
+        setTimeout(() => {
+          let node = document.getElementById('mk-custom-tab')
+          node && node.click()
+        }, 200)
+      }
     })
   }
 
@@ -92,7 +97,9 @@
 
     this.setState({visible: true})
 
-    if (cusicons.length > 0 && selectIcon && /<svg/.test(selectIcon)) {
+    if (!window.GLOB.designView && !window.GLOB.systemIcons) {
+      this.getIcons()
+    } else if (cusicons.length > 0 && selectIcon && /<svg/.test(selectIcon)) {
       setTimeout(() => {
         let node = document.getElementById('mk-custom-tab')
         node && node.click()

--
Gitblit v1.8.0