<template>
  <div id="unit" class="flex-row">
    <dep-list class="basic-main"  @select-changed="selected" v-ref:todolist></dep-list>
    <div class="binary-right" style="width: 68%;" v-if="isChange">
        <div class="flex">
            <dep-compile-list :data="row"></dep-compile-list>
        </div>
    </div>
  </div>
</template>

<script>
  export default {
    title: '部门管理',
    data () {
      return {
        row: null,
        isChange: false
      }
    },
    methods: {
      selected (obj) {
        this.row = obj.val
        this.isChange = true
      }
    },
    events: {
      'add' () {
        this.isChange = false
        this.row = null
        this.isChange = true
      },
      'search' () {
        this.isChange = false
      },
      'refresh' () {
        this.row = null
        this.isChange = false
        this.$refs.todolist.$refs.paged.$refs.cri.search()
      }
    }
  }
</script>
<style>
</style>
