From 7e3cee4150e65f2ba1a927a2f0a92f1435b6269f Mon Sep 17 00:00:00 2001 From: zhenhui <1276357500@qq.com> Date: Tue, 3 Mar 2026 17:05:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/plugin/dice/player/index/index.vue | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/saiadmin-artd/src/views/plugin/dice/player/index/index.vue b/saiadmin-artd/src/views/plugin/dice/player/index/index.vue index 30a209c..12ce563 100644 --- a/saiadmin-artd/src/views/plugin/dice/player/index/index.vue +++ b/saiadmin-artd/src/views/plugin/dice/player/index/index.vue @@ -48,7 +48,7 @@ v-permission="'dice:player:index:update'" :model-value="row.status === 1" :loading="row._statusLoading" - @change="(v: boolean) => handleStatusChange(row, v ? 1 : 0)" + @change="(v: string | number | boolean) => handleStatusChange(row, v ? 1 : 0)" /> @@ -105,13 +105,23 @@ getData() } - // 权重列带 % 的 formatter - const weightFormatter = (_row: any, _column: any, cellValue: unknown) => - cellValue != null && cellValue !== '' ? `${cellValue}%` : '-' + // 权重列带 % 的 formatter(ColumnOption.formatter 仅接收 row) + const weightFormatter = (prop: string) => (row: any) => { + const cellValue = row[prop] + return cellValue != null && cellValue !== '' ? `${cellValue}%` : '-' + } // 倍率列展示:0=正常 1=强制杀猪 2=T1高倍率 - const isUpFormatter = (_row: any, _column: any, cellValue: unknown) => - cellValue === 0 ? '正常' : cellValue === 1 ? '强制杀猪' : cellValue === 2 ? 'T1高倍率' : '-' + const isUpFormatter = (row: any) => { + const cellValue = row.is_up + return cellValue === 0 + ? '正常' + : cellValue === 1 + ? '强制杀猪' + : cellValue === 2 + ? 'T1高倍率' + : '-' + } // 表格配置 const { @@ -137,11 +147,11 @@ { prop: 'status', label: '状态', width: 88, useSlot: true }, { prop: 'coin', label: '平台币', width: 100, useSlot: true }, { prop: 'is_up', label: '倍率', width: 80, formatter: isUpFormatter }, - { prop: 't1_wight', label: 'T1池权重', width: 100, formatter: weightFormatter }, - { prop: 't2_wight', label: 'T2池权重', width: 100, formatter: weightFormatter }, - { prop: 't3_wight', label: 'T3池权重', width: 100, formatter: weightFormatter }, - { prop: 't4_wight', label: 'T4池权重', width: 100, formatter: weightFormatter }, - { prop: 't5_wight', label: 'T5池权重', width: 100, formatter: weightFormatter }, + { prop: 't1_wight', label: 'T1池权重', width: 100, formatter: weightFormatter('t1_wight') }, + { prop: 't2_wight', label: 'T2池权重', width: 100, formatter: weightFormatter('t2_wight') }, + { prop: 't3_wight', label: 'T3池权重', width: 100, formatter: weightFormatter('t3_wight') }, + { prop: 't4_wight', label: 'T4池权重', width: 100, formatter: weightFormatter('t4_wight') }, + { prop: 't5_wight', label: 'T5池权重', width: 100, formatter: weightFormatter('t5_wight') }, { prop: 'total_draw_count', label: '总抽奖次数' }, { prop: 'paid_draw_count', label: '购买抽奖次数' }, { prop: 'free_draw_count', label: '赠送抽奖次数' },