| | |
| | | |
| | | const BarCode = asyncComponent(() => import('@/components/barcode')) |
| | | const QrCode = asyncComponent(() => import('@/components/qrcode')) |
| | | const Video = asyncComponent(() => import('@/components/video')) |
| | | const MarkColumn = asyncIconComponent(() => import('@/menu/components/table/normal-table/columns/markcolumn')) |
| | | |
| | | const Card = ({ id, cardIds, fields, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle, updateMarks }) => { |
| | | const Card = ({ id, fields, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle, updateMarks }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'action', id, originalIndex }, |
| | |
| | | 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) |
| | | }, |
| | | }) |
| | | |
| | |
| | | <QrCode card={card} value={card.value || 'mksoft'}/> |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'video') { |
| | | return ( |
| | | <div> |
| | | <Video card={card} value={card.url || 'http://qingqiumarket.cn/mkwms/Content/images/upload/20210104/trailer.mp4'}/> |
| | | </div> |
| | | ) |
| | | } else if (card.eleType === 'currentDate') { |
| | | return ( |
| | | <div className="ant-mk-date"> |