From fbad7d82de145608672e6df2895bf97730afc8b2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 24 四月 2023 18:00:01 +0800
Subject: [PATCH] 2023-04-24

---
 src/menu/components/share/pastecomponent/index.jsx |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx
index cb1bb7b..51ae57d 100644
--- a/src/menu/components/share/pastecomponent/index.jsx
+++ b/src/menu/components/share/pastecomponent/index.jsx
@@ -7,7 +7,7 @@
 import Utils from '@/utils/utils.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'))
 
@@ -19,10 +19,6 @@
 
   state = {
     visible: false
-  }
-
-  handleMenuClick = () => {
-    this.setState({visible: true})
   }
 
   resetconfig = (item, config) => {
@@ -59,6 +55,11 @@
       item.setting = item.setting || {}
       item.setting.width = item.setting.width || 6
       delete item.$cardType
+
+      if (config.type === 'carousel') {
+        delete item.setting.linkbtn
+        delete item.backElements
+      }
 
       if (item.elements) {
         item.elements = item.elements.map(cell => {
@@ -116,9 +117,14 @@
   pasteSubmit = () => {
     const { options } = this.props
     this.pasteFormRef.handleConfirm().then(res => {
-
       if (!options.includes(res.copyType)) {
         notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', duration: 5 })
+        return
+      }
+
+      if (!this.props.config) {
+        this.props.updateConfig(res)
+        this.setState({visible: false})
         return
       }
 
@@ -133,6 +139,10 @@
         this.setState({visible: false})
         return
       } else if (type === 'action') {
+        if (res.style) {
+          delete res.style.width
+          delete res.style.float
+        }
         if (['line', 'bar', 'scatter'].includes(config.type) && !['excelOut', 'excelIn'].includes(res.OpenType)) {
           notification.warning({ top: 92, message: '鍥捐〃涓笉鏀寔姝ょ被鎸夐挳锛�', duration: 5 })
           return
@@ -181,7 +191,7 @@
         })
       }
 
-      this.props.updateConfig(config)
+      this.props.updateConfig(config, type)
       this.setState({visible: false})
 
       notification.success({

--
Gitblit v1.8.0