<template>
  <div class="userManage">
    <orgTree class="orgTree" ref="orgTree" @node-select="nodeSelect" :isAddOrgBtn="true"></orgTree>
    <workSpace ref="workSpace" @after-op="afterOp"></workSpace>
  </div>
</template>

<script>
  import workSpace from './module/workSpace.vue'
  import orgTree from '../module/orgTree.vue'
  export default {
    name: 'index',
    components: {
      workSpace,
      orgTree,
    },
    methods: {
      afterOp() {
        this.$refs.orgTree.getOrgListTree()
      },
      nodeSelect(node) {
        this.$refs.workSpace.users = node != null ? [node, ...node.children] : []
      },
    },
  }
</script>

<style scoped lang="less">
  .userManage {
    display: flex;
    justify-content: space-between;
    .orgTree {
      margin-right: 20px;
    }
  }
</style>
