fix: 优化后台列表与弹窗排版

This commit is contained in:
Nixevol
2026-07-04 22:45:36 +08:00
parent f493dc061d
commit a4bce741ea
4 changed files with 30 additions and 4 deletions
+1
View File
@@ -119,6 +119,7 @@
- 后台列表对齐规范(2026-07-04):主列表和追溯码管理中,图片/ID/编号/状态/审核状态/角色/数量/时间/IP/操作等短值列统一 `align: 'center'`;名称、艺术家、模板、路径、备注、错误原因、消息等长文本列保持左对齐并配合省略提示。已覆盖艺术品档案、用户管理、查询日志、内容审核、追溯码管理、出库导入、操作日志、溯源模板、备份恢复等表格。
- 后台列表列宽规范(2026-07-04):主列表列宽采用“短值列固定、长文本列弹性”的策略。状态、数量、时间、ID、操作等列用稳定 `width`;名称、艺术家、模板、路径、备注、错误原因、消息、字段配置、短链等列优先用 `minWidth` 让 Naive DataTable 在宽屏下自动分配剩余宽度,小屏仍通过 `scroll-x` 保留横向滚动。已覆盖操作日志、用户管理、艺术品档案、查询日志、内容审核、追溯码管理、出库导入、溯源模板、备份恢复等列表,避免宽屏下字段挤在左侧、右侧大面积空白。
- 后台列表表头显示规则(2026-07-04):所有列表表头字段名必须完整、单行显示,不能换行或省略;全局 `.table-fill .n-data-table-th` 固定 `white-space: nowrap`,筛选表头 `.filter-title-text` 不再做省略。带筛选图标的列需要额外预留图标空间,例如出库状态、审核状态、查询结果等列宽不可只按文字宽度估算;短码、档案编号、账号等短字段仍应固定合理宽度,避免参与宽屏弹性分配后过宽。
- 后台弹窗与列表单行约定(2026-07-04):全局 `.table-fill .n-data-table-td` 固定 `white-space: nowrap`,长文本列需显式配置 `ellipsis: { tooltip: true }` 以实现单行省略和悬浮查看完整内容;艺术品档案列表档案编号列按 `ARTVERIS-000000` 这类编号预留宽度,不允许折行。Naive UI `preset="card"` 弹窗全局限制为视口内最大宽高,弹窗头尾固定、内容区 `.n-card-content` 自滚动,避免长表单撑出整页滚动;复杂表单局部区域如模板字段配置需自行提供内部横向滚动。
- 后台 UI 约定补充(2026-07-04):后台术语统一用“客户端”替代“C 端”。新增 `openMediaViewer` 复用 PhotoSwipe,`MediaUpload`、`MediaSorter`、作品/审核封面、出库导入预览图均可点击预览。枚举/下拉筛选移入表头,输入检索保留在工具栏;新增 `renderTableFilterTitle` 作为表头筛选渲染工具。所有操作列应固定右侧、`align: center`,按钮容器使用全局 `.row-actions`。
- 本次验证(2026-07-04):已执行 `pnpm --filter @artveris/api prisma:generate`、`pnpm build:shared`、`pnpm --filter @artveris/api build`、`pnpm --filter @artveris/admin build`、`pnpm --filter @artveris/client build`、`pnpm --filter @artveris/api test`,均通过;`pnpm --filter @artveris/api prisma:deploy` 已成功应用迁移 `20260704090000_import_backup_audit`。浏览器检查新增菜单/页面(操作日志、备份恢复、出库导入、艺术品档案、查询日志、系统设置)无前端 error;接口联调通过 ZIP 模板下载、二维码 xlsx 导出、ZIP 导入预览+确认、备份创建+下载+删除。
+19
View File
@@ -62,6 +62,25 @@ body,
.table-fill .n-data-table-th {
white-space: nowrap;
}
.table-fill .n-data-table-td {
white-space: nowrap;
}
.n-modal.n-card {
max-width: calc(100vw - 32px);
max-height: calc(100vh - 48px);
display: flex;
flex-direction: column;
}
.n-modal.n-card > .n-card-header,
.n-modal.n-card > .n-card__footer {
flex: 0 0 auto;
}
.n-modal.n-card > .n-card-content,
.n-modal.n-card > .n-card__content {
flex: 1 1 auto;
min-height: 0;
overflow: auto;
}
.table-fill .n-data-table-td--fixed-right,
.table-fill .n-data-table-th--fixed-right {
background-color: var(--n-td-color);
+3 -3
View File
@@ -27,7 +27,7 @@
class="table-fill"
flex-height
remote
:scroll-x="1360"
:scroll-x="1400"
:row-key="(r) => r.id"
/>
<div class="table-pagination">
@@ -82,7 +82,7 @@ const columns: DataTableColumns<any> = [
})
: h(NAvatar, { size: 44, style: 'border-radius:8px' }, { default: () => '—' }),
},
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 140, align: 'center', render: (r) => r.archiveNo || '-' },
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 170, align: 'center', ellipsis: { tooltip: true }, render: (r) => r.archiveNo || '-' },
{ title: () => t('pages.artwork.title'), key: 'title', minWidth: 220, ellipsis: { tooltip: true } },
{ title: () => t('pages.artwork.artist'), key: 'artist', minWidth: 130, ellipsis: { tooltip: true }, render: (r) => r.artist || '-' },
{ title: () => t('pages.artwork.template'), key: 'template', minWidth: 150, ellipsis: { tooltip: true }, render: (r) => r.template?.name || '-' },
@@ -107,7 +107,7 @@ const columns: DataTableColumns<any> = [
{ default: () => t(`common.auditStatus.${r.auditStatus || 'PENDING'}`) },
),
},
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, align: 'center', render: (r) => fmt(r.createdAt) },
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, align: 'center', ellipsis: { tooltip: true }, render: (r) => fmt(r.createdAt) },
{
title: () => t('common.label.operation'),
key: 'ops',
+7 -1
View File
@@ -54,7 +54,7 @@
</n-switch>
</n-form-item>
<n-form-item :label="t('pages.template.fields')">
<div style="width: 100%">
<div class="field-editor">
<div class="field-hint">{{ t('pages.template.sortHint') }}</div>
<div v-for="(f, i) in form.fields" :key="i" class="field-row">
<span class="field-order">{{ i + 1 }}</span>
@@ -293,6 +293,12 @@ onMounted(load);
align-items: center;
gap: 8px;
margin-bottom: 8px;
min-width: 560px;
}
.field-editor {
width: 100%;
overflow-x: auto;
padding-bottom: 2px;
}
.field-order {
width: 18px;