king
2021-01-05 b6e8966b84a0641a29de57e3e7240e1227406765
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,