fix: align game king configuration scope

This commit is contained in:
zhx 2026-07-18 13:12:15 +08:00
parent b0e2a98d2a
commit 8cc2614fb3

View File

@ -12,7 +12,7 @@
type="info" type="info"
:closable="false" :closable="false"
show-icon show-icon
title="消费金额、抽奖次数和排行榜均以后端金币流水为准;活动开始后,每次抽奖金币数、开始时间、平台及事件白名单不可修改。" title="消费金额、抽奖次数和排行榜均以后端识别的游戏消费流水为准;活动开始后,每次抽奖金币数、开始时间及平台不可修改。"
/> />
</div> </div>
@ -41,18 +41,6 @@
{{ formatNumber(scope.row.coinPerDraw) }} 金币 {{ formatNumber(scope.row.coinPerDraw) }} 金币
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="精确事件白名单" min-width="220">
<template slot-scope="scope">
<el-tag
v-for="eventType in scope.row.eventTypes || []"
:key="eventType"
class="event-tag"
size="mini"
>
{{ eventType }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="状态" min-width="130" align="center"> <el-table-column label="状态" min-width="130" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="activityStatusTag(activityStatus(scope.row))"> <el-tag :type="activityStatusTag(activityStatus(scope.row))">
@ -183,23 +171,6 @@
<div class="form-help">活动结束后继续等待钱包异步流水到达再冻结最终榜单默认 30 分钟</div> <div class="form-help">活动结束后继续等待钱包异步流水到达再冻结最终榜单默认 30 分钟</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="精确事件白名单" prop="eventTypes">
<el-select
v-model="form.eventTypes"
multiple
filterable
allow-create
default-first-option
style="width: 100%"
:disabled="startedLocked"
placeholder="输入钱包流水的完整 eventType 后回车,例如 HOT_GAME_123不支持前缀和通配符"
/>
<div class="form-help">
这里只做精确等值匹配第三方游戏通常包含游戏 ID请从真实金币支出流水复制完整 eventType避免把礼物或其他支出计入活动
</div>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="排行口径"> <el-form-item label="排行口径">
<el-input value="消费金币榜TYCOON" disabled /> <el-input value="消费金币榜TYCOON" disabled />
@ -502,7 +473,7 @@
</activity-dialog> </activity-dialog>
<activity-dialog <activity-dialog
:title="`${selectedActivity.activityName || ''} - 历史游戏流水补数`" :title="`${selectedActivity.activityName || ''} - 历史游戏消费流水补数`"
:visible.sync="backfillVisible" :visible.sync="backfillVisible"
width="620px" width="620px"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -511,30 +482,9 @@
type="warning" type="warning"
:closable="false" :closable="false"
show-icon show-icon
title="补数按收支类型、单个精确 eventType 和金币流水主键游标执行。每组条件必须分别补到 finished=true防止共用游标漏数据。" title="这里只补活动期间的游戏消费流水;事件类型和支出方向均由服务端固定识别,请持续执行到 finished=true。"
/> />
<el-form label-width="120px" class="backfill-form"> <el-form label-width="120px" class="backfill-form">
<el-form-item label="流水类型">
<el-select v-model="backfillForm.receiptType" style="width: 100%" @change="resetBackfillCursor">
<el-option label="游戏消费Tycoon / 抽奖次数)" :value="1" />
<el-option label="游戏中奖收入Victorious" :value="0" />
</el-select>
</el-form-item>
<el-form-item label="精确 eventType">
<el-select
v-model="backfillForm.eventType"
style="width: 100%"
filterable
@change="resetBackfillCursor"
>
<el-option
v-for="item in selectedActivity.eventTypes || []"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="lastId 游标"> <el-form-item label="lastId 游标">
<el-input v-model.trim="backfillForm.lastId" placeholder="首次留空;后续自动回填 nextLastId" /> <el-input v-model.trim="backfillForm.lastId" placeholder="首次留空;后续自动回填 nextLastId" />
</el-form-item> </el-form-item>
@ -615,8 +565,7 @@ export default {
timeZone: [{ required: true, message: '请选择活动时区', trigger: 'change' }], timeZone: [{ required: true, message: '请选择活动时区', trigger: 'change' }],
timeRange: [{ type: 'array', required: true, len: 2, message: '请选择完整活动时间', trigger: 'change' }], timeRange: [{ type: 'array', required: true, len: 2, message: '请选择完整活动时间', trigger: 'change' }],
coinPerDraw: [{ required: true, message: '请输入每次抽奖金币数', trigger: 'blur' }], coinPerDraw: [{ required: true, message: '请输入每次抽奖金币数', trigger: 'blur' }],
settlementDelayMinutes: [{ required: true, message: '请输入结算等待分钟数', trigger: 'blur' }], settlementDelayMinutes: [{ required: true, message: '请输入结算等待分钟数', trigger: 'blur' }]
eventTypes: [{ type: 'array', required: true, min: 1, message: '至少配置一个精确 eventType', trigger: 'change' }]
}, },
timeZoneOptions: ['Asia/Riyadh', 'Asia/Shanghai', 'UTC'], timeZoneOptions: ['Asia/Riyadh', 'Asia/Shanghai', 'UTC'],
resourceSelectorVisible: false, resourceSelectorVisible: false,
@ -637,8 +586,6 @@ export default {
backfillLoading: false, backfillLoading: false,
backfillResult: null, backfillResult: null,
backfillForm: { backfillForm: {
receiptType: 1,
eventType: '',
lastId: '', lastId: '',
limit: 500 limit: 500
} }
@ -673,7 +620,6 @@ export default {
timeRange: [], timeRange: [],
coinPerDraw: 1, coinPerDraw: 1,
settlementDelayMinutes: 30, settlementDelayMinutes: 30,
eventTypes: [],
rankingType: 'TYCOON', rankingType: 'TYCOON',
rankingPeriod: 'OVERALL', rankingPeriod: 'OVERALL',
enabled: false, enabled: false,
@ -814,12 +760,6 @@ export default {
this.$message.error('结算等待必须是 0 到 1440 的整数分钟') this.$message.error('结算等待必须是 0 到 1440 的整数分钟')
return false return false
} }
const eventTypes = (this.form.eventTypes || []).map(item => String(item).trim())
const invalidEventType = eventTypes.find(item => !item || item.length > 64 || item.indexOf(',') >= 0)
if (invalidEventType !== undefined || new Set(eventTypes).size !== eventTypes.length) {
this.$message.error('eventType 必须非空、最长 64 字符、不含逗号且不可重复')
return false
}
// //
if (this.startedLocked) { if (this.startedLocked) {
return true return true
@ -850,6 +790,7 @@ export default {
return true return true
}, },
buildSavePayload() { buildSavePayload() {
// eventTypes
const payload = { const payload = {
id: this.form.id || null, id: this.form.id || null,
activityCode: this.form.activityCode.trim(), activityCode: this.form.activityCode.trim(),
@ -861,7 +802,6 @@ export default {
endTime: Number(this.form.timeRange[1]), endTime: Number(this.form.timeRange[1]),
settlementDelayMinutes: Number(this.form.settlementDelayMinutes), settlementDelayMinutes: Number(this.form.settlementDelayMinutes),
coinPerDraw: Number(this.form.coinPerDraw), coinPerDraw: Number(this.form.coinPerDraw),
eventTypes: this.form.eventTypes.map(item => String(item).trim()),
rankingType: 'TYCOON', rankingType: 'TYCOON',
rankingPeriod: 'OVERALL', rankingPeriod: 'OVERALL',
enabled: Boolean(this.form.enabled) enabled: Boolean(this.form.enabled)
@ -1023,8 +963,6 @@ export default {
openBackfill(row) { openBackfill(row) {
this.selectedActivity = row this.selectedActivity = row
this.backfillForm = { this.backfillForm = {
receiptType: 1,
eventType: row.eventTypes && row.eventTypes.length ? row.eventTypes[0] : '',
lastId: '', lastId: '',
limit: 500 limit: 500
} }
@ -1032,17 +970,7 @@ export default {
this.backfillVisible = true this.backfillVisible = true
}, },
runBackfill() { runBackfill() {
if (this.backfillForm.receiptType !== 0 && this.backfillForm.receiptType !== 1) {
this.$message.error('请选择金币流水类型')
return
}
if (!this.backfillForm.eventType) {
this.$message.error('请选择一个精确 eventType')
return
}
const params = { const params = {
eventType: this.backfillForm.eventType,
receiptType: this.backfillForm.receiptType,
limit: Number(this.backfillForm.limit) limit: Number(this.backfillForm.limit)
} }
if (this.backfillForm.lastId) { if (this.backfillForm.lastId) {
@ -1051,18 +979,13 @@ export default {
this.backfillLoading = true this.backfillLoading = true
backfillAslanGameKingConsumption(this.selectedActivity.id, params).then(res => { backfillAslanGameKingConsumption(this.selectedActivity.id, params).then(res => {
this.backfillResult = res.body || {} this.backfillResult = res.body || {}
// eventType //
this.backfillForm.lastId = this.backfillResult.nextLastId || this.backfillForm.lastId this.backfillForm.lastId = this.backfillResult.nextLastId || this.backfillForm.lastId
this.$message.success(this.backfillResult.finished ? '该 eventType 已补数完成' : '本批补数完成,请继续下一批') this.$message.success(this.backfillResult.finished ? '游戏消费流水已补数完成' : '本批补数完成,请继续下一批')
}).finally(() => { }).finally(() => {
this.backfillLoading = false this.backfillLoading = false
}) })
}, },
resetBackfillCursor() {
// lastId receiptType + eventType
this.backfillForm.lastId = ''
this.backfillResult = null
},
activityStatus(row) { activityStatus(row) {
if (!row || !row.id) { if (!row || !row.id) {
return 'DISABLED' return 'DISABLED'
@ -1173,10 +1096,6 @@ export default {
line-height: 20px; line-height: 20px;
} }
.event-tag {
margin: 2px 4px 2px 0;
}
.settlement-status { .settlement-status {
margin-top: 6px; margin-top: 6px;
color: #606266; color: #606266;