feat: 实现需求管理、加班记录、成员/角色管理模块
- 需求模块:完整 CRUD、状态流转(采纳/拒绝/关闭)、详情抽屉、产品→项目级联选择 - 加班记录:产品→项目→版本三级联动、月份筛选(MonthPicker)、CSV 导出 - 成员管理:左右布局(部门树+成员列表)、手机号脱敏、初始密码自动生成及规则设置 - 角色管理:卡片列表、系统角色保护、CRUD - 通用组件:FilterSelect 下拉、MonthPicker 月份选择器、Pagination 分页 - 样式统一:状态标签加 border、日期输入现代化、筛选组件风格一致 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,25 @@
|
||||
import { VersionStatus } from './version-status';
|
||||
import type { Stage, Role } from './stage';
|
||||
|
||||
interface VersionMember {
|
||||
export interface VersionMember {
|
||||
role: Role;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface RoleProgress {
|
||||
export interface RoleProgress {
|
||||
role: Role;
|
||||
percent: number;
|
||||
daysSpent: number;
|
||||
}
|
||||
|
||||
export type Priority = 'P0' | 'P1' | 'P2' | 'P3' | 'P4';
|
||||
|
||||
export interface VersionLinks {
|
||||
research?: string;
|
||||
prototype?: string;
|
||||
ui?: string;
|
||||
}
|
||||
|
||||
interface ProductOverviewLike {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -20,6 +28,7 @@ interface ProductOverviewLike {
|
||||
id: string; name: string; status?: string; releaseDate: string | null; createdAt: string;
|
||||
currentStage?: Stage; startDate?: string | null; expectedReleaseDate?: string | null;
|
||||
members?: VersionMember[]; progress?: RoleProgress[];
|
||||
priority?: Priority; links?: VersionLinks;
|
||||
}[];
|
||||
}
|
||||
|
||||
@@ -41,12 +50,15 @@ export interface VersionWithContext {
|
||||
createdAt: string;
|
||||
productId: string;
|
||||
productName: string;
|
||||
projectId: string;
|
||||
projectName: string;
|
||||
currentStage?: Stage;
|
||||
startDate?: string | null;
|
||||
expectedReleaseDate?: string | null;
|
||||
members?: VersionMember[];
|
||||
progress?: RoleProgress[];
|
||||
priority?: Priority;
|
||||
links?: VersionLinks;
|
||||
}
|
||||
|
||||
export function flattenProjects(overview: ProductOverviewLike[]): ProjectWithContext[] {
|
||||
@@ -60,6 +72,7 @@ export function flattenProjects(overview: ProductOverviewLike[]): ProjectWithCon
|
||||
status: (v.status || 'released') as VersionStatus,
|
||||
productId: product.id,
|
||||
productName: product.name,
|
||||
projectId: project.id,
|
||||
projectName: project.name,
|
||||
}));
|
||||
result.push({
|
||||
@@ -85,6 +98,7 @@ export function flattenVersions(overview: ProductOverviewLike[]): VersionWithCon
|
||||
status: (version.status || 'released') as VersionStatus,
|
||||
productId: product.id,
|
||||
productName: product.name,
|
||||
projectId: project?.id || '',
|
||||
projectName: project?.name || '未关联',
|
||||
});
|
||||
}
|
||||
@@ -96,3 +110,8 @@ export function getProjectDetail(overview: ProductOverviewLike[], projectId: str
|
||||
const projects = flattenProjects(overview);
|
||||
return projects.find((p) => p.id === projectId) || null;
|
||||
}
|
||||
|
||||
export function getVersionDetail(overview: ProductOverviewLike[], versionId: string): VersionWithContext | null {
|
||||
const versions = flattenVersions(overview);
|
||||
return versions.find((v) => v.id === versionId) || null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user