diff --git a/apps/admin/src/components/TraceCodePanel.vue b/apps/admin/src/components/TraceCodePanel.vue index 234a2c3..5f9c86c 100644 --- a/apps/admin/src/components/TraceCodePanel.vue +++ b/apps/admin/src/components/TraceCodePanel.vue @@ -300,7 +300,7 @@ const columns = computed>(() => { width: 124, align: 'center', render: (r) => - r.outTime || r.outImage || getOutImages(r).length + r.outTime || getOutImages(r).length ? h(NTag, { size: 'small', type: 'success' }, { default: () => t('pages.traceCode.outRegistered') }) : h(NText, { depth: 3 }, { default: () => t('pages.traceCode.notOutbound') }), }, @@ -754,12 +754,9 @@ function fileName(key: string) { function getOutImages(row: any) { const list = Array.isArray(row.outImages) ? row.outImages : []; - if (list.length) { - return list.map((item: any) => - typeof item === 'string' ? { key: item, url: item, name: fileName(item), type: 'image' } : item, - ); - } - return row.outImage ? [{ key: row.outImage, url: row.outImageUrl || row.outImage, name: fileName(row.outImage), type: 'image' }] : []; + return list.map((item: any) => + typeof item === 'string' ? { key: item, url: item, name: fileName(item), type: 'image' } : item, + ); } function openOutboundModal(row: any) { diff --git a/apps/admin/src/locales/en-US.json b/apps/admin/src/locales/en-US.json index c3b769b..74a9f34 100644 --- a/apps/admin/src/locales/en-US.json +++ b/apps/admin/src/locales/en-US.json @@ -182,6 +182,39 @@ "placeholderPass": "Enter password", "success": "Signed in" }, + "install": { + "subtitle": "First run — please complete the setup", + "start": "Start Install", + "installing": "Installing…", + "alreadyInstalled": "The system has already been initialized", + "gotoAdmin": "You can open the admin console now.", + "enterAdmin": "Open Admin", + "base": "Base", + "appName": "Platform Name", + "baseUrl": "Public URL", + "listenPort": "Listen Port", + "baseUrlHint": "All three apps share this URL: admin at /admin, client at /trace, API at /api. Use Nginx / a control panel to reverse-proxy the domain and HTTPS to the listen port.", + "host": "Host", + "port": "Port", + "database": "Database", + "username": "Username", + "password": "Password", + "adminUser": "DB admin user (optional)", + "adminPass": "DB admin password (optional)", + "mysqlAdminHint": "Only needed if the business account cannot create databases; the database, tables and data are created automatically.", + "admin": "Admin", + "realName": "Name", + "storage": "Storage", + "driver": "Driver", + "local": "Local", + "localDir": "Local Directory", + "cdnBaseUrl": "CDN URL", + "failed": "Installation failed", + "done": "Initialized. The service is restarting, please wait…", + "loadFailed": "Failed to read installation status", + "defaultAppName": "Artwork Traceability Platform", + "defaultAdminName": "Administrator" + }, "dashboard": { "totalArtworks": "Artworks", "totalCodes": "Total Codes", @@ -271,6 +304,12 @@ "changeReason": "Change Reason", "changeReasonPlaceholder": "Describe why this change is needed for audit and traceability.", "defaultChangeTitle": "Artwork content update", + "defaultNodes": { + "create": "Creation / Selection", + "produce": "Production", + "storage": "Storage / Custody", + "outbound": "Outbound / Transfer" + }, "changeRecords": "Change Records", "pendingChange": "Pending Revision", "rejectedChange": "Rejected Revision", @@ -444,6 +483,7 @@ "carouselIntervalHint": "Seconds each media stays; decimals allowed. 0 disables auto-advance (manual loop still works).", "clientBaseUrl": "Client URL", "storageSettings": "Storage & CDN", + "storageHint": "Storage settings are NOT applied by the Save button above. After editing, click Test to verify the target, Migrate to copy existing files, then Switch to activate.", "storageDriver": "Storage", "storageDriverLocal": "Local", "storageDriverOss": "OSS/S3", diff --git a/apps/admin/src/locales/zh-CN.json b/apps/admin/src/locales/zh-CN.json index 3020650..7b5f4e0 100644 --- a/apps/admin/src/locales/zh-CN.json +++ b/apps/admin/src/locales/zh-CN.json @@ -182,6 +182,39 @@ "placeholderPass": "请输入密码", "success": "登录成功" }, + "install": { + "subtitle": "首次运行,请完成系统初始化", + "start": "开始安装", + "installing": "安装中…", + "alreadyInstalled": "系统已完成初始化", + "gotoAdmin": "可直接进入管理后台。", + "enterAdmin": "进入后台", + "base": "基础", + "appName": "平台名称", + "baseUrl": "对外访问地址", + "listenPort": "监听端口", + "baseUrlHint": "三端共用此地址:后台 /admin、客户端 /trace、接口 /api。域名与 HTTPS 建议由 Nginx/宝塔/1Panel 反代到监听端口。", + "host": "主机", + "port": "端口", + "database": "数据库", + "username": "账号", + "password": "密码", + "adminUser": "建库管理员账号(可选)", + "adminPass": "建库管理员密码(可选)", + "mysqlAdminHint": "仅当业务账号无建库权限时填写;系统会自动创建数据库并初始化表结构与数据。", + "admin": "管理员", + "realName": "姓名", + "storage": "存储", + "driver": "方式", + "local": "本地", + "localDir": "本地目录", + "cdnBaseUrl": "CDN 地址", + "failed": "安装失败", + "done": "初始化完成,服务正在重启,请稍候…", + "loadFailed": "读取安装状态失败", + "defaultAppName": "艺术品溯源平台", + "defaultAdminName": "管理员" + }, "dashboard": { "totalArtworks": "作品总数", "totalCodes": "追溯码总数", @@ -271,6 +304,12 @@ "changeReason": "修改理由", "changeReasonPlaceholder": "请说明本次修改的原因,便于审核与追溯", "defaultChangeTitle": "作品内容修改", + "defaultNodes": { + "create": "创作 / 选胚", + "produce": "制作过程", + "storage": "仓储 / 托管", + "outbound": "出库 / 流转" + }, "changeRecords": "修改记录", "pendingChange": "待审核修改", "rejectedChange": "修改已驳回", @@ -444,6 +483,7 @@ "carouselIntervalHint": "每张媒体停留秒数,支持小数;填 0 则不自动切换(仍可手动循环切换)", "clientBaseUrl": "客户端地址", "storageSettings": "存储与 CDN", + "storageHint": "存储配置不随上方「保存」生效:修改后请依次点「测试」验证目标可用、「迁移」把已有文件复制到目标,再点「切换」正式启用。", "storageDriver": "存储方式", "storageDriverLocal": "本地", "storageDriverOss": "OSS/S3", diff --git a/apps/admin/src/views/ArtworkEdit.vue b/apps/admin/src/views/ArtworkEdit.vue index 153b322..daaa8f3 100644 --- a/apps/admin/src/views/ArtworkEdit.vue +++ b/apps/admin/src/views/ArtworkEdit.vue @@ -403,10 +403,10 @@ function nextLocalId(prefix: string) { function defaultTraceNodes() { return [ - { localId: nextLocalId('node'), nodeType: NodeType.CREATE, title: '创作 / 选胚', sortOrder: 0, media: [] }, - { localId: nextLocalId('node'), nodeType: NodeType.PRODUCE, title: '制作过程', sortOrder: 1, media: [] }, - { localId: nextLocalId('node'), nodeType: NodeType.STORAGE, title: '仓储 / 托管', sortOrder: 2, media: [] }, - { localId: nextLocalId('node'), nodeType: NodeType.OUTBOUND, title: '出库 / 流转', sortOrder: 3, media: [] }, + { localId: nextLocalId('node'), nodeType: NodeType.CREATE, title: t('pages.artwork.defaultNodes.create'), sortOrder: 0, media: [] }, + { localId: nextLocalId('node'), nodeType: NodeType.PRODUCE, title: t('pages.artwork.defaultNodes.produce'), sortOrder: 1, media: [] }, + { localId: nextLocalId('node'), nodeType: NodeType.STORAGE, title: t('pages.artwork.defaultNodes.storage'), sortOrder: 2, media: [] }, + { localId: nextLocalId('node'), nodeType: NodeType.OUTBOUND, title: t('pages.artwork.defaultNodes.outbound'), sortOrder: 3, media: [] }, ]; } diff --git a/apps/admin/src/views/Install.vue b/apps/admin/src/views/Install.vue index 4ee93f1..166da66 100644 --- a/apps/admin/src/views/Install.vue +++ b/apps/admin/src/views/Install.vue @@ -116,81 +116,10 @@ interface InstallForm { }; } -const messages = { - 'zh-CN': { - subtitle: '首次运行,请完成系统初始化', - start: '开始安装', - installing: '安装中…', - alreadyInstalled: '系统已完成初始化', - gotoAdmin: '可直接进入管理后台。', - enterAdmin: '进入后台', - base: '基础', - appName: '平台名称', - baseUrl: '对外访问地址', - listenPort: '监听端口', - baseUrlHint: '三端共用此地址:后台 /admin、客户端 /trace、接口 /api。域名与 HTTPS 建议由 Nginx/宝塔/1Panel 反代到监听端口。', - host: '主机', - port: '端口', - database: '数据库', - username: '账号', - password: '密码', - adminUser: '建库管理员账号(可选)', - adminPass: '建库管理员密码(可选)', - mysqlAdminHint: '仅当业务账号无建库权限时填写;系统会自动创建数据库并初始化表结构与数据。', - admin: '管理员', - realName: '姓名', - storage: '存储', - driver: '方式', - local: '本地', - localDir: '本地目录', - cdnBaseUrl: 'CDN 地址', - failed: '安装失败', - done: '初始化完成,服务正在重启,请稍候…', - loadFailed: '读取安装状态失败', - defaultAppName: '艺术品溯源平台', - defaultAdminName: '管理员', - }, - 'en-US': { - subtitle: 'First run — please complete the setup', - start: 'Start Install', - installing: 'Installing…', - alreadyInstalled: 'The system has already been initialized', - gotoAdmin: 'You can open the admin console now.', - enterAdmin: 'Open Admin', - base: 'Base', - appName: 'Platform Name', - baseUrl: 'Public URL', - listenPort: 'Listen Port', - baseUrlHint: 'All three apps share this URL: admin at /admin, client at /trace, API at /api. Use Nginx / a control panel to reverse-proxy the domain and HTTPS to the listen port.', - host: 'Host', - port: 'Port', - database: 'Database', - username: 'Username', - password: 'Password', - adminUser: 'DB admin user (optional)', - adminPass: 'DB admin password (optional)', - mysqlAdminHint: 'Only needed if the business account cannot create databases; the database, tables and data are created automatically.', - admin: 'Admin', - realName: 'Name', - storage: 'Storage', - driver: 'Driver', - local: 'Local', - localDir: 'Local Directory', - cdnBaseUrl: 'CDN URL', - failed: 'Installation failed', - done: 'Initialized. The service is restarting, please wait…', - loadFailed: 'Failed to read installation status', - defaultAppName: 'Artwork Traceability Platform', - defaultAdminName: 'Administrator', - }, -} as const; - -type MessageKey = keyof (typeof messages)['zh-CN']; - -const { locale } = useI18n(); -const lang = computed<'zh-CN' | 'en-US'>(() => (String(locale.value).startsWith('en') ? 'en-US' : 'zh-CN')); -function tt(key: MessageKey): string { - return messages[lang.value][key] || messages['zh-CN'][key]; +const { t } = useI18n(); +// 安装向导文案统一走全局 locale(pages.install.*),保持与后台其它页面一致 +function tt(key: string): string { + return t(`pages.install.${key}`); } const driverOptions = computed(() => [ @@ -199,7 +128,7 @@ const driverOptions = computed(() => [ ]); const form = reactive({ - appName: messages[lang.value].defaultAppName, + appName: tt('defaultAppName'), baseUrl: location.origin, port: 3000, mysql: { @@ -212,7 +141,7 @@ const form = reactive({ adminPassword: '', }, redis: { host: '127.0.0.1', port: 6379, password: '' }, - admin: { username: 'admin', password: '', realName: messages[lang.value].defaultAdminName }, + admin: { username: 'admin', password: '', realName: tt('defaultAdminName') }, storage: { driver: 'local', localDir: './storage', diff --git a/apps/admin/src/views/Settings.vue b/apps/admin/src/views/Settings.vue index 4f1525e..e583db2 100644 --- a/apps/admin/src/views/Settings.vue +++ b/apps/admin/src/views/Settings.vue @@ -127,6 +127,7 @@ {{ t('pages.settings.confirmStorage') }} + {{ t('pages.settings.storageHint') }}
@@ -449,6 +450,9 @@ const currentIconUrl = computed(() => resolveAppIcon(form.appIconFiles[0]?.url | flex-wrap: wrap; justify-content: flex-end; } +.storage-hint { + margin: 0 12px 8px; +} .setting-row { padding: 8px 12px; border-bottom: 1px solid var(--n-border-color); diff --git a/apps/client/src/locales/en-US.json b/apps/client/src/locales/en-US.json index 81f0396..101a04d 100644 --- a/apps/client/src/locales/en-US.json +++ b/apps/client/src/locales/en-US.json @@ -19,7 +19,9 @@ }, "timeline": { "expandMedia": "View images ({n})", - "collapse": "Collapse" + "collapse": "Collapse", + "outboundTitle": "Outbound Record", + "outboundDesc": "Outbound photos for the physical item of this trace code." }, "chain": { "archiveNo": "Archive No.", diff --git a/apps/client/src/locales/zh-CN.json b/apps/client/src/locales/zh-CN.json index 073bc5a..0836a2c 100644 --- a/apps/client/src/locales/zh-CN.json +++ b/apps/client/src/locales/zh-CN.json @@ -19,7 +19,9 @@ }, "timeline": { "expandMedia": "查看图片({n})", - "collapse": "收起图片" + "collapse": "收起图片", + "outboundTitle": "本件出库记录", + "outboundDesc": "该追溯码对应实物的出库实况记录。" }, "chain": { "archiveNo": "档案编号", diff --git a/apps/client/src/views/Trace.vue b/apps/client/src/views/Trace.vue index e52cc20..4cd632e 100644 --- a/apps/client/src/views/Trace.vue +++ b/apps/client/src/views/Trace.vue @@ -197,9 +197,9 @@
-
{{ n.title }}
+
{{ nodeTitle(n) }}
{{ [fmtDate(n.occurredAt), n.location].filter(Boolean).join(' · ') }}
-
{{ n.description }}
+
{{ nodeDesc(n) }}