From 9fa028fdac3517c2c2b167e52782f83185daa131 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 10 六月 2022 11:29:05 +0800
Subject: [PATCH] 2022-06-10

---
 src/templates/modalconfig/checkCard/index.jsx |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/templates/modalconfig/checkCard/index.jsx b/src/templates/modalconfig/checkCard/index.jsx
index 952f4db..0969425 100644
--- a/src/templates/modalconfig/checkCard/index.jsx
+++ b/src/templates/modalconfig/checkCard/index.jsx
@@ -16,6 +16,7 @@
     const { display, width, options, fields, ratio, picratio, backgroundColor, borderColor } = this.props.config
 
     let _ratio = picratio || ratio
+    let _options = []
     let paddingTop = '100%'
     if (_ratio === '4:3') {
       paddingTop = '75%'
@@ -23,6 +24,10 @@
       paddingTop = '66.7%'
     } else if (_ratio === '16:9') {
       paddingTop = '56.25%'
+    }
+
+    if (options) {
+      _options = options.filter(op => !op.Hide)
     }
 
     let style = {}
@@ -34,7 +39,7 @@
     if (display !== 'picture') {
       let _style = backgroundColor ? {backgroundColor} : null
  
-      if (!options || options.length === 0) {
+      if (_options.length === 0) {
         return <Col span={width}>
           <div className="card-cell" style={style}>
             <div className="bg-mask" style={_style}></div>
@@ -45,7 +50,7 @@
           </div>
         </Col>
       }
-      return options.map(item => {
+      return _options.map(item => {
         return <Col span={width} key={item.key}>
           <div className="card-cell" style={style}>
             <div className="bg-mask" style={_style}></div>
@@ -56,13 +61,13 @@
         </Col>
       })
     } else {
-      if (!options || options.length === 0) {
+      if (_options.length === 0) {
         return <Col span={width}>
           <div className="card-pic-cell" style={{...style, paddingTop, background: '#91d5ff'}}>
           </div>
         </Col>
       }
-      return options.map(item => {
+      return _options.map(item => {
         return <Col span={width} key={item.key}>
           <div className="card-pic-cell" style={{...style, paddingTop, backgroundImage: `url(${item.$url})`}}>
           </div>

--
Gitblit v1.8.0