优化:名录编码自动生成并隐藏维护入口

This commit is contained in:
2026-11-03 13:11:00 +08:00
parent 52d92c95d8
commit 1aeccddd4d
8 changed files with 126 additions and 36 deletions
+7
View File
@@ -0,0 +1,7 @@
/** Internal catalog identity never needs user input. Existing identities survive renames. */
export function newMasterDataCode(existing: Iterable<string>): string {
const used = existing instanceof Set ? existing : new Set(existing);
let code: string;
do { code = `REF-${crypto.randomUUID()}`; } while (used.has(code));
return code;
}