React ant design Checkbox多选框 (代码区域主要方法: onCheckAllChange() onChange() )

 

React ant design Checkbox多选框 (代码区域主要方法: onCheckAllChange() onChange() )_第1张图片

import React, { Component } from 'react'
import { Input, Divider, Checkbox,Form,Button,message,Modal} from 'antd';
import Mobx from './../mobx/index';
import { observer } from 'mobx-react';
import { Netx } from '../../MyApi'
const CheckboxGroup = Checkbox.Group;
const FormItem = Form.Item;
@observer
class NewSalesman extends Component {
  constructor(props) {
    super(props);
    this.Mobx= Mobx.testStore;
    this.state={
      checkList:[]
    }
  }
  //新增业务员
  handleSubmit=(e)=>{
    e.preventDefault();
    this.props.form.validateFields((err, values) => {
      if (!err) {
        if(values.status===true){
          values.status=1
        }else{
          values.status=0;
        }
        values.id=this.Mobx.operator.id;
        values.access_id=Array.from(new Set(this.Mobx.operator.access_id));
        this.qr_add_staff(values)
      }
  })
}
     //保存___发送给服务器
     async qr_add_staff(obj){
       let  qr_add_staff =await Netx.qr_add_staff(obj);
         if(qr_add_staff.status===1){//成功的标记
          message.success(qr_add_staff.info.tips);
          this.props.form.resetFields();
          this.Mobx.ResetOperator();
          let  shuju=this.Mobx.jurisdiction
          for(var i=0;i{
        return 
{info.desc}
} ) } render_jurisdiction2(){ return(

该账号是系统的管理员,默认拥有所有权限,且处于启用状态,不可停用。

) } render() { const { getFieldDecorator } = this.props.form; let Enable=null; if(this.props.default==="非默认"){ Enable=( {getFieldDecorator('status',{ valuePropName: 'checked',initialValue:this.Mobx.operator.status || false, })( 启用 )} ) } return (
确定 , ]} > {/* border:'1px solid red' */}
{getFieldDecorator('name', { rules: [{ required: true, message: '请输入登录员名!' }], initialValue:this.Mobx.operator.name })( )} {getFieldDecorator('nickname', { rules: [{ required: true, message: '请输入操作员姓名' }], initialValue:this.Mobx.operator.nickname })( )} {getFieldDecorator('pwd', { rules: [{ required: true, message: '请输入密码!' }], initialValue:this.Mobx.operator.pwd })( )} 权限分配 {this.props.default==="非默认"? this.render_jurisdiction1():this.render_jurisdiction2()} {Enable}
) } } export default NewSalesman = Form.create()(NewSalesman);

 

 

 

 

 

 

你可能感兴趣的:(React ant design Checkbox多选框 (代码区域主要方法: onCheckAllChange() onChange() ))