king
2022-11-08 d0e8c7cb64d7d219f7cfec8bc87cf699b9cfe7b2
src/templates/comtableconfig/updatetable/index.jsx
@@ -20,6 +20,7 @@
  }
  state = {}
  delButtons = []
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
@@ -52,22 +53,19 @@
  execUpdate = (_resolve) => {
    const { config } = this.props
    let uuid = config.uuid
    let trail = md5(uuid).slice(-10) + 'mk'
    uuid = uuid.replace(/.{12}$/, trail)
    this.delButtons = []
    let _config = {
      version: 1.0,
      uuid: uuid,
      MenuID: uuid,
      uuid: config.uuid,
      MenuID: config.uuid,
      fstMenuId: config.fstMenuId,
      parentId: config.ParentId,
      Template: 'BaseTable',
      easyCode: config.easyCode,
      enabled: false,
      MenuName: config.MenuName + '_new',
      MenuNo: config.MenuNo + '_new',
      MenuName: config.MenuName,
      MenuNo: config.MenuNo,
      OpenType: 'newtab',
      tables: config.tables || [],
      urlFields: config.urlFields || [],
@@ -126,7 +124,7 @@
                equalTab: n.equalTab && n.equalTab.length > 0 ? n.equalTab[0] : ''
              }
            ]}
            this.delButtons.push(n.linkTab)
            oldtabs[n.uuid] = tab.components[0].uuid
            _tbs.push(tab.components[0])
@@ -688,13 +686,15 @@
      Api.getSystemConfig(param).then(res => {
        resolve(res)
      })
    // }).then(res => { // 删除原菜单
    //   if (!res || !res.status) return res
    }).then(res => { // 删除原菜单
      if (!res || !res.status) return res
    //   return Api.getSystemConfig({
    //     func: 'sPC_MainMenu_Del',
    //     MenuID: this.props.config.uuid
    //   })
      if (this.delButtons.length === 0) return res
      return Api.getSystemConfig({
        func: 'sPC_MainMenu_Del',
        MenuID: this.delButtons.join(',')
      })
    }).then(res => {
      if (!res) return
@@ -714,9 +714,10 @@
        let _param = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam)))
        // window.history.replaceState(null, null, window.location.href.split('#')[0] + `#/tabledesign/${_param}`)
        // window.location.reload()
        window.open(`#/tabledesign/${_param}`)
        setTimeout(() => {
          window.history.replaceState(null, null, window.location.href.split('#')[0] + `#/tabledesign/${_param}`)
          window.location.reload()
        }, 2000)
      } else {
        notification.warning({
          top: 92,
@@ -968,6 +969,8 @@
      delete _btn.position
      delete _btn.linkTab
      this.delButtons.push(btn.uuid)
      _btn.show = 'button'
      if (_btn.execSuccess === 'equaltab') {