feat(admin,api,player): 赛事分组管理、盘口独立页与多语言展示优化
- 管理端按联赛展示单场,新增赛事/单场流程与列表展开状态保持 - 盘口赔率迁至独立页面,保存按钮仅在有修改时高亮 - API 新增联赛列表与子场查询,按 locale 返回队名并修复编译 - 波胆其它选项与促销标签等 i18n 补齐,文案更易懂
This commit is contained in:
22
apps/admin/src/utils/adminSelectionLabel.ts
Normal file
22
apps/admin/src/utils/adminSelectionLabel.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { defaultSelectionName } from './selectionDefaults';
|
||||
|
||||
/** 管理后台盘口选项展示名(按 code + 当前语言) */
|
||||
export function adminSelectionLabel(
|
||||
t: (key: string) => string,
|
||||
code: string,
|
||||
opts?: { lineValue?: number | null; period?: string },
|
||||
): string {
|
||||
const i18nKey = `matchEditor.selection.${code}`;
|
||||
const translated = t(i18nKey);
|
||||
if (translated !== i18nKey) return translated;
|
||||
|
||||
const score = code.match(/^SCORE_(\d+)_(\d+)$/);
|
||||
if (score) return `${score[1]}-${score[2]}`;
|
||||
|
||||
if (opts) {
|
||||
const name = defaultSelectionName(code, opts);
|
||||
if (name !== code) return name;
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
Reference in New Issue
Block a user