From 66cc7818cf5e13c44f4372e7d47fb72df7d2f752 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 16 九月 2022 10:30:14 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/share/actioncomponent/dragaction/index.jsx | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/src/menu/components/share/actioncomponent/dragaction/index.jsx b/src/menu/components/share/actioncomponent/dragaction/index.jsx index 77e72fe..4ea521d 100644 --- a/src/menu/components/share/actioncomponent/dragaction/index.jsx +++ b/src/menu/components/share/actioncomponent/dragaction/index.jsx @@ -104,6 +104,45 @@ const [, drop] = useDrop({ accept: 'action', drop(item) { + if (item.$init) { // 鎷栨嫿娣诲姞 + let newcard = {} + newcard.uuid = Utils.getuuid() + newcard.focus = true + + if (item.class === 'element') { + delete item.overIndex + return + } else { + newcard.label = 'button' + newcard.verify = null + newcard.show = 'link' + newcard.Ot = 'requiredSgl' + newcard.OpenType = item.value + newcard.class = 'primary' + + if (newcard.OpenType === 'excelIn') { + newcard.label = item.text + newcard.class = 'dgreen' + newcard.Ot = 'notRequired' + } else if (item.subType === '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