From 79e4981aa6cc9354276fc54cdf6d14eb08ab7fee Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 22 六月 2023 15:59:04 +0800
Subject: [PATCH] Merge branch 'develop' of ssh://121.36.20.145:29418/~jinfei/pc-plat into develop

---
 src/tabviews/zshare/mutilform/mkCheckCard/index.jsx |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx
index 154b7bd..a7dc070 100644
--- a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx
+++ b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Col, Row } from 'antd'
+import { Col, Row, Switch } from 'antd'
 import { CheckOutlined } from '@ant-design/icons'
 
 import MKEmitter from '@/utils/events.js'
@@ -281,6 +281,29 @@
     }
   }
 
+  onChange = (val) => {
+    if (val) {
+      let keys = []
+      this.state.options.forEach(item => {
+        if (item.$disabled) return
+
+        keys.push(item.$value)
+      })
+
+      this.setState({
+        selectKeys: keys
+      }, () => {
+        this.props.onChange(keys.join(','))
+      })
+    } else {
+      this.setState({
+        selectKeys: []
+      }, () => {
+        this.props.onChange('')
+      })
+    }
+  }
+
   render() {
     const { config, options } = this.state
 
@@ -289,9 +312,13 @@
     if (options.length * config.width > 24) {
       extend += ' mutile-line'
     }
+    if (config.border === 'hide') {
+      extend += ' border-hide'
+    }
 
     return (
       <div className={'check-card-form-box ' + extend}>
+        {config.checkAll === 'show' && options.length > 3 ? <Switch size="small" onChange={this.onChange}/> : null}
         <Row gutter={12}>{this.getCards()}</Row>
       </div>
     )

--
Gitblit v1.8.0