feat(用户列表): 部分内容按权限展示

This commit is contained in:
hzj 2026-05-11 18:57:00 +08:00
parent e7ec4c4ae0
commit d3405276c5
3 changed files with 30 additions and 9 deletions

View File

@ -92,8 +92,8 @@
size="38"
/>
<div class="tags">
<el-tag>{{ $t('pages.userBaseInfo.labels.gold') }}{{ candy || 0 }}</el-tag>
&nbsp;
<el-tag v-if="hasGoldBalancePermission">{{ $t('pages.userBaseInfo.labels.gold') }}{{ candy || 0 }}</el-tag>
<template v-if="hasGoldBalancePermission">&nbsp;</template>
<!-- <el-tag>当前订阅<a :title="notExpiredSubscriptionName">{{ notExpiredSubscriptionName }}</a> -->
<!-- <span v-if="balance.vipEvent > 0">{{ balance.vipExpireTime }}</span> </el-tag>-->
</div>
@ -743,6 +743,11 @@ export default {
},
computed: {
...mapGetters(['buttonPermissions']),
hasGoldBalancePermission() {
return this.buttonPermissions.includes(
'user:table:column:gold-coin-balance'
)
},
associatedDeviceNotEmpty() {
return (
this.deviceInfo &&
@ -815,11 +820,13 @@ export default {
that.registerLoading = false
})
getUserCandyBalance(userId)
.then(res => {
this.candy = res.body
})
.catch(er => {})
if (that.hasGoldBalancePermission) {
getUserCandyBalance(userId)
.then(res => {
this.candy = res.body
})
.catch(er => {})
}
getUserIdentity(userId)
.then(res => {

View File

@ -188,7 +188,12 @@
/>
</template>
</el-table-column>
<el-table-column prop="goldBalance" label="金币余额" align="center">
<el-table-column
v-if="buttonPermissions.includes('user:table:column:gold-coin-balance')"
prop="goldBalance"
label="金币余额"
align="center"
>
<template slot-scope="scope">
<el-link
v-if="buttonPermissions.includes('user:table:query:gold')"
@ -203,7 +208,12 @@
</div>
</template>
</el-table-column>
<el-table-column prop="diamondBalance" label="钻石余额" align="center">
<el-table-column
v-if="buttonPermissions.includes('user:table:column:diamond-balance')"
prop="diamondBalance"
label="钻石余额"
align="center"
>
<template slot-scope="scope">
<el-link
v-if="buttonPermissions.includes('user:table:query:gold')"
@ -219,6 +229,7 @@
</template>
</el-table-column>
<el-table-column
v-if="buttonPermissions.includes('user:table:column:salary-diamond-balance')"
prop="salaryDiamondBalance"
label="工资钻石余额"
align="center"

View File

@ -251,6 +251,7 @@
<!-- 金币余额 -->
<el-table-column
v-if="buttonPermissions.includes('user:table:column:gold-coin-balance')"
prop="goldBalance"
:label="$t('pages.userTable.table.goldBalance')"
align="center"
@ -273,6 +274,7 @@
<!-- 钻石余额 -->
<el-table-column
v-if="buttonPermissions.includes('user:table:column:diamond-balance')"
prop="diamondBalance"
:label="$t('pages.userTable.table.diamondBalance')"
align="center"
@ -294,6 +296,7 @@
<!-- 工资钻石余额 -->
<el-table-column
v-if="buttonPermissions.includes('user:table:column:salary-diamond-balance')"
prop="salaryDiamondBalance"
:label="$t('pages.userTable.table.salaryDiamondBalance')"
align="center"