|
@@ -29,10 +29,10 @@ const formRef = ref<FormExpose>()
|
|
|
|
|
|
// ========== 创建部门树结构 ==========
|
|
// ========== 创建部门树结构 ==========
|
|
const filterText = ref('')
|
|
const filterText = ref('')
|
|
-const deptOptions = ref([]) // 树形结构
|
|
|
|
|
|
+const deptOptions = ref() // 树形结构
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
const getTree = async () => {
|
|
const getTree = async () => {
|
|
- const res = await DeptApi.listSimpleDeptApi()
|
|
|
|
|
|
+ const res = await DeptApi.getDeptPageApi(null)
|
|
deptOptions.value = handleTree(res)
|
|
deptOptions.value = handleTree(res)
|
|
}
|
|
}
|
|
const filterNode = (value: string, data: Tree) => {
|
|
const filterNode = (value: string, data: Tree) => {
|
|
@@ -118,6 +118,7 @@ onMounted(async () => {
|
|
:highlight-current="true"
|
|
:highlight-current="true"
|
|
default-expand-all
|
|
default-expand-all
|
|
:filter-node-method="filterNode"
|
|
:filter-node-method="filterNode"
|
|
|
|
+ :expand-on-click-node="false"
|
|
>
|
|
>
|
|
<template #default="{ node, data }">
|
|
<template #default="{ node, data }">
|
|
<span class="custom-tree-node">
|
|
<span class="custom-tree-node">
|