king
2020-12-23 e9640ccdc9fe57f91919e3f51462c780e44fadb0
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: originIndex } = findCard(draggedId)
      if (originIndex === -1) return
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
    },
  })