king
2021-08-31 72419e2f826031a158173f46d723a672064e37cd
src/menu/components/share/actioncomponent/dragaction/card.jsx
@@ -1,6 +1,7 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Icon, Button, Popover } from 'antd'
import { resetStyle } from '@/utils/utils-custom.js'
import './index.scss'
const Card = ({ id, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle, profileCard, doubleClickCard }) => {
@@ -14,11 +15,10 @@
  const [, drop] = useDrop({
    accept: 'action',
    canDrop: () => true,
    drop: () => {},
    hover({ id: draggedId }) {
    drop: ({ id: draggedId }) => {
      if (!draggedId || draggedId === id) return
      const { index: originIndex } = findCard(id)
      const { index: originIndex } = findCard(draggedId)
      if (originIndex === -1) return
      const { index: overIndex } = findCard(id)
@@ -37,12 +37,14 @@
  }
  let btnElement = null
  let _style = resetStyle(card.style)
  if (card.show === 'icon') {
    btnElement = (
      <Button
        type="link"
        icon={card.icon}
        style={card.btnstyle}
        style={_style}
        onDoubleClick={() => doubleClickCard(id)}
      >{card.icon ? '' : card.label}</Button>
    )
@@ -50,7 +52,7 @@
    btnElement = (
      <Button
        type="link"
        style={card.btnstyle}
        style={_style}
        onDoubleClick={() => doubleClickCard(id)}
      >{card.label}{card.icon ? <Icon type={card.icon}/> : null}</Button>
    )
@@ -58,7 +60,7 @@
    btnElement = (
      <Button
        icon={card.icon}
        style={card.btnstyle}
        style={_style}
        onDoubleClick={() => doubleClickCard(id)}
      >
        {card.label}