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/templates/modalconfig/checkCard/index.jsx | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/templates/modalconfig/checkCard/index.jsx b/src/templates/modalconfig/checkCard/index.jsx index 60a6e3e..3575d22 100644 --- a/src/templates/modalconfig/checkCard/index.jsx +++ b/src/templates/modalconfig/checkCard/index.jsx @@ -13,14 +13,15 @@ state = {} getCards = () => { - const { display, width, options, fields, ratio, backgroundColor, borderColor } = this.props.config + const { display, width, options, fields, ratio, picratio, backgroundColor, borderColor } = this.props.config + let _ratio = picratio || ratio let paddingTop = '100%' - if (ratio === '4:3') { + if (_ratio === '4:3') { paddingTop = '75%' - } else if (ratio === '3:2') { + } else if (_ratio === '3:2') { paddingTop = '66.7%' - } else if (ratio === '16:9') { + } else if (_ratio === '16:9') { paddingTop = '56.25%' } @@ -31,12 +32,12 @@ } if (display !== 'picture') { - if (backgroundColor) { - style.backgroundColor = backgroundColor - } + let _style = backgroundColor ? {backgroundColor} : null + if (!options || options.length === 0) { return <Col span={width}> <div className="card-cell" style={style}> + <div className="bg-mask" style={_style}></div> {fields ? 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}}>{col.field}</span> }) : null} @@ -47,6 +48,7 @@ return options.map(item => { return <Col span={width} key={item.key}> <div className="card-cell" style={style}> + <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