用户管理:资金变动按钮整合为3个(钻石/H币/赊尼券变动)

This commit is contained in:
zpc 2026-02-12 11:13:22 +08:00
parent 4cb752ba8c
commit 12c28e4a79
3 changed files with 8 additions and 11 deletions

View File

@ -121,14 +121,13 @@ const formRules = computed<FormRules>(() => ({
//
const typeLabel = computed(() => {
const labels: Record<number, string> = { 1: '余额', 2: '积分', 3: '钻石' }
return labels[props.type] || '余额'
const labels: Record<number, string> = { 1: '钻石', 2: 'H币', 3: '赊尼券' }
return labels[props.type] || '钻石'
})
//
const dialogTitle = computed(() => {
const actionLabel = props.action === 'add' ? '充值' : '扣除'
return `${actionLabel}${typeLabel.value}`
return `${typeLabel.value}变动`
})
//

View File

@ -94,12 +94,9 @@
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="money:add">充值余额</el-dropdown-item>
<el-dropdown-item command="money:sub">扣除余额</el-dropdown-item>
<el-dropdown-item command="integral:add">充值积分</el-dropdown-item>
<el-dropdown-item command="integral:sub">扣除积分</el-dropdown-item>
<el-dropdown-item command="diamond:add">充值钻石</el-dropdown-item>
<el-dropdown-item command="diamond:sub">扣除钻石</el-dropdown-item>
<el-dropdown-item command="money:change">钻石变动</el-dropdown-item>
<el-dropdown-item command="integral:change">H币变动</el-dropdown-item>
<el-dropdown-item command="diamond:change">赊尼券变动</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>

View File

@ -227,7 +227,8 @@ const handleCommand = async (command: string, row: UserListItem) => {
const typeMap: Record<string, number> = { money: 1, integral: 2, diamond: 3 }
moneyDialogType.value = typeMap[typeStr]
moneyDialogAction.value = action as 'add' | 'sub'
// change
moneyDialogAction.value = action === 'sub' ? 'sub' : 'add'
moneyDialogVisible.value = true
return
}