fix: 修复用户列表货币字段显示名称
- 表格列标题改为动态显示货币名称(钻石、HH币、哈尼券) - 资金变动菜单项改为动态显示货币名称 - 流水明细菜单项改为动态显示货币名称 - 从应用设置API获取货币配置
This commit is contained in:
parent
4379b62a03
commit
4754b122dc
|
|
@ -26,22 +26,22 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 余额 -->
|
||||
<el-table-column prop="balance" label="余额" min-width="100" align="right">
|
||||
<!-- 钻石 (Balance/Money) -->
|
||||
<el-table-column prop="balance" :label="balanceName" min-width="100" align="right">
|
||||
<template #default="{ row }">
|
||||
<span class="money">¥{{ row.balance?.toFixed(2) || '0.00' }}</span>
|
||||
<span class="money">{{ row.balance?.toFixed(2) || '0.00' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 积分 -->
|
||||
<el-table-column prop="integral" label="积分" min-width="80" align="right">
|
||||
<!-- HH币 (Integral) -->
|
||||
<el-table-column prop="integral" :label="integralName" min-width="80" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.integral || 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 钻石 -->
|
||||
<el-table-column prop="diamond" label="钻石" min-width="80" align="right">
|
||||
<!-- 哈尼券 (Diamond/Money2) -->
|
||||
<el-table-column prop="diamond" :label="diamondName" min-width="80" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.diamond || 0 }}
|
||||
</template>
|
||||
|
|
@ -94,9 +94,9 @@
|
|||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="money:change">钻石变动</el-dropdown-item>
|
||||
<el-dropdown-item command="integral:change">HH币变动</el-dropdown-item>
|
||||
<el-dropdown-item command="diamond:change">哈尼券变动</el-dropdown-item>
|
||||
<el-dropdown-item command="money:change">{{ balanceName }}变动</el-dropdown-item>
|
||||
<el-dropdown-item command="integral:change">{{ integralName }}变动</el-dropdown-item>
|
||||
<el-dropdown-item command="diamond:change">{{ diamondName }}变动</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
|
|
@ -139,9 +139,9 @@
|
|||
<el-dropdown-item command="view:team">查看下级</el-dropdown-item>
|
||||
<el-dropdown-item command="view:box">查看盒柜</el-dropdown-item>
|
||||
<el-dropdown-item command="view:orders">查看订单</el-dropdown-item>
|
||||
<el-dropdown-item command="view:moneyDetail">钻石流水明细</el-dropdown-item>
|
||||
<el-dropdown-item command="view:integralDetail">HH币流水明细</el-dropdown-item>
|
||||
<el-dropdown-item command="view:diamondDetail">哈尼券流水明细</el-dropdown-item>
|
||||
<el-dropdown-item command="view:moneyDetail">{{ balanceName }}流水明细</el-dropdown-item>
|
||||
<el-dropdown-item command="view:integralDetail">{{ integralName }}流水明细</el-dropdown-item>
|
||||
<el-dropdown-item command="view:diamondDetail">{{ diamondName }}流水明细</el-dropdown-item>
|
||||
<el-dropdown-item command="view:ipLogs">查看IP登录列表</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
|
|
@ -166,9 +166,10 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { ref, watch, computed, onMounted } from 'vue'
|
||||
import { User, ArrowDown } from '@element-plus/icons-vue'
|
||||
import type { UserListItem } from '@/api/business/user'
|
||||
import { getAppSetting } from '@/api/business/config'
|
||||
|
||||
interface Props {
|
||||
data: UserListItem[]
|
||||
|
|
@ -189,6 +190,30 @@ const emit = defineEmits<{
|
|||
const currentPage = ref(props.page)
|
||||
const currentPageSize = ref(props.pageSize)
|
||||
|
||||
// 应用设置
|
||||
const appSetting = ref<any>({})
|
||||
|
||||
// 动态货币名称
|
||||
const balanceName = computed(() => appSetting.value.balance_name || '钻石')
|
||||
const integralName = computed(() => appSetting.value.currency1_name || 'HH币')
|
||||
const diamondName = computed(() => appSetting.value.currency2_name || '哈尼券')
|
||||
|
||||
// 加载应用设置
|
||||
const loadAppSetting = async () => {
|
||||
try {
|
||||
const res = await getAppSetting()
|
||||
if (res.data?.value) {
|
||||
appSetting.value = res.data.value
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载应用设置失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadAppSetting()
|
||||
})
|
||||
|
||||
watch(() => props.page, (val) => {
|
||||
currentPage.value = val
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user