import type { PageResult } from '@/types/api';
|
|
/** 组织类型。 */
|
export type OrgType = 'HQ' | 'BRANCH' | 'DEALER' | 'AGENT' | 'DEPT' | 'TEAM';
|
|
/** 组织响应体(OrgVO)。 */
|
export interface OrgVO {
|
id: number;
|
orgName: string;
|
orgType?: OrgType;
|
parentId?: number | null;
|
orgPath?: string;
|
leaderId?: number | null;
|
region?: string;
|
sortOrder?: number;
|
status?: boolean;
|
children?: OrgVO[];
|
}
|
|
/** GET /tenant/organizations/tree 请求参数。 */
|
export interface TenantOrgTreeRequest {
|
/** 传入则返回以该节点为根的子树;不传返回所有根组织。 */
|
orgId?: number;
|
}
|
|
/** GET /tenant/organizations/tree 响应数据(ResultListOrgVO 的 data)。 */
|
export type TenantOrgTreeResponse = OrgVO[];
|
|
/** POST /tenant/organizations 请求体(OrgCreateDTO)。 */
|
export interface TenantOrgCreateRequest {
|
orgName: string;
|
/** 组织类型,默认 DEPT。 */
|
orgType?: OrgType;
|
/** 上级组织 ID,根组织不传。 */
|
parentId?: number;
|
/** 负责人员工 ID。 */
|
leaderId?: number;
|
region?: string;
|
sortOrder?: number;
|
}
|
|
/** POST /tenant/organizations 响应数据(ResultOrgVO 的 data)。 */
|
export type TenantOrgCreateResponse = OrgVO;
|
|
/** PUT /tenant/organizations/{id} 请求参数(路径参数 + OrgCreateDTO)。 */
|
export interface TenantOrgUpdateRequest extends TenantOrgCreateRequest {
|
/** 组织 ID(路径参数)。 */
|
id: number;
|
}
|
|
/** PUT /tenant/organizations/{id} 请求体。 */
|
export type TenantOrgUpdateBody = Omit<TenantOrgUpdateRequest, 'id'>;
|
|
/** PUT /tenant/organizations/{id} 响应数据(ResultOrgVO 的 data)。 */
|
export type TenantOrgUpdateResponse = OrgVO;
|
|
/** DELETE /tenant/organizations/{id} 请求参数。 */
|
export interface TenantOrgDeleteRequest {
|
/** 组织 ID(路径参数)。 */
|
id: number;
|
}
|
|
/** DELETE /tenant/organizations/{id} 响应数据(ResultVoid 的 data)。 */
|
export type TenantOrgDeleteResponse = void;
|
|
/** PUT /tenant/organizations/{id}/toggle-status 请求参数。 */
|
export interface TenantOrgToggleStatusRequest {
|
/** 组织 ID(路径参数)。 */
|
id: number;
|
}
|
|
/** PUT /tenant/organizations/{id}/toggle-status 响应数据(ResultVoid 的 data)。 */
|
export type TenantOrgToggleStatusResponse = void;
|
|
/** GET /tenant/employees 请求参数(负责人下拉远程搜索)。 */
|
export interface TenantEmployeeOptionListRequest {
|
page?: number;
|
size?: number;
|
/** 姓名 / 手机号模糊搜索。 */
|
keyword?: string;
|
}
|
|
/** 负责人选项(EmployeeVO 子集)。 */
|
export interface DepartmentLeaderOption {
|
id: number;
|
name: string;
|
status?: string;
|
}
|
|
/** GET /tenant/employees 响应数据(ResultPageResultEmployeeVO 的 data)。 */
|
export type TenantEmployeeOptionListResponse = PageResult<DepartmentLeaderOption>;
|
|
/** GET /tenant/employees/{id} 请求参数(编辑时回填负责人姓名)。 */
|
export interface DepartmentLeaderDetailRequest {
|
/** 员工 ID(路径参数)。 */
|
id: number;
|
}
|
|
/** GET /tenant/employees/{id} 响应数据(EmployeeVO 子集)。 */
|
export type DepartmentLeaderDetailResponse = DepartmentLeaderOption;
|
|
/** ProTable 筛选参数:组织树接口没有查询参数,这些字段仅用于前端本地过滤。 */
|
export interface DepartmentListQuery {
|
orgName?: string;
|
orgType?: OrgType;
|
status?: 'true' | 'false';
|
}
|
|
/** 新增 / 编辑部门表单值。 */
|
export interface DepartmentFormValues {
|
orgName: string;
|
orgType: OrgType;
|
parentId?: number;
|
leaderId?: number;
|
region?: string;
|
sortOrder?: number;
|
}
|