| | |
| | | import { useDrop } from 'react-dnd' |
| | | import { is, fromJS } from 'immutable' |
| | | import update from 'immutability-helper' |
| | | import { Col, Icon } from 'antd' |
| | | import { Col } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import Card from './card' |
| | | import './index.scss' |
| | |
| | | drop() {} |
| | | }) |
| | | |
| | | const addsearch = (e) => { |
| | | e.stopPropagation() |
| | | // const addsearch = (e) => { |
| | | // e.stopPropagation() |
| | | |
| | | let newcard = {} |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.focus = true |
| | | // let newcard = {} |
| | | // newcard.uuid = Utils.getuuid() |
| | | // newcard.focus = true |
| | | |
| | | newcard.label = 'label' |
| | | newcard.initval = '' |
| | | newcard.type = 'select' |
| | | newcard.resourceType = '0' |
| | | newcard.options = [] |
| | | newcard.setAll = 'false' |
| | | newcard.orderType = 'asc' |
| | | newcard.display = 'dropdown' |
| | | newcard.match = '=' |
| | | // newcard.label = 'label' |
| | | // newcard.initval = '' |
| | | // newcard.type = 'select' |
| | | // newcard.resourceType = '0' |
| | | // newcard.options = [] |
| | | // newcard.setAll = 'false' |
| | | // newcard.orderType = 'asc' |
| | | // newcard.display = 'dropdown' |
| | | // newcard.match = '=' |
| | | |
| | | let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0 |
| | | // let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0 |
| | | |
| | | const { index: overIndex } = findCard(`${targetId}`) |
| | | let targetIndex = overIndex |
| | | // const { index: overIndex } = findCard(`${targetId}`) |
| | | // let targetIndex = overIndex |
| | | |
| | | targetIndex++ |
| | | // targetIndex++ |
| | | |
| | | const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] }) |
| | | // const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] }) |
| | | |
| | | handleList(_cards, newcard) |
| | | } |
| | | // handleList(_cards, newcard) |
| | | // } |
| | | |
| | | return ( |
| | | <div ref={drop} className="ant-row"> |
| | |
| | | /> |
| | | </Col> |
| | | ))} |
| | | <Icon type="plus" onClick={addsearch}/> |
| | | {/* <Icon type="plus" onClick={addsearch}/> */} |
| | | </div> |
| | | ) |
| | | } |