From b5e70973340bf912b733acd737f55f90653dece8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 03 七月 2021 09:48:25 +0800 Subject: [PATCH] 2021-07-03 --- src/tabviews/zshare/mutilform/checkCard/index.jsx | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/tabviews/zshare/mutilform/checkCard/index.jsx b/src/tabviews/zshare/mutilform/checkCard/index.jsx index 8fa13b6..34d8810 100644 --- a/src/tabviews/zshare/mutilform/checkCard/index.jsx +++ b/src/tabviews/zshare/mutilform/checkCard/index.jsx @@ -69,11 +69,8 @@ paddingTop = '56.25%' } - let style = {} - - if (borderColor) { - style.borderColor = borderColor - } + let style = borderColor ? {borderColor} : {} + let _style = backgroundColor ? {backgroundColor} : null if (!options || options.length === 0) { return null @@ -81,9 +78,7 @@ if (!fields || fields.length === 0) { return null } - if (backgroundColor) { - style.backgroundColor = backgroundColor - } + return options.map(item => { let _active = false if (multiple === 'true' && selectKeys.includes(item.$value)) { @@ -93,7 +88,8 @@ } return <Col span={width} key={item.key}> - <div className={'card-cell ' + (_active ? 'active' : '')} style={style} onClick={() => this.changeCard(item)}> + <div className={'card-cell' + (_active ? ' active' : '') + (_style ? ' bg-control' : '')} style={style} onClick={() => this.changeCard(item)}> + <div className="bg-mask" style={_style}></div> {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> })} -- Gitblit v1.8.0