| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { DndProvider, DragSource, DropTarget } from 'react-dnd' |
| | | import { Table, Popover, Icon, Modal, message, Button } from 'antd' |
| | | import { Table, Popover, Modal, message, Button } from 'antd' |
| | | import { PlusOutlined, FileSyncOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {column && ['custom', 'action'].includes(column.type) ? |
| | | <Icon className="plus" title="添加" type="plus" onClick={() => this.props.addElement(column)} /> : null |
| | | <PlusOutlined className="plus" title="添加" onClick={() => this.props.addElement(column)} /> : null |
| | | } |
| | | <Icon className="edit" title="编辑" type="edit" onClick={() => this.props.editColumn(column)} /> |
| | | {column && column.type === 'custom' ? <Icon className="style" title="调整样式" onClick={() => this.props.changeStyle(column)} type="font-colors" /> : null} |
| | | <Icon className="close" title="删除" type="delete" onClick={this.deleteCol} /> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column && column.type === 'custom' ? <FontColorsOutlined className="style" title="调整样式" onClick={() => this.props.changeStyle(column)}/> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | return ( |
| | | <td style={{...style, minWidth: column.Width || 100}} className={className}> |
| | | {val} |
| | | {column.Hide === 'true' ? <Icon style={{marginLeft: '5px', color: 'orange', fontSize: '12px'}} type="close-circle" /> : null} |
| | | {column.marks && column.marks.length ? <Icon className="profile" type="ant-design"/> : null} |
| | | {column.Hide === 'true' ? <CloseCircleOutlined style={{marginLeft: '5px', color: 'orange', fontSize: '12px'}}/> : null} |
| | | {column.marks && column.marks.length ? <AntDesignOutlined className="profile"/> : null} |
| | | </td> |
| | | ) |
| | | } else { |
| | |
| | | const columns = this.state.columns.map((col, index) => { |
| | | let title = col.label |
| | | if (col.editable === 'true') { |
| | | title = <span>{col.label}<Icon style={{position: 'absolute', bottom: 0, right: 0, color: '#1890ff'}} type="edit" /></span> |
| | | title = <span>{col.label}<EditOutlined style={{position: 'absolute', bottom: 0, right: 0, color: '#1890ff'}}/></span> |
| | | } |
| | | return { |
| | | title: title, |
| | |
| | | <div className="col-control"> |
| | | <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={() => this.setState({visible: true})} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeSubmitStyle} type="font-colors" /> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.setState({visible: true})} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeSubmitStyle}/> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button className="submit-btn" style={config.submit.style} onDoubleClick={() => this.setState({visible: true})} type="primary">提交</Button> |
| | | </Popover> |
| | | <Icon title="复制显示列" type="copy" onClick={this.copycolumn} /> |
| | | <CopyOutlined title="复制显示列" onClick={this.copycolumn} /> |
| | | <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> |
| | | <Icon title="同步字段集" type="file-sync" onClick={this.syncfield} /> |
| | | <Icon title="清空显示列" type="delete" onClick={this.clear}/> |
| | | <FileSyncOutlined title="同步字段集" onClick={this.syncfield} /> |
| | | <DeleteOutlined title="清空显示列" onClick={this.clear}/> |
| | | </div> |
| | | <DndProvider> |
| | | <Table |