新增部门查询功能的参数支持,包括用户ID和绑定状态,优化可用部门列表查询逻辑

This commit is contained in:
Chuck1sn
2025-06-19 15:45:34 +08:00
parent f04ea3a9e8
commit 7442516c07

View File

@@ -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,
}, },
}, },
}); });