From 7faca5512a0c285f8ddb5feb5743f07df89c25cc Mon Sep 17 00:00:00 2001 From: fawney19 Date: Sat, 10 Jan 2026 19:32:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E4=BC=98=E5=8C=96=E5=AF=86?= =?UTF-8?q?=E9=92=A5=E6=B7=BB=E5=8A=A0=E5=92=8C=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=E7=A9=BA=E7=8A=B6=E6=80=81=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - KeyFormDialog: 添加模式下保存后不关闭对话框,清除表单以便连续添加 - KeyFormDialog: 按钮文案根据编辑/添加模式动态显示 - Dashboard: 优化统计卡片加载状态和空数据占位显示 --- .../providers/components/KeyFormDialog.vue | 14 +- frontend/src/views/shared/Dashboard.vue | 161 ++++++++++++------ 2 files changed, 121 insertions(+), 54 deletions(-) diff --git a/frontend/src/features/providers/components/KeyFormDialog.vue b/frontend/src/features/providers/components/KeyFormDialog.vue index 5054b3d..0cf7f88 100644 --- a/frontend/src/features/providers/components/KeyFormDialog.vue +++ b/frontend/src/features/providers/components/KeyFormDialog.vue @@ -232,7 +232,7 @@ :disabled="saving" @click="handleSave" > - {{ saving ? '保存中...' : '保存' }} + {{ saving ? (isEditMode ? '保存中...' : '添加中...') : (isEditMode ? '保存' : '添加') }} @@ -408,6 +408,14 @@ function resetForm() { } } +// 添加成功后清除部分字段以便继续添加 +function clearForNextAdd() { + formNonce.value = createFieldNonce() + apiKeyFocused.value = false + form.value.name = '' + form.value.api_key = '' +} + // 加载密钥数据(编辑模式) function loadKeyData() { if (!props.editingKey) return @@ -530,6 +538,10 @@ async function handleSave() { capabilities: capabilitiesData || undefined }) success('密钥已添加', '成功') + // 添加模式:不关闭对话框,只清除名称和密钥以便继续添加 + emit('saved') + clearForNextAdd() + return } emit('saved') diff --git a/frontend/src/views/shared/Dashboard.vue b/frontend/src/views/shared/Dashboard.vue index c0a2b57..bc4d38c 100644 --- a/frontend/src/views/shared/Dashboard.vue +++ b/frontend/src/views/shared/Dashboard.vue @@ -16,7 +16,8 @@
-