一、调研/产品方案/UI设计 - 转交功能: - 未开始/进行中状态可转交给其他参与人员 - 转交按钮打开内联选择器,从 version.members 选人 - 确认后更新 plan.owner 二、关联需求表格增强: - 描述列:超出宽度省略号,hover 显示完整 title 属性 - 需求类型列:原始需求(灰色)/ 变更需求(橙色) - 变更原因列:显示变更原因标签 - 添加日期列:显示 createdAt 三、需求变更功能: - 新增"需求变更"按钮(橙色边框) - 变更表单:变更人员(从参与人员选)、变更原因(6种)、 需求概述、需求详细 - 变更原因选项:需求理解偏差导致返工、反馈导致返工、 实现难度超预期、上游交付延误、范围蔓延、其他 - 创建后自动关联到当前版本,标记为变更需求 四、数据模型扩展(lib/requirement.ts): - 新增 reqType: 'original' | 'change' - 新增 changeReason: ChangeReason - 新增 changeBy: string - 导出 CHANGE_REASON_LABEL 常量 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
119 lines
3.3 KiB
TypeScript
119 lines
3.3 KiB
TypeScript
import type { Priority } from './derive';
|
|
|
|
export type RequirementStatus = 'pending_review' | 'adopted' | 'rejected' | 'planned' | 'developing' | 'testing' | 'released' | 'closed';
|
|
export type Effort = 'S' | 'M' | 'L' | 'XL';
|
|
export type SourceType = 'customer' | 'internal' | 'operation' | 'aftersale' | 'market' | 'competitor' | 'management';
|
|
|
|
export interface DictItem {
|
|
id: string;
|
|
name: string;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface SourceTarget {
|
|
id: string;
|
|
name: string;
|
|
sourceType: SourceType;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface Requirement {
|
|
id: string;
|
|
code: string;
|
|
title: string;
|
|
description: string;
|
|
productId: string;
|
|
projectId: string;
|
|
versionId?: string;
|
|
sourceType: SourceType;
|
|
sourceTarget: string;
|
|
platforms: string[];
|
|
typeId: string;
|
|
status: RequirementStatus;
|
|
priority: Priority;
|
|
effort: Effort;
|
|
currentStage?: string;
|
|
productOwner?: string;
|
|
creator: string;
|
|
createdAt: string;
|
|
parentId?: string;
|
|
addedToVersionBy?: string;
|
|
reqType?: 'original' | 'change';
|
|
changeReason?: ChangeReason;
|
|
changeBy?: string;
|
|
}
|
|
|
|
export type ChangeReason = 'misunderstanding' | 'feedback_rework' | 'difficulty_exceeded' | 'upstream_delay' | 'scope_creep' | 'other';
|
|
|
|
export const CHANGE_REASON_LABEL: Record<ChangeReason, string> = {
|
|
misunderstanding: '需求理解偏差导致返工',
|
|
feedback_rework: '反馈导致返工',
|
|
difficulty_exceeded: '实现难度超预期',
|
|
upstream_delay: '上游交付延误',
|
|
scope_creep: '范围蔓延',
|
|
other: '其他',
|
|
};
|
|
|
|
export const SOURCE_TYPE_LABEL: Record<SourceType, string> = {
|
|
customer: '客户',
|
|
internal: '内部',
|
|
operation: '运营',
|
|
aftersale: '售后',
|
|
market: '市场',
|
|
competitor: '竞品',
|
|
management: '管理层',
|
|
};
|
|
|
|
export const SOURCE_TARGET_LABEL: Record<SourceType, string> = {
|
|
customer: '来源客户',
|
|
internal: '提出部门',
|
|
operation: '提出部门',
|
|
aftersale: '提出部门',
|
|
market: '来源渠道',
|
|
competitor: '竞品名称',
|
|
management: '提出人',
|
|
};
|
|
|
|
export const REQ_STATUS_LABEL: Record<RequirementStatus, string> = {
|
|
pending_review: '待评审',
|
|
adopted: '已采纳',
|
|
rejected: '已拒绝',
|
|
planned: '已规划',
|
|
developing: '开发中',
|
|
testing: '测试中',
|
|
released: '已上线',
|
|
closed: '已关闭',
|
|
};
|
|
|
|
export const REQ_STATUS_COLOR: Record<RequirementStatus, string> = {
|
|
pending_review: 'bg-zinc-100 text-zinc-700 border border-zinc-200',
|
|
adopted: 'bg-emerald-50 text-emerald-700 border border-emerald-200',
|
|
rejected: 'bg-red-50 text-red-600 border border-red-200',
|
|
planned: 'bg-blue-50 text-blue-700 border border-blue-200',
|
|
developing: 'bg-indigo-50 text-indigo-700 border border-indigo-200',
|
|
testing: 'bg-purple-50 text-purple-700 border border-purple-200',
|
|
released: 'bg-emerald-50 text-emerald-700 border border-emerald-200',
|
|
closed: 'bg-zinc-50 text-zinc-500 border border-zinc-200',
|
|
};
|
|
|
|
export const EFFORT_LABEL: Record<Effort, string> = {
|
|
S: 'S (1-2天)',
|
|
M: 'M (3-5天)',
|
|
L: 'L (5-10天)',
|
|
XL: 'XL (10+天)',
|
|
};
|
|
|
|
export const EFFORT_SHORT: Record<Effort, string> = {
|
|
S: 'S',
|
|
M: 'M',
|
|
L: 'L',
|
|
XL: 'XL',
|
|
};
|
|
|
|
export const EFFORT_COLOR: Record<Effort, string> = {
|
|
S: 'bg-emerald-50 text-emerald-700',
|
|
M: 'bg-blue-50 text-blue-700',
|
|
L: 'bg-orange-50 text-orange-700',
|
|
XL: 'bg-red-50 text-red-700',
|
|
};
|