king
2023-07-02 8bc1c1f8cf628efb149f0331ddd491b4c000009d
src/menu/transfer/index.jsx
@@ -29,6 +29,22 @@
    const _this = this
    if (!config.enabled) {
      let tb = config.components[0]
      if (config.components.length === 1 && tb.setting.interType === 'system' && !tb.setting.dataresource) {
        confirm({
          title: '当前页面将清空,确定切换为自定义页面吗?',
          content: '',
          onOk() {
            return new Promise(resolve => {
              _this.execUpdate(resolve, true)
            })
          },
          onCancel() {}
        })
        return
      }
      notification.warning({
        top: 92,
        message: '未启用菜单不可升级!',
@@ -49,7 +65,7 @@
    })
  }
  execUpdate = (_resolve) => {
  execUpdate = (_resolve, clear) => {
    let _config = fromJS(this.props.config).toJS()
    _config.permission = 'true'
    _config.Template = 'CustomPage'
@@ -59,23 +75,53 @@
    delete _config.autoMatic
    let useMSearch = false
    _config.components.forEach((item, i) => {
      if (item.type === 'tabs') {
        item.name = '标签组' + i
        item.width = 24
        item.subtype = 'tabs'
        item.setting = {autoSwitch: 'false', blacklist: [], name: item.name, position: 'top', supModule: [], tabStyle: 'line', width: 24}
        item.subtabs.forEach(tab => {
          tab.components[0].subtype = 'normaltable'
          tab.components[0].width = 24
          tab.components[0].wrap.width = 24
          tab.components[0].wrap.name = tab.components[0].name
          if (tab.components[0].setting.useMSearch === 'true') {
            useMSearch = true
          }
          tab.components[0].action.forEach(btn => {
    if (clear) {
      _config.components = []
    } else {
      _config.components.forEach((item, i) => {
        if (item.type === 'tabs') {
          item.name = '标签组' + i
          item.width = 24
          item.subtype = 'tabs'
          item.setting = {autoSwitch: 'false', blacklist: [], name: item.name, position: 'top', supModule: [], tabStyle: 'line', width: 24}
          item.subtabs.forEach(tab => {
            tab.components[0].subtype = 'normaltable'
            tab.components[0].width = 24
            tab.components[0].wrap.width = 24
            tab.components[0].wrap.name = tab.components[0].name
            if (tab.components[0].setting.useMSearch === 'true') {
              useMSearch = true
            }
            tab.components[0].action.forEach(btn => {
              if (btn.OpenType === 'popview' && btn.config) {
                btn.config.Template = 'CustomPage'
                if (btn.config.components[0]) {
                  btn.config.components[0].subtype = 'normaltable'
                }
              }
            })
            tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true'))
            tab.components[0].cols.forEach(col => {
              if (col.type !== 'custom') return
              col.elements.forEach(btn => {
                if (btn.OpenType === 'popview' && btn.config) {
                  btn.config.Template = 'CustomPage'
                  if (btn.config.components[0]) {
                    btn.config.components[0].subtype = 'normaltable'
                  }
                }
              })
            })
          })
        } else {
          item.subtype = 'normaltable'
          item.width = 24
          item.wrap.width = 24
          item.wrap.name = item.name
          item.action.forEach(btn => {
            if (btn.OpenType === 'popview' && btn.config) {
              btn.config.Template = 'CustomPage'
              if (btn.config.components[0]) {
@@ -83,8 +129,8 @@
              }
            }
          })
          tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true'))
          tab.components[0].cols.forEach(col => {
          item.cols = item.cols.filter(col => !(col.field && col.Hide === 'true'))
          item.cols.forEach(col => {
            if (col.type !== 'custom') return
            col.elements.forEach(btn => {
              if (btn.OpenType === 'popview' && btn.config) {
@@ -95,34 +141,9 @@
              }
            })
          })
        })
      } else {
        item.subtype = 'normaltable'
        item.width = 24
        item.wrap.width = 24
        item.wrap.name = item.name
        item.action.forEach(btn => {
          if (btn.OpenType === 'popview' && btn.config) {
            btn.config.Template = 'CustomPage'
            if (btn.config.components[0]) {
              btn.config.components[0].subtype = 'normaltable'
            }
          }
        })
        item.cols = item.cols.filter(col => !(col.field && col.Hide === 'true'))
        item.cols.forEach(col => {
          if (col.type !== 'custom') return
          col.elements.forEach(btn => {
            if (btn.OpenType === 'popview' && btn.config) {
              btn.config.Template = 'CustomPage'
              if (btn.config.components[0]) {
                btn.config.components[0].subtype = 'normaltable'
              }
            }
          })
        })
      }
    })
        }
      })
    }
    if (useMSearch) {
      let cell = {