diff --git a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue index df3999a7..45234f6b 100644 --- a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue +++ b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue @@ -2,6 +2,23 @@ import { ElMessage } from 'element-plus'; import { computed, onMounted, onUnmounted, ref, watch } from 'vue'; +const props = withDefaults(defineProps(), { + visible: false, + mode: 'create', + formData: () => ({ + name: '', + expireTime: '', + premiumQuotaLimit: 0, + quotaUnit: '万', + }), +}); + +const emit = defineEmits<{ + 'update:visible': [value: boolean]; + 'confirm': [data: TokenFormData | TokenFormData[]]; + 'batchCreate': [items: TokenFormData[], onProgress: (index: number, status: CreateStatus, error?: string) => void]; +}>(); + // 最大批量创建数量 const MAX_BATCH_CREATE_COUNT = 10; @@ -29,23 +46,6 @@ interface Props { formData?: TokenFormData; } -const props = withDefaults(defineProps(), { - visible: false, - mode: 'create', - formData: () => ({ - name: '', - expireTime: '', - premiumQuotaLimit: 0, - quotaUnit: '万', - }), -}); - -const emit = defineEmits<{ - 'update:visible': [value: boolean]; - 'confirm': [data: TokenFormData | TokenFormData[]]; - 'batchCreate': [items: TokenFormData[], onProgress: (index: number, status: CreateStatus, error?: string) => void]; -}>(); - const localFormData = ref({ name: '', expireTime: '', @@ -119,7 +119,8 @@ watch(batchCount, (count) => { } batchNamesText.value = names.join('\n'); } - } else { + } + else { batchNamesText.value = ''; } }); @@ -373,7 +374,8 @@ async function handlePreviewConfirm() { // 预览对话框取消 function handlePreviewCancel() { - if (isCreating.value) return; + if (isCreating.value) + return; showPreviewDialog.value = false; previewNames.value = []; createStatusList.value = []; @@ -612,9 +614,15 @@ function formatDateTime(dateStr: string | null | undefined) {
- - - + + + + + + + + + @@ -662,7 +670,9 @@ function formatDateTime(dateStr: string | null | undefined) {
-
配额设置
+
+ 配额设置 +
无限制 @@ -677,7 +687,9 @@ function formatDateTime(dateStr: string | null | undefined) {
-
API 密钥名称列表
+
+ API 密钥名称列表 +
{ {{ model.modelTypeName }} - {{ item.modelApiTypeName }} + API类型: {{ item.modelApiTypeName }}