From e8edfdadb561cd83bf6e1c3e00d55b8cc2aee6d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 17 十月 2022 17:57:34 +0800
Subject: [PATCH] 2022-10-17

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

diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx
index a18fd27..0f6fb9a 100644
--- a/src/menu/components/tabs/paste/index.jsx
+++ b/src/menu/components/tabs/paste/index.jsx
@@ -1,6 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Icon, Modal, notification } from 'antd'
+import { Modal, notification } from 'antd'
+import { SnippetsOutlined } from '@ant-design/icons'
 
 import MenuUtils from '@/utils/utils-custom.js'
 import MKEmitter from '@/utils/events.js'
@@ -23,15 +24,14 @@
     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
     
     if (item.type === 'tabs') {
       uuids[item.uuid] = MenuUtils.getuuid()
       item.uuid = uuids[item.uuid]
-      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
+      item.setting.name = item.setting.name + MenuUtils.getSignName()
       item.name = item.setting.name
       
       item.subtabs.forEach(tab => {
@@ -39,23 +39,22 @@
         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
         })
       })
     } else if (item.type === 'group') {
       uuids[item.uuid] = MenuUtils.getuuid()
       item.uuid = uuids[item.uuid]
-      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
+      item.setting.name = item.setting.name + MenuUtils.getSignName()
       item.name = item.setting.name
 
       item.components = item.components.map(cell => {
-        cell.floor = Tab.floor + 1
         cell.tabId = Tab.uuid
         cell.parentId = Tab.parentId
 
@@ -72,7 +71,7 @@
 
   pasteSubmit = () => {
     const { Tab } = this.props
-    let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter', 'chart']
+    let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter', 'chart']
     let types = {
       login: '鐧诲綍',
       navbar: '瀵艰埅鏍�',
@@ -101,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
       
@@ -129,7 +129,7 @@
 
     return (
       <div style={{display: 'inline-block'}}>
-        <Icon type="snippets" style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />
+        <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />
         <Modal
           title="绮樿创"
           visible={visible}

--
Gitblit v1.8.0