fix:本月已用流量和运营商周期月内已用流量代理企业不展示,其他账号新增权限
This commit is contained in:
@@ -51,10 +51,10 @@
|
||||
</ElTag>
|
||||
</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="本月已用流量">{{
|
||||
<ElDescriptionsItem v-if="canShowCardMonthUsage" label="本月已用流量">{{
|
||||
formatDataSize(cardInfo?.current_month_usage_mb || 0)
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="运营商周期月内已用流量">{{
|
||||
<ElDescriptionsItem v-if="canShowCardMonthUsage" label="运营商周期月内已用流量">{{
|
||||
formatDataSize(cardInfo?.last_gateway_reading_mb || 0)
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="实名时间">{{
|
||||
@@ -479,6 +479,7 @@
|
||||
import { CopyDocument } from '@element-plus/icons-vue'
|
||||
import { useAssetFormatters } from '../composables/useAssetFormatters'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
|
||||
// Props
|
||||
@@ -583,6 +584,9 @@
|
||||
})
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const CARD_MONTH_USAGE_PERMISSION = 'asset_info:view_card_month_usage'
|
||||
|
||||
const realnamePolicyPermission = computed(() => {
|
||||
return props.cardInfo?.asset_type === 'card'
|
||||
@@ -600,6 +604,11 @@
|
||||
|
||||
const canShowPolling = computed(() => hasAuth(pollingPermission.value))
|
||||
|
||||
const canShowCardMonthUsage = computed(() => {
|
||||
const userType = Number(userStore.info.user_type ?? 0)
|
||||
return ![3, 4].includes(userType) && hasAuth(CARD_MONTH_USAGE_PERMISSION)
|
||||
})
|
||||
|
||||
// Emits
|
||||
interface Emits {
|
||||
(e: 'update:pollingEnabled', value: boolean): void
|
||||
|
||||
Reference in New Issue
Block a user