feat(产品需求): 实现产品需求相关代码。

This commit is contained in:
dk
2026-05-06 17:50:29 +08:00
parent 89cdc62eaa
commit 67ef8af3fa
15 changed files with 3386 additions and 3 deletions

View File

@@ -215,5 +215,214 @@ declare namespace Api {
interface InactiveProductMemberParams {
reason?: string | null;
}
// ========== 产品需求相关类型定义 ==========
/** 需求状态编码 */
type RequirementStatusCode =
| 'pending_confirm'
| 'pending_review'
| 'pending_dispatch'
| 'implementing'
| 'accepted'
| 'closed'
| 'rejected'
| 'cancelled';
/** 需求来源类型 */
type RequirementSourceType = 'manual' | 'work_order';
/** 需求优先级 */
type RequirementPriority = 0 | 1 | 2 | 3;
/** 是否需要评审 */
type RequirementReviewRequired = 0 | 1;
// ========== 需求实体 ==========
interface Requirement {
/** 需求编号 */
id: string;
/** 产品 ID */
productId: string;
/** 父需求编号0表示顶级需求 */
parentId: string;
/** 所属模块编号 */
moduleId: string;
/** 是否需要评审0不需要1需要 */
reviewRequired: RequirementReviewRequired;
/** 需求标题 */
title: string;
/** 需求描述(富文本) */
description?: string | null;
/** 需求分类字典值 */
category: string;
/** 需求分类名称 */
categoryName?: string | null;
/** 来源类型 */
sourceType: RequirementSourceType;
/** 来源业务ID */
sourceBizId?: string | null;
/** 优先级0低 1中 2高 3紧急 */
priority: RequirementPriority;
/** 优先级名称 */
priorityName?: string | null;
/** 当前状态编码 */
statusCode: RequirementStatusCode;
/** 当前状态名称 */
statusName?: string | null;
/** 最近一次状态动作原因 */
lastStatusReason?: string | null;
/** 提出人用户编号 */
proposerId: string;
/** 提出人用户姓名 */
proposerNickname?: string | null;
/** 当前处理人用户编号 */
currentHandlerUserId?: string | null;
/** 当前处理人姓名 */
currentHandlerUserNickname?: string | null;
/** 默认实现项目编号 */
implementProjectId?: string | null;
/** 实现项目名称 */
implementProjectName?: string | null;
/** 预期完成时间 */
completionDate: string;
/** 排序值 */
sort: number;
/** 创建时间 */
createTime: string;
/** 更新时间 */
updateTime: string;
/** 子需求列表(树形结构) */
children?: Requirement[];
/** 是否为终态 */
terminal?: boolean;
}
// ========== 需求模块实体 ==========
interface RequirementModule {
/** 模块编号 */
id: string | undefined;
/** 父模块编号0表示顶级 */
parentId: string | undefined;
/** 所属产品编号 */
productId: string;
/** 模块名称 */
moduleName: string;
/** 模块说明 */
remark?: string | null;
/** 图标 */
icon?: string | null;
/** 排序值 */
sort: number;
/** 子模块列表 */
children?: RequirementModule[];
}
// ========== 需求生命周期 ==========
interface RequirementLifecycleAction {
actionCode: string;
actionName: string;
toStatusCode: string;
toStatusName: string;
needReason: boolean;
}
interface RequirementLifecycleInfo {
statusCode: RequirementStatusCode;
statusName?: string | null;
lastStatusReason?: string | null;
terminal: boolean;
allowEdit: boolean;
availableActions: RequirementLifecycleAction[];
}
// ========== 请求参数类型 ==========
/** 需求分页查询参数 */
type RequirementSearchParams = CommonType.RecordNullable<
Pick<PageParams, 'pageNo' | 'pageSize'> &
Pick<
Requirement,
'moduleId' | 'category' | 'priority' | 'statusCode' | 'currentHandlerUserId' | 'sourceType'
> & {
productId: string;
title?: string;
}
>;
/** 创建需求参数 */
type SaveRequirementParams = Pick<
Requirement,
| 'productId'
| 'moduleId'
| 'reviewRequired'
| 'title'
| 'description'
| 'category'
| 'priority'
| 'proposerId'
| 'currentHandlerUserId'
| 'implementProjectId'
| 'completionDate'
| 'sort'
>;
/** 更新需求参数 */
type UpdateRequirementParams = { id: string } & SaveRequirementParams;
/** 变更需求状态参数 */
interface ChangeRequirementStatusParams {
id: string;
productId: string;
actionCode: string;
reason?: string | null;
implementProjectId?: string | null;
}
/** 关闭需求参数 */
interface CloseRequirementParams {
id: string;
productId: string;
reason: string;
}
/** 拆分需求参数 */
type SplitRequirementParams = Pick<
Requirement,
| 'parentId'
| 'productId'
| 'moduleId'
| 'reviewRequired'
| 'title'
| 'description'
| 'category'
| 'priority'
| 'proposerId'
| 'currentHandlerUserId'
| 'completionDate'
| 'sort'
>;
/** 删除需求参数 */
interface DeleteRequirementParams {
id: string;
productId: string;
}
// ========== 模块请求参数 ==========
/** 保存模块参数 */
type SaveRequirementModuleParams = Pick<
RequirementModule,
'id' | 'productId' | 'parentId' | 'moduleName' | 'remark' | 'icon' | 'sort'
>;
/** 删除模块参数 */
interface DeleteRequirementModuleParams {
id: string | undefined;
productId: string;
}
}
}