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/card/cardcellcomponent/dragaction/index.jsx |   53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx
index f6cdeac..683cd5f 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx
+++ b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx
@@ -112,6 +112,58 @@
   const [, drop] = useDrop({
     accept: 'action',
     drop(item) {
+      if (item.$init) { // 鎷栨嫿娣诲姞
+        let newcard = {}
+        newcard.uuid = Utils.getuuid()
+        newcard.focus = true
+
+        // 鏄剧ず鍒楄繃婊�
+        if (parent.type === 'custom' && item.class !== 'element') {
+          delete item.overIndex
+          return
+        } else if (parent.type === 'action' && item.class === 'element') {
+          delete item.overIndex
+          return
+        }
+        
+        if (item.class === 'element') {
+          newcard.eleType = item.value
+          newcard.datatype = 'dynamic'
+          newcard.height = 1
+        } else {
+          newcard.eleType = 'button'
+          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)
+        } else {
+          handleList([...cards, newcard])
+        }
+
+        handleMenu(newcard)
+
+        delete item.overIndex
+        return
+      }
+
       const { index } = findCard(item.id)
       if (index > -1) return
       dropButton(item.id)
@@ -127,7 +179,6 @@
               id={card.uuid}
               key={card.uuid}
               card={card}
-              parent={parent}
               copyCard={copyCard}
               moveCard={moveCard}
               editCard={editCard}

--
Gitblit v1.8.0