修改DiceLotteryPoolConfig-type改为name映射

This commit is contained in:
2026-03-17 17:09:10 +08:00
parent d4cf708bc1
commit e7b8f4cae9
18 changed files with 64 additions and 115 deletions

View File

@@ -89,7 +89,7 @@
</div>
<div class="config-row">
<span class="config-label">{{ $t('page.form.configLabelType') }}</span>
<span>{{ lotteryConfigTypeText(currentLotteryConfig.type) }}</span>
<span>{{ lotteryConfigTypeText(currentLotteryConfig.name) }}</span>
</div>
<div class="config-row">
<span class="config-label">{{ $t('page.form.configLabelWeights') }}</span>
@@ -265,11 +265,12 @@
/** 当前选中的 DiceLotteryConfig 完整数据(用于展示) */
const currentLotteryConfig = ref<Record<string, any> | null>(null)
function lotteryConfigTypeText(type: unknown): string {
const t = Number(type)
if (t === 0) return '付费'
if (t === 1) return '赠送'
return t ? `类型${t}` : '-'
function lotteryConfigTypeText(name: unknown): string {
const n = String(name ?? '')
if (n === 'default') return '默认'
if (n === 'killScore') return '杀分'
if (n === 'up') return '上分'
return n || '-'
}
/** 是否为空/自定义权重(未选彩金池或选 0 */