integrated_traffic_vue/src/components/department/index.vue

66 lines
1.3 KiB
Vue

<template>
<el-tree-select
v-model="modelValue"
:data="departmentTree"
node-key="id"
:props="{
children: 'nodes',
label: 'name',
}"
:render-after-expand="false"
accordion
:check-strictly="checkStrictly"
:clearable="clearable"
:show-checkbox="showCheckbox"
:multiple="multiple"
:collapse-tags="collapseTags"
/>
</template>
<script setup>
import { layoutFnGetDepartmentTree } from "@/assets/js/data_dictionary";
import { useVModel } from "@vueuse/core";
defineOptions({
name: "LayoutDepartment",
});
const props = defineProps({
modelValue: {
type: [String, Array],
required: true,
default: "",
},
checkStrictly: {
type: Boolean,
default: true,
},
showCheckbox: {
type: Boolean,
default: false,
},
multiple: {
type: Boolean,
default: false,
},
collapseTags: {
type: Boolean,
default: false,
},
clearable: {
type: Boolean,
default: true,
},
rootDisable: {
type: String,
default: "Y",
},
});
const emits = defineEmits(["update:modelValue"]);
const modelValue = useVModel(props, "modelValue", emits);
const departmentTree = await layoutFnGetDepartmentTree({
ROOT_DISABLE: props.rootDisable,
});
</script>
<style scoped></style>