| | |
| | | |
| | | const { MonthPicker, WeekPicker, RangePicker } = DatePicker |
| | | |
| | | const Card = ({ id, type, card, moveCard, findCard, editCard, delCard, copyCard, hasDrop, showfield }) => { |
| | | const Card = ({ id, type, card, moveCard, findCard, editCard, delCard, copyCard, profileCard, hasDrop, showfield }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: ItemTypes[type], id, originalIndex }, |
| | |
| | | const copy = () => { |
| | | copyCard(id) |
| | | } |
| | | |
| | | const profile = () => { |
| | | profileCard(id) |
| | | } |
| | | |
| | | let _defaultValue = '' // 下拉搜索、时间范围类型,初始值需要预处理 |
| | | |
| | | if (type === 'search' && card.type === 'select') { |
| | | if (type === 'search' && (card.type === 'multiselect' || card.type === 'select' || card.type === 'link')) { |
| | | if (card.initval) { |
| | | let _option = card.options.filter(option => option.Value === card.initval)[0] |
| | | if (_option) { |
| | |
| | | {card.type === 'text' ? |
| | | <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null |
| | | } |
| | | {(card.type === 'select' || card.type === 'link') ? |
| | | {(card.type === 'multiselect' || card.type === 'select' || card.type === 'link') ? |
| | | <Select defaultValue={_defaultValue}></Select> : null |
| | | } |
| | | {card.type === 'date' ? |
| | |
| | | </span> : null |
| | | } |
| | | </div> |
| | | <Icon className="edit" type="edit" onClick={edit} /> |
| | | <Icon className="edit close" type="close" onClick={del} /> |
| | | {type === 'action' ? <Icon className="edit copy" type="copy" onClick={copy} /> : null} |
| | | <Icon className="edit" title="编辑" type="edit" onClick={edit} /> |
| | | <Icon className="edit close" title="删除" type="close" onClick={del} /> |
| | | {type === 'action' ? <Icon className="edit copy" title="复制" type="copy" onClick={copy} /> : null} |
| | | {type === 'action' && ['pop', 'prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ? |
| | | <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null |
| | | } |
| | | </div> |
| | | ) |
| | | } |