mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-13 04:46:46 +08:00
48 lines
1.1 KiB
Vue
48 lines
1.1 KiB
Vue
<template>
|
|
<a-tree-select
|
|
:getPopupContainer="
|
|
(triggerNode) => {
|
|
return triggerNode.parentNode || document.body;
|
|
}
|
|
"
|
|
v-model:value="id"
|
|
style="width: 100%"
|
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
placeholder="请选择归属组织"
|
|
allow-clear
|
|
:tree-data="options"
|
|
:fieldNames="{
|
|
children: 'treeChildList',
|
|
label: 'name',
|
|
value: 'id',
|
|
}"
|
|
:disabled="disabled"
|
|
@change="change"
|
|
dropdownClassName="treeDropdown"
|
|
>
|
|
</a-tree-select>
|
|
</template>
|
|
<script setup>
|
|
import {computed, defineEmits, defineProps, onMounted, ref} from "vue";
|
|
import {useStore} from "vuex";
|
|
|
|
const store = useStore();
|
|
|
|
const props = defineProps({
|
|
value: String
|
|
})
|
|
const emit = defineEmits({})
|
|
|
|
const options = computed(() => store.state.orgtreeList)
|
|
|
|
const id = computed(() => {
|
|
return props.value
|
|
})
|
|
|
|
function change(key, obj) {
|
|
emit('update:name', obj[0])
|
|
emit('update:value', key)
|
|
}
|
|
|
|
</script>
|