| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, Popover } from 'antd' |
| | | import { Popover } from 'antd' |
| | | import { EditOutlined, CloseOutlined, AntDesignOutlined, CaretUpOutlined, CaretDownOutlined, CloseCircleOutlined } from '@ant-design/icons' |
| | | import './index.scss' |
| | | |
| | | const Card = ({ id, card, showfield, moveCard, findCard, editCard, delCard, markCard }) => { |
| | |
| | | return ( |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" title="edit" type="edit" onClick={() => editCard(id)} /> |
| | | <Icon className="close" title="delete" type="close" onClick={() => delCard(id)} /> |
| | | {['text', 'number'].includes(card.type) && !card.origin ? <Icon className="profile" title="mark" type="ant-design" onClick={() => markCard(id)} /> : null} |
| | | <EditOutlined className="edit" onClick={() => editCard(id)} /> |
| | | <CloseOutlined className="close" onClick={() => delCard(id)} /> |
| | | {['text', 'number'].includes(card.type) && !card.origin ? <AntDesignOutlined className="profile" title="标记" onClick={() => markCard(id)} /> : null} |
| | | </div> |
| | | } trigger="hover"> |
| | | <div className="page-card" style={{ flex: card.Width, opacity: opacity}}> |
| | |
| | | <span className="ant-table-column-title">{card.label}</span> |
| | | {card.IsSort === 'true' ? |
| | | <span className="ant-table-column-sorter"> |
| | | <Icon type="caret-up" /> |
| | | <Icon type="caret-down" /> |
| | | <CaretUpOutlined /> |
| | | <CaretDownOutlined /> |
| | | </span> : null |
| | | } |
| | | </div> |
| | | {showfield ? |
| | | <div className="ant-table-column-fields"> |
| | | <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span> |
| | | {card.Hide === 'true' ? <Icon style={{marginLeft: '5px', color: 'orange', fontSize: '12px'}} type="close-circle" /> : null} |
| | | {card.Hide === 'true' ? <CloseCircleOutlined style={{marginLeft: '5px', color: 'orange', fontSize: '12px'}}/> : null} |
| | | </div> : null |
| | | } |
| | | </span> |