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,9 +7,7 @@ import type { FileInfo } from '@/types/api'
import type { AfterSales, ProjectStatus } from '@/types/business/project'
interface Props {
/** 售后工单;`undefined` 或 `status === '无'` 表示没有进行中的工单 */
afterSales?: AfterSales
/** 项目状态 —— 决定售后区的三态展示(见下方模板注释) */
projectStatus: ProjectStatus
}
@@ -22,25 +20,10 @@ const emit = defineEmits<{
const ossStore = useOssStore()
/**
* 售后页签的三态(设计稿便签原文):
* 1. 项目**未完成** → 不展示售后信息;
* 2. 已完成 + **未提交**售后 → 内容为空,只给「申请售后」;
* 3. 已完成 + **已提交**售后 → 展示售后信息 + 「取消售后」。
*
* <p>「已完成」按详情页状态口径判定(后端 `COMPLETED` 经 projectVo 映射成「已完成」)。
* 后端 `requestAfterSale` 也会校验这一点,前端只是提前把入口藏掉。</p>
*/
const isCompleted = computed(() => props.projectStatus === '已完成')
/** 存在进行中的售后工单(撤回后的记录在映射层已归为「无」) */
const hasTicket = computed(() => props.afterSales?.status === '处理中')
/**
* 预览 / 下载直接走附件自身的 OSS 地址(后端下发的 `url` 就是可访问地址);
* 删除没有接口 —— 售后附件只在「申请 / 完成售后」时整体写入,不支持单独删。
*/
function previewFile(file: FileInfo): void {
// 同源预览:有 ossId 走后端 inline 接口,绕开 OSS 桶「强制下载」
ossStore.openPreview(file)
}
@@ -67,16 +50,13 @@ function onDeleteFile(): void {
<template>
<section class="project-after-sales">
<!-- 规则 1:项目未完成 → 不展示售后信息 -->
<div v-if="!isCompleted" class="project-after-sales__blank">
<p class="project-after-sales__blank-text text-secondary">
项目完成后可申请售后
</p>
</div>
<!-- 规则 3:已完成 + 已提交售后 → 工单横幅 + 售后信息 + 取消售后 -->
<template v-else-if="hasTicket && afterSales">
<!-- 设计 10:整宽浅红提示横幅,只有标题 + 说明两行,无图标 -->
<div class="project-after-sales__banner">
<div class="project-after-sales__banner-text">
<h3 class="project-after-sales__banner-title">
@@ -133,7 +113,6 @@ function onDeleteFile(): void {
</div>
</template>
<!-- 规则 2:已完成 + 未提交售后 → 内容为空 + 申请售后 -->
<template v-else>
<div class="project-after-sales__blank">
<p class="project-after-sales__blank-text text-secondary">
@@ -153,24 +132,16 @@ function onDeleteFile(): void {
</template>
<style lang="less" scoped>
// 设计稿实测(1920,1:1):横幅 (70,342) 1780×96 底 #FDEEEE;
// 标题 (96,367.5) 17/700 #D93025;说明 (96,395.5) 13/400 #4B5563;
// 区块标题 (82,468) 15/700;字段标签 (63.5,508) 13/500 #1F2937(整行铺满 → 实际落 x70);
// 只读框 (70,533) 1780×39 底 #F3F4F6 描边 #DDE1E7;文本域 (70,615) 1780×130;
// 附件标题 (70,768.5) 13/500 + 提示 (149,769.5) 11/400 #9CA3AF + 「上传文档」(1801.4,769) 12/500;
// 文件行 (70,805) 1780×55 #F7F8FA;操作 (1628,968)/(1754,968) 15/500 白字 —— 底部按钮。
.project-after-sales {
.flex(column, flex-start, stretch);
padding: 0;
// ── 顶部工单横幅 ──
// 页签分割线 317 → 横幅顶 342(25)
&__banner {
.flex(row, flex-start, center);
height: 96px;
box-sizing: border-box;
margin-top: 25px;
padding-left: 26px; // 文字 x96 = 内容区 x70 + 26
padding-left: 26px;
border-radius: 0;
background: @project-banner-soft;
}
@@ -180,7 +151,6 @@ function onDeleteFile(): void {
min-width: 0;
}
// 横幅标题 17/700,行高 22(顶 367.5 = 横幅 342 + 25.5)
&__banner-title {
margin: 0;
padding-top: 0;
@@ -190,7 +160,6 @@ function onDeleteFile(): void {
color: @project-banner-title;
}
// 说明 13/400(顶 395.5 = 标题底 389.5 + 6)
&__banner-desc {
margin-top: 6px;
font-size: 13px;
@@ -199,11 +168,10 @@ function onDeleteFile(): void {
color: @project-cell;
}
// ── 「售后信息」区块标题 ──
&__title {
.section-title();
margin-top: 0;
padding-left: 12px; // 文字落 x82
padding-left: 12px;
font-size: 15px;
font-weight: 700;
line-height: 20px;
@@ -214,35 +182,28 @@ function onDeleteFile(): void {
}
}
// 横幅底 438 → 标题 468;标题底 488 → 字段。
// 后代表达式:紧邻横幅的标题额外上抬 —— 用统一节距表达(见下方 padding)
&__banner + &__title {
margin-top: 30px;
}
// 标题盒底 484.5 → 首标签盒顶 505(20.5)
&__title + &__field {
margin-top: 20.5px;
}
&__field {
.flex(column, flex-start, stretch);
gap: 5px; // 标签盒底 528 → 只读框顶 533
gap: 5px;
}
// 框底 → 下一标签盒顶:ro1 底 572 → 标签2 586.5(14.5);ro2 底 745 → 标签3 765(20)
&__field + &__field {
margin-top: 14.5px;
}
// 第三个字段(附件)上距略大:设计 ro2 底 745 → 标签3 768.5
// 注意:字段在 section 里是第 3/4/5 个子元素(前面还有 banner、title),所以是 nth-child(5)
&__field:nth-child(5) {
margin-top: 23px;
gap: 20px; // 标签行盒底 785 → 首行附件 805
gap: 20px;
}
// 设计:标签与提示同行
&__field-head {
.flex(row, flex-start, center);
gap: 14px; // 149 − (70+65) = 14
@@ -254,7 +215,6 @@ function onDeleteFile(): void {
color: @project-muted;
}
// 字段标签 13/500
&__label {
font-size: 13px;
font-weight: 500;
@@ -262,11 +222,10 @@ function onDeleteFile(): void {
color: @project-ink;
}
// 只读展示:设计 1780×39、底 #F3F4F6、描边 1px #DDE1E7、圆角 8
&__readonly {
.flex(row, flex-start, center);
min-height: 39px;
padding: 0 13px; // 值 x83 = 内容区 70 + 13
padding: 0 13px;
border: 1px solid @project-input-border;
border-radius: 8px;
background: @project-field-bg;
@@ -299,7 +258,6 @@ function onDeleteFile(): void {
font-size: @font-size-body;
}
// 末行附件 925(870+55)→ 按钮盒顶 955(30)
&__actions {
.flex(row, flex-end, center);
gap: 42px; // 1754 − (1628+84) = 42
@@ -337,7 +295,6 @@ function onDeleteFile(): void {
}
}
// 附件行:公共 FileList 外观覆写(设计 1780×55、底 #F7F8FA、圆角 8)
:deep(.file-list) {
gap: 10px;
}

View File

@@ -8,7 +8,6 @@ interface Props {
defineProps<Props>()
// ⚠️ 详情页只「展示」文件,不提供上传入口(上传在需求提报页)。
const emit = defineEmits<{
delete: [index: number]
preview: [index: number]
@@ -18,8 +17,6 @@ const emit = defineEmits<{
<template>
<section class="project-files">
<!-- 设计稿(785b3eb8)本页签**没有区块标题**,文件行直接起于分割线下方 24px;
标题只保留给读屏,视觉隐藏。 -->
<h2 class="project-files__title">
项目文件
</h2>
@@ -59,14 +56,10 @@ const emit = defineEmits<{
</template>
<style lang="less" scoped>
// 设计稿实测(1920,1:1):无区块标题,文件行直接起于 (70,342);
// 行 1780×55 底 #F7F8FA、接缝 10;类型徽标 (87,352) 33×21;文件名 (130,352) 13px;
// 副行 (130,372) 11px #9CA3AF;操作 (1748,361) 12px #6B7280(预览 / 下载),右缘 x1845。
.project-files {
.flex(column, flex-start, stretch);
padding: 0;
// 设计稿无可见标题:仅读屏可读(不占位)
&__title {
position: absolute;
width: 1px;
@@ -81,16 +74,15 @@ const emit = defineEmits<{
&__list {
.flex(column, flex-start, stretch);
gap: 10px;
margin-top: 24px; // 分割线 317 → 首行顶 342(785b3eb8)
margin-top: 24px;
}
// 整行通铺 #F7F8FA、圆角 8,行高 55(内容 35 + 上下 10)
&__item {
.flex(row, space-between, center);
gap: @spacing-base;
height: 55px;
box-sizing: border-box;
padding: 0 5.6px 0 17px; // 徽标左缘 87 = 内容区 70 + 17;操作右缘 1845 = 1850 − 5
padding: 0 5.6px 0 17px;
border-radius: 8px;
background: @finance-row-bg;
}
@@ -117,7 +109,7 @@ const emit = defineEmits<{
&__actions {
.flex(row, flex-end, center);
gap: 14px; // 1748.39 → 1805.33 实测节距 57/40 → 用文字宽 + 14
gap: 14px;
flex-shrink: 0;
}

View File

@@ -3,20 +3,8 @@ import { computed, ref } from 'vue'
import { PROJECT_STATUS_LABEL, PROJECT_STATUS_OPTIONS, PROJECT_TIME_OPTIONS } from '@/utils/projectMeta'
import type { ProjectQuery, ProjectTypeCount } from '@/types/business/project'
/**
* 项目中心左侧筛选栏(按项目中心设计稿还原)。
*
* <p>⚠️ 业务类型的**值域、文案、件数全部来自 store**(`typeCounts` ← `GET /web/requirementPool/getFilterConditions`
* 的 `businessTypeCounts`,全量口径),组件内不定义业务值域;
* 只有后端未下发的组(项目状态 / 提交时间)才用 `utils/projectMeta.ts` 里的前端常量。</p>
*
* <p>「不限」统一用**空值**表示(不是 'all'):业务类型用空数组、其余用空串,
* 都不会出现在 querystring 里,正好对上后端「有值才匹配」的语义。</p>
*/
interface Props {
query: ProjectQuery
/** 当前筛选命中的项目数(确定筛选按钮上的「N个结果」) */
total: number
typeCounts: ProjectTypeCount[]
}
@@ -34,7 +22,6 @@ const emit = defineEmits<{
reset: []
}>()
/** 自选时间区间是否展开(设计稿只给了按钮态,展开后是两个原生日期输入) */
const rangeOpen = ref(false)
const rangeLabel = computed(() => {
@@ -45,7 +32,6 @@ const rangeLabel = computed(() => {
const chips = computed<Chip[]>(() => {
const list: Chip[] = []
// 业务类型是**多选**:每个已选类型各出一个 chip,key 带 id 以便单独移除
props.query.businessTypes.forEach((value) => {
const found = props.typeCounts.find((item) => item.value === value)
list.push({ key: `businessType:${value}`, label: found?.label ?? value })
@@ -67,14 +53,12 @@ function patch(partial: Partial<ProjectQuery>): void {
emit('update:query', { ...props.query, ...partial })
}
/** 业务类型行是否处于选中态(「全部」= 一个都没勾) */
function isTypeSelected(value: string): boolean {
return value === 'all'
? props.query.businessTypes.length === 0
: props.query.businessTypes.includes(value)
}
/** 业务类型多选切换:点「全部」清空,点具体行按勾选状态增删(后端口径是 IN,多选即并集) */
function onToggleType(value: string): void {
if (value === 'all') {
patch({ businessTypes: [] })
@@ -88,13 +72,11 @@ function onToggleType(value: string): void {
})
}
/** 快捷区间与自选区间互斥:点快捷区间会清掉自选日期 */
function onPickShortcut(value: ProjectQuery['timeShortcut']): void {
rangeOpen.value = false
patch({ timeShortcut: value, startDate: '', endDate: '' })
}
/** 选了自选日期就把快捷区间复位(避免两组条件同时生效) */
function onPickDate(partial: { startDate?: string; endDate?: string }): void {
patch({ timeShortcut: 'all', ...partial })
}
@@ -127,7 +109,6 @@ function onClearChips(): void {
筛选条件
</h2>
<!-- 业务类型:**多选**(值域 / 件数均来自后端统计;「全部」= 清空选择,可单选或多选) -->
<section class="project-filter__group">
<h3 class="project-filter__group-title">
业务类型
@@ -148,7 +129,6 @@ function onClearChips(): void {
</ul>
</section>
<!-- 项目状态:2 列胶囊网格 -->
<section class="project-filter__group">
<h3 class="project-filter__group-title">
项目状态
@@ -167,7 +147,6 @@ function onClearChips(): void {
</div>
</section>
<!-- 提交时间:快捷区间 + 自选区间 -->
<section class="project-filter__group">
<h3 class="project-filter__group-title">
提交时间
@@ -211,7 +190,6 @@ function onClearChips(): void {
</div>
</section>
<!-- 已选条件 -->
<section class="project-filter__chips">
<div class="project-filter__chips-head">
<span class="project-filter__chips-title">已选条件({{ chips.length }}个)</span>
@@ -237,7 +215,6 @@ function onClearChips(): void {
</div>
</section>
<!-- 底部操作 -->
<div class="project-filter__actions">
<button
type="button"
@@ -259,7 +236,6 @@ function onClearChips(): void {
<style lang="less" scoped>
.project-filter {
// 左栏固定宽(设计稿实测 313 / 卡片间距 17 / 容器 1353)
flex: 0 0 313px;
padding: 20px 28px 24px;
border-radius: @radius-base;
@@ -287,7 +263,6 @@ function onClearChips(): void {
color: @heading-color;
}
// ── 业务类型列表 ──
&__list {
display: flex;
flex-direction: column;
@@ -324,7 +299,6 @@ function onClearChips(): void {
background: @white;
transition: background-color 0.2s, border-color 0.2s;
// 勾:用两条边框旋转 45° 画出来,不引额外图标
&::after {
content: '';
position: absolute;
@@ -339,7 +313,6 @@ function onClearChips(): void {
}
}
// 选中行:方框实心主色 + 白色勾(多选下每行独立显隐)
&__row.is-active &__box {
border-color: @primary-color;
background: @primary-color;
@@ -362,7 +335,6 @@ function onClearChips(): void {
color: @text-color;
}
// ── 胶囊网格(项目状态 / 提交时间)──
&__grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -392,7 +364,6 @@ function onClearChips(): void {
}
}
// ── 自选日期区间(点开后才出现)──
&__range {
.flex(row, space-between, center);
margin-top: 9px;
@@ -415,7 +386,6 @@ function onClearChips(): void {
color: @text-color-secondary;
}
// ── 已选条件 ──
&__chips {
margin-top: 18px;
padding: 12px;
@@ -466,7 +436,6 @@ function onClearChips(): void {
margin-left: 4px;
}
// ── 底部操作 ──
&__actions {
.flex(row, space-between, center);
margin-top: 16px;

View File

@@ -18,28 +18,16 @@ const emit = defineEmits<{
download: [file: FileInfo]
}>()
/**
* 是否可跳收银台支付。
*
* <p>用「待支付 + id 是纯数字」判断,而不是过去的「来源是账单」——本栈的支付口径就是
* **计划 id**(收银台 `?ids=` 与 `vm_finance_payment.bill_id` 同一口径),计划卡本就该能付;
* 数字校验只是防止空 id 拼出 `?ids=`。</p>
*/
function canPay(bill: ProjectBill): boolean {
return bill.status === '待支付' && /^\d+$/.test(bill.id)
}
/**
* 三态配色类(设计稿口径,挂到 `.project-finance__plan` 上,由后代选择器分发):
* 已支付 = 绿、待支付 = 橙、未到期 = 灰,**徽标实底 + 金额文字同色**。
*/
const TONE_CLASS: Record<ProjectBill['status'], string> = {
'已支付': 'is-paid',
'待支付': 'is-pending',
'未到期': 'is-idle',
}
/** 文件行副标题(设计稿:「2.4MB · 上传于 2026-8-17 17:00」) */
function fileMeta(file: FileInfo): string {
const size = file.size ? formatFileSize(file.size) : ''
const time = file.uploadTime ? `上传于 ${file.uploadTime}` : ''
@@ -49,7 +37,6 @@ function fileMeta(file: FileInfo): string {
<template>
<section class="project-finance">
<!-- 付款计划(数据源 vm_bill_plan):卡内三态 = 已支付 / 待支付 / 未到期 -->
<h2 class="project-finance__title">
付款计划
</h2>
@@ -69,7 +56,6 @@ function fileMeta(file: FileInfo): string {
<div class="project-finance__plan-body">
<div class="project-finance__fields">
<!-- 交易流水号只在已支付时出现(设计稿:已支付那张卡多一行流水号) -->
<p v-if="bill.status === '已支付' && bill.tradeNo" class="project-finance__field">
交易流水号:{{ bill.tradeNo }}
</p>
@@ -85,7 +71,6 @@ function fileMeta(file: FileInfo): string {
</div>
</div>
<!-- 支付口径 = 计划 id(与收银台 ?ids= / vm_finance_payment.bill_id 一致) -->
<button
v-if="canPay(bill)"
class="project-finance__pay"
@@ -100,7 +85,6 @@ function fileMeta(file: FileInfo): string {
</p>
</div>
<!-- 发票记录 -->
<h2 class="project-finance__title">
发票记录
</h2>
@@ -134,7 +118,6 @@ function fileMeta(file: FileInfo): string {
</li>
</ul>
<!-- 合同文件 -->
<h2 class="project-finance__title">
合同文件
</h2>
@@ -165,15 +148,10 @@ function fileMeta(file: FileInfo): string {
</template>
<style lang="less" scoped>
// 设计稿实测(1920,1:1):标题 (82,342) 15/700;计划卡 (70,380) 372×139 / (70,533) 372×144 /
// (70,691) 372×116,描边 1px #F0F1F3、圆角 13;期次名 (89,398) 14/700;状态 (378,400) 11/500;
// 字段行 (89,426) 11/400 #6B7280;金额 (341.33,453) 20/700;「立即支付」通栏 372×34 #F59E0B;
// 发票记录标题 (82,841)、合同文件标题 (82,1033);文件行 1780×55 #F7F8FA。
.project-finance {
.flex(column, flex-start, stretch);
padding: 0;
// 分割线 317 → 「付款计划」盒 339(ink 342,843103b2)
&__title {
.section-title();
margin-top: 22px;
@@ -188,32 +166,25 @@ function fileMeta(file: FileInfo): string {
}
}
// 首区块标题盒底 359 → 首张卡顶 380
&__title:first-child + &__plans {
margin-top: 21px;
}
// 区块间距:付款计划卡底 807 → 「发票记录」盒 838(31);发票行底 999 → 「合同文件」盒 1030(31)
&__plans + &__title,
&__files + &__title {
margin-top: 31px;
}
// 区块标题盒底 → 首行顶:838+20 → 879(21);1030+20 → 1071(21)
&__title + &__files,
&__title + &__file {
margin-top: 21px;
}
// ---------- 付款计划 ----------
// 卡片竖排单列、定宽 372 左对齐;卡间距 14(380→533→691 实测 153/158,扣卡高)
&__plans {
.flex(column, flex-start, flex-start);
gap: 14px;
}
// 白底 + 1px #F0F1F3 描边、圆角 13,定宽 372;内容内缩 19/17
&__plan {
.flex(column, flex-start, stretch);
position: relative;
@@ -223,24 +194,20 @@ function fileMeta(file: FileInfo): string {
border-radius: 13px;
background: @white;
box-sizing: border-box;
gap: 0; // 段间距全部走显式 margin,避免 gap 与 margin 叠加
gap: 0;
// 带「立即支付」时按钮贴卡片下缘:底部不留内边距
&:has(.project-finance__pay) {
padding-bottom: 0;
}
// 两条字段、无支付按钮(卡3):底距 17(设计卡高 116 = 2+17+19+8+53+17)
&:not(:has(.project-finance__field:nth-child(3))):not(:has(.project-finance__pay)) {
padding-bottom: 17px;
}
// 三条字段、无支付按钮(卡1):底距 15(设计卡高 139 = 2+17+19+8+78+15)
&:has(.project-finance__field:nth-child(3)):not(:has(.project-finance__pay)) {
padding-bottom: 15px;
}
// 三态配色(浅底徽标 + 同色系金额)
&.is-paid {
.project-finance__badge {
color: @finance-paid;
@@ -277,7 +244,6 @@ function fileMeta(file: FileInfo): string {
gap: @spacing-sm;
}
// 期次标题 14/700,行高 19(顶 398 = 卡内 380+18)
&__plan-name {
font-size: 14px;
font-weight: 700;
@@ -286,7 +252,6 @@ function fileMeta(file: FileInfo): string {
.ellipsis();
}
// 状态纯文字(设计 11/500)
&__badge {
.flex(row, center, center);
flex-shrink: 0;
@@ -296,24 +261,18 @@ function fileMeta(file: FileInfo): string {
white-space: nowrap;
}
// 金额是**文本覆盖层**,不参与卡高:设计里它压在字段区右侧、与首字段行齐平
// (ink 453 = 卡顶 380 + 73;字段盒顶 424 + 29)。必须 absolute,否则 26 高的
// 行盒会把 __plan-body 撑高,三张卡分别虚高 8/8/0。
&__plan-body {
.flex(row, space-between, flex-start);
position: relative;
margin-top: 8px; // 期次行盒底 416 → 字段块顶 424
margin-top: 8px;
gap: @spacing-base;
}
// 字段块按内容定高(3 行 78 / 2 行 53),行距由绝对偏移给,避免 margin 叠加。
// 设计:卡1 424→502(3 行 0/23/61),卡2 564→617、卡3 729→782(2 行 0/23)。
&__fields {
position: relative;
flex: 0 0 auto;
min-width: 0;
// 3 行时块高 78,2 行时 53
height: 53px;
&:has(> :nth-child(3)) {
@@ -330,7 +289,6 @@ function fileMeta(file: FileInfo): string {
color: @project-label;
.ellipsis();
// 字段行距:426 → 449 → 487(相对块顶 0 / 23 / 61)
&:nth-child(1) { top: 0; }
&:nth-child(2) { top: 23px; }
@@ -338,7 +296,6 @@ function fileMeta(file: FileInfo): string {
&:nth-child(3) { top: 61px; }
}
// 金额 20/700:设计 ink 453(卡顶 380 + 73),相对首字段行盒顶(424)再下移 29
&__amount {
position: absolute;
top: 29px;
@@ -350,8 +307,6 @@ function fileMeta(file: FileInfo): string {
white-space: nowrap;
}
// 「立即支付」:设计卡内通铺 370×34、贴卡片下缘。
// 卡2:字段块底 617 → 按钮顶 642(间距 25),按钮底 676,卡底 677。
&__pay {
height: 34px;
margin: 11px -19px 0;
@@ -369,9 +324,6 @@ function fileMeta(file: FileInfo): string {
}
}
// ---------- 发票 / 合同文件 ----------
// 发票行间距 10(879→944 / 1071→1136)
&__files {
.flex(column, flex-start, stretch);
gap: 10px;
@@ -380,18 +332,16 @@ function fileMeta(file: FileInfo): string {
list-style: none;
}
// 整行通铺 #F7F8FA、圆角 8,行高 55
&__file {
.flex(row, space-between, center);
gap: @spacing-base;
height: 55px;
box-sizing: border-box;
padding: 0 5.7px 0 16px; // 徽标左缘 86 = 内容区 70 + 16;操作右缘 x1845
padding: 0 5.7px 0 16px;
border-radius: 8px;
background: @finance-row-bg;
}
// 文件类型方块(设计 ≈33×21)
&__file-badge {
.flex(row, center, center);
flex-shrink: 0;

View File

@@ -8,12 +8,6 @@ interface Props {
defineProps<Props>()
/**
* 状态文字配色(项目详情设计稿:状态是**卡片右侧的纯文字**,不是胶囊标签)。
*
* <p>设计稿只画了「进行中」= @project-accent,其余状态按语义就近归组;
* 颜色一律走 `styles/variables.less`,组件内不写魔法色值。</p>
*/
const STATUS_CLASS: Record<ProjectStatus, string> = {
'待立项': 'is-idle',
'进行中': 'is-active',
@@ -24,7 +18,6 @@ const STATUS_CLASS: Record<ProjectStatus, string> = {
'已取消': 'is-idle',
}
/** 业务类型:优先用后端原样下发的名称(它来自提报表,接口能下发就照显),兜底才查前端枚举 */
function businessTypeText(project: Project): string {
return project.businessTypeName || formatBusinessType(project.businessType)
}
@@ -32,11 +25,6 @@ function businessTypeText(project: Project): string {
<template>
<section class="project-info-card">
<!--
项目标识:设计稿是「白底圆角方块 + 蓝色描边徽标(内含 </>)」。
⚠️ 接口没有 logo 字段(ProjectRequirementBaseVo 只下发名称/编号/类型/状态/时间),
所以这里按设计稿渲染占位徽标,不是真实项目图标。
-->
<span class="project-info-card__logo" aria-hidden="true">
<span class="project-info-card__logo-badge">&lt;/&gt;</span>
</span>
@@ -65,9 +53,6 @@ function businessTypeText(project: Project): string {
</template>
<style lang="less" scoped>
// 设计稿实测(1920,1:1):logo 方块 (70,196) 64×64、圆角 16;
// 标题 ink (142,212) 19/700 #1F2937;字段行 ink (142,245) 11px,标签 #6B7280 / 值 #1F2937;
// 状态 ink (1802,225.5) 16/700 #024FFF。整块 195..262(67 高),其后页签行 278 起(+16)。
.project-info-card {
.flex(row, flex-start, flex-start);
gap: 8px; // 142 − (70 + 64) = 8
@@ -84,7 +69,6 @@ function businessTypeText(project: Project): string {
background: @project-logo-bg;
}
// 方块内只有蓝色「</>」文字(设计 20/400 #024FFF)
&__logo-badge {
color: @project-accent;
font-size: 20px;
@@ -98,7 +82,6 @@ function businessTypeText(project: Project): string {
min-width: 0;
}
// 标题 19/700、行盒 25:ink 212 → box 209(块顶 195 + 14)
&__name {
margin: 14px 0 0;
font-size: 19px;
@@ -108,7 +91,6 @@ function businessTypeText(project: Project): string {
.ellipsis();
}
// 字段行 11/15:ink 245 → box 243(标题盒底 234 + 9)
&__meta {
.flex(row, flex-start, center);
gap: 20px;
@@ -130,7 +112,6 @@ function businessTypeText(project: Project): string {
font-weight: 400;
}
// 状态纯文字 16/700:ink 225.5 → box 222.5(块顶 195 + 27.5);右缘超出内容区 21.6
&__status {
flex-shrink: 0;
margin: 27.5px -21.6px 0 0;

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);

View File

@@ -1,13 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
/**
* 项目中心分页器(按设计稿:小方块、当前页为**蓝色描边**而非填充)。
*
* <p>为什么不复用公共 `PaginationBar`:那个是 32px 实心选中态、服务多个页面,
* 与项目中心设计稿的 20px 描边样式不同,改它会波及其它页面。</p>
*/
interface Props {
page: number
pageSize: number
@@ -20,7 +13,6 @@ const emit = defineEmits<{ pageChange: [page: number] }>()
const pageCount = computed(() => Math.max(1, Math.ceil(props.total / props.pageSize)))
/** 页码序列:≤7 全部展示,否则首尾 + 当前页窗口(… 省略) */
const pages = computed<Array<number | '...'>>(() => {
const n = pageCount.value
const { page } = props
@@ -96,7 +88,6 @@ function go(page: number): void {
color: @primary-color;
}
// 设计稿:当前页是描边态(蓝框 + 蓝字),不是实心
&.is-active {
border-color: @primary-color;
color: @primary-color;

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
interface Props {
/** 总体进度百分比(后端 `projectStage.developmentProgress`;未立项为 0) */
progress: number
startTime?: string
endTime?: string
@@ -8,7 +7,6 @@ interface Props {
const props = defineProps<Props>()
/** 进度条填充宽度(夹到 0~100,避免脏数据把条撑出容器) */
function clampPercent(value: number): number {
if (!Number.isFinite(value)) return 0
return Math.min(100, Math.max(0, Math.round(value)))
@@ -26,7 +24,6 @@ function clampPercent(value: number): number {
<span class="project-progress__percent">{{ clampPercent(props.progress) }}%</span>
</div>
<!-- 设计稿:轨道通栏,蓝色填充,末端一个白底蓝环圆点(进度为 0 时不画圆点) -->
<div class="project-progress__track">
<div class="project-progress__fill" :style="{ width: `${clampPercent(props.progress)}%` }" />
<span
@@ -44,18 +41,14 @@ function clampPercent(value: number): number {
</template>
<style lang="less" scoped>
// 设计稿实测(1920,1:1;5865c6d9 为 −14 基准,此处统一到主流基准 ⇒ 全部 +14):
// 「开发进度」ink 324 15/700;「总体进度」ink 372 12/400 #6B7280;「65%」ink 364 20/700 #024FFF;
// 进度条 (70,402) 1780×6、填充 1157 #024FFF、轨道 #EDEFF2;起止时间 ink 420 11/400 #9CA3AF。
.project-progress {
.flex(column, flex-start, stretch);
padding: 0;
// 分割线 317 → 标题 box 321
&__title {
.section-title();
margin-top: 4px;
padding-left: 12px; // 文字落 x82 = 内容区 x70 + 12
padding-left: 12px;
font-size: 15px;
font-weight: 700;
line-height: 20px;
@@ -66,7 +59,6 @@ function clampPercent(value: number): number {
}
}
// 标题盒 321..341 → 「总体进度」盒 370(12/16)
&__head {
.flex(row, space-between, baseline);
margin-top: 29px;
@@ -78,7 +70,6 @@ function clampPercent(value: number): number {
color: @project-label;
}
// 「65%」20/700:ink 364 → 行盒 361,相对 head 行顶 370 上移 9
&__percent {
margin-top: -9px;
font-size: 20px;
@@ -87,7 +78,6 @@ function clampPercent(value: number): number {
color: @project-accent;
}
// 说明盒 370..386 → 轨道顶 402
&__track {
position: relative;
height: 6px;
@@ -103,7 +93,6 @@ function clampPercent(value: number): number {
transition: width 0.3s;
}
// 轨道底 408 → 起止时间盒 418(11/15,ink 420)
&__range {
.flex(row, space-between, center);
margin-top: 10px;

View File

@@ -3,25 +3,9 @@ import { computed } from 'vue'
import { PROJECT_STATUS_LABEL } from '@/utils/projectMeta'
import type { ProjectTypeCount, RdProjectVo } from '@/types/business/project'
/**
* 项目中心列表(按设计稿还原 + 后端 RdProjectVo 契约)。
*
* <p>设计稿要点:表头浅灰底 + 加粗居中、整表 #bbbbbb 网格线、行高约 76、
* 进度列**只给百分比文字**(不画进度条)、状态列是纯文字(不是彩色标签)、
* 最后一列是操作(「详情」,已完成的额外给「申请售后」)。</p>
*
* <p>三处「后端没有 / 前端不能编」的兜底:<br>
* 1. 业务类型列:SQL 里 `businessType` 已 JOIN 提报表**翻译成中文类型名**(如「互联网软件」),
* 直接渲染即可;`typeLabels`(提报 id → 名称)当前命不中,只作为后端改回下发 id 时的兜底。<br>
* 2. 进度列:`progress` 取项目表(未立项必为 null)⇒ 显示「—」,不假装成 0%。<br>
* 3. 状态列:取 `COALESCE(项目状态, 需求状态)`,未立项回落 `INITIATING`(待立项)。</p>
*/
interface Props {
projects: RdProjectVo[]
/** 业务类型件数列表(含「全部」);用它建 id → 中文 的映射 */
typeCounts: ProjectTypeCount[]
/** 是否处于筛选态(决定空态文案:没筛过 = 本来就没项目,筛过 = 没有符合条件的) */
filtered: boolean
}
@@ -32,7 +16,6 @@ const emit = defineEmits<{
afterSales: [id: string]
}>()
/** businessTypeId → 业务类型中文 */
const typeLabels = computed<Record<string, string>>(() => {
const map: Record<string, string> = {}
for (const item of props.typeCounts) {
@@ -48,16 +31,9 @@ function typeLabel(value: string | null | undefined): string {
function statusLabel(value: string | null | undefined): string {
if (!value) return '—'
// 后端已用字典翻成中文(「进行中」…);码值也能认,认不出就原样显示
return PROJECT_STATUS_LABEL[value] ?? value
}
/**
* 是否已完成(决定是否给「申请售后」入口)。
*
* <p>⚠️ 后端状态自字典翻译后下发的是**中文**「已完成」,码值 `COMPLETED` 也可能出现
* (字典缺项 / 直连子表)⇒ 两种都认。只比码值会让售后按钮永远不出现。</p>
*/
function isCompleted(value: string | null | undefined): boolean {
return value === 'COMPLETED' || value === '已完成'
}
@@ -135,7 +111,6 @@ function progressLabel(value: number | null | undefined): string {
border: 1px solid @project-table-line;
text-align: center;
vertical-align: middle;
// 设计稿表格正文实测 12px(比左栏正文小一号),沿用 14px 会把操作列挤到换行
font-size: @font-size-sm;
}
@@ -151,7 +126,6 @@ function progressLabel(value: number | null | undefined): string {
color: @heading-color;
}
// 列宽按设计稿实测比例(1002 总宽 → 61/294/218/107/144/90/88)
th:nth-child(1) { width: 6.09%; }
th:nth-child(2) { width: 29.34%; }
th:nth-child(3) { width: 21.76%; }

View File

@@ -33,16 +33,13 @@ defineProps<Props>()
</template>
<style lang="less" scoped>
// 设计稿实测(1920,1:1;5865c6d9 −14 基准 ⇒ 统一后 +14):
// 标题 ink 617 15/700;头像直径 64、首列左缘 x66.5(中心 98.5)、相邻中心距 99 → 间距 35;
// 姓名 ink 734 16/600 #1F2937;角色 ink 761 12/400 #9CA3AF。
.project-team {
.flex(column, flex-start, stretch);
padding: 0;
&__title {
.section-title();
margin-top: 42px; // 里程碑说明盒底 575 → 标题盒 614(ink 617)
margin-top: 42px;
padding-left: 12px;
font-size: 15px;
font-weight: 700;
@@ -54,13 +51,12 @@ defineProps<Props>()
}
}
// 标题盒底 634 → 头像顶 670(中心 y702)
&__list {
.flex(row, flex-start, flex-start);
flex-wrap: wrap;
gap: 32px @team-gap;
margin-top: 33px;
margin-left: -3.5px; // 首列左缘 66.5 = 内容区 70 − 3.5
margin-left: -3.5px;
}
&__item {
@@ -68,7 +64,6 @@ defineProps<Props>()
width: @team-size;
}
// 品牌蓝实底圆 + 白色单字(设计 16/400)
&__avatar {
.flex(row, center, center);
width: @team-size;
@@ -81,7 +76,6 @@ defineProps<Props>()
line-height: 22px;
}
// 头像底 734 → 姓名 ink 734
&__name {
margin-top: 0;
max-width: 100%;
@@ -93,7 +87,6 @@ defineProps<Props>()
.ellipsis();
}
// 姓名盒底 756 → 角色盒 759(12/19,ink 761)
&__role {
margin-top: 3px;
max-width: 100%;

View File

@@ -1,12 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
/**
* 项目中心右侧搜索条(按设计稿:关键字输入框 + 重置 + 搜索)。
*
* <p>输入框比两侧按钮更高(设计稿实测 37 vs 26),三者按中线对齐。</p>
*/
interface Props {
keyword: string
}