diff --git a/aidocs/project_context.md b/aidocs/project_context.md
index 06e2e14..39dd04b 100644
--- a/aidocs/project_context.md
+++ b/aidocs/project_context.md
@@ -139,6 +139,7 @@
- 艺术品审核变更流(2026-07-05):已有作品详情页不再显示“保存草稿”,只保留“提交审核”。运营编辑已有作品时,基础信息、作品媒体、溯源时间轴、认证文件都先作为本地页面状态,点击提交后写入新表 `artwork_revision` 的 `afterSnapshot`,正式 `artwork/trace_node/certificate` 数据不立即覆盖;审核通过后才用快照覆盖正式数据,审核驳回只记录意见,不影响客户端当前可查的已审核正式版本。新建/未审核作品仍可直接更新正式草稿内容并进入初次审核;DRAFT 不进入内容审核列表。内容审核列表现在读取 `/artworks/audit-list` 的待审核变更稿,点击详情会带 `revisionId` 预览待审核内容,审核操作也绑定具体变更稿。作品详情底部新增“修改记录”列表,覆盖创建、提交人、修改标题、修改理由、审核结果、审核人、审核时间和驳回意见;艺术品档案列表审核列以正式 `auditStatus/auditRemark` 为主,并额外标识未生效修改稿。备份清单新增 `artworkRevision`,确保审核变更记录随系统备份/恢复。
- 审核变更流展示修正(2026-07-05):已有已通过作品即使存在待审核/已驳回修改稿,也不影响客户端查看,客户端始终读取正式表中上一版已审核通过内容;后台展示时区分“正式状态”和“待审修改/修改驳回”。作品详情基础信息卡右上角只显示正式状态,待审核或被驳回的修改稿用提示条说明“客户端仍展示上一版正式内容”;艺术品档案列表审核列显示正式审核状态,并在正式已通过且存在未生效变更时追加小标签。修改标题/修改理由不再常驻作品详情页,改为点击“提交审核”时弹窗填写,提交后进入修改记录列表。
- 修改记录时间精度(2026-07-05):后台作品详情底部“修改记录”的提交时间、审核时间使用 `fmtSecond` 显示到秒(`YYYY-MM-DD HH:mm:ss`),列宽按秒级时间放宽;其他列表仍默认沿用分钟级 `fmt`,避免全平台时间显示无意变化。
+- 审核提交空修改校验(2026-07-05):已有作品详情页加载后会记录规范化原始快照,只有基础信息、动态字段、作品媒体、溯源时间轴或认证文件发生实际变化时,“提交审核”按钮才可用;未变化时按钮禁用并提示“作品内容未发生变化,无需提交审核”。后端 `ArtworkService.update` 同样使用规范化快照比较正式内容和提交内容,若无变化则返回 `VALIDATION_FAILED`,防止绕过前端直接提交空修改。比较会规整日期为 `YYYY-MM-DD`、忽略展示 URL、统一空值并按动态字段 key 排序。
- 全局追溯码页布局修复(2026-07-05):数据看板点击“追溯码总数 / 已激活追溯码”会进入隐藏全局 `/trace-codes` 页面;该页面现在使用 `page table-page` 与 `TraceCodePanel` 组合,表格主体和分页按后台列表规范自适应宽高,避免只显示工具栏和分页、表格主体被压成 0 高。主布局在 `traceCodes` / `artwork-trace-codes` 路由下顶部标题显示“追溯码管理”,侧边菜单仍归属“艺术品档案”。
- 数据看板时间步进器(2026-07-05):查询趋势的“近 N 日”数字输入框使用 Naive UI `button-placement="both"`,呈现为左侧减号、中间数值、右侧加号的紧凑步进器;数值居中显示,并继续保持 `1-365` 天范围和修改后清空自定义日期范围的逻辑。
- 默认主题与语言初始化(2026-07-05):后台主题无用户保存值时默认 `auto`,跟随浏览器/系统 `prefers-color-scheme`;后台语言无保存值时按 `navigator.languages / navigator.language` 匹配 `zh-CN` 或 `en-US`,并同步设置 ``。后台登录页右上角现在同时提供主题切换和语言切换。客户端语言继续默认识别浏览器语言,并补充 `` 同步;客户端基础色板通过 CSS `prefers-color-scheme` 跟随系统,新增 `--card-bg/--soft-bg/--border/--shell-shadow` 等变量,首页和通用卡片使用变量适配明暗色。
diff --git a/apps/admin/src/locales/en-US.json b/apps/admin/src/locales/en-US.json
index a5b66a5..c3aa05c 100644
--- a/apps/admin/src/locales/en-US.json
+++ b/apps/admin/src/locales/en-US.json
@@ -258,6 +258,7 @@
"saveDraft": "Save Draft",
"submitReview": "Submit for Audit",
"submittedReview": "Submitted for audit. Changes take effect only after approval.",
+ "noChangeTip": "No artwork content changes to submit.",
"changeInfo": "Change Notes",
"changeTitle": "Change Title",
"changeTitlePlaceholder": "e.g. Add certificate, adjust artwork images",
diff --git a/apps/admin/src/locales/zh-CN.json b/apps/admin/src/locales/zh-CN.json
index 9b8e61f..e2a6bf8 100644
--- a/apps/admin/src/locales/zh-CN.json
+++ b/apps/admin/src/locales/zh-CN.json
@@ -258,6 +258,7 @@
"saveDraft": "保存草稿",
"submitReview": "提交审核",
"submittedReview": "已提交审核,审核通过后修改才会生效",
+ "noChangeTip": "作品内容未发生变化,无需提交审核",
"changeInfo": "修改说明",
"changeTitle": "修改标题",
"changeTitlePlaceholder": "例如:补充认证文件、调整作品图片",
diff --git a/apps/admin/src/views/ArtworkEdit.vue b/apps/admin/src/views/ArtworkEdit.vue
index 0b69f4a..65b3cb8 100644
--- a/apps/admin/src/views/ArtworkEdit.vue
+++ b/apps/admin/src/views/ArtworkEdit.vue
@@ -11,7 +11,13 @@
{{ t('pages.artwork.saveDraft') }}
-
+
{{ isNew ? t('common.action.save') : t('pages.artwork.submitReview') }}
@@ -370,7 +376,9 @@ const certs = ref([]);
const revisions = ref([]);
const revisionLoading = ref(false);
const previewRevision = ref(null);
+const originalSnapshot = ref('');
let localIdSeed = 0;
+const hasArtworkChanges = computed(() => isNew.value || originalSnapshot.value !== JSON.stringify(buildComparableSnapshot()));
function nextLocalId(prefix: string) {
localIdSeed += 1;
@@ -414,6 +422,10 @@ async function openSubmitReview() {
} catch {
return;
}
+ if (!hasArtworkChanges.value) {
+ message.warning(t('pages.artwork.noChangeTip'));
+ return;
+ }
if (!submitReviewForm.title) submitReviewForm.title = t('pages.artwork.defaultChangeTitle');
submitReviewModal.value = true;
}
@@ -431,6 +443,7 @@ async function loadArtwork() {
} else {
previewRevision.value = null;
}
+ originalSnapshot.value = JSON.stringify(buildComparableSnapshot());
}
async function loadRevisions() {
@@ -498,6 +511,7 @@ function normalizeCert(c: any) {
...c,
originKey: c.originKey ?? c.originFileUrl,
watermarkKey: c.watermarkKey ?? c.watermarkFileUrl,
+ issuedAt: c.issuedAt,
originUrl: c.originUrl,
watermarkUrl: c.watermarkUrl,
};
@@ -523,6 +537,7 @@ function buildCertPayload() {
return certs.value.map((cert) => ({
name: cert.name,
issuer: cert.issuer,
+ issuedAt: cert.issuedAt || undefined,
type: cert.type,
originKey: cert.originKey,
watermarkKey: cert.watermarkKey,
@@ -537,6 +552,11 @@ async function saveArtwork(asDraft: boolean) {
}
saving.value = true;
try {
+ if (!isNew.value && !hasArtworkChanges.value) {
+ message.warning(t('pages.artwork.noChangeTip'));
+ submitReviewModal.value = false;
+ return;
+ }
const payload = {
templateId: form.templateId,
title: form.title,
@@ -571,6 +591,65 @@ async function saveArtwork(asDraft: boolean) {
}
}
+function buildComparableSnapshot() {
+ return {
+ artwork: {
+ templateId: Number(form.templateId),
+ title: form.title || '',
+ artist: form.artist || '',
+ status: form.status,
+ dynamicFields: normalizeJson(form.dynamicFields || {}),
+ images: normalizeMedia(form.images),
+ },
+ traceNodes: nodes.value.map((node, index) => ({
+ nodeType: node.nodeType,
+ title: node.title || '',
+ occurredAt: normalizeDateOnly(node.occurredAt),
+ location: node.location || '',
+ description: node.description || '',
+ mediaFiles: normalizeMedia(node.media || node.mediaFiles),
+ sortOrder: index,
+ })),
+ certificates: certs.value.map((cert) => ({
+ name: cert.name || '',
+ issuer: cert.issuer || '',
+ issuedAt: normalizeDateOnly(cert.issuedAt),
+ type: cert.type,
+ originKey: cert.originKey,
+ watermarkKey: cert.watermarkKey || '',
+ })),
+ };
+}
+
+function normalizeMedia(items?: any[]) {
+ return (items || []).map((item) => ({
+ key: item.key || item.url || '',
+ name: item.name || '',
+ type: item.type || '',
+ }));
+}
+
+function normalizeJson(value: unknown): unknown {
+ if (Array.isArray(value)) return value.map((item) => normalizeJson(item));
+ if (value && typeof value === 'object') {
+ return Object.keys(value as Record)
+ .sort()
+ .reduce>((acc, key) => {
+ const item = (value as Record)[key];
+ if (item !== undefined) acc[key] = normalizeJson(item);
+ return acc;
+ }, {});
+ }
+ return value ?? null;
+}
+
+function normalizeDateOnly(value?: string | Date | null) {
+ if (!value) return null;
+ const date = new Date(value);
+ if (!Number.isNaN(date.getTime())) return date.toISOString().slice(0, 10);
+ return String(value).slice(0, 10);
+}
+
/* 节点 */
const nodeModal = ref(false);
const nodeSaving = ref(false);
diff --git a/apps/api/src/artwork/artwork.service.ts b/apps/api/src/artwork/artwork.service.ts
index e000b18..2d13bf1 100644
--- a/apps/api/src/artwork/artwork.service.ts
+++ b/apps/api/src/artwork/artwork.service.ts
@@ -278,6 +278,9 @@ export class ArtworkService {
const artwork = await this.ensureExists(id);
const shouldApplyDirectly = artwork.status !== ArtworkStatus.ACTIVE || artwork.auditStatus !== AuditStatus.APPROVED;
+ if (!this.hasSnapshotChanged(current, afterSnapshot)) {
+ throw new BusinessException(ErrorCode.VALIDATION_FAILED, '作品内容未发生变化,无需提交审核', 400);
+ }
const revisionTitle = dto.revisionTitle || '作品内容修改';
const revisionReason = dto.revisionReason || null;
@@ -454,7 +457,7 @@ export class ArtworkService {
return nodes.map((node, index) => ({
nodeType: node.nodeType,
title: node.title,
- occurredAt: node.occurredAt ?? null,
+ occurredAt: this.normalizeDateOnly(node.occurredAt),
location: node.location ?? null,
description: node.description ?? null,
mediaFiles: (node.mediaFiles ?? []) as MediaItem[],
@@ -466,7 +469,7 @@ export class ArtworkService {
return certs.map((cert) => ({
name: cert.name,
issuer: cert.issuer ?? null,
- issuedAt: cert.issuedAt ?? null,
+ issuedAt: this.normalizeDateOnly(cert.issuedAt),
type: cert.type,
originKey: cert.originKey,
watermarkKey: cert.watermarkKey ?? null,
@@ -512,7 +515,7 @@ export class ArtworkService {
.map((node) => ({
nodeType: node.nodeType,
title: node.title,
- occurredAt: node.occurredAt ? node.occurredAt.toISOString() : null,
+ occurredAt: this.normalizeDateOnly(node.occurredAt),
location: node.location,
description: node.description,
mediaFiles: (Array.isArray(node.mediaFiles) ? node.mediaFiles : []) as unknown as MediaItem[],
@@ -521,7 +524,7 @@ export class ArtworkService {
certificates: record.certificates.map((cert) => ({
name: cert.name,
issuer: cert.issuer,
- issuedAt: cert.issuedAt ? cert.issuedAt.toISOString() : null,
+ issuedAt: this.normalizeDateOnly(cert.issuedAt),
type: cert.type,
originKey: cert.originFileUrl,
watermarkKey: cert.watermarkFileUrl,
@@ -529,6 +532,70 @@ export class ArtworkService {
};
}
+ private hasSnapshotChanged(before: ArtworkSnapshot, after: ArtworkSnapshot): boolean {
+ return JSON.stringify(this.normalizeSnapshotForCompare(before)) !== JSON.stringify(this.normalizeSnapshotForCompare(after));
+ }
+
+ private normalizeSnapshotForCompare(snapshot: ArtworkSnapshot) {
+ return {
+ artwork: {
+ templateId: Number(snapshot.artwork.templateId),
+ title: snapshot.artwork.title ?? '',
+ artist: snapshot.artwork.artist ?? '',
+ status: snapshot.artwork.status,
+ dynamicFields: this.normalizeJson(snapshot.artwork.dynamicFields ?? {}),
+ images: this.normalizeMedia(snapshot.artwork.images),
+ },
+ traceNodes: snapshot.traceNodes.map((node, index) => ({
+ nodeType: node.nodeType,
+ title: node.title ?? '',
+ occurredAt: this.normalizeDateOnly(node.occurredAt),
+ location: node.location ?? '',
+ description: node.description ?? '',
+ mediaFiles: this.normalizeMedia(node.mediaFiles),
+ sortOrder: index,
+ })),
+ certificates: snapshot.certificates.map((cert) => ({
+ name: cert.name ?? '',
+ issuer: cert.issuer ?? '',
+ issuedAt: this.normalizeDateOnly(cert.issuedAt),
+ type: cert.type,
+ originKey: cert.originKey,
+ watermarkKey: cert.watermarkKey ?? '',
+ })),
+ };
+ }
+
+ private normalizeMedia(items?: MediaItem[]) {
+ return (items ?? []).map((item) => ({
+ key: item.key,
+ name: item.name ?? '',
+ type: item.type ?? '',
+ }));
+ }
+
+ private normalizeJson(value: unknown): unknown {
+ if (Array.isArray(value)) return value.map((item) => this.normalizeJson(item));
+ if (value && typeof value === 'object') {
+ return Object.keys(value as Record)
+ .sort()
+ .reduce>((acc, key) => {
+ const item = (value as Record)[key];
+ if (item !== undefined) acc[key] = this.normalizeJson(item);
+ return acc;
+ }, {});
+ }
+ return value ?? null;
+ }
+
+ private normalizeDateOnly(value?: string | Date | null): string | null {
+ if (!value) return null;
+ if (value instanceof Date) return value.toISOString().slice(0, 10);
+ const date = new Date(value);
+ if (!Number.isNaN(date.getTime())) return date.toISOString().slice(0, 10);
+ return value.slice(0, 10);
+ }
+
private snapshotWithUrls(input: unknown) {
const snapshot = input as ArtworkSnapshot | Record;
if (!('artwork' in snapshot)) return snapshot;