| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Table, message, Button } from 'antd' |
| | | import { Table, message, Button, Typography } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const { Paragraph } = Typography |
| | | |
| | | export default class MainTable extends Component { |
| | | static propTpyes = { |
| | |
| | | </div> |
| | | </div> |
| | | ) |
| | | } else if (item.type === 'picture') { |
| | | let photos = '' |
| | | if (item.field && record.hasOwnProperty(item.field)) { |
| | | photos = record[item.field].split(',') |
| | | } else { |
| | | photos = '' |
| | | } |
| | | return ( |
| | | <div className="picture-col" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | {photos && photos.map((url, i) => { |
| | | return <img key={`${i}`} src={url} alt=""/> |
| | | })} |
| | | </div> |
| | | ) |
| | | } else if (item.type === 'textarea') { |
| | | let content = '' |
| | | let match = false |
| | | if (item.field && record.hasOwnProperty(item.field)) { |
| | | content = `${record[item.field]}` |
| | | } |
| | | |
| | | if (content && item.matchVal && content.indexOf(item.matchVal) > 0) { |
| | | match = true |
| | | } |
| | | |
| | | content = (item.prefix || '') + content + (item.postfix || '') |
| | | |
| | | return ( |
| | | <div className={match ? item.color : ''}> |
| | | <div className="background"></div> |
| | | <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } else if (item.type === 'action') { |
| | | return ( |
| | | <div className={item.style} style={{ minWidth: (item.Width || 120) + 'px' }}> |