<template>
  <div class="row" style=" height: 50px;  margin-left: 19px;">
    <div class="col-sm-3 form-group">
      <label class="font_normal_body">查询类型</label>
      <v-select :options='searchoptions' :value.sync="searchtype"
                close-on-select value-single
                placeholder='查询类型' v-model="searchtype" ></v-select>
    </div>
  </div>
  <div id="unit" class="flex-row" style="height: 98%">
    <div class="basic-main">
      <master-list v-if="searchlistflag"
                style="width:auto;"
                v-ref:todolist></master-list>
      <master-list-org
        style="width:auto;" v-if="!searchlistflag"
        v-ref:todolist></master-list-org>

    </div>
<!--    <div class="binary-right" style="width: 60%;" v-if="row">-->
<!--      <master-compile-list v-if="row" :data="row" :searchtype="searchtype" :look='true'></master-compile-list>-->
<!--    </div>-->
  </div>
</template>
<script>
  import {HttpResetClass} from 'vue-client'
  export default {
    title: '主数据管理',
    data () {
      return {
        searchoptions:[{label:"人员",value:"人员"},{label:"组织",value:"组织"}],
        searchtype :'人员',
        searchlistflag :true,
        row: null,
      }
    },
    methods: {
      //选中数据实现两边数据绑定
      async selected (obj) {
        delete obj.val.num
        this.row = null
        this.row = obj.val
      }
    },
    watch:{
      'searchtype'(val){
          if(val == '人员'){
            this.searchlistflag = true;
          }else{
            this.searchlistflag = false;
          }
      }
    },
    events: {
      //返回
      'cancel' () {
        this.row = null
      },
    }
  }
</script>
<style>
</style>
