king
8 天以前 80deba0c2dcffd9e6b6f07815c7c52199309ce42
src/templates/treepageconfig/index.jsx
@@ -1,41 +1,36 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import { Button, Card, Modal, Collapse, notification, Spin, Icon, Switch, Tooltip, Row, Col, Tree } from 'antd'
import moment from 'moment'
import { Button, Card, Collapse, notification, Spin, Tooltip, Row, Col, Tree } from 'antd'
import { QuestionCircleOutlined, RedoOutlined, SearchOutlined, FileOutlined, FolderOpenOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import asyncComponent from '@/utils/asyncComponent'
import MenuForm from '@/templates/comtableconfig/menuform'
import EditComponent from '@/templates/zshare/editcomponent'
import SourceElement from '@/templates/zshare/dragsource'
import Source from './source'
import './index.scss'
const { Panel } = Collapse
const { confirm } = Modal
// const { confirm } = Modal
const { TreeNode } = Tree
const UpdateTable = asyncComponent(() => import('./updatetable'))
const TreeSettingComponent = asyncComponent(() => import('@/templates/sharecomponent/treesettingcomponent'))
const TabsComponent = asyncComponent(() => import('@/templates/sharecomponent/tabscomponent'))
class ComTableConfig extends Component {
  static propTpyes = {
    menu: PropTypes.any,
    optionLibs: PropTypes.any,
    reloadmenu: PropTypes.func,
    handleView: PropTypes.func
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    config: null,            // 页面配置
    formlist: null,          // 搜索条件、按钮、显示列表单字段
    menuloading: false,      // 菜单保存中
@@ -46,10 +41,8 @@
    originMenu: null,        // 原始菜单
    delTabs: [],             // 删除标签列表
    tabviews: [],            // 所有标签页
    optionLibs: null,        // 自定义下拉选项库
    activeKey: '0',          // 默认展开基本信息
    pasteContent: null,      // 粘贴配置信息
    openEdition: ''          // 编辑版本标记,防止多人操作
    openEdition: '',         // 编辑版本标记,防止多人操作
  }
  /**
@@ -58,7 +51,7 @@
   * 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单
   */
  UNSAFE_componentWillMount () {
    const { menu, optionLibs } = this.props
    const { menu } = this.props
    let _LongParam = menu.LongParam
    let _config = ''
@@ -76,9 +69,9 @@
    _config.MenuName = menu.MenuName || ''
    _config.MenuNo = menu.MenuNo || ''
    _config.OpenType = menu.PageParam ? menu.PageParam.OpenType : ''
    _config.MenuID = menu.MenuID || ''
    // 配置默认值,兼容
    _config.Template = 'TreePage'
    _config.easyCode = _config.easyCode || ''
    
    if (_config.type === 'user') {
@@ -105,7 +98,6 @@
      config: _config,
      openEdition: menu.open_edition || '',
      activeKey: menu.activeKey || '0',
      optionLibs: optionLibs,
      originMenu: fromJS(_config).toJS()
    })
  }
@@ -115,6 +107,54 @@
   */
  componentDidMount () {
    this.reloadTab(false)
    document.onkeydown = (event) => {
      let e = event || window.event
      let keyCode = e.keyCode || e.which || e.charCode
      let preKey = ''
      if (e.ctrlKey) {
        preKey = 'ctrl'
      }
      if (e.shiftKey) {
        preKey = 'shift'
      } else if (e.altKey) {
        preKey = 'alt'
      }
      if (!preKey || !keyCode) return
      let _shortcut = `${preKey}+${keyCode}`
      if (_shortcut === 'ctrl+83') {
        let modals = document.querySelectorAll('.mk-pop-modal')
        let msg = null
        for (let i = 0; i < modals.length; i++) {
          if (msg) {
            break
          }
          let node = modals[i].querySelector('.mk-com-name')
          if (node) {
            msg = node.innerText
          }
        }
        if (msg) {
          notification.warning({
            top: 92,
            message: '请保存' + msg,
            duration: 5
          })
          return false
        }
        let node = document.getElementById('save-config')
        if (node && node.click) {
          node.click()
        }
        return false
      }
    }
  }
  /**
@@ -124,6 +164,7 @@
    this.setState = () => {
      return
    }
    document.onkeydown = () => {}
  }
  /**
@@ -134,7 +175,7 @@
      loading: type,
      tabviews: []
    })
    Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => {
    Api.getCloudConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => {
      if (res.status) {
        this.setState({
          loading: false,
@@ -169,384 +210,259 @@
    })
  }
  getFuncNames = (data, funcNames, tableNames) => {
    data.forEach(item => {
      if (item.subfuncs) {
        this.getFuncNames(item.subfuncs, funcNames, tableNames)
      } else {
        if (item.tableName) {
          tableNames.push(item.tableName)
        }
        if (item.innerFunc) {
          funcNames.push({func: item.innerFunc, label: item.label || ''})
        }
        if (item.callbackFunc) {
          funcNames.push({func: item.callbackFunc, label: item.label || ''})
        }
      }
    })
    return {
      func: funcNames,
      table: tableNames
    }
  }
  /**
   * @description 三级菜单保存
   */
  submitConfig = () => {
    const { menu } = this.props
    const { delTabs, openEdition } = this.state
  // submitConfig = () => {
  //   const { menu } = this.props
  //   const { delTabs, openEdition } = this.state
    let _config = fromJS(this.state.config).toJS()
  //   let _config = fromJS(this.state.config).toJS()
    // 基本信息验证
    if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) {
      notification.warning({
        top: 92,
        message: this.state.dict['model.menu.basemsg'],
        duration: 5
      })
      this.setState({activeKey: '0'})
      return
    }
  //   // 基本信息验证
  //   if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) {
  //     notification.warning({
  //       top: 92,
  //       message: '请完善菜单基本信息!',
  //       duration: 5
  //     })
  //     this.setState({activeKey: '0'})
  //     return
  //   }
    // 新建验证
    if (_config.isAdd) {
      _config.tabgroups[0].sublist = _config.tabgroups[0].sublist.filter(item => !item.origin)
    }
  //   // 新建验证
  //   if (_config.isAdd) {
  //     _config.tabgroups[0].sublist = _config.tabgroups[0].sublist.filter(item => !item.origin)
  //   }
    // 使用已有菜单时,默认添加关联标签id
    if (_config.type === 'user') {
      _config.tabgroups.forEach(group => {
        group.sublist = group.sublist.map(tab => {
          if (!tab.linkTab) {
            tab.linkTab = Utils.getuuid()
          }
          return tab
        })
      })
    }
  //   // 使用已有菜单时,默认添加关联标签id
  //   if (_config.type === 'user') {
  //     _config.tabgroups.forEach(group => {
  //       group.sublist = group.sublist.map(tab => {
  //         if (!tab.linkTab) {
  //           tab.linkTab = Utils.getuuid()
  //         }
  //         return tab
  //       })
  //     })
  //   }
    // 未设置数据源或标签不合法时,启用状态为false
    let vresult = this.verifyconfig(_config)
    if (vresult !== true) {
      _config.enabled = false
    }
  //   // 未设置数据源或标签不合法时,启用状态为false
  //   let vresult = this.verifyconfig(_config)
  //   if (vresult !== true) {
  //     _config.enabled = false
  //   }
    _config.funcs = [] // 页面及子页面存储过程集
  //   if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
  //     this.setState({
  //       menucloseloading: true
  //     })
  //   } else {
  //     this.setState({
  //       menuloading: true
  //     })
  //   }
    _config.funcs.push({
      type: 'view',
      subtype: 'view',
      uuid: menu.MenuID,
      intertype: _config.setting.interType || 'inner',
      interface: _config.setting.interface || '',
      tableName: _config.setting.tableName || '',
      innerFunc: _config.setting.innerFunc || '',
      outerFunc: _config.setting.outerFunc || ''
    })
  //   // 保存时删除配置类型,system 、user
  //   delete _config.type
  //   delete _config.isAdd
    _config.tabgroups.forEach(group => {
      group.sublist.forEach(tab => {
        _config.funcs.push({
          type: 'tab',
          subtype: 'tab',
          uuid: tab.uuid,
          label: tab.label,
          linkTab: tab.linkTab
        })
      })
    })
  //   let _LongParam = ''
    if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
      this.setState({
        menucloseloading: true
      })
    } else {
      this.setState({
        menuloading: true
      })
    }
  //   try {
  //     _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
  //   } catch (e) {
  //     notification.warning({
  //       top: 92,
  //       message: '编译错误',
  //       duration: 5
  //     })
  //     this.setState({
  //       menucloseloading: false,
  //       menuloading: false
  //     })
  //     return
  //   }
    new Promise(resolve => {
      let deffers = []
      _config.funcs.forEach(item => {
        if (item.type === 'tab') {
          let deffer = new Promise(resolve => {
            Api.getSystemConfig({
              func: 'sPC_Get_LongParam',
              MenuID: item.linkTab
            }).then(result => {
              if (result.status && result.LongParam) {
                let _LongParam = ''
                if (result.LongParam) {
                  try {
                    _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
                  } catch (e) {
                    console.warn('Parse Failure')
                    _LongParam = ''
                  }
                }
  //   // let _sort = 0
  //   // let btntabs = []
    
                if (_LongParam) {
                  item.menuNo = _LongParam.tabNo || ''
                  item.subfuncs = _LongParam.funcs || []
                }
              }
              resolve()
            })
          })
  //   // let tabParam = { // 添加菜单tab页
  //   //   func: 'sPC_sMenusTab_AddUpt',
  //   //   MenuID: menu.MenuID
  //   // }
          deffers.push(deffer)
        }
      })
  //   // let _LText = []
      if (deffers.length === 0) {
        resolve()
      } else {
        Promise.all(deffers).then(() => {
          resolve()
        })
      }
    }).then(() => {
      // 保存时删除配置类型,system 、user
      delete _config.type
      delete _config.isAdd
  //   // btntabs.forEach(item => {
  //   //   _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
  //   // })
  //   // _config.tabgroups.forEach(group => {
  //   //   group.sublist.forEach(item => {
  //   //     _sort++
  //   //     _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
  //   //   })
  //   // })
      let _LongParam = ''
  //   // _LText = _LText.join(' union all ')
      try {
        _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
      } catch (e) {
        notification.warning({
          top: 92,
          message: '编译错误',
          duration: 5
        })
        this.setState({
          menucloseloading: false,
          menuloading: false
        })
        return
      }
  //   // tabParam.LText = Utils.formatOptions(_LText)
  //   // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
  //   // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
      let _sort = 0
      let btntabs = []
      let tabParam = { // 添加菜单tab页
        func: 'sPC_sMenusTab_AddUpt',
        MenuID: menu.MenuID
      }
  //   let _funcs = []
  //   let _tables = []
      let _LText = []
  //   if (_config.setting.tableName) {
  //     _tables.push(_config.setting.tableName)
  //   }
  //   if (_config.setting.innerFunc) {
  //     _funcs.push({func: _config.setting.innerFunc, label: _config.MenuName || ''})
  //   }
  //   if (_config.setting.outerFunc) {
  //     _funcs.push({func: _config.setting.outerFunc, label: _config.MenuName || ''})
  //   }
      btntabs.forEach(item => {
        _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
      })
      _config.tabgroups.forEach(group => {
        group.sublist.forEach(item => {
          _sort++
          _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
        })
      })
  //   let param = {
  //     func: 'sPC_TrdMenu_AddUpt',
  //     FstID: _config.fstMenuId,
  //     SndID: _config.ParentId,
  //     ParentID: _config.ParentId,
  //     MenuID: menu.MenuID,
  //     MenuNo: _config.MenuNo,
  //     EasyCode: _config.easyCode,
  //     Template: _config.Template,
  //     MenuName: _config.MenuName,
  //     PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}),
  //     LongParam: _LongParam,
  //     LText: _funcs.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`),
  //     LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
  //   }
      _LText = _LText.join(' union all ')
  //   if (menu.menuSort) { // 菜单新建时设置排序
  //     param.Sort = menu.menuSort
  //   }
      tabParam.LText = Utils.formatOptions(_LText)
      tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
  //   param.LText = param.LText.join(' union all ')
  //   param.LText = Utils.formatOptions(param.LText)
  //   param.LTexttb = param.LTexttb.join(' union all ')
  //   param.LTexttb = Utils.formatOptions(param.LTexttb)
  //   param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
  //   param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      let _vals = this.getFuncNames(_config.funcs, [], [])
      let _tables = Array.from(new Set(_vals.table))
  //   if (openEdition) { // 版本管理
  //     param.open_edition = openEdition
  //   }
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
        FstID: _config.fstMenuId,
        SndID: _config.ParentId,
        ParentID: _config.ParentId,
        MenuID: menu.MenuID,
        MenuNo: _config.MenuNo,
        EasyCode: _config.easyCode,
        Template: _config.Template,
        MenuName: _config.MenuName,
        PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}),
        LongParam: _LongParam,
        LText: _vals.func.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`),
        LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
      }
  //   // 有按钮或标签删除时,先进行删除操作
  //   // 删除成功后,保存页面配置
  //   new Promise(resolve => {
  //     if (delTabs.length > 0) {
  //       let deffers = delTabs.map(item => {
  //         let _param = {
  //           func: 'sPC_MainMenu_Del',
  //           MenuID: item.uuid
  //         }
      if (menu.menuSort) { // 菜单新建时设置排序
        param.Sort = menu.menuSort
      }
  //         return new Promise(resolve => {
  //           Api.getCloudConfig(_param).then(response => {
  //             resolve(response)
  //           })
  //         })
  //       })
  //       Promise.all(deffers).then(result => {
  //         let error = null
  //         result.forEach(response => {
  //           if (!response.status) {
  //             error = response
  //           }
  //         })
      param.LText = param.LText.join(' union all ')
      param.LText = Utils.formatOptions(param.LText)
      param.LTexttb = param.LTexttb.join(' union all ')
      param.LTexttb = Utils.formatOptions(param.LTexttb)
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
  //         if (error) {
  //           this.setState({
  //             menuloading: false,
  //             menucloseloading: false
  //           })
  //           notification.warning({
  //             top: 92,
  //             message: error.message,
  //             duration: 5
  //           })
  //           resolve(false)
  //         } else {
  //           this.setState({
  //             delTabs: []
  //           })
  //           resolve(true)
  //         }
  //       })
  //     } else if (delTabs.length === 0) {
  //       resolve(true)
  //     }
  //   }).then(resp => {
  //     if (resp === false) return
      if (openEdition) { // 版本管理
        param.open_edition = openEdition
      }
  //     Api.getCloudConfig(param).then(response => {
  //       if (response.status) {
  //         this.setState({
  //           config: _config,
  //           openEdition: response.open_edition || '',
  //           originMenu: fromJS(_config).toJS(),
  //           menuloading: false,
  //           menucloseloading: false
  //         })
      // 有按钮或标签删除时,先进行删除操作
      // 删除成功后,保存页面配置
      new Promise(resolve => {
        if (delTabs.length > 0) {
          let deffers = delTabs.map(item => {
            let _param = {
              func: 'sPC_MainMenu_Del',
              MenuID: item.uuid
            }
  //         notification.success({
  //           top: 92,
  //           message: '保存成功',
  //           duration: 2
  //         })
            return new Promise(resolve => {
              Api.getSystemConfig(_param).then(response => {
                resolve(response)
              })
            })
          })
          Promise.all(deffers).then(result => {
            let error = null
            result.forEach(response => {
              if (!response.status) {
                error = response
              }
            })
            if (error) {
              this.setState({
                menuloading: false,
                menucloseloading: false
              })
              notification.warning({
                top: 92,
                message: error.message,
                duration: 5
              })
              resolve(false)
            } else {
              this.setState({
                delTabs: []
              })
              resolve(true)
            }
          })
        } else if (delTabs.length === 0) {
          resolve(true)
        }
      }).then(resp => {
        if (resp === false) return
        let localParam = fromJS(param).toJS()
  //         this.props.reloadmenu()
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            this.setState({
              config: _config,
              openEdition: response.open_edition || '',
              originMenu: fromJS(_config).toJS()
            })
            this.props.reloadmenu()
            // 存在标签页时
            if (tabParam.LText) {
              Api.getSystemConfig(tabParam).then(result => {
                if (result.status) {
                  notification.success({
                    top: 92,
                    message: '保存成功',
                    duration: 2
                  })
                  if (this.state.closeVisible) {
                    this.props.handleView()
                  } else {
                    this.setState({
                      menuloading: false,
                      menucloseloading: false
                    })
                  }
                } else {
                  notification.warning({
                    top: 92,
                    message: result.message,
                    duration: 5
                  })
                  this.setState({
                    menuloading: false,
                    menucloseloading: false
                  })
                }
              })
            } else {
              notification.success({
                top: 92,
                message: '保存成功',
                duration: 2
              })
              if (this.state.closeVisible) {
                this.props.handleView()
              } else {
                this.setState({
                  menuloading: false,
                  menucloseloading: false
                })
              }
            }
            localParam.func = 'sPC_TrdMenu_AddUpt_For_Local'
            delete localParam.LongParam
            delete localParam.PageParam
            delete localParam.Template
            delete localParam.Sort
            delete localParam.EasyCode
            delete localParam.open_edition
            Api.getLocalConfig(localParam)
          } else {
            this.setState({
              menuloading: false,
              menucloseloading: false
            })
            notification.warning({
              top: 92,
              message: response.message,
              duration: 5
            })
          }
        })
      })
    })
  }
  //         if (this.state.closeVisible) {
  //           this.props.handleView()
  //         }
  //       } else {
  //         this.setState({
  //           menuloading: false,
  //           menucloseloading: false
  //         })
  //         notification.warning({
  //           top: 92,
  //           message: response.message,
  //           duration: 5
  //         })
  //       }
  //     })
  //   })
  // }
  /**
   * @description 点击返回时,判断配置保存状态
   */
  cancelConfig = () => {
    const { config, originMenu } = this.state
    let _this = this
    // const { config, originMenu } = this.state
    // let that = this
    if (config.isAdd) {
      confirm({
        content: '菜单尚未提交,确定放弃保存吗?',
        onOk() {
          _this.props.handleView()
        },
        onCancel() {}
      })
    } else {
      if (!is(fromJS(originMenu), fromJS(config))) {
        this.setState({
          closeVisible: true
        })
      } else {
        this.props.handleView()
      }
    }
    // if (config.isAdd) {
    //   confirm({
    //     content: '菜单尚未提交,确定放弃保存吗?',
    //     onOk() {
    //       that.props.handleView()
    //     },
    //     onCancel() {}
    //   })
    // } else {
    //   if (!is(fromJS(originMenu), fromJS(config))) {
    //     this.setState({
    //       closeVisible: true
    //     })
    //   } else {
    //     this.props.handleView()
    //   }
    // }
    this.props.handleView()
  }
  /**
@@ -554,12 +470,12 @@
   */
  setSubConfig = (item) => {
    const { menu } = this.props
    const { config, originMenu, optionLibs, activeKey, openEdition } = this.state
    const { config, originMenu, activeKey, openEdition } = this.state
    if (config.isAdd) { // menuID不存在时,为新建菜单,提示菜单尚未保存
      notification.warning({
        top: 92,
        message: this.state.dict['header.menu.config.notsave'],
        message: '菜单尚未保存,请先保存菜单配置!',
        duration: 5
      })
    } else {
@@ -567,7 +483,7 @@
      if (!config.fstMenuId || !config.ParentId || !config.MenuName || !config.MenuNo) {
        notification.warning({
          top: 92,
          message: this.state.dict['model.menu.basemsg'],
          message: '请完善菜单基本信息!',
          duration: 5
        })
        this.setState({activeKey: '0'})
@@ -578,13 +494,14 @@
      if (!is(fromJS(originMenu), fromJS(config))) {
        notification.warning({
          top: 92,
          message: this.state.dict['header.menu.config.update'],
          message: '菜单配置已修改,请保存!',
          duration: 5
        })
        return
      }
      let submenu = menu.fstMenuList.filter(item => item.MenuID === config.fstMenuId)[0]
      let _Menu = {
        ...menu,
        LongParam: config,
@@ -593,14 +510,13 @@
        MenuNo: config.MenuNo,
        ParentId: config.ParentId,
        fstMenuId: config.fstMenuId,
        supMenuList: submenu ? submenu.options : []
        supMenuList: submenu ? submenu.children : []
      }
      _Menu.activeKey = activeKey       // 保存当前打开页签
      _Menu.open_edition = openEdition  // 更新版本号
      let param = {
        optionLibs: optionLibs,
        editMenu: _Menu,
        editTab: item,
        tabConfig: null,
@@ -617,7 +533,7 @@
        loading: true
      })
      Api.getSystemConfig({
      Api.getCloudConfig({
        func: 'sPC_Get_LongParam',
        MenuID: item.linkTab
      }).then(res => {
@@ -710,21 +626,6 @@
  }
  /**
   * @description 编辑功能完成更新,包括解冻按钮、粘贴、替换等
   */
  editConfig = (res) => {
    if (res.type === 'paste') {
      this.setState({
        pasteContent: res.content
      }, () => {
        this.setState({
          pasteContent: null
        })
      })
    }
  }
  /**
   * @description 更新标签配置信息
   */
  updatetabs = (config, delcards) => {
@@ -761,17 +662,16 @@
          <div className="tools">
            <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}>
              {/* 基本信息 */}
              <Panel forceRender={true} header={this.state.dict['header.menu.basedata']} key="0" id="main-basedata">
              <Panel forceRender={true} header="基本信息" key="0" id="main-basedata">
                {/* 菜单信息 */}
                <MenuForm
                  menu={menu}
                  config={config}
                  dict={this.state.dict}
                  updatemenu={this.updateconfig}
                />
              </Panel>
              {/* 添加标签 */}
              <Panel header={this.state.dict['header.menu.tab']} key="4">
              <Panel header="标签页" key="4">
                <div className="search-element">
                  {Source.tabItems.map((item, index) => {
                    return (<SourceElement key={index} content={item}/>)
@@ -780,9 +680,9 @@
                {configTabs.length > 0 ?
                  <p className="config-btn-title">
                    <Tooltip placement="topLeft" title="点击按钮,可完成或查看标签配置信息。">
                      <Icon type="question-circle" />
                      <QuestionCircleOutlined className="mk-form-tip" />
                    </Tooltip>
                    {this.state.dict['header.menu.tab.configurable']}
                    标签配置
                  </p> : null
                }
                {configTabs.map((item, index) => {
@@ -803,15 +703,15 @@
          <div className="setting">
            <Card title={
              <div>
                {this.state.dict['header.menu.page.configurable']}
                <Icon type="redo" style={{marginLeft: '10px'}} title="刷新标签列表" onClick={() => this.reloadTab(true)} />
                页面配置
                <RedoOutlined style={{marginLeft: '10px'}} title="刷新标签列表" onClick={() => this.reloadTab(true)} />
              </div>
            } bordered={false} extra={
              <div>
                <EditComponent dict={this.state.dict} type="TreePage" config={this.state.config} MenuID={this.props.menu.MenuID} refresh={this.editConfig}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button>
                <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button>
                <UpdateTable config={config}/>
                {/* <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> */}
                {/* <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button> */}
                <Button onClick={this.cancelConfig}>关闭</Button>
              </div>
            } style={{ width: '100%' }}>
              <Row gutter={16}>
@@ -819,7 +719,6 @@
                  <TreeSettingComponent
                    config={config}
                    MenuID={this.props.menu.MenuID}
                    permFuncField={this.props.permFuncField}
                    updatesetting={this.updateconfig}
                  />
                  <Card
@@ -827,7 +726,7 @@
                    title={
                      <span className="tree-title">
                        <span className="title">{config.setting.title}</span>
                        {config.setting.searchable !== 'false' ? <span className="ant-input-search ant-input-affix-wrapper"><span className="ant-input-suffix"><Icon type="search" /></span></span> : null}
                        {config.setting.searchable !== 'false' ? <span className="ant-input-search ant-input-affix-wrapper"><span className="ant-input-suffix"><SearchOutlined /></span></span> : null}
                      </span>
                    }
                    bordered={false}
@@ -839,13 +738,13 @@
                        showIcon={config.setting.showIcon === 'true'}
                        showLine={config.setting.showLine === 'true'}
                      >
                        <TreeNode icon={<Icon type="folder-open" />} title="parent 0" key="0-0">
                          <TreeNode icon={<Icon type="file" />} title="leaf 0-0" key="0-0-0" isLeaf />
                          <TreeNode icon={<Icon type="file" />} title="leaf 0-1" key="0-0-1" isLeaf />
                        <TreeNode icon={<FolderOpenOutlined />} title="parent 0" key="0-0">
                          <TreeNode icon={<FileOutlined />} title="leaf 0-0" key="0-0-0" isLeaf />
                          <TreeNode icon={<FileOutlined />} title="leaf 0-1" key="0-0-1" isLeaf />
                        </TreeNode>
                        <TreeNode icon={<Icon type="folder-open" />} title="parent 1" key="0-1">
                          <TreeNode icon={<Icon type="file" />} title="leaf 1-0" key="0-1-0" isLeaf />
                          <TreeNode icon={<Icon type="file" />} title="leaf 1-1" key="0-1-1" isLeaf />
                        <TreeNode icon={<FolderOpenOutlined />} title="parent 1" key="0-1">
                          <TreeNode icon={<FileOutlined />} title="leaf 1-0" key="0-1-0" isLeaf />
                          <TreeNode icon={<FileOutlined />} title="leaf 1-1" key="0-1-1" isLeaf />
                        </TreeNode>
                      </Tree>
                    </div>
@@ -865,37 +764,25 @@
          </div>
        </DndProvider>
        {/* 返回时未保存提示 */}
        <Modal
        {/* <Modal
          bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}}
          closable={false}
          maskClosable={false}
          visible={this.state.closeVisible}
          onCancel={() => { this.setState({closeVisible: false}) }}
          footer={[
            <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>,
            <Button key="notsave" className="mk-btn mk-yellow" onClick={this.notsave}>{this.state.dict['model.notsave']}</Button>,
            <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button>
            <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>保存</Button>,
            <Button key="notsave" className="mk-btn mk-yellow" onClick={this.notsave}>不保存</Button>,
            <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>取消</Button>
          ]}
          destroyOnClose
        >
          {this.state.dict['header.menu.config.placeholder']}
        </Modal>
          配置已修改,是否保存配置信息?
        </Modal> */}
        {this.state.loading && <Spin size="large" />}
      </div>
    )
  }
}
const mapStateToProps = (state) => {
  return {
    sysRoles: state.sysRoles,
    permFuncField: state.permFuncField,
    memberLevel: state.memberLevel
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(ComTableConfig)
export default ComTableConfig