From 5374fa10c854e2602e4a05e4475356c64d801114 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 08 一月 2020 18:00:24 +0800 Subject: [PATCH] 2020-01-08 --- src/tabviews/subtable/subTable/index.jsx | 39 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) diff --git a/src/tabviews/subtable/subTable/index.jsx b/src/tabviews/subtable/subTable/index.jsx index 093c555..f860604 100644 --- a/src/tabviews/subtable/subTable/index.jsx +++ b/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' }}> -- Gitblit v1.8.0