king
2021-01-07 2292d1826e69e21c8a411c217faef635fe57d458
src/menu/datasource/verifycard/settingform/index.jsx
@@ -4,6 +4,7 @@
import { formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import MenuUtils from '@/menu/utils/menuUtils.js'
import CodeMirror from '@/templates/zshare/codemirror'
import './index.scss'
@@ -30,7 +31,7 @@
  UNSAFE_componentWillMount () {
    const { menu, config } = this.props
    let modules = this.getModules(menu.components, config.uuid)
    let modules = MenuUtils.getSupModules(menu.components, config.uuid)
    if (!modules) {
      modules = []
    }
@@ -52,57 +53,6 @@
    }
    this.setState({modules, usefulFields})
  }
  getModules = (components, selfId) => {
    let modules = components.map(item => {
      if (item.uuid === selfId) {
        return {
          children: null
        }
      } else if (item.switchable) {
        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
  }
  handleConfirm = () => {