king
2020-01-08 5374fa10c854e2602e4a05e4475356c64d801114
src/tabviews/subtable/subTable/index.jsx
@@ -1,7 +1,9 @@
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 = {
@@ -109,6 +111,41 @@
          </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' }}>