<template>
  <div>
    <Button @click="click1">选人1</Button>
    <Button @click="checkShow" type="primary">选择--测试1</Button>
    <Button @click="checkShow2" type="primary">选择--测试2</Button>
    <!--<Button style="margin-left: 15px" @click="click2">选人2</Button>-->
    <bc-check-person ref='check1' :show.sync="showModal1" company role interior quickly :areas="areas" :orgs="orgs" :roles="roles" :companys="companys"></bc-check-person>
    <!--<bc-check-person ref='check2' :show.sync="showModal2" interior quickly></bc-check-person>-->
    <bc-check ref="check1" :treeData.sync="treeData" :resultData.sync="resultData" :show.sync="showCheck" multi :treeId="'tree1'"></bc-check>
    <bc-check ref="check2" :treeData.sync="treeData2" :resultData.sync="resultData2" :show.sync="showCheck2" multi :treeId="'tree2'"></bc-check>
  </div>
</template>
<script>
  import bcCheckPerson from './bc-check-person'
  import bcCheck from './bc-check'

  export default {
    name:'checkPerson',
    components:{
      bcCheckPerson,
      bcCheck
    },
    data() {
      return {
        showCheck:false,
        showCheck2:false,
        treeData: [],
        treeData2: [],
        resultData:[],
        resultData2:[],
        showModal1:false,
        showModal2:false,
        areas:[{id:'1'}],
        companys:[],
        orgs:[],
        roles:[]
      }
    },
    methods: {
      click1 () {
        this.showModal1 = true
      },
      click2 () {
        this.showModal2 = true
      },
      checkShow (){
        this.showCheck=true;
        this.treeData = [{id: 1, pId: 0, type: 'area', isParent: true, name: '湖南省',},
          {id: 2, pId: 1, type: 'company', isParent: true, name: '湖南省政府',},
          {id: 3, pId: 2, type: 'user', isParent: false, name: '张三', userName: '张三'},
          {id: 4, pId: 1, type: 'area', isParent: false, name: '长沙市',},
          {id: 5, pId: 4, type: 'user', isParent: false, name: '李四', userName: '李四'},];
      },
      checkShow2 (){
        this.showCheck2=true;
        this.treeData2 = [{id: 1, pId: 0, type: 'area', isParent: true, name: '湖北省',},
          {id: 2, pId: 1, type: 'company', isParent: true, name: '湖北省政府',},
          {id: 3, pId: 2, type: 'user', isParent: false, name: '朱一', userName: '朱一'},
          {id: 4, pId: 1, type: 'area', isParent: false, name: '武汉市',},
          {id: 5, pId: 4, type: 'user', isParent: false, name: '刘二', userName: '刘二'},];
      }
    }
  }
</script>
