From 268b3e77f3beaba03a1273d643d8aa4fa5db1c10 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 16 十月 2026 13:08:27 +0800
Subject: [PATCH] feat: 全量列表页接入 Excel 导入按钮与共享弹窗
---
src/views/ai/model/apiKey/index.vue | 34 +++++++++++++++++++++++++++++++++-
1 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/src/views/ai/model/apiKey/index.vue b/src/views/ai/model/apiKey/index.vue
index 866c0a8..7eb8204 100644
--- a/src/views/ai/model/apiKey/index.vue
+++ b/src/views/ai/model/apiKey/index.vue
@@ -7,14 +7,26 @@
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
-import { deleteApiKey, getApiKeyPage } from '#/api/ai/model/apiKey';
+import {
+ deleteApiKey,
+ getApiKeyPage,
+ importApiKey,
+ importApiKeyTemplate,
+} from '#/api/ai/model/apiKey';
import { $t } from '#/locales';
+
+import ImportModalComponent from '#/components/import-modal';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
+ destroyOnClose: true,
+});
+
+const [ImportModal, importModalApi] = useVbenModal({
+ connectedComponent: ImportModalComponent,
destroyOnClose: true,
});
@@ -26,6 +38,18 @@
/** 鍒涘缓 API 瀵嗛挜 */
function handleCreate() {
formModalApi.setData(null).open();
+}
+
+/** 瀵煎叆 API 瀵嗛挜 */
+function handleImport() {
+ importModalApi
+ .setData({
+ title: $t('ui.actionTitle.import', ['API 瀵嗛挜']),
+ fileName: 'API瀵嗛挜瀵煎叆妯℃澘.xls',
+ importFn: importApiKey,
+ templateFn: importApiKeyTemplate,
+ })
+ .open();
}
/** 缂栬緫 API 瀵嗛挜 */
@@ -81,6 +105,7 @@
<template>
<Page auto-content-height><FormModal @success="handleRefresh" />
+ <ImportModal @success="handleRefresh" />
<Grid table-title="API 瀵嗛挜鍒楄〃">
<template #toolbar-tools>
<TableAction
@@ -92,6 +117,13 @@
auth: ['ai:api-key:create'],
onClick: handleCreate,
},
+ {
+ label: $t('ui.actionTitle.import', ['API 瀵嗛挜']),
+ type: 'primary',
+ icon: ACTION_ICON.UPLOAD,
+ auth: ['ai:api-key:import'],
+ onClick: handleImport,
+ },
]"
/>
</template>
--
Gitblit v1.9.3