From b8e1395f02c929eaa96b949cf6027ee2a43856a6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 九月 2022 19:03:37 +0800
Subject: [PATCH] 2022-09-06

---
 src/templates/sharecomponent/actioncomponent/dragaction/index.jsx |   49 +++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx
index a30105b..5de06eb 100644
--- a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx
@@ -6,9 +6,7 @@
 import Card from './card'
 import './index.scss'
 
-const Container = ({list, setting, placeholder, handleList, handleMenu, deleteMenu, profileMenu, doubleClickCard }) => {
-  let target = null
-
+const Container = ({list, setting, handleList, handleMenu, deleteMenu, profileMenu, doubleClickCard }) => {
   const [cards, setCards] = useState(list)
   const moveCard = (id, atIndex) => {
     const { card, index } = findCard(id)
@@ -55,10 +53,9 @@
     copycard.uuid = Utils.getuuid()
     copycard.origin = false
     copycard.copyType = 'action'
-    copycard.label = copycard.label + '(copy)'
     copycard.focus = true
 
-    copycard.originCard = card
+    copycard.originCard = {...card, appkey: window.GLOB.appkey}
 
     if (copycard.OpenType === 'popview') { // 寰呭畬鍠�
       copycard.linkTab = ''
@@ -67,9 +64,20 @@
     let _val = fromJS(copycard).toJS()
 
     try {
+      if (_val.control) {
+        delete _val.controlField
+        delete _val.controlVal
+      }
+      delete _val.$srcId
+    
+      let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
+      if (srcid) {
+        _val.$srcId = srcid
+      }
+      
       _val.uuid = Utils.getuuid()
       _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val)))
-    } catch {
+    } catch (e) {
       console.warn('Stringify Failure')
       _val = ''
     }
@@ -90,10 +98,6 @@
     handleList(_cards, copycard)
   }
 
-  const hasDrop = (item) => {
-    target = item
-  }
-
   const [, drop] = useDrop({
     accept: 'action',
     drop(item) {
@@ -112,13 +116,11 @@
       newcard.tabType = 'SubTable'
       newcard.icon = ''
       newcard.class = 'default'
-      newcard.intertype = 'inner'
-      newcard.method = 'POST'
+      newcard.intertype = 'system'
       newcard.position = 'toolbar'
       newcard.execSuccess = 'grid'
       newcard.execError = 'never'
       newcard.popClose = 'never'
-      newcard.errorTime = 10
       newcard.verify = null
 
       if (item.subType === 'excelIn') {
@@ -133,23 +135,23 @@
         newcard.sysInterface = setting.sysInterface
         newcard.outerFunc = setting.outerFunc
         newcard.interface = setting.interface
+        newcard.execSuccess = 'never'
         newcard.class = 'dgreen'
       }
       
-      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
-      if (target) {
-        targetId = target.uuid
+      let targetId = ''
+
+      if (item.dropTargetId) {
+        targetId = item.dropTargetId
+        delete item.dropTargetId
+      } else if (cards.length > 0) {
+        targetId = cards.slice(-1)[0].uuid
       }
 
       const { index: overIndex } = findCard(`${targetId}`)
-      let targetIndex = overIndex
-
-      targetIndex++
-
-      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
+      const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
 
       handleList(_cards, newcard)
-      target = null
     }
   })
 
@@ -165,7 +167,6 @@
           editCard={editCard}
           delCard={delCard}
           findCard={findCard}
-          hasDrop={hasDrop}
           profileCard={profileCard}
           doubleClickCard={doubleClickBtn}
         />
@@ -173,7 +174,7 @@
       
       {cards.length === 0 ?
         <div className="common-drawarea-placeholder">
-          {placeholder}
+          璇锋坊鍔犳寜閽�
         </div> : null
       }
     </div>

--
Gitblit v1.8.0