| | |
| | | import { Col } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import Card from './card' |
| | | import ItemTypes from './itemtypes' |
| | | import './index.scss' |
| | | |
| | | const Container = ({list, group, setting, placeholder, handleList, handleForm, closeForm }) => { |
| | |
| | | if (!card) return |
| | | |
| | | const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) |
| | | setCards(_cards) |
| | | |
| | | if (!group) { |
| | | handleList(_cards) |
| | | } else { |
| | |
| | | } |
| | | |
| | | const [, drop] = useDrop({ |
| | | accept: ItemTypes.form, |
| | | accept: 'form', |
| | | drop(item) { |
| | | if (item.hasOwnProperty('originalIndex') && group) { |
| | | const { card } = findCard(item.id) |
| | | |
| | | if (!card) { |
| | | handleList(cards, group, item.id) |
| | | } |