[色子游戏]抽奖记录(测试权重)-优化

[API]记录抽奖券DicePlayerTicketRecord
This commit is contained in:
2026-03-25 18:51:29 +08:00
parent f8cf85dd01
commit d793a511ee
27 changed files with 256 additions and 47 deletions

View File

@@ -61,6 +61,7 @@ export default {
* 可选 lottery_config_id不选则传 paid_tier_weights / free_tier_weightsT1-T5
*/
startWeightTest(params: {
ante?: number
lottery_config_id?: number
paid_lottery_config_id?: number
free_lottery_config_id?: number

View File

@@ -58,19 +58,37 @@
<!-- 抽奖类型 -->
<template #lottery_type="{ row }">
<ElTag size="small" :type="row.lottery_type === 0 ? 'warning' : 'success'">
{{ row.lottery_type === 0 ? t('page.search.paid') : row.lottery_type === 1 ? t('page.search.free') : '-' }}
{{
row.lottery_type === 0
? t('page.search.paid')
: row.lottery_type === 1
? t('page.search.free')
: '-'
}}
</ElTag>
</template>
<!-- 是否中大奖 -->
<template #is_win="{ row }">
<ElTag size="small" :type="row.is_win === 1 ? 'success' : 'info'">
{{ row.is_win === 0 ? t('page.search.noBigWin') : row.is_win === 1 ? t('page.search.bigWin') : '-' }}
{{
row.is_win === 0
? t('page.search.noBigWin')
: row.is_win === 1
? t('page.search.bigWin')
: '-'
}}
</ElTag>
</template>
<!-- 方向 -->
<template #direction="{ row }">
<ElTag size="small" :type="row.direction === 0 ? 'primary' : 'warning'">
{{ row.direction === 0 ? t('page.search.clockwise') : row.direction === 1 ? t('page.search.anticlockwise') : '-' }}
{{
row.direction === 0
? t('page.search.clockwise')
: row.direction === 1
? t('page.search.anticlockwise')
: '-'
}}
</ElTag>
</template>
<!-- 摇取点数 -->
@@ -132,6 +150,8 @@
lottery_type: undefined,
direction: undefined,
is_win: undefined,
paid_amount: undefined,
ante: undefined,
win_coin_min: undefined,
win_coin_max: undefined,
reward_tier: undefined,
@@ -208,9 +228,16 @@
columnsFactory: () => [
{ type: 'selection' },
{ prop: 'id', label: 'page.table.id', width: 80 },
{ prop: 'lottery_config_id', label: 'page.table.lotteryPoolConfig', width: 120, useSlot: true },
{
prop: 'lottery_config_id',
label: 'page.table.lotteryPoolConfig',
width: 120,
useSlot: true
},
{ prop: 'lottery_type', label: 'page.table.drawType', width: 100, useSlot: true },
{ prop: 'is_win', label: 'page.table.isBigWin', width: 100, useSlot: true },
{ prop: 'paid_amount', label: 'page.table.paidAmount', width: 130 },
{ prop: 'ante', label: 'page.table.ante', width: 90 },
{ prop: 'win_coin', label: 'page.table.winCoin', width: 110 },
{ prop: 'super_win_coin', label: 'page.table.superWinCoin', width: 120 },
{ prop: 'reward_win_coin', label: 'page.table.rewardWinCoin', width: 140 },
@@ -222,7 +249,13 @@
{ prop: 'reward_config_id', label: 'page.table.rewardConfig', width: 100, useSlot: true },
{ prop: 'status', label: 'page.table.status', width: 80, useSlot: true },
{ prop: 'create_time', label: 'page.table.createTime', width: 170 },
{ prop: 'operation', label: 'table.actions.operation', width: 100, fixed: 'right', useSlot: true }
{
prop: 'operation',
label: 'table.actions.operation',
width: 100,
fixed: 'right',
useSlot: true
}
]
}
})

View File

@@ -28,6 +28,24 @@
<el-option :label="$t('page.search.anticlockwise')" :value="1" />
</el-select>
</el-form-item>
<el-form-item :label="$t('page.search.ante')" prop="ante">
<el-input-number
v-model="formData.ante"
:placeholder="$t('table.searchBar.all')"
:precision="0"
controls-position="right"
style="width: 100%"
/>
</el-form-item>
<el-form-item :label="$t('page.search.paidAmount')" prop="paid_amount">
<el-input-number
v-model="formData.paid_amount"
:placeholder="$t('table.searchBar.all')"
:precision="0"
controls-position="right"
style="width: 100%"
/>
</el-form-item>
<el-form-item :label="$t('page.search.isBigWin')" prop="is_win">
<el-select v-model="formData.is_win" :placeholder="$t('form.placeholderSelect')" clearable style="width: 100%">
<el-option :label="$t('page.search.noBigWin')" :value="0" />
@@ -153,6 +171,8 @@
lottery_config_id: null,
lottery_type: null,
is_win: null,
ante: 1,
paid_amount: 0,
win_coin: 0,
direction: null,
reward_tier: undefined as string | undefined,

View File

@@ -32,6 +32,28 @@
</el-select>
</el-form-item>
</el-col>
<el-col v-bind="setSpan(6)">
<el-form-item :label="$t('page.search.paidAmount')" prop="paid_amount">
<el-input-number
v-model="formData.paid_amount"
:placeholder="$t('table.searchBar.all')"
:precision="0"
controls-position="right"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col v-bind="setSpan(6)">
<el-form-item :label="$t('page.search.ante')" prop="ante">
<el-input-number
v-model="formData.ante"
:placeholder="$t('table.searchBar.all')"
:precision="0"
controls-position="right"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col v-bind="setSpan(6)">
<el-form-item :label="$t('page.search.winCoin')" prop="win_coin_min">
<div class="range-wrap">

View File

@@ -82,6 +82,7 @@
username: undefined,
use_coins_min: undefined,
use_coins_max: undefined,
ante: undefined,
total_ticket_count_min: undefined,
total_ticket_count_max: undefined,
paid_ticket_count_min: undefined,
@@ -136,6 +137,7 @@
formatter: (row: Record<string, any>) => usernameFormatter(row)
},
{ prop: 'use_coins', label: 'page.table.useCoins', align: 'center' },
{ prop: 'ante', label: 'page.table.ante', align: 'center' },
{ prop: 'total_ticket_count', label: 'page.table.totalDrawCount', align: 'center' },
{ prop: 'paid_ticket_count', label: 'page.table.paidDrawCount', align: 'center' },
{ prop: 'free_ticket_count', label: 'page.table.freeDrawCount', align: 'center' },

View File

@@ -34,6 +34,18 @@
</div>
</el-form-item>
</el-col>
<el-col v-bind="setSpan(6)">
<el-form-item :label="$t('page.search.ante')" prop="ante">
<el-input-number
v-model="formData.ante"
:placeholder="$t('table.searchBar.all')"
:min="1"
:precision="0"
controls-position="right"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col v-bind="setSpan(6)">
<el-form-item :label="$t('page.search.totalDrawCount')" prop="total_ticket_count_min">
<div class="range-wrap">

View File

@@ -12,6 +12,9 @@
{{ $t('page.weightTest.alertBody') }}
</ElAlert>
<ElForm ref="formRef" :model="form" label-width="140px">
<ElFormItem :label="$t('page.weightTest.labelAnte')" prop="ante" required>
<ElInputNumber v-model="form.ante" :min="1" :step="1" style="width: 100%" />
</ElFormItem>
<ElSteps :active="currentStep" finish-status="success" simple class="steps-wrap">
<ElStep :title="$t('page.weightTest.stepPaid')" />
<ElStep :title="$t('page.weightTest.stepFree')" />
@@ -187,6 +190,7 @@
const formRef = ref()
const currentStep = ref(0)
const form = reactive({
ante: 1,
paid_lottery_config_id: undefined as number | undefined,
free_lottery_config_id: undefined as number | undefined,
paid_tier_weights: { T1: 20, T2: 20, T3: 20, T4: 20, T5: 20 } as Record<string, number>,
@@ -270,6 +274,7 @@
function buildPayload() {
const payload: Record<string, unknown> = {
ante: form.ante,
paid_s_count: form.paid_s_count,
paid_n_count: form.paid_n_count,
free_s_count: form.free_s_count,
@@ -289,6 +294,10 @@
}
function validateForm(): boolean {
if (form.ante == null || form.ante <= 0) {
ElMessage.warning(t('page.weightTest.warnAnte'))
return false
}
if (form.paid_s_count + form.paid_n_count + form.free_s_count + form.free_n_count <= 0) {
ElMessage.warning(t('page.weightTest.warnTotalSpins'))
return false

View File

@@ -214,6 +214,13 @@
align: 'center',
showOverflowTooltip: true
},
{
prop: 'remark',
label: 'page.table.remark',
width: 220,
align: 'center',
showOverflowTooltip: true
},
{ prop: 'create_time', label: 'page.table.createTime', width: 170, align: 'center' },
{
prop: 'operation',