king
2023-03-11 34e7681fd12b1c4e4994d3bea1a553870e10bc50
src/templates/treepageconfig/index.jsx
@@ -10,7 +10,6 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import MenuForm from '@/templates/comtableconfig/menuform'
import SourceElement from '@/templates/zshare/dragsource'
@@ -43,7 +42,6 @@
    tabviews: [],            // 所有标签页
    activeKey: '0',          // 默认展开基本信息
    openEdition: '',         // 编辑版本标记,防止多人操作
    modalStatus: false       // 弹窗是否开启,判断ctrl+s是否可用
  }
  /**
@@ -127,10 +125,23 @@
      let _shortcut = `${preKey}+${keyCode}`
      if (_shortcut === 'ctrl+83') {
        if (this.state.modalStatus) {
        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: '请保存' + this.state.modalStatus,
            message: '请保存' + msg,
            duration: 5
          })
          return false
@@ -143,7 +154,6 @@
        return false
      }
    }
    MKEmitter.addListener('modalStatus', this.modalStatus)
  }
  /**
@@ -154,11 +164,6 @@
      return
    }
    document.onkeydown = () => {}
    MKEmitter.removeListener('modalStatus', this.modalStatus)
  }
  modalStatus = (val) => {
    this.setState({modalStatus: val})
  }
  /**
@@ -278,31 +283,31 @@
      return
    }
    let _sort = 0
    let btntabs = []
    // let _sort = 0
    // let btntabs = []
    
    let tabParam = { // 添加菜单tab页
      func: 'sPC_sMenusTab_AddUpt',
      MenuID: menu.MenuID
    }
    // let tabParam = { // 添加菜单tab页
    //   func: 'sPC_sMenusTab_AddUpt',
    //   MenuID: menu.MenuID
    // }
    let _LText = []
    // let _LText = []
    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`)
      })
    })
    // 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`)
    //   })
    // })
    _LText = _LText.join(' union all ')
    // _LText = _LText.join(' union all ')
    tabParam.LText = Utils.formatOptions(_LText)
    tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    // tabParam.LText = Utils.formatOptions(_LText)
    // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    let _funcs = []
    let _tables = []
@@ -409,60 +414,22 @@
          this.setState({
            config: _config,
            openEdition: response.open_edition || '',
            originMenu: fromJS(_config).toJS()
            originMenu: fromJS(_config).toJS(),
            menuloading: false,
            menucloseloading: false
          })
          // 存在标签页时
          if (tabParam.LText) {
            Api.getSystemConfig(tabParam).then(result => {
              if (result.status) {
                notification.success({
                  top: 92,
                  message: '保存成功',
                  duration: 2
                })
          notification.success({
            top: 92,
            message: '保存成功',
            duration: 2
          })
                this.props.reloadmenu()
                Api.genericInterface(localParam)
          this.props.reloadmenu()
          Api.genericInterface(localParam)
                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
            })
            this.props.reloadmenu()
            Api.genericInterface(localParam)
            if (this.state.closeVisible) {
              this.props.handleView()
            } else {
              this.setState({
                menuloading: false,
                menucloseloading: false
              })
            }
          if (this.state.closeVisible) {
            this.props.handleView()
          }
        } else {
          this.setState({