fix: 修复授权页面卡类选项显示空括号问题

- 只有当 billing_type 有值时才显示括号内容
- 将"卡类权限"标签改为"选择卡类",更清晰
- 添加 selectCardTypePlaceholder 翻译

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 19:22:29 +08:00
parent d10c2ffa77
commit 802c36072c
4 changed files with 10 additions and 8 deletions
+4 -4
View File
@@ -269,16 +269,16 @@ onMounted(() => {
</div>
<div class="space-y-2">
<UiLabel>{{ t('admin.agentApps.createForm.cardPermission') }} <span class="text-destructive">*</span></UiLabel>
<UiLabel>{{ t('admin.agentApps.createForm.selectCardType') }} <span class="text-destructive">*</span></UiLabel>
<div class="flex gap-3">
<div class="flex-1">
<UiSelect v-model="selectedCardTypeId" :disabled="!form.application_id || saving">
<UiSelectTrigger>
<UiSelectValue :placeholder="t('admin.agentApps.createForm.selectCardType')" />
<UiSelectValue :placeholder="t('admin.agentApps.createForm.selectCardTypePlaceholder')" />
</UiSelectTrigger>
<UiSelectContent>
<UiSelectItem v-for="ct in availableCardTypes" :key="ct.id" :value="String(ct.id)">
{{ ct.name }} ({{ ct.billing_type }})
{{ ct.name }}<template v-if="ct.billing_type"> ({{ ct.billing_type }})</template>
</UiSelectItem>
</UiSelectContent>
</UiSelect>
@@ -293,7 +293,7 @@ onMounted(() => {
<div v-for="(p, index) in permissions" :key="p.card_type_id" class="flex items-center justify-between p-3 gap-4">
<div class="flex-1 min-w-0">
<div class="font-medium truncate">{{ p.card_type_name }}</div>
<div class="text-sm text-muted-foreground">{{ p.billing_type }}</div>
<div v-if="p.billing_type" class="text-sm text-muted-foreground">{{ p.billing_type }}</div>
</div>
<div class="flex items-center gap-2 shrink-0">
<div class="flex items-center gap-1">
@@ -232,16 +232,16 @@ onMounted(() => {
</div>
<div class="space-y-2">
<UiLabel>{{ t('admin.agentApps.createForm.cardPermission') }} <span class="text-destructive">*</span></UiLabel>
<UiLabel>{{ t('admin.agentApps.createForm.selectCardType') }} <span class="text-destructive">*</span></UiLabel>
<div class="flex gap-3">
<div class="flex-1">
<UiSelect v-model="selectedCardTypeId" :disabled="!form.application_id || saving">
<UiSelectTrigger>
<UiSelectValue :placeholder="t('admin.agentApps.createForm.selectCardType')" />
<UiSelectValue :placeholder="t('admin.agentApps.createForm.selectCardTypePlaceholder')" />
</UiSelectTrigger>
<UiSelectContent>
<UiSelectItem v-for="ct in availableCardTypes" :key="ct.id" :value="String(ct.id)">
{{ ct.name }} ({{ ct.billing_type }})
{{ ct.name }}<template v-if="ct.billing_type"> ({{ ct.billing_type }})</template>
</UiSelectItem>
</UiSelectContent>
</UiSelect>
@@ -256,7 +256,7 @@ onMounted(() => {
<div v-for="(p, index) in permissions" :key="p.card_type_id" class="flex items-center justify-between p-3 gap-4">
<div class="flex-1 min-w-0">
<div class="font-medium truncate">{{ p.card_type_name }}</div>
<div class="text-sm text-muted-foreground">{{ p.billing_type }}</div>
<div v-if="p.billing_type" class="text-sm text-muted-foreground">{{ p.billing_type }}</div>
</div>
<div class="flex items-center gap-2 shrink-0">
<div class="flex items-center gap-1">
+1
View File
@@ -1717,6 +1717,7 @@
"selectAppPlaceholder": "Please select an application",
"cardPermission": "Card Type Permissions",
"selectCardType": "Select Card Type",
"selectCardTypePlaceholder": "Please select a card type",
"addCardType": "Add",
"cardTypeList": "Authorized Card Types",
"cardTypeName": "Card Type Name",
+1
View File
@@ -1706,6 +1706,7 @@
"selectAppPlaceholder": "请选择应用",
"cardPermission": "卡类权限",
"selectCardType": "选择卡类",
"selectCardTypePlaceholder": "请选择卡类",
"addCardType": "添加",
"cardTypeList": "已授权卡类",
"cardTypeName": "卡类名称",