mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-13 21:27:19 +08:00
新增部门查询功能的参数支持,包括用户ID和绑定状态,优化可用部门列表查询逻辑
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user