From f393af9623c26ae177a3f69b8676afc4e23bff8d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 08 二月 2022 14:48:51 +0800
Subject: [PATCH] 2022-02-08

---
 src/menu/components/tabs/paste/index.jsx |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx
index 59eb081..3e73e8d 100644
--- a/src/menu/components/tabs/paste/index.jsx
+++ b/src/menu/components/tabs/paste/index.jsx
@@ -24,8 +24,7 @@
     this.setState({visible: true})
   }
 
-  resetconfig = (item, Tab, copyBtns, uuids = {}) => {
-    item.floor = Tab.floor + 1
+  resetconfig = (item, Tab, copyBtns, uuids = {}, floor) => {
     item.tabId = Tab.uuid
     item.parentId = Tab.parentId
     
@@ -40,12 +39,12 @@
         tab.uuid = uuids[tab.uuid]
         tab.parentId = item.uuid
 
-        if (item.floor >= 3) {
+        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)
+          cell = this.resetconfig(cell, tab, copyBtns, uuids, floor + 1)
           return cell
         })
       })
@@ -56,7 +55,6 @@
       item.name = item.setting.name
 
       item.components = item.components.map(cell => {
-        cell.floor = Tab.floor + 1
         cell.tabId = Tab.uuid
         cell.parentId = Tab.parentId
 
@@ -102,8 +100,9 @@
       }
 
       let copyBtns = new Map()
+      let floor = MenuUtils.getFloor(Tab.parentId)
 
-      res = this.resetconfig(res, Tab, copyBtns)
+      res = this.resetconfig(res, Tab, copyBtns, {}, floor)
 
       delete res.copyType
       

--
Gitblit v1.8.0