新增部门查询功能的参数支持,包括用户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 (
params: {
name?: string;
userId?: number;
bindState?: "BIND" | "UNBIND" | "ALL";
} = {},
page = 1,
pageSize = 10,
@@ -36,9 +38,7 @@ export function useDepartmentQuery() {
page,
size: pageSize,
},
departmentQueryDto: {
name: params.name || "",
},
departmentQueryDto: params,
},
},
});
@@ -56,12 +56,12 @@ export function useDepartmentQuery() {
};
// 获取可用部门列表(用于选择上级部门)
const fetchAvailableDepartments = async (excludeId?: number) => {
const fetchAvailableDepartments = async (id?: number) => {
try {
const response = await client.GET("/department/query-available", {
params: {
query: {
id: excludeId,
id,
},
},
});