<template>
  <div id="StaffListManage" class="flex-row " :class="{'binary':row}">
    <div :class="{'basic-main':!row, 'binary-left':row}">
      <staff-list @select-changed="selected" v-ref:list></staff-list>
    </div>
    <div class="binary-right" v-if="row">
      <staff-compile-list v-if="row" :data="row" :look='true'></staff-compile-list>
    </div>
  </div>
</template>

<script>

  export default {
    title: '人员管理',
    props: ['data'],
    data () {
      return {
        row: null,
        showselect:true
      }
    },
    methods: {
      //选中数据实现两边数据绑定
      async selected (obj) {
        if(this.showselect) return;
        delete obj.val.num
        delete obj.val.f_zone_name
        delete obj.val.f_org_name
        this.row = null
        this.row = obj.val
      }
    },
    events: {
      //返回
      'cancel' () {
        this.row = null
      },
      'search' () {
        this.isChange = false
      },
      'refresh' () {
        this.row = null
        this.isChange = false
        this.$refs.list.$refs.paged.$refs.cri.search()
      }
    }
  }

</script>
