feat 完善注释

This commit is contained in:
Ironsp
2026-10-01 17:24:57 +08:00
parent 2b59f68fd7
commit 9f4a5c7cda
183 changed files with 485 additions and 3615 deletions

View File

@@ -7,19 +7,12 @@ interface Props {
const props = defineProps<Props>()
/** 三态 → 修饰类(设计稿:已完成=绿实心+白勾 / 进行中=白底粗蓝环 / 待开始=白底灰环) */
function stateClass(status: Milestone['status']): string {
if (status === '已完成') return 'is-done'
if (status === '进行中') return 'is-active'
return 'is-pending'
}
/**
* 连接线是否走「已完成」的绿色。
*
* <p>设计稿实测:只有<b>下一个节点已完成</b>时该段才是绿色(第二个节点已完成 → 第 1 段绿;
* 第三个节点进行中 → 第 2 段仍是灰色,不随「进行中」变蓝)。</p>
*/
function linkDone(index: number): boolean {
return props.milestones[index + 1]?.status === '已完成'
}
@@ -49,7 +42,6 @@ function linkDone(index: number): boolean {
</svg>
</span>
<span class="project-milestones__name">{{ node.name }}</span>
<!-- 设计稿:已完成节点显示完成时间,其余显示状态文案 -->
<span class="project-milestones__sub">{{ node.time || node.status }}</span>
</li>
</ol>
@@ -61,9 +53,6 @@ function linkDone(index: number): boolean {
</template>
<style lang="less" scoped>
// 设计稿实测(1920,1:1;5865c6d9 −14 基准 ⇒ 统一后 +14):
// 标题 ink 471 15/700;首列中心 x261(步距 356)、已完成实心点 26(x235..261,顶 y509);
// 连接线 356×3(y520);名称 ink 541 12;说明 ink 561 10;待开始线 #E5E7EB、已完成 #22C55E。
@milestone-dot: 26px;
@milestone-line-h: 3px;
@@ -73,7 +62,7 @@ function linkDone(index: number): boolean {
&__title {
.section-title();
margin-top: 35px; // 起止时间盒底 433 → 标题盒 468
margin-top: 35px;
padding-left: 12px;
font-size: 15px;
font-weight: 700;
@@ -85,11 +74,10 @@ function linkDone(index: number): boolean {
}
}
// 起止时间盒底 433 → 「项目进度(里程碑)」盒 468(ink 471)→ 圆点顶 509
&__track {
.flex(row, flex-start, flex-start);
margin-top: 0;
padding-top: 21px; // 标题盒底 488 → 圆点顶 509
padding-top: 21px;
padding-bottom: 0;
overflow-x: auto;
.scrollbar();
@@ -101,13 +89,12 @@ function linkDone(index: number): boolean {
flex: 0 0 @milestone-node;
min-width: 0;
// 连接线:y506(圆点顶 495 起第 11px),x248 → 604(下一节点 x426 起 178 宽)
&:not(:last-child)::after {
content: '';
position: absolute;
top: (@milestone-dot / 2 - @milestone-line-h / 2); // 13 − 1.5 = 11.5
left: calc(50% + 13px); // 261 → 248 再 +13 = 当前中心 +13
width: @milestone-node; // 覆盖到下一节点左缘
left: calc(50% + 13px);
width: @milestone-node;
height: @milestone-line-h;
background: @milestone-ring;
}
@@ -128,7 +115,6 @@ function linkDone(index: number): boolean {
background: @white;
box-sizing: border-box;
// 已完成:实心绿点(设计 (235,495) 26×26,勾白 11)
.is-done & {
border-color: @milestone-done;
background: @milestone-done;
@@ -145,7 +131,6 @@ function linkDone(index: number): boolean {
height: 11px;
}
// 圆点底 521 → 名称顶 527(12px 字 line-height 16)
&__name {
margin-top: 6px;
max-width: calc(@milestone-node - 16px);
@@ -166,7 +151,6 @@ function linkDone(index: number): boolean {
}
}
// 名称底 543 → 说明顶 547(10px 字 line-height 14)
&__sub {
margin-top: 4px;
max-width: calc(@milestone-node - 16px);