From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 十一月 2021 20:47:04 +0800
Subject: [PATCH] 2021-11-18

---
 src/menu/components/tabs/paste/index.jsx |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx
index c51ac9f..a18fd27 100644
--- a/src/menu/components/tabs/paste/index.jsx
+++ b/src/menu/components/tabs/paste/index.jsx
@@ -5,7 +5,7 @@
 import MenuUtils from '@/utils/utils-custom.js'
 import MKEmitter from '@/utils/events.js'
 import asyncComponent from '@/utils/asyncComponent'
-import './index.scss'
+// import './index.scss'
 
 const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
 
@@ -23,18 +23,20 @@
     this.setState({visible: true})
   }
 
-  resetconfig = (item, Tab, copyBtns) => {
+  resetconfig = (item, Tab, copyBtns, uuids = {}) => {
     item.floor = Tab.floor + 1
     item.tabId = Tab.uuid
     item.parentId = Tab.parentId
     
     if (item.type === 'tabs') {
-      item.uuid = MenuUtils.getuuid()
+      uuids[item.uuid] = MenuUtils.getuuid()
+      item.uuid = uuids[item.uuid]
       item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
       item.name = item.setting.name
       
       item.subtabs.forEach(tab => {
-        tab.uuid = MenuUtils.getuuid()
+        uuids[tab.uuid] = MenuUtils.getuuid()
+        tab.uuid = uuids[tab.uuid]
         tab.parentId = item.uuid
 
         if (item.floor >= 3) {
@@ -42,12 +44,13 @@
         }
 
         tab.components = tab.components.map(cell => {
-          cell = this.resetconfig(cell, tab, copyBtns)
+          cell = this.resetconfig(cell, tab, copyBtns, uuids)
           return cell
         })
       })
     } else if (item.type === 'group') {
-      item.uuid = MenuUtils.getuuid()
+      uuids[item.uuid] = MenuUtils.getuuid()
+      item.uuid = uuids[item.uuid]
       item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
       item.name = item.setting.name
 
@@ -56,12 +59,12 @@
         cell.tabId = Tab.uuid
         cell.parentId = Tab.parentId
 
-        cell = MenuUtils.resetComponentConfig(cell, copyBtns)
+        cell = MenuUtils.resetComponentConfig(cell, copyBtns, uuids)
 
         return cell
       })
     } else {
-      item = MenuUtils.resetComponentConfig(item, copyBtns)
+      item = MenuUtils.resetComponentConfig(item, copyBtns, uuids)
     }
 
     return item
@@ -69,7 +72,7 @@
 
   pasteSubmit = () => {
     const { Tab } = this.props
-    let options = ['tabs', 'group', 'datacard', 'propcard', 'balcony', 'normaltable', 'mainsearch', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter']
+    let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter', 'chart']
     let types = {
       login: '鐧诲綍',
       navbar: '瀵艰埅鏍�',

--
Gitblit v1.8.0