feat: 拆分上链与出库管理界面
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { i18n } from '@/locales';
|
||||
|
||||
const REASON_KEYS: Record<string, string> = {
|
||||
'该追溯码已登记出库': 'alreadyOutbound',
|
||||
'停用或异常追溯码不可上链': 'traceCodeUnavailable',
|
||||
'作品未生效或未审核通过': 'artworkUnavailable',
|
||||
'作品缺少有效主图': 'missingPrimaryImage',
|
||||
'该追溯码已上链': 'alreadyOnchain',
|
||||
'该追溯码正在上链处理中': 'onchainProcessing',
|
||||
};
|
||||
|
||||
export function localizeOperationReason(value: unknown): string {
|
||||
const text = typeof value === 'string' ? value : '';
|
||||
const key = REASON_KEYS[text];
|
||||
return key ? i18n.global.t(`pages.operations.reason.${key}`) : text;
|
||||
}
|
||||
Reference in New Issue
Block a user