perf: 提取tree props

This commit is contained in:
xingyu4j
2022-12-06 15:23:09 +08:00
parent 61f647b385
commit 3fd6193ac1
7 changed files with 36 additions and 51 deletions

View File

@@ -284,7 +284,7 @@ import {
} from 'element-plus'
import { useRouter } from 'vue-router'
import { VxeGridInstance } from 'vxe-table'
import { handleTree } from '@/utils/tree'
import { handleTree, defaultProps } from '@/utils/tree'
import download from '@/utils/download'
import { CommonStatusEnum } from '@/utils/constants'
import { getAccessToken, getTenantId } from '@/utils/auth'
@@ -306,11 +306,6 @@ import {
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const defaultProps = {
children: 'children',
label: 'name',
value: 'id'
}
const queryParams = reactive({
deptId: null
})
@@ -327,7 +322,7 @@ const { gridOptions, getList, deleteData, exportList } = useVxeGrid<UserApi.User
})
// ========== 创建部门树结构 ==========
const filterText = ref('')
const deptOptions = ref<any[]>([]) // 树形结构
const deptOptions = ref<Tree[]>([]) // 树形结构
const treeRef = ref<InstanceType<typeof ElTree>>()
const getTree = async () => {
const res = await listSimpleDeptApi()