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/system/dict/modules/type-grid.vue | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/views/system/dict/modules/type-grid.vue b/src/views/system/dict/modules/type-grid.vue
index 5c333b3..9135ad6 100644
--- a/src/views/system/dict/modules/type-grid.vue
+++ b/src/views/system/dict/modules/type-grid.vue
@@ -15,8 +15,12 @@
deleteDictTypeList,
exportDictType,
getDictTypePage,
+ importDictType,
+ importDictTypeTemplate,
} from '#/api/system/dict/type';
import { $t } from '#/locales';
+
+import ImportModalComponent from '#/components/import-modal';
import { useTypeGridColumns, useTypeGridFormSchema } from '../data';
import TypeForm from './type-form.vue';
@@ -25,6 +29,11 @@
const [TypeFormModal, typeFormModalApi] = useVbenModal({
connectedComponent: TypeForm,
+ destroyOnClose: true,
+});
+
+const [ImportModal, importModalApi] = useVbenModal({
+ connectedComponent: ImportModalComponent,
destroyOnClose: true,
});
@@ -37,6 +46,18 @@
async function handleExport() {
const data = await exportDictType(await gridApi.formApi.getValues());
downloadFileFromBlobPart({ fileName: '瀛楀吀绫诲瀷.xls', source: data });
+}
+
+/** 瀵煎叆瀛楀吀绫诲瀷 */
+function handleImport() {
+ importModalApi
+ .setData({
+ title: $t('ui.actionTitle.import', ['瀛楀吀绫诲瀷']),
+ fileName: '瀛楀吀绫诲瀷瀵煎叆妯℃澘.xls',
+ importFn: importDictType,
+ templateFn: importDictTypeTemplate,
+ })
+ .open();
}
/** 鍒涘缓瀛楀吀绫诲瀷 */
@@ -132,6 +153,7 @@
<template>
<div class="h-full">
<TypeFormModal @success="handleRefresh" />
+ <ImportModal @success="handleRefresh" />
<Grid table-title="瀛楀吀绫诲瀷鍒楄〃">
<template #toolbar-tools>
<TableAction
@@ -151,6 +173,13 @@
onClick: handleExport,
},
{
+ label: $t('ui.actionTitle.import', ['瀛楀吀绫诲瀷']),
+ type: 'primary',
+ icon: ACTION_ICON.UPLOAD,
+ auth: ['system:dict:import'],
+ onClick: handleImport,
+ },
+ {
label: $t('ui.actionTitle.deleteBatch'),
type: 'primary',
danger: true,
--
Gitblit v1.9.3