From c56ca91edd1454d1a19689b8db02ecc862499437 Mon Sep 17 00:00:00 2001 From: Nixevol Date: Sun, 5 Jul 2026 00:16:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=A4=87=E6=A1=88=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aidocs/project_context.md | 1 + apps/admin/src/layouts/MainLayout.vue | 4 ++- apps/admin/src/locales/en-US.json | 1 + apps/admin/src/locales/zh-CN.json | 1 + apps/admin/src/views/Settings.vue | 6 ++++ apps/api/prisma/seed.ts | 1 + apps/api/src/settings/settings.controller.ts | 2 +- apps/api/src/settings/settings.service.ts | 2 ++ apps/client/src/views/Home.vue | 29 +++++++++++++++++++- apps/client/src/views/Trace.vue | 11 +++++++- 10 files changed, 54 insertions(+), 4 deletions(-) diff --git a/aidocs/project_context.md b/aidocs/project_context.md index fd9f3fb..e4725a9 100644 --- a/aidocs/project_context.md +++ b/aidocs/project_context.md @@ -128,6 +128,7 @@ - 本次验证(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 导入预览+确认、备份创建+下载+删除。 - 最终验证补充(2026-07-04):重新执行 `pnpm build:shared`、`pnpm --filter @artveris/api build`、`pnpm --filter @artveris/admin build`、`pnpm --filter @artveris/client build`、`pnpm --filter @artveris/api test`、`git diff --check`,均通过(`git diff --check` 仅提示 `trace-code.service.ts` 行尾将由 CRLF 转 LF)。用真实登录 token 调用 `/api/trace-codes/export?artworkId=3` 下载 ZIP 并检查压缩包,确认包含 `{档案编号}_{YYYYMMDDHHmmss}.xlsx` 与 `images/{追溯码}.png`。 - 追溯码导出 Excel 样式(2026-07-05):`TraceCodeService.exportCodes` 生成的 xlsx 中,表头和数据行统一垂直居中;“链接”列改为 Excel 超链接单元格(蓝色下划线,可单击跟踪链接)。导出仍为内存即时生成 ZIP,不落盘;已用真实接口导出并拆包检查 xlsx,确认存在 hyperlink 关系和 `vertical="center"` 样式。 +- 备案信息配置(2026-07-05):系统设置新增 `filingInfo`,默认“备案信息待补充”,超管可在后台「系统设置 / 基础设置 / 平台信息」中维护。`GET /settings/public` 下发 `filingInfo` 给客户端;后台管理页脚和客户端首页/溯源详情页脚均从设置读取备案信息,后续修改备案号无需改源代码。 ## 当前代码基准与注意事项 diff --git a/apps/admin/src/layouts/MainLayout.vue b/apps/admin/src/layouts/MainLayout.vue index 2098b31..0b23058 100644 --- a/apps/admin/src/layouts/MainLayout.vue +++ b/apps/admin/src/layouts/MainLayout.vue @@ -48,7 +48,7 @@ © 2026 {{ appName }} - 备案信息待补充 + {{ filingInfo }} @@ -86,6 +86,7 @@ const auth = useAuthStore(); const collapsed = ref(window.innerWidth < 900); const appName = ref(t('pages.login.title')); +const filingInfo = ref(''); function renderIcon(icon: unknown) { return () => h(NIcon, null, { default: () => h(icon as never) }); @@ -146,6 +147,7 @@ onMounted(async () => { try { const s = await settingsApi.getAll(); if (s.appName) appName.value = s.appName; + filingInfo.value = s.filingInfo || ''; } catch { /* ignore */ } diff --git a/apps/admin/src/locales/en-US.json b/apps/admin/src/locales/en-US.json index 42d6503..5b45f5b 100644 --- a/apps/admin/src/locales/en-US.json +++ b/apps/admin/src/locales/en-US.json @@ -350,6 +350,7 @@ "logRetentionDays": "Query Log Retention (days)", "operationLogRetentionDays": "Operation Log Retention (days)", "watermarkText": "Certificate Watermark", + "filingInfo": "Filing Info", "carouselInterval": "Client Carousel Interval (s)", "carouselIntervalHint": "Seconds each media stays; decimals allowed. 0 disables auto-advance (manual loop still works).", "saved": "Settings saved" diff --git a/apps/admin/src/locales/zh-CN.json b/apps/admin/src/locales/zh-CN.json index ad7e0c3..285754d 100644 --- a/apps/admin/src/locales/zh-CN.json +++ b/apps/admin/src/locales/zh-CN.json @@ -350,6 +350,7 @@ "logRetentionDays": "查询日志保留天数", "operationLogRetentionDays": "操作日志保留天数", "watermarkText": "证书水印文案", + "filingInfo": "备案信息", "carouselInterval": "客户端轮播间隔(秒)", "carouselIntervalHint": "每张媒体停留秒数,支持小数;填 0 则不自动切换(仍可手动循环切换)", "saved": "设置已保存" diff --git a/apps/admin/src/views/Settings.vue b/apps/admin/src/views/Settings.vue index 2ef73c6..96b9a6d 100644 --- a/apps/admin/src/views/Settings.vue +++ b/apps/admin/src/views/Settings.vue @@ -14,6 +14,9 @@ + + + @@ -95,6 +98,7 @@ const form = reactive({ logRetentionDays: 365, operationLogRetentionDays: 180, watermarkText: '', + filingInfo: '', carouselInterval: 3, backupEnabled: false, backupSchedule: 'daily', @@ -108,6 +112,7 @@ async function load() { form.logRetentionDays = Number(s.logRetentionDays || 365); form.operationLogRetentionDays = Number(s.operationLogRetentionDays || 180); form.watermarkText = s.watermarkText || ''; + form.filingInfo = s.filingInfo || ''; form.carouselInterval = Number(s.carouselInterval ?? 3); form.backupEnabled = s.backupEnabled === 'true'; form.backupSchedule = s.backupSchedule || 'daily'; @@ -123,6 +128,7 @@ async function save() { logRetentionDays: String(form.logRetentionDays), operationLogRetentionDays: String(form.operationLogRetentionDays), watermarkText: form.watermarkText, + filingInfo: form.filingInfo, carouselInterval: String(form.carouselInterval), backupEnabled: String(form.backupEnabled), backupSchedule: form.backupSchedule, diff --git a/apps/api/prisma/seed.ts b/apps/api/prisma/seed.ts index 87eaa2e..1418cab 100644 --- a/apps/api/prisma/seed.ts +++ b/apps/api/prisma/seed.ts @@ -62,6 +62,7 @@ async function ensureSettings(): Promise { appName: process.env.APP_NAME || '艺术品溯源平台', logRetentionDays: process.env.LOG_RETENTION_DAYS || '365', watermarkText, + filingInfo: '备案信息待补充', }; for (const [key, value] of Object.entries(defaults)) { await prisma.systemSetting.upsert({ where: { key }, update: {}, create: { key, value } }); diff --git a/apps/api/src/settings/settings.controller.ts b/apps/api/src/settings/settings.controller.ts index 5f329af..16ff87b 100644 --- a/apps/api/src/settings/settings.controller.ts +++ b/apps/api/src/settings/settings.controller.ts @@ -22,7 +22,7 @@ export class SettingsController { @ApiOperation({ summary: '获取公开设置(应用名等)' }) async getPublic() { const all = await this.settingsService.getAll(); - return { appName: all.appName, carouselInterval: all.carouselInterval }; + return { appName: all.appName, carouselInterval: all.carouselInterval, filingInfo: all.filingInfo }; } @ApiBearerAuth() diff --git a/apps/api/src/settings/settings.service.ts b/apps/api/src/settings/settings.service.ts index 0a0cd09..0a186e9 100644 --- a/apps/api/src/settings/settings.service.ts +++ b/apps/api/src/settings/settings.service.ts @@ -7,6 +7,7 @@ const EDITABLE_KEYS = [ 'logRetentionDays', 'operationLogRetentionDays', 'watermarkText', + 'filingInfo', 'carouselInterval', 'backupEnabled', 'backupSchedule', @@ -28,6 +29,7 @@ export class SettingsService { logRetentionDays: String(this.config.get('logRetentionDays') || 365), operationLogRetentionDays: '365', watermarkText: this.config.get('watermarkText') || '仅供溯源核验使用', + filingInfo: '备案信息待补充', carouselInterval: '3', backupEnabled: 'false', backupSchedule: 'daily', diff --git a/apps/client/src/views/Home.vue b/apps/client/src/views/Home.vue index c6fa161..012bbc9 100644 --- a/apps/client/src/views/Home.vue +++ b/apps/client/src/views/Home.vue @@ -4,19 +4,36 @@

{{ t('home.title') }}

{{ t('home.hint') }}

+
+ {{ appName }} + {{ filingInfo }} +
diff --git a/apps/client/src/views/Trace.vue b/apps/client/src/views/Trace.vue index 0c08763..a3fc2ac 100644 --- a/apps/client/src/views/Trace.vue +++ b/apps/client/src/views/Trace.vue @@ -268,7 +268,10 @@
{{ t('chain.notOnchain') }}
-
{{ appName }}
+
+ {{ appName }} + {{ filingInfo }} +
@@ -293,6 +296,7 @@ const { t, locale } = useI18n(); const loading = ref(true); const data = ref(null); const appName = ref(''); +const filingInfo = ref(''); const toast = ref(''); // 节点图片默认收缩,避免页面过长;点击展开 @@ -574,10 +578,12 @@ onMounted(async () => { try { const info = await fetchAppInfo(); appName.value = info?.appName || t('app.name'); + filingInfo.value = info?.filingInfo || ''; const iv = Number(info?.carouselInterval); if (Number.isFinite(iv) && iv >= 0) carouselInterval.value = iv; } catch { appName.value = t('app.name'); + filingInfo.value = ''; } document.addEventListener('click', closeLangMenu); }); @@ -1126,6 +1132,9 @@ watch( padding: 8px 0; } .footer { + display: flex; + flex-direction: column; + gap: 6px; text-align: center; font-size: 12px; padding: 24px 0 32px;