king
2022-10-19 8f394e7ef20cc0abba3f47c23a63b069e9dd0e45
src/menu/components/tabs/paste/index.jsx
@@ -24,10 +24,7 @@
    this.setState({visible: true})
  }
  resetconfig = (item, Tab, copyBtns, uuids = {}, floor) => {
    item.tabId = Tab.uuid
    item.parentId = Tab.parentId
  resetconfig = (item, copyBtns, uuids = {}) => {
    if (item.type === 'tabs') {
      uuids[item.uuid] = MenuUtils.getuuid()
      item.uuid = uuids[item.uuid]
@@ -37,14 +34,9 @@
      item.subtabs.forEach(tab => {
        uuids[tab.uuid] = MenuUtils.getuuid()
        tab.uuid = uuids[tab.uuid]
        tab.parentId = item.uuid
        if (floor >= 3) {
          tab.components = tab.components.filter(cell => cell.type !== 'tabs')
        }
        tab.components = tab.components.map(cell => {
          cell = this.resetconfig(cell, tab, copyBtns, uuids, floor + 1)
          cell = this.resetconfig(cell, copyBtns, uuids)
          return cell
        })
      })
@@ -55,9 +47,6 @@
      item.name = item.setting.name
      item.components = item.components.map(cell => {
        cell.tabId = Tab.uuid
        cell.parentId = Tab.parentId
        cell = MenuUtils.resetComponentConfig(cell, copyBtns, uuids)
        return cell
@@ -100,9 +89,8 @@
      }
      let copyBtns = new Map()
      let floor = MenuUtils.getFloor(Tab.parentId)
      res = this.resetconfig(res, Tab, copyBtns, {}, floor)
      res = this.resetconfig(res, copyBtns, {})
      delete res.copyType