From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 八月 2022 11:42:43 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/menu/components/share/copycomponent/index.jsx |   43 +++++++++++++++++++++++++++++++++----------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/src/menu/components/share/copycomponent/index.jsx b/src/menu/components/share/copycomponent/index.jsx
index a4c90ed..53404dc 100644
--- a/src/menu/components/share/copycomponent/index.jsx
+++ b/src/menu/components/share/copycomponent/index.jsx
@@ -1,25 +1,48 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Icon, message } from 'antd'
+import { message } from 'antd'
+import { CopyOutlined } from '@ant-design/icons'
 import './index.scss'
 
 class CopyComponent extends Component {
   static propTpyes = {
-    btnlog: PropTypes.array,
-    handlelog: PropTypes.func
+    type: PropTypes.string,
+    card: PropTypes.object
   }
 
   trigger = () => {
     const { card, type } = this.props
-    let copycard = fromJS(card).toJS()
-    copycard.copyType = type
-
-    let _val = ''
+    let _val = fromJS(card).toJS()
+    _val.copyType = type
 
     try {
-      _val = window.btoa(window.encodeURIComponent(JSON.stringify(copycard)))
-    } catch {
+      delete _val.$srcId
+    
+      let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
+      if (srcid) {
+        _val.$srcId = srcid
+      }
+
+      if (type === 'menucell') {
+        _val.setting.type = 'linkmenu'
+        _val.setting.linkMenuId = ''
+        _val.setting.copyMenuId = ''
+      } else if (_val.type === 'menubar' && _val.subtype === 'menubar') {
+        let cell = _val.subMenus[0]
+        _val.subMenus = []
+
+        if (cell) {
+          cell.setting.type = 'menu'
+          cell.setting.linkMenuId = ''
+          cell.setting.copyMenuId = ''
+
+          _val.subMenus.push(cell)
+        }
+      }
+
+      _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val)))
+    } catch (e) {
       message.warning('澶嶅埗澶辫触锛岃閲嶈瘯锛�')
       _val = ''
     }
@@ -38,7 +61,7 @@
 
   render () {
     return (
-      <Icon type="copy" title="澶嶅埗" style={{color: '#26C281'}} onClick={this.trigger} />
+      <CopyOutlined title="澶嶅埗" style={{color: '#26C281'}} onClick={this.trigger} />
     )
   }
 }

--
Gitblit v1.8.0