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/commontable/mainTable/index.jsx | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/src/tabviews/commontable/mainTable/index.jsx b/src/tabviews/commontable/mainTable/index.jsx index 6a3c73c..b2223cd 100644 --- a/src/tabviews/commontable/mainTable/index.jsx +++ b/src/tabviews/commontable/mainTable/index.jsx @@ -1,8 +1,10 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Table, message, Affix, Button } from 'antd' +import { Table, message, Affix, Button, Typography } from 'antd' import './index.scss' + +const { Paragraph } = Typography export default class MainTable extends Component { static propTpyes = { @@ -141,6 +143,27 @@ })} </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