| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Icon, Select, DatePicker, Input, Popover, Form } from 'antd' |
| | | import { Select, DatePicker, Input, Popover, Form } from 'antd' |
| | | import { EditOutlined, CopyOutlined, CloseOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import DateGroup from '@/menu/components/search/main-search/dategroup' |
| | |
| | | let _defaultValue = '' // 下拉搜索、时间范围类型,初始值需要预处理 |
| | | |
| | | if (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) { |
| | | _defaultValue = _option.Text || '' |
| | | } else { |
| | | _defaultValue = '' |
| | | } |
| | | } else if (card.setAll === 'true') { |
| | | _defaultValue = '全部' |
| | | let _option = card.options.filter(option => option.Value === card.initval)[0] |
| | | if (_option) { |
| | | _defaultValue = _option.Text || '' |
| | | } else { |
| | | _defaultValue = '' |
| | | } |
| | | } else if (card.type === 'daterange') { |
| | | _defaultValue = [null, null] |
| | |
| | | return ( |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" title="编辑" type="edit" onClick={() => editCard(id)} /> |
| | | <Icon className="copy" title="复制" type="copy" onClick={() => copyCard(id)} /> |
| | | <Icon className="close" title="删除" type="close" onClick={() => delCard(id)} /> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => editCard(id)} /> |
| | | <CopyOutlined className="copy" title="复制" onClick={() => copyCard(id)} /> |
| | | <CloseOutlined className="close" title="删除" onClick={() => delCard(id)} /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <div className={'page-card ' + (card.labelShow || '')} style={{ opacity: opacity}}> |