From ed1cc4adc145f8685d04763e19fbd6b0bd80c136 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 六月 2022 16:22:44 +0800 Subject: [PATCH] 2022-06-09 --- src/menu/components/card/cardcellcomponent/dragaction/index.jsx | 42 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx index 19161bc..bba223b 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx @@ -8,7 +8,7 @@ import Action from './action' import './index.scss' -const Container = ({list, fields, handleList, handleMenu, deleteMenu, profileAction, handleStyle, updateMarks, dropButton, handleSubConfig }) => { +const Container = ({list, parent, fields, handleList, handleMenu, deleteMenu, profileAction, handleStyle, updateMarks, dropButton, handleSubConfig }) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -38,15 +38,35 @@ let copycard = fromJS(card).toJS() let _cards = fromJS(cards).toJS() - copycard.uuid = Utils.getuuid() - copycard.copyType = 'customCardElement' + if (card.eleType === 'button') { + copycard.copyType = 'action' + } else { + copycard.copyType = 'customCardElement' + } copycard.focus = true - let _val = '' + let _val = fromJS(copycard).toJS() + + if (_val.control) { + _val.control = '' + + delete _val.controlField + delete _val.controlVal + } + + copycard.uuid = Utils.getuuid() + copycard.originCard = card 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 + } + + _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) + } catch (e) { console.warn('Stringify Failure') _val = '' } @@ -78,9 +98,12 @@ const doubleClickCard = id => { const { card } = findCard(id) - if (card.OpenType === 'pop') { - handleSubConfig(card) + + if (card.eleType !== 'button') { + return } + + handleSubConfig(card) } const delCard = id => { @@ -106,6 +129,8 @@ id={card.uuid} key={card.uuid} card={card} + parent={parent} + copyCard={copyCard} moveCard={moveCard} editCard={editCard} changeStyle={changeStyle} @@ -121,6 +146,7 @@ id={card.uuid} key={card.uuid} card={card} + parent={parent} fields={fields} moveCard={moveCard} copyCard={copyCard} -- Gitblit v1.8.0