<template>
    <div>
      <el-form  label-width="120px">
        <el-form-item
            label="用户类型："
            prop="type_id"
        >
          <el-radio-group v-model="type_id" >
                <el-radio :label="1">个人会员</el-radio>
                <el-radio :label="2">政务会员</el-radio>  
                <el-radio :label="4">调研员</el-radio>
                <!-- <el-radio :label="3">企业会员</el-radio> -->
         </el-radio-group>
        </el-form-item>
        <!---添加-->
        <Personal     v-if="type_id==1 && !this.memberDataForm.id"  :memberDataForm="memberDataForm"  @SubmitClick="SubmitClick" @closeDlg="closeDlg">
        </Personal>
         <GovernmentAffairs     v-if="type_id==2 && !this.memberDataForm.id"  :memberDataForm="memberDataForm"  @SubmitClick="SubmitClick"     @closeDlg="closeDlg"   >
        </GovernmentAffairs>
        <Researcher     v-if="type_id==4 && !this.memberDataForm.id"  :memberDataForm="memberDataForm"  @SubmitClick="SubmitClick" @closeDlg="closeDlg">
        </Researcher>
        <!--修改-->
        <PersonalEdit     v-if="type_id==1 && this.memberDataForm.id"  :memberDataForm="memberDataForm"  @SubmitClick="SubmitClick" @closeDlg="closeDlg">
        </PersonalEdit>
         <GovernmentAffairsEdit     v-if="type_id==2  && this.memberDataForm.id"  :memberDataForm="memberDataForm"  @SubmitClick="SubmitClick"      @closeDlg="closeDlg"  >
        </GovernmentAffairsEdit>
       <!-- <Enterprise         v-if="type_id==3"     @SubmitClick="SubmitClick">
        </Enterprise> -->
       
      </el-form>
    </div>
  </template>
  <script>
    // import Enterprise from "./enterprise";
    import GovernmentAffairs from "./governmentAffairs";
    import Personal from "./personal";
    import Researcher from "./researcher";
    
    import GovernmentAffairsEdit from "./governmentAffairsEdit";
    import PersonalEdit from "./personalEdit";
    import ResearcherEdit from "./researcherEdit";
  export default {
    props: {
      memberDataForm: {
      type: Object,
      default: () => {}
    },
    isloading:{
      type:Boolean,
      default: true
    },
    closeDlg:{
      type:Function
    }
    },
    components: {
        // Enterprise,
        GovernmentAffairs,
        Personal,
        GovernmentAffairsEdit,
        PersonalEdit,
        Researcher,
        ResearcherEdit
    },
    data() {
      let self = this
      return {
        type_id:"4"
      }
    },
    mounted() {
        console.log("接收数据：",this.memberDataForm)
        if(this.memberDataForm) {
          this.form = Object.assign({} , this.memberDataForm)
          this.type_id = this.memberDataForm.type_id
        }
    },
    methods: {
      closeDlg() {
        // this.isloading = false
        console.log("addEdit提交")
        this.$emit('closeDlg',1)
      },
   
      accountType(){
       
        console.log(this.type_id)
      },
      SubmitClick(data){
      
        data['type_id'] = this.type_id
        console.log("提交数据：",data)
        this.$emit('memberSubmitClick',data)
      }

      
    }
  }
  </script>
  <style>
  /* .el-cascader-node>.el-radio{
    margin-top:25px;
  } */
  .el-radio-group{
    line-height: 46px;
  }
  </style>
  