feat: 优化默认建档模板和时间轴

This commit is contained in:
Nixevol
2026-07-05 01:21:34 +08:00
parent 7a51814307
commit b51f26213b
6 changed files with 74 additions and 11 deletions
+8
View File
@@ -14,6 +14,13 @@ interface MediaItem {
type?: string;
}
const DEFAULT_TRACE_NODES: Prisma.TraceNodeCreateWithoutArtworkInput[] = [
{ nodeType: 'CREATE', title: '创作 / 选胚', sortOrder: 0 },
{ nodeType: 'PRODUCE', title: '制作过程', sortOrder: 1 },
{ nodeType: 'STORAGE', title: '仓储 / 托管', sortOrder: 2 },
{ nodeType: 'OUTBOUND', title: '出库 / 流转', sortOrder: 3 },
];
@Injectable()
export class ArtworkService {
constructor(
@@ -46,6 +53,7 @@ export class ArtworkService {
dynamicFields: (dto.dynamicFields ?? {}) as Prisma.InputJsonValue,
images: (dto.images ?? []) as unknown as Prisma.InputJsonValue,
createdBy: userId,
traceNodes: { create: DEFAULT_TRACE_NODES },
},
});
// 创建后回填档案编号(需要自增 id)