修复打包前端报错

This commit is contained in:
2026-03-03 17:05:36 +08:00
parent 878dbbf578
commit 7e3cee4150

View File

@@ -48,7 +48,7 @@
v-permission="'dice:player:index:update'" v-permission="'dice:player:index:update'"
:model-value="row.status === 1" :model-value="row.status === 1"
:loading="row._statusLoading" :loading="row._statusLoading"
@change="(v: boolean) => handleStatusChange(row, v ? 1 : 0)" @change="(v: string | number | boolean) => handleStatusChange(row, v ? 1 : 0)"
/> />
</template> </template>
<!-- 平台币tag 展示 --> <!-- 平台币tag 展示 -->
@@ -105,13 +105,23 @@
getData() getData()
} }
// 权重列带 % 的 formatter // 权重列带 % 的 formatterColumnOption.formatter 仅接收 row
const weightFormatter = (_row: any, _column: any, cellValue: unknown) => const weightFormatter = (prop: string) => (row: any) => {
cellValue != null && cellValue !== '' ? `${cellValue}%` : '-' const cellValue = row[prop]
return cellValue != null && cellValue !== '' ? `${cellValue}%` : '-'
}
// 倍率列展示0=正常 1=强制杀猪 2=T1高倍率 // 倍率列展示0=正常 1=强制杀猪 2=T1高倍率
const isUpFormatter = (_row: any, _column: any, cellValue: unknown) => const isUpFormatter = (row: any) => {
cellValue === 0 ? '正常' : cellValue === 1 ? '强制杀猪' : cellValue === 2 ? 'T1高倍率' : '-' const cellValue = row.is_up
return cellValue === 0
? '正常'
: cellValue === 1
? '强制杀猪'
: cellValue === 2
? 'T1高倍率'
: '-'
}
// 表格配置 // 表格配置
const { const {
@@ -137,11 +147,11 @@
{ prop: 'status', label: '状态', width: 88, useSlot: true }, { prop: 'status', label: '状态', width: 88, useSlot: true },
{ prop: 'coin', label: '平台币', width: 100, useSlot: true }, { prop: 'coin', label: '平台币', width: 100, useSlot: true },
{ prop: 'is_up', label: '倍率', width: 80, formatter: isUpFormatter }, { prop: 'is_up', label: '倍率', width: 80, formatter: isUpFormatter },
{ prop: 't1_wight', label: 'T1池权重', width: 100, formatter: weightFormatter }, { prop: 't1_wight', label: 'T1池权重', width: 100, formatter: weightFormatter('t1_wight') },
{ prop: 't2_wight', label: 'T2池权重', width: 100, formatter: weightFormatter }, { prop: 't2_wight', label: 'T2池权重', width: 100, formatter: weightFormatter('t2_wight') },
{ prop: 't3_wight', label: 'T3池权重', width: 100, formatter: weightFormatter }, { prop: 't3_wight', label: 'T3池权重', width: 100, formatter: weightFormatter('t3_wight') },
{ prop: 't4_wight', label: 'T4池权重', width: 100, formatter: weightFormatter }, { prop: 't4_wight', label: 'T4池权重', width: 100, formatter: weightFormatter('t4_wight') },
{ prop: 't5_wight', label: 'T5池权重', width: 100, formatter: weightFormatter }, { prop: 't5_wight', label: 'T5池权重', width: 100, formatter: weightFormatter('t5_wight') },
{ prop: 'total_draw_count', label: '总抽奖次数' }, { prop: 'total_draw_count', label: '总抽奖次数' },
{ prop: 'paid_draw_count', label: '购买抽奖次数' }, { prop: 'paid_draw_count', label: '购买抽奖次数' },
{ prop: 'free_draw_count', label: '赠送抽奖次数' }, { prop: 'free_draw_count', label: '赠送抽奖次数' },