| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { DndProvider, DragSource, DropTarget } from 'react-dnd' |
| | | import { Table, Popover, Modal, message, notification } from 'antd' |
| | | import { PlusOutlined, PlusSquareOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined, InfoOutlined } from '@ant-design/icons' |
| | | import { Table, Popover, Modal, message, notification, Typography } from 'antd' |
| | | import { PlusOutlined, PlusSquareOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const EditColumn = asyncComponent(() => import('./editColumn')) |
| | | const MarkColumn = asyncIconComponent(() => import('@/menu/components/share/markcomponent')) |
| | | const CardCellComponent = asyncComponent(() => import('@/menu/components/card/cardcellcomponent')) |
| | |
| | | |
| | | class HeaderCol extends Component { |
| | | deleteCol = () => { |
| | | const _this = this |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定删除显示列吗?', |
| | | onOk() { |
| | | _this.props.deleteCol(_this.props.column) |
| | | that.props.deleteCol(that.props.column) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | val = '$Index' |
| | | } else if (column.type === 'formula') { |
| | | val = column.formula |
| | | if (column.eval === 'false') { |
| | | val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') |
| | | val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span> |
| | | } |
| | | // if (column.eval === 'false') { |
| | | // val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, ' ') |
| | | // val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span> |
| | | // } |
| | | } |
| | | return ( |
| | | <td style={{...style}} className={className}> |
| | | {val} |
| | | {column.field ? <Paragraph className="col-copy" copyable={{ text: column.field }}>{val}</Paragraph> : val} |
| | | {column.Hide === 'true' ? <CloseCircleOutlined style={{marginLeft: '5px', color: 'orange', fontSize: '12px'}}/> : null} |
| | | {column.marks && column.marks.length ? <AntDesignOutlined className="profile"/> : null} |
| | | </td> |
| | |
| | | if (!cell.eleType) { |
| | | if (cell.copyType === 'action') { |
| | | cell.eleType = 'button' |
| | | cell.width = cell.width || 12 |
| | | cell.width = typeof(cell.width) === 'number' ? cell.width : 12 |
| | | } else { |
| | | cell.eleType = 'text' |
| | | } |
| | |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | copyFields = () => { |
| | | const { config } = this.props |
| | | let m = [] |
| | | let n = [] |
| | | // copyFields = () => { |
| | | // const { config } = this.props |
| | | // let m = [] |
| | | // let n = [] |
| | | |
| | | config.columns.forEach(col => { |
| | | m.push(`${col.field} ${col.datatype}`) |
| | | n.push(col.field) |
| | | }) |
| | | // config.columns.forEach(col => { |
| | | // m.push(`${col.field} ${col.datatype}`) |
| | | // n.push(col.field) |
| | | // }) |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = `/*${m.join(',')}*/ |
| | | ${n.join(',')}` |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | // let oInput = document.createElement('input') |
| | | // oInput.value = `/*${m.join(',')}*/ |
| | | // ${n.join(',')}` |
| | | // document.body.appendChild(oInput) |
| | | // oInput.select() |
| | | // document.execCommand('Copy') |
| | | // document.body.removeChild(oInput) |
| | | |
| | | message.success('复制成功。') |
| | | } |
| | | // message.success('复制成功。') |
| | | // } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('plusColumns', this.plusColumns) |
| | |
| | | <FieldsComponent config={config} type="columns" /> |
| | | <CopyOutlined title="复制显示列" onClick={this.copycolumn} /> |
| | | <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> |
| | | <InfoOutlined title="复制字段" style={{color: 'orange'}} onClick={this.copyFields}/> |
| | | {/* <InfoOutlined title="复制字段" style={{color: 'orange'}} onClick={this.copyFields}/> */} |
| | | </div> |
| | | <DndProvider> |
| | | {groups ? groups.map((group, i) => { |