修复: 1.管理员编辑代理云端数据权限switch无效(后端缺少CanViewCloudData字段) 2.代理卡密status显示disabledbanned 3.代理用户管理只显示代理/子代理卡密充值过的用户
This commit is contained in:
@@ -47,7 +47,7 @@ export function getColumns(t: Composer['t']): ColumnDef<Card>[] {
|
||||
unused: { label: t('agent.cards.status.unused'), variant: 'default' },
|
||||
used: { label: t('agent.cards.status.used'), variant: 'secondary' },
|
||||
expired: { label: t('agent.cards.status.expired'), variant: 'destructive' },
|
||||
disabled: { label: t('agent.cards.status.disabled'), variant: 'secondary' },
|
||||
banned: { label: t('agent.cards.status.banned'), variant: 'destructive' },
|
||||
}
|
||||
const { label, variant } = statusMap[status] || { label: status || '-', variant: 'secondary' }
|
||||
return h(Badge, { variant }, () => label)
|
||||
|
||||
@@ -32,7 +32,7 @@ const total = ref(0)
|
||||
const unusedCount = ref(0)
|
||||
const usedCount = ref(0)
|
||||
const expiredCount = ref(0)
|
||||
const disabledCount = ref(0)
|
||||
const bannedCount = ref(0)
|
||||
const currentPage = ref(1)
|
||||
const pageSize = ref(20)
|
||||
const tableRef = ref()
|
||||
@@ -74,7 +74,7 @@ const statusOptions = computed(() => [
|
||||
{ label: t('agent.cards.status.unused'), value: 'unused' },
|
||||
{ label: t('agent.cards.status.used'), value: 'used' },
|
||||
{ label: t('agent.cards.status.expired'), value: 'expired' },
|
||||
{ label: t('agent.cards.status.disabled'), value: 'disabled' },
|
||||
{ label: t('agent.cards.status.banned'), value: 'banned' },
|
||||
])
|
||||
|
||||
const serverPagination = computed(() => ({
|
||||
@@ -152,7 +152,7 @@ async function fetchCards() {
|
||||
unusedCount.value = data.unused_count || 0
|
||||
usedCount.value = data.used_count || 0
|
||||
expiredCount.value = data.expired_count || 0
|
||||
disabledCount.value = data.disabled_count || 0
|
||||
bannedCount.value = data.banned_count || data.disabled_count || 0
|
||||
} else if (Array.isArray(data)) {
|
||||
cards.value = data
|
||||
total.value = data.length
|
||||
@@ -241,7 +241,7 @@ onMounted(async () => {
|
||||
</template>
|
||||
|
||||
<div class="space-y-6">
|
||||
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-5">
|
||||
<UiCard>
|
||||
<UiCardHeader class="flex flex-row items-center justify-between pb-2 space-y-0">
|
||||
<UiCardTitle class="text-sm font-medium">
|
||||
@@ -297,6 +297,20 @@ onMounted(async () => {
|
||||
</div>
|
||||
</UiCardContent>
|
||||
</UiCard>
|
||||
|
||||
<UiCard>
|
||||
<UiCardHeader class="flex flex-row items-center justify-between pb-2 space-y-0">
|
||||
<UiCardTitle class="text-sm font-medium">
|
||||
{{ t('agent.cards.banned') }}
|
||||
</UiCardTitle>
|
||||
<Key class="size-4 text-muted-foreground" />
|
||||
</UiCardHeader>
|
||||
<UiCardContent>
|
||||
<div class="text-2xl font-bold">
|
||||
{{ bannedCount }}
|
||||
</div>
|
||||
</UiCardContent>
|
||||
</UiCard>
|
||||
</div>
|
||||
|
||||
<UiCard>
|
||||
|
||||
@@ -2819,7 +2819,7 @@
|
||||
"unused": "Unused",
|
||||
"used": "Used",
|
||||
"expired": "Expired",
|
||||
"disabled": "Disabled",
|
||||
"banned": "Banned",
|
||||
"totalCards": "Total Cards",
|
||||
"searchPlaceholder": "Search card code, app or card type...",
|
||||
"exportBtn": "Export",
|
||||
@@ -2840,7 +2840,7 @@
|
||||
"unused": "Unused",
|
||||
"used": "Used",
|
||||
"expired": "Expired",
|
||||
"disabled": "Disabled"
|
||||
"banned": "Banned"
|
||||
},
|
||||
"create": {
|
||||
"title": "Generate Cards",
|
||||
|
||||
@@ -2820,7 +2820,7 @@
|
||||
"unused": "未使用",
|
||||
"used": "已使用",
|
||||
"expired": "已过期",
|
||||
"disabled": "已禁用",
|
||||
"banned": "已禁用",
|
||||
"totalCards": "卡密总数",
|
||||
"searchPlaceholder": "搜索卡号、应用或卡类...",
|
||||
"exportBtn": "导出",
|
||||
@@ -2841,7 +2841,7 @@
|
||||
"unused": "未使用",
|
||||
"used": "已使用",
|
||||
"expired": "已过期",
|
||||
"disabled": "已禁用"
|
||||
"banned": "已禁用"
|
||||
},
|
||||
"create": {
|
||||
"title": "生成卡密",
|
||||
|
||||
Reference in New Issue
Block a user