# Conflicts:
#	src/service/api/product.ts
#	src/service/api/project.ts
#	src/typings/api/project.d.ts
This commit is contained in:
dk
2026-05-13 21:20:59 +08:00
59 changed files with 8046 additions and 919 deletions

View File

@@ -68,10 +68,10 @@ declare namespace Api {
type ProjectExecutionActionCode = 'start' | 'pause' | 'resume' | 'cancel';
/** 任务状态编码 */
type ProjectTaskStatusCode = 'pending' | 'active' | 'blocked' | 'completed' | 'cancelled';
type ProjectTaskStatusCode = 'pending' | 'active' | 'paused' | 'completed' | 'cancelled';
/** 任务动作编码 */
type ProjectTaskActionCode = 'start' | 'block' | 'resume' | 'complete' | 'cancel';
type ProjectTaskActionCode = 'auto_start' | 'pause' | 'resume' | 'complete' | 'cancel';
interface LifecycleAction<ActionCode extends string = string> {
actionCode: ActionCode;
@@ -116,7 +116,7 @@ declare namespace Api {
updateTime: string;
}
interface ExecutionMember {
interface ExecutionAssignee {
id: string;
executionId: string;
userId: string;
@@ -126,14 +126,14 @@ declare namespace Api {
removedReason: string | null;
}
/** 执行成员变更事件类型 */
type ExecutionMemberActionType = 'join' | 'inactive' | 'owner_transfer_in' | 'owner_transfer_out';
/** 执行协办人变更事件类型 */
type ExecutionAssigneeActionType = 'join' | 'inactive' | 'owner_transfer_in' | 'owner_transfer_out';
/** 执行成员变更历史 */
interface ExecutionMemberLog {
/** 执行协办人变更历史 */
interface ExecutionAssigneeLog {
id: string;
executionId: string;
actionType: ExecutionMemberActionType;
actionType: ExecutionAssigneeActionType;
userId: string;
userNicknameSnapshot: string | null;
operatorUserId: string;
@@ -142,15 +142,72 @@ declare namespace Api {
reason: string | null;
}
type ExecutionMemberLogSearchParams = CommonType.RecordNullable<
type ExecutionAssigneeLogSearchParams = CommonType.RecordNullable<
Pick<PageParams, 'pageNo' | 'pageSize'> & {
actionTypes: ExecutionMemberActionType[];
actionTypes: ExecutionAssigneeActionType[];
userId: string;
startTime: string;
endTime: string;
}
>;
/** 通用附件元数据(任务 / 工时等域共用,规则见 AttachmentValidator */
interface AttachmentItem {
/**
* 文件 IDinfra_file.id 字符串形式)。
* 用于会话级清理时调用 DELETE /system/file/delete?id=xxx 删除孤儿文件。
*/
fileId: string;
url: string;
name: string;
size?: number;
contentType?: string;
}
/** 任务详情 / 分页响应里嵌入的活跃协办人引用(按加入时间正序) */
interface TaskAssigneeRef {
id: string;
userId: string;
nickname: string;
/** 加入时间5.6 路径返5.3 嵌入路径不返,留 undefined */
joinedAt?: string | null;
}
/** 协办人变更事件类型5.9 actionType */
type TaskAssigneeActionType = 'join' | 'inactive';
/** 协办人变更日志 */
interface TaskAssigneeLog {
id: string;
taskId: string;
actionType: TaskAssigneeActionType;
userId: string;
userNicknameSnapshot: string | null;
operatorUserId: string;
operatorNicknameSnapshot: string | null;
actionTime: string;
reason: string | null;
}
type TaskAssigneeLogSearchParams = CommonType.RecordNullable<
Pick<PageParams, 'pageNo' | 'pageSize'> & {
actionTypes: TaskAssigneeActionType[];
userId: string;
startTime: string;
endTime: string;
}
>;
/** 5.7 加入协办人入参 */
interface CreateTaskAssigneeParams {
userId: string;
}
/** 5.8 退出协办人入参 */
interface InactiveTaskAssigneeParams {
reason: string;
}
interface ProjectTask {
id: string;
projectId: string;
@@ -159,6 +216,10 @@ declare namespace Api {
taskTitle: string;
ownerId: string;
ownerNickname?: string | null;
/** 所属执行的负责人 userId按钮可见度公式用 */
executionOwnerId: string;
/** 父任务负责人 userId一级任务为 null */
parentTaskOwnerId: string | null;
statusCode: ProjectTaskStatusCode;
statusName: string | null;
terminal: boolean;
@@ -171,6 +232,10 @@ declare namespace Api {
actualEndDate: string | null;
taskDesc: string | null;
lastStatusReason: string | null;
assignees?: TaskAssigneeRef[] | null;
attachments?: AttachmentItem[] | null;
/** 已填报工时合计单位小时0.5 颗粒BigDecimal。逻辑删除的工时不计入。 */
totalSpentHours?: number | null;
createTime: string;
updateTime: string;
}
@@ -192,7 +257,8 @@ declare namespace Api {
updateTime: string[];
}>;
interface SaveProjectExecutionParams {
/** 创建执行入参(含 ownerId + assigneeUserIds */
interface CreateProjectExecutionParams {
executionName: string;
executionType: string;
ownerId: string;
@@ -200,7 +266,20 @@ declare namespace Api {
plannedStartDate: string | null;
plannedEndDate: string | null;
executionDesc: string | null;
memberUserIds?: string[];
assigneeUserIds?: string[];
}
/** 执行创建/编辑弹层 emit 的统一 payload创建时含 ownerId + assigneeUserIds编辑时不含 */
type SaveProjectExecutionParams = CreateProjectExecutionParams;
/** 编辑执行入参(不含 ownerId / assigneeUserIds */
interface UpdateProjectExecutionParams {
executionName: string;
executionType: string;
projectRequirementId: string | null;
plannedStartDate: string | null;
plannedEndDate: string | null;
executionDesc: string | null;
}
interface ChangeExecutionOwnerParams {
@@ -213,11 +292,11 @@ declare namespace Api {
reason: string | null;
}
interface CreateExecutionMemberParams {
interface CreateExecutionAssigneeParams {
userId: string;
}
interface InactiveExecutionMemberParams {
interface InactiveExecutionAssigneeParams {
reason: string;
}
@@ -246,8 +325,10 @@ declare namespace Api {
plannedStartDate: string | null;
plannedEndDate: string | null;
taskDesc: string | null;
/** 仅创建任务时生效编辑接口静默忽略userId 必须是当前有效执行成员且不能等于 ownerId */
/** 仅创建任务时生效编辑接口静默忽略userId 必须是当前有效执行协办人且不能等于 ownerId */
assigneeUserIds?: string[];
/** 编辑语义null 保留原值 / [] 清空 / [...] 整体替换 */
attachments?: AttachmentItem[] | null;
}
interface ChangeTaskStatusParams {
@@ -255,6 +336,48 @@ declare namespace Api {
reason: string | null;
}
/** 任务工时记录 */
interface TaskWorklog {
id: string;
taskId: string;
userId: string;
userNickname: string | null;
/** 段起始日期YYYY-MM-DD单天=与 endDate 相等 */
startDate: string;
/** 段结束日期YYYY-MM-DD单天=与 startDate 相等 */
endDate: string;
/** 本次填报小时数BigDecimal0.5 颗粒,> 0 */
durationHours: number;
/** 本次填报进度0~100scale=2 */
progressRate: number;
workContent: string | null;
attachments?: AttachmentItem[] | null;
createTime: string;
updateTime: string;
}
type TaskWorklogSearchParams = CommonType.RecordNullable<
Pick<PageParams, 'pageNo' | 'pageSize'> & {
userId: string;
startDate: string;
endDate: string;
}
>;
interface SaveTaskWorklogParams {
/** 段起始日期YYYY-MM-DD */
startDate: string;
/** 段结束日期YYYY-MM-DD不得早于 startDate */
endDate: string;
/** 本次填报小时数,> 0 且 0.5 整数倍 */
durationHours: number;
/** 本次填报进度0~100scale=2必填 */
progressRate: number;
workContent?: string | null;
/** 编辑语义null 保留原值 / [] 清空 / [...] 替换 */
attachments?: AttachmentItem[] | null;
}
/** 项目设置参数 */
interface ProjectSettings {
baseInfo: ProjectSettingBaseInfo;
@@ -424,6 +547,26 @@ declare namespace Api {
reason: string;
}
/** 删除执行入参 */
interface DeleteProjectExecutionParams {
/** 二次确认:必须与当前执行名称完全一致 */
executionName: string;
/** 删除确认口令:接受 "删除" 或 "DELETE" */
confirmText: string;
/** 删除原因,写入审计日志 */
reason: string;
}
/** 删除任务入参 */
interface DeleteProjectTaskParams {
/** 二次确认:必须与当前任务名称完全一致 */
taskName: string;
/** 删除确认口令:接受 "删除" 或 "DELETE" */
confirmText: string;
/** 删除原因,写入审计日志 */
reason: string;
}
/** 创建项目成员参数 */
interface CreateProjectMemberParams {
userId: string;
@@ -447,6 +590,16 @@ declare namespace Api {
reason: string | null;
}
/**
* 项目创建(含初始团队)原子接口参数
*
* 新增项目两步向导提交的载荷。经理成员也由前端聚合到 members 数组中。
*/
interface CreateProjectWithTeamParams {
project: SaveProjectParams;
members: CreateProjectMemberParams[];
}
// ========== 项目需求相关类型定义 ==========
/** 项目需求状态编码 */
type ProjectRequirementStatusCode =