From c83a50317baeba1a4771e4d802eee029ed2b7e31 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 23 六月 2020 18:23:43 +0800 Subject: [PATCH] 2020-06-23 --- src/tabviews/zshare/normalTable/index.jsx | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 0ffe91a..337f4fd 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -438,9 +438,38 @@ return ( <div> - <div className="baseboard"></div> <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null } + </div> + </div> + ) + } else if (item.type === 'link') { + let content = '' + let _href = record[item.field] || '' + + if (item.nameField && record.hasOwnProperty(item.nameField)) { + content = record[item.nameField] + } + + if (!content && _href) { + content = _href + } else if (!_href) { + content = '' + } + + if (item.joint === 'true' && _href) { + let _param = window.btoa('id=' + record[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) + _href += '?' + _param + } + + if (item.blur) { + content = md5(content) + } + + return ( + <div> + <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> + {content ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null } </div> </div> ) @@ -478,7 +507,7 @@ } if (content !== '') { - if (item.format === 'percent') { + if (col.format === 'percent') { content = content * 100 } @@ -547,6 +576,28 @@ } contents.push(content) + } else if (col.type === 'link') { + let content = col.nameField ? record[col.nameField] : '' + let _href = record[col.field] || '' + + if (!content && _href) { + content = _href + } else if (!_href) { + content = '' + } + + if (col.joint === 'true' && _href) { + let _param = window.btoa('id=' + record[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) + _href += '?' + _param + } + + if (item.blur) { + content = md5(content) + } + + content = _href ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null + + contents.push(content) } else { let content = record[col.field] -- Gitblit v1.8.0