king
2023-08-27 da64ab0923bf8817fc8599a6e37b953ce38f64c8
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
@@ -295,6 +318,7 @@
    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>
    )