mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-04-11 08:47:21 +00:00
新增部门查询功能的参数支持,包括用户ID和绑定状态,优化可用部门列表查询逻辑
This commit is contained in:
@@ -24,6 +24,8 @@ export function useDepartmentQuery() {
|
|||||||
const fetchDepartmentWith = async (
|
const fetchDepartmentWith = async (
|
||||||
params: {
|
params: {
|
||||||
name?: string;
|
name?: string;
|
||||||
|
userId?: number;
|
||||||
|
bindState?: "BIND" | "UNBIND" | "ALL";
|
||||||
} = {},
|
} = {},
|
||||||
page = 1,
|
page = 1,
|
||||||
pageSize = 10,
|
pageSize = 10,
|
||||||
@@ -36,9 +38,7 @@ export function useDepartmentQuery() {
|
|||||||
page,
|
page,
|
||||||
size: pageSize,
|
size: pageSize,
|
||||||
},
|
},
|
||||||
departmentQueryDto: {
|
departmentQueryDto: params,
|
||||||
name: params.name || "",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -56,12 +56,12 @@ export function useDepartmentQuery() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 获取可用部门列表(用于选择上级部门)
|
// 获取可用部门列表(用于选择上级部门)
|
||||||
const fetchAvailableDepartments = async (excludeId?: number) => {
|
const fetchAvailableDepartments = async (id?: number) => {
|
||||||
try {
|
try {
|
||||||
const response = await client.GET("/department/query-available", {
|
const response = await client.GET("/department/query-available", {
|
||||||
params: {
|
params: {
|
||||||
query: {
|
query: {
|
||||||
id: excludeId,
|
id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user