king
2021-01-20 0227c25e4ed573d3095ada3f9c9a4ba5f18b0de5
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,
@@ -278,10 +229,10 @@
          if (btn.class !== item.class || btn.show !== item.show || !btn.btnstyle.color) {
            if (btn.show === 'link' || btn.show === 'icon') {
              btn.btnstyle.color = color[btn.class]
              btn.btnstyle.background = 'transparent'
              btn.btnstyle.backgroundColor = 'transparent'
            } else {
              btn.btnstyle.color = '#ffffff'
              btn.btnstyle.background = color[btn.class]
              btn.btnstyle.backgroundColor = color[btn.class]
            }
          }
          return btn
@@ -293,7 +244,7 @@
      if (labelrepet) {
        notification.warning({
          top: 92,
          message: this.state.dict['model.name.exist'] + ' !',
          message: '名称已存在!',
          duration: 5
        })
        return
@@ -453,6 +404,8 @@
   * @description 按钮双击触发子配置
   */
  btnDoubleClick = (element) => {
    if (sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') !== 'false') return
    if (element.OpenType === 'pop' || element.OpenType === 'popview') {
      this.props.setSubConfig(element)
    } else {