king
2020-11-23 f8c3c53f9e29541f8c0e3fcbf682c301fd17e06a
src/menu/actioncomponent/index.jsx
@@ -4,8 +4,6 @@
import { is, fromJS } from 'immutable'
import { Modal, notification, Button } from 'antd'
import Api from '@/api'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import DevUtils from '@/utils/devutils.js'
import zhCN from '@/locales/zh-CN/model.js'
@@ -169,75 +167,37 @@
    </div>
    let menulist = []
    if (menu.fstMenuList) {
      menulist = menu.fstMenuList.map(item => {
        return {
          value: item.MenuID,
          label: item.text,
          isLeaf: false
        }
      let trees = fromJS(menu.fstMenuList).toJS()
      menulist = trees.map(fst => {
        fst.value = fst.MenuID
        fst.label = fst.MenuName
        fst.isLeaf = false
        fst.children = fst.children.map(snd => {
          snd.value = snd.MenuID
          snd.label = snd.MenuName
          snd.children = snd.children.map(thd => {
            thd.value = thd.MenuID
            thd.label = thd.MenuName
            thd.disabled = thd.MenuID === menu.MenuID
            return thd
          })
          return snd
        })
        return fst
      })
    }
    let modules = this.getModules(menu.components, config.uuid)
    if (menu.fstMenuList && card.linkmenu && card.linkmenu.length > 0) {
      let _param = {
        func: 'sPC_Get_FunMenu',
        ParentID: card.linkmenu[0],
        systemType: options.sysType,
        debug: 'Y'
      }
      Api.getSystemConfig(_param).then(result => {
        if (result.status) {
          menulist = menulist.map(item => {
            if (item.value === card.linkmenu[0]) {
              item.children = result.data.map(item => {
                let submenu = {
                  value: item.ParentID,
                  label: item.MenuNameP,
                  children: item.FunMenu.map(cell => {
                    return {
                      value: cell.MenuID,
                      label: cell.MenuName,
                      MenuID: cell.MenuID,
                      MenuName: cell.MenuName,
                      MenuNo: cell.MenuNo,
                      Ot: cell.Ot,
                      PageParam: cell.PageParam,
                      LinkUrl: cell.LinkUrl,
                      disabled: cell.MenuID === menu.MenuID
                    }
                  })
                }
                return submenu
              })
            }
            return item
          })
        } else {
          notification.warning({
            top: 92,
            message: result.message,
            duration: 5
          })
        }
        this.setState({
          visible: true,
          card: card,
          formlist: getActionForm(card, functip, config.setting, menu.permFuncField, this.props.type, menulist, modules)
        })
      })
    } else {
      this.setState({
        visible: true,
        card: card,
        formlist: getActionForm(card, functip, config.setting, menu.permFuncField, this.props.type, menulist, modules)
      })
    }
    this.setState({
      visible: true,
      card: card,
      formlist: getActionForm(card, functip, config.setting, menu.permFuncField, this.props.type, menulist, modules)
    })
  }
  /**