From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/menu/components/share/actioncomponent/dragaction/index.jsx | 40 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/menu/components/share/actioncomponent/dragaction/index.jsx b/src/menu/components/share/actioncomponent/dragaction/index.jsx index 13bbd48..73abf27 100644 --- a/src/menu/components/share/actioncomponent/dragaction/index.jsx +++ b/src/menu/components/share/actioncomponent/dragaction/index.jsx @@ -64,8 +64,6 @@ let _val = fromJS(copycard).toJS() if (_val.control) { - _val.control = '' - delete _val.controlField delete _val.controlVal } @@ -106,6 +104,44 @@ const [, drop] = useDrop({ accept: 'action', drop(item) { + if (item.$init) { // 鎷栨嫿娣诲姞 + if (item.class === 'element') { + delete item.overIndex + return + } + let newcard = {} + newcard.uuid = Utils.getuuid() + newcard.focus = true + newcard.label = 'button' + newcard.verify = null + newcard.show = 'button' + newcard.Ot = 'requiredSgl' + newcard.OpenType = item.value + newcard.class = 'primary' + newcard.style = { marginRight: '15px' } + + if (newcard.OpenType === 'excelIn') { + newcard.label = item.text + newcard.class = item.class || 'dgreen' + newcard.Ot = 'notRequired' + } else if (newcard.OpenType === 'excelOut') { + newcard.label = item.text + newcard.execSuccess = 'never' + newcard.class = 'dgreen' + } + + if (item.overIndex) { + const { index } = findCard(item.overIndex) + const _cards = update(cards, { $splice: [[index + 1, 0, newcard]] }) + handleList(_cards, newcard) + } else { + handleList([...cards, newcard], newcard) + } + + delete item.overIndex + return + } + const { index } = findCard(item.id) if (index > -1) return dropButton(item.id) -- Gitblit v1.8.0