feat(版本详情): 完善流程日志与需求覆盖
This commit is contained in:
@@ -18,7 +18,7 @@ import { VersionStatus, VERSION_STATUS_LABEL, VERSION_STATUS_BG } from '@/lib/ve
|
||||
import { STATUS_PROGRESS, calcGroupProgress as calcDevTaskProgress, getEstimateHours, aggregateDevTaskHours } from '@/lib/dev-task';
|
||||
import { CapsuleStages } from '@/components/version/CapsuleStages';
|
||||
import { MemberChips } from '@/components/version/MemberChips';
|
||||
import type { VersionPlan } from '@/lib/version-plan';
|
||||
import { getRequirementCoverageSummary, type VersionPlan } from '@/lib/version-plan';
|
||||
import type { DevTask } from '@/lib/dev-task';
|
||||
import type { TestCase } from '@/lib/test-case';
|
||||
import type { Bug } from '@/lib/bug';
|
||||
@@ -139,13 +139,12 @@ function VersionCard({ version, progress, plans, devTasks, testCases, bugs, requ
|
||||
if (p.status === 'completed') doneItems += count;
|
||||
else doneItems += tasks.filter((t) => t.status === 'completed').length;
|
||||
} else {
|
||||
const linked = p.linkedRequirementIds || [];
|
||||
const count = Math.max(linked.length, 1);
|
||||
const summary = getRequirementCoverageSummary(p);
|
||||
const count = Math.max(summary.total, 1);
|
||||
totalItems += count;
|
||||
if (p.status === 'completed') doneItems += count;
|
||||
else {
|
||||
const completed = p.completedRequirementIds || [];
|
||||
doneItems += completed.filter((id) => linked.includes(id)).length;
|
||||
doneItems += summary.completed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -411,10 +410,9 @@ export default function ProjectDetailPage() {
|
||||
const productPlans = vPlans.filter((p) => p.type === 'product');
|
||||
if (productPlans.length > 0) {
|
||||
const totals = productPlans.reduce((acc, p) => {
|
||||
const linked = p.linkedRequirementIds || [];
|
||||
const completed = p.completedRequirementIds || [];
|
||||
acc.total += linked.length;
|
||||
acc.done += completed.filter((id) => linked.includes(id)).length;
|
||||
const summary = getRequirementCoverageSummary(p);
|
||||
acc.total += summary.total;
|
||||
acc.done += summary.completed;
|
||||
return acc;
|
||||
}, { total: 0, done: 0 });
|
||||
segments.push(totals.total > 0 ? (totals.done / totals.total) * 100 : 0);
|
||||
@@ -423,10 +421,9 @@ export default function ProjectDetailPage() {
|
||||
const uiPlans = vPlans.filter((p) => p.type === 'ui');
|
||||
if (uiPlans.length > 0) {
|
||||
const totals = uiPlans.reduce((acc, p) => {
|
||||
const linked = p.linkedRequirementIds || [];
|
||||
const completed = p.completedRequirementIds || [];
|
||||
acc.total += linked.length;
|
||||
acc.done += completed.filter((id) => linked.includes(id)).length;
|
||||
const summary = getRequirementCoverageSummary(p);
|
||||
acc.total += summary.total;
|
||||
acc.done += summary.completed;
|
||||
return acc;
|
||||
}, { total: 0, done: 0 });
|
||||
segments.push(totals.total > 0 ? (totals.done / totals.total) * 100 : 0);
|
||||
|
||||
@@ -32,6 +32,7 @@ import { getProjectAdoptedRequirementCandidates } from '@/lib/requirement-select
|
||||
import { calcBugSeverityRanking, calcPersonalEffortRanking, calcStageEffortMetrics, calcVersionOverviewEffortTotals } from '@/lib/version-overview';
|
||||
import { addVersionMembers, DEFAULT_VERSION_MEMBER_ROLE, filterVersionMemberCandidates } from '@/lib/version-members';
|
||||
import { addRecommendedVersionMembers, getDefaultRecommendedMemberNames, recommendVersionMembers, type MemberRecommendationGroup, type RecommendableRole } from '@/lib/member-recommendation';
|
||||
import { getRequirementCoverageSummary } from '@/lib/version-plan';
|
||||
|
||||
function formatOverviewDateTime(value?: string | null): string {
|
||||
if (!value) return '-';
|
||||
@@ -369,14 +370,13 @@ export default function VersionDetailPage() {
|
||||
doneItems += tasks.filter((t) => t.status === 'completed').length;
|
||||
}
|
||||
} else {
|
||||
const linked = p.linkedRequirementIds || [];
|
||||
const count = Math.max(linked.length, 1);
|
||||
const summary = getRequirementCoverageSummary(p);
|
||||
const count = Math.max(summary.total, 1);
|
||||
totalItems += count;
|
||||
if (p.status === 'completed') {
|
||||
doneItems += count;
|
||||
} else {
|
||||
const completed = p.completedRequirementIds || [];
|
||||
doneItems += completed.filter((id) => linked.includes(id)).length;
|
||||
doneItems += summary.completed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user