From b6e8966b84a0641a29de57e3e7240e1227406765 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 05 一月 2021 11:30:42 +0800
Subject: [PATCH] 2021-01-05

---
 src/menu/components/share/actioncomponent/index.jsx |   63 +++----------------------------
 1 files changed, 7 insertions(+), 56 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx
index 98132c1..5b45d27 100644
--- a/src/menu/components/share/actioncomponent/index.jsx
+++ b/src/menu/components/share/actioncomponent/index.jsx
@@ -9,18 +9,20 @@
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import { getActionForm } from './formconfig'
+import asyncSpinComponent from '@/utils/asyncSpinComponent'
 
 import MKEmitter from '@/utils/events.js'
 import ActionForm from './actionform'
-import VerifyCard from '@/templates/zshare/verifycard'
+import MenuUtils from '@/menu/utils/menuUtils.js'
 import CreateFunc from '@/templates/zshare/createfunc'
-import VerifyPrint from '@/templates/sharecomponent/actioncomponent/verifyprint'
-import VerifyExcelIn from '@/templates/sharecomponent/actioncomponent/verifyexcelin'
-import VerifyExcelOut from '@/templates/sharecomponent/actioncomponent/verifyexcelout'
 import DragElement from './dragaction'
 import './index.scss'
 
 const { confirm } = Modal
+const VerifyCard = asyncSpinComponent(() => import('@/templates/zshare/verifycard'))
+const VerifyPrint = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyprint'))
+const VerifyExcelIn = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelin'))
+const VerifyExcelOut = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelout'))
 
 class ActionComponent extends Component {
   static propTpyes = {
@@ -137,57 +139,6 @@
     }
   }
 
-  getModules = (components, selfId) => {
-    let modules = components.map(item => {
-      if (item.uuid === selfId) {
-        return {
-          children: null
-        }
-      } else if (item.format) {
-        return {
-          value: item.uuid,
-          label: item.name
-        }
-      } else if (item.type === 'tabs') {
-        let _item = {
-          value: item.uuid,
-          label: item.name,
-          children: item.subtabs.map(f_tab => {
-            let subItem = {
-              value: f_tab.uuid,
-              label: f_tab.label,
-              children: this.getModules(f_tab.components, selfId)
-            }
-
-            if (!subItem.children || subItem.children.length === 0) {
-              return {children: null}
-            }
-            return subItem
-          })
-        }
-
-        _item.children = _item.children.filter(t => t.children !== null)
-
-        if (_item.children.length === 0) {
-          return {children: null}
-        }
-
-        return _item
-      } else {
-        return {
-          children: null
-        }
-      }
-    })
-
-    modules = modules.filter(mod => mod.children !== null)
-
-    if (modules.length === 0) {
-      return null
-    }
-    return modules
-  }
-
   /**
    * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭�
    */
@@ -222,7 +173,7 @@
       menulist = []
     }
     
-    let modules = this.getModules(menu.components, config.uuid)
+    let modules = MenuUtils.getSubModules(menu.components, config.uuid)
 
     this.setState({
       visible: true,

--
Gitblit v1.8.0