From fb64bcf1fab18b33d21470c83f28d4cda8d309ce Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 26 十月 2022 12:15:59 +0800
Subject: [PATCH] 2022-10-26

---
 src/menu/pastecontroller/index.jsx |   39 +++++++++++++++------------------------
 1 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx
index fbe0827..aac79e7 100644
--- a/src/menu/pastecontroller/index.jsx
+++ b/src/menu/pastecontroller/index.jsx
@@ -4,7 +4,6 @@
 import { SnippetsOutlined } from '@ant-design/icons'
 
 import MenuUtils from '@/utils/utils-custom.js'
-import MKEmitter from '@/utils/events.js'
 import asyncComponent from '@/utils/asyncComponent'
 // import './index.scss'
 
@@ -19,7 +18,7 @@
     visible: false
   }
 
-  resetconfig = (item, copyBtns, uuids = {}) => {
+  resetconfig = (item, uuids = {}) => {
     let appType = sessionStorage.getItem('appType')
     
     if (item.type === 'tabs') {
@@ -37,7 +36,7 @@
         }
 
         tab.components = tab.components.map(cell => {
-          cell = this.resetconfig(cell, copyBtns, uuids)
+          cell = this.resetconfig(cell, uuids)
           return cell
         })
       })
@@ -48,28 +47,28 @@
       item.name = item.setting.name
 
       item.components = item.components.map(cell => {
-        cell = MenuUtils.resetComponentConfig(cell, copyBtns, uuids)
+        cell = MenuUtils.resetComponentConfig(cell, uuids)
         return cell
       })
     } else {
-      item = MenuUtils.resetComponentConfig(item, copyBtns, uuids)
+      item = MenuUtils.resetComponentConfig(item, uuids)
     }
 
     return item
   }
 
   pasteSubmit = () => {
-    let options = ['tabs', 'menubar', 'topbar', 'timeline', 'datacard', 'propcard', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter']
+    let appType = sessionStorage.getItem('appType')
+    let options = ['tabs', 'timeline', 'datacard', 'propcard', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'dashboard', 'scatter']
+
+    if (appType === 'mob') {
+      options.push('menubar', 'topbar')
+    } else {
+      options.push('editable')
+    }
 
     this.pasteFormRef.handleConfirm().then(res => {
-      if ((res.copyType === 'menubar' || res.copyType === 'topbar') && sessionStorage.getItem('appType') !== 'mob') {
-        notification.warning({
-          top: 92,
-          message: '褰撳墠绯荤粺涓嶆敮鎸佽彍鍗曠粍浠讹紒',
-          duration: 5
-        })
-        return
-      } else if (!options.includes(res.copyType)) {
+      if (!options.includes(res.copyType)) {
         notification.warning({
           top: 92,
           message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�',
@@ -78,19 +77,11 @@
         return
       }
 
-      let copyBtns = new Map()
+      res = this.resetconfig(res)
 
-      res = this.resetconfig(res, copyBtns)
-
-      delete res.copyType
+      // delete res.copyType
       
       this.props.insert(res)
-
-      copyBtns = [...copyBtns.values()]
-
-      if (copyBtns.length > 0) {
-        MKEmitter.emit('copyButtons', copyBtns)
-      }
 
       this.setState({visible: false})
     })

--
Gitblit v1.8.0