diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 363a960..637208e 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -9,9 +9,9 @@ }) } // 组织机构树列表 -export function getDeptTreeList(params?: { deptType: string }) { +export function getDeptTreeList(params?: object) { return request({ - url: `${prefix}/dept/tree`, + url: `${prefix}/dept/tree?pid=0`, method: 'get', params, }) diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 363a960..637208e 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -9,9 +9,9 @@ }) } // 组织机构树列表 -export function getDeptTreeList(params?: { deptType: string }) { +export function getDeptTreeList(params?: object) { return request({ - url: `${prefix}/dept/tree`, + url: `${prefix}/dept/tree?pid=0`, method: 'get', params, }) diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 247bb11..04b39cc 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -76,12 +76,13 @@ }) } else { + console.log(dictStore.allDeptList, 'dictStore.allDeptList') refreshList(dictStore.allDeptList) } } else { // 如果指定了需要展示的部门类型 if (dictStore.companyList.length === 0) { // 如果store中未存储,从服务器上获取 - getDeptTreeList({ deptType: props.deptType }).then((res) => { + getDeptTreeList({ deptType: props.deptType, pid: '0' }).then((res) => { const list = res.data dictStore.setAllCompanyList(list) refreshList(list)