From e9640ccdc9fe57f91919e3f51462c780e44fadb0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 23 十二月 2020 13:14:20 +0800
Subject: [PATCH] 2020-12-23

---
 src/menu/components/card/cardcellcomponent/dragaction/action.jsx |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx
index a4bed7a..7bdc28b 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx
+++ b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx
@@ -3,7 +3,7 @@
 import { Icon, Popover, Button } from 'antd'
 import './index.scss'
 
-const Card = ({ id, cardIds, card, moveCard, findCard, editCard, delCard, profileCard, changeStyle, doubleClickCard }) => {
+const Card = ({ id, card, moveCard, findCard, editCard, delCard, profileCard, changeStyle, doubleClickCard }) => {
   const originalIndex = findCard(id).index
   const [{ isDragging }, drag] = useDrag({
     item: { type: 'action', id, originalIndex },
@@ -15,13 +15,13 @@
     accept: 'action',
     canDrop: () => true,
     drop({ id: draggedId }) {
-      if (!draggedId) return
-      if (!cardIds.includes(draggedId)) return
+      if (!draggedId || draggedId === id) return
 
-      if (draggedId !== id) {
-        const { index: overIndex } = findCard(id)
-        moveCard(draggedId, overIndex)
-      }
+      const { index: originIndex } = findCard(draggedId)
+      if (originIndex === -1) return
+
+      const { index: overIndex } = findCard(id)
+      moveCard(draggedId, overIndex)
     },
   })
 

--
Gitblit v1.8.0