接口
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
<script lang="ts" name="SystemUserDeptTree" setup>
|
||||
import { ElTree } from 'element-plus'
|
||||
// import * as DeptApi from '@/api/system/dept'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
|
||||
const deptName = ref('')
|
||||
@@ -32,59 +32,7 @@ const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||
|
||||
/** 获得部门树 */
|
||||
const getTree = async () => {
|
||||
// const res = await DeptApi.getSimpleDeptList()
|
||||
const res = [
|
||||
{
|
||||
id: 100,
|
||||
name: '芋道源码',
|
||||
parentId: 0
|
||||
},
|
||||
{
|
||||
id: 101,
|
||||
name: '深圳总公司',
|
||||
parentId: 100
|
||||
},
|
||||
{
|
||||
id: 103,
|
||||
name: '研发部门',
|
||||
parentId: 101
|
||||
},
|
||||
{
|
||||
id: 108,
|
||||
name: '市场部门',
|
||||
parentId: 102
|
||||
},
|
||||
{
|
||||
id: 102,
|
||||
name: '长沙分公司',
|
||||
parentId: 100
|
||||
},
|
||||
{
|
||||
id: 104,
|
||||
name: '市场部门',
|
||||
parentId: 101
|
||||
},
|
||||
{
|
||||
id: 109,
|
||||
name: '财务部门',
|
||||
parentId: 102
|
||||
},
|
||||
{
|
||||
id: 105,
|
||||
name: '测试部门',
|
||||
parentId: 101
|
||||
},
|
||||
{
|
||||
id: 106,
|
||||
name: '财务部门',
|
||||
parentId: 101
|
||||
},
|
||||
{
|
||||
id: 107,
|
||||
name: '运维部门',
|
||||
parentId: 101
|
||||
}
|
||||
]
|
||||
const res = await DeptApi.getSimpleDeptList()
|
||||
deptList.value = []
|
||||
deptList.value.push(...handleTree(res))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user