diff --git a/src/components/Tables/SimpleTable/index.jsx b/src/components/Tables/SimpleTable/index.jsx index 3a89c0cc..ff38b95e 100644 --- a/src/components/Tables/SimpleTable/index.jsx +++ b/src/components/Tables/SimpleTable/index.jsx @@ -16,7 +16,7 @@ import React from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; import { get, isString, isEmpty, isEqual, has } from 'lodash'; -import { Table } from 'antd'; +import { Table, Typography } from 'antd'; import { getColumnSorter, getSortOrder, @@ -33,6 +33,8 @@ import { import { getNoValue } from 'utils/index'; import styles from './index.less'; +const { Paragraph } = Typography; + export default class SimpleTable extends React.Component { static propTypes = { data: PropTypes.array.isRequired, @@ -89,6 +91,7 @@ export default class SimpleTable extends React.Component { linkPrefix, valueMap, unit, + copyable, ...rest } = column; if (column.key === 'operation') { @@ -123,6 +126,14 @@ export default class SimpleTable extends React.Component { if (dataIndex === 'cost' || isPrice) { newRender = this.getPriceRender(newRender, column); } + if (copyable) { + newRender = (value) => { + if (value && value !== '-') { + return {value}; + } + return '-'; + }; + } const newColumn = { ...rest, dataIndex,