From 29432c9167e3fcdf83f35d0bb9dbe9acb7c7ffbf Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 22 六月 2021 14:35:23 +0800 Subject: [PATCH] 2021-06-22 --- src/tabviews/zshare/mutilform/checkCard/index.jsx | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/tabviews/zshare/mutilform/checkCard/index.jsx b/src/tabviews/zshare/mutilform/checkCard/index.jsx index f9e8ecf..8fa13b6 100644 --- a/src/tabviews/zshare/mutilform/checkCard/index.jsx +++ b/src/tabviews/zshare/mutilform/checkCard/index.jsx @@ -57,7 +57,7 @@ } getCards = () => { - const { display, width, options, fields, ratio, multiple } = this.props.card + const { display, width, options, fields, ratio, multiple, backgroundColor, borderColor } = this.props.card const { selectKeys } = this.state let paddingTop = '100%' @@ -69,11 +69,20 @@ paddingTop = '56.25%' } + let style = {} + + if (borderColor) { + style.borderColor = borderColor + } + if (!options || options.length === 0) { return null } else if (display !== 'picture') { if (!fields || fields.length === 0) { return null + } + if (backgroundColor) { + style.backgroundColor = backgroundColor } return options.map(item => { let _active = false @@ -84,7 +93,7 @@ } return <Col span={width} key={item.key}> - <div className={'card-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)}> + <div className={'card-cell ' + (_active ? 'active' : '')} style={style} onClick={() => this.changeCard(item)}> {fields.map(col => { return <span key={col.key} style={{color: col.color, fontSize: col.fontSize + 'px', height: col.fontSize * 1.5 + 'px', textAlign: col.align}}>{item[col.field]}</span> })} @@ -101,7 +110,7 @@ } return <Col span={width} key={item.key}> - <div className={'card-pic-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)} style={{paddingTop, backgroundImage: `url(${item.$url})`}}> + <div className={'card-pic-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)} style={{...style, paddingTop, backgroundImage: `url(${item.$url})`}}> </div> </Col> }) -- Gitblit v1.8.0