<template>
  <div id="unit" class="flex-row" >
    <org-list  @isclick="selected" class="basic-main" style="width:auto;" v-ref:orglist>
    </org-list>
    <div class="binary-right" style="width: 40%;" v-if="row">
      <organization v-if="row.resourcetype=='organization'" :look='true':data="row" :parent="row.parent"></organization>
      <zone v-if="row.resourcetype=='zone'" :data="row" :look='true' :parent="row.parent"></zone>
    </div>
  </div>
</template>

<script>

  import {HttpResetClass} from 'vue-client'


  export default {
    title: '组织管理',
    props: ['data'],
    data () {
      return {
        row: null,
      }
    },
    methods: {
      //选中数据实现两边数据绑定
      async selected (obj) {
        let rowdata=obj.val.data
        rowdata.parent==obj.val.parent
        this.row = null
        this.row = rowdata
      }
    },
    events: {
      //返回
      'cancel' () {
        this.row = null
      },
    },
    watch: {

    },
  }

</script>
