<template>
  <layout-tree
    :api="layoutFnGetDepartmentTree"
    v-model:refresh="refresh"
    :id="departmentId"
    @throw-data="emits('throw-data', $event)"
    @node-click="emits('node-click', $event)"
  />
</template>

<script setup>
import { layoutFnGetDepartmentTree } from "@/assets/js/data_dictionary.js";
import LayoutTree from "@/components/tree/index.vue";
import { useVModel } from "@vueuse/core";

defineOptions({
  name: "LayoutDepartmentTree",
});
const props = defineProps({
  refresh: {
    type: Boolean,
    default: false,
  },
  departmentId: {
    type: String,
    default: "",
  },
});
const emits = defineEmits(["node-click", "throw-data", "update:refresh"]);
const refresh = useVModel(props, "refresh", emits);
</script>

<style scoped lang="scss"></style>
