king
2023-01-17 474c68f0fea10cc62977c67d186732b3346cdd53
src/tabviews/custom/components/table/edit-table/normalTable/cusSwitch/index.jsx
@@ -8,6 +8,7 @@
class ColorSketch extends Component {
  static propTpyes = {
    defaultValue: PropTypes.any,
    autoFocus: PropTypes.any,
    config: PropTypes.object,
    onChange: PropTypes.func
  }
@@ -31,15 +32,16 @@
    const { config } = this.props
    this.setState({ status: val }, () => {
      let _val = val ? config.openVal : config.closeVal
      this.props.onChange(_val)
      let _text = val ? config.openText : config.closeText
      this.props.onChange(_val, _text)
    })
  }
  render() {
    const { config } = this.props
    const { config, autoFocus } = this.props
    const { status } = this.state
    return (
      <Switch checkedChildren={config.openText} autoFocus={true} onBlur={this.props.onBlur} unCheckedChildren={config.closeText} checked={status} onChange={this.changeStatus} />
      <Switch checkedChildren={config.openText} autoFocus={autoFocus} onBlur={this.props.onBlur} unCheckedChildren={config.closeText} checked={status} onChange={this.changeStatus} />
    )
  }
}