king
2020-08-31 b3547d1c531e479021219fda5df153a11b9b52a3
src/templates/sharecomponent/cardcomponent/dragdetail/card.jsx
@@ -1,6 +1,6 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Icon } from 'antd'
import { Icon, Popover } from 'antd'
import './index.scss'
const Card = ({ id, card, moveCard, findCard, editCard, delCard }) => {
@@ -28,11 +28,16 @@
  })
  return (
    <div ref={node => drag(drop(node))} className={'mk-card-meta-item ' + card.align} style={{opacity: opacity, width: card.width + '%'}}>
      <div className={'content line' + card.height} style={{fontWeight: card.fontWeight, fontSize: card.fontSize + 'px', height: card.height * card.fontSize * 1.5}} title={card.content}>{card.content}</div>
      <Icon className="edit" title="编辑" type="edit" onClick={() => editCard(card)} />
      <Icon className="edit close" title="删除" type="close" onClick={() => delCard(card)} />
    </div>
    <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
      <div className="mk-popover-control">
        <Icon className="edit" title="编辑" type="edit" onClick={() => editCard(card)} />
        <Icon className="edit close" title="删除" type="close" onClick={() => delCard(card)} />
      </div>
    } trigger="hover">
      <div ref={node => drag(drop(node))} className={'mk-card-meta-item ' + card.align} style={{opacity: opacity, width: card.width + '%'}}>
        <div className={'content line' + card.height} style={{fontWeight: card.fontWeight, fontSize: card.fontSize + 'px', height: card.height * card.fontSize * 1.5}} title={card.content}>{card.content}</div>
      </div>
    </Popover>
  )
}
export default Card