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/role/index.vue |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index 783203d..33a5f67 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -15,8 +15,12 @@
   deleteRoleList,
   exportRole,
   getRolePage,
+  importRole,
+  importRoleTemplate,
 } from '#/api/system/role';
 import { $t } from '#/locales';
+
+import ImportModalComponent from '#/components/import-modal';
 
 import { useGridColumns, useGridFormSchema } from './data';
 import AssignDataPermissionForm from './modules/assign-data-permission-form.vue';
@@ -39,6 +43,11 @@
   destroyOnClose: true,
 });
 
+const [ImportModal, importModalApi] = useVbenModal({
+  connectedComponent: ImportModalComponent,
+  destroyOnClose: true,
+});
+
 /** 鍒锋柊琛ㄦ牸 */
 function handleRefresh() {
   gridApi.query();
@@ -48,6 +57,18 @@
 async function handleExport() {
   const data = await exportRole(await gridApi.formApi.getValues());
   downloadFileFromBlobPart({ fileName: '瑙掕壊.xls', source: data });
+}
+
+/** 瀵煎叆瑙掕壊 */
+function handleImport() {
+  importModalApi
+    .setData({
+      title: $t('ui.actionTitle.import', ['瑙掕壊']),
+      fileName: '瑙掕壊瀵煎叆妯℃澘.xls',
+      importFn: importRole,
+      templateFn: importRoleTemplate,
+    })
+    .open();
 }
 
 /** 鍒涘缓瑙掕壊 */
@@ -150,6 +171,7 @@
   <Page auto-content-height><FormModal @success="handleRefresh" />
     <AssignDataPermissionFormModel @success="handleRefresh" />
     <AssignMenuFormModel @success="handleRefresh" />
+    <ImportModal @success="handleRefresh" />
     <Grid table-title="瑙掕壊鍒楄〃">
       <template #toolbar-tools>
         <TableAction
@@ -169,6 +191,13 @@
               onClick: handleExport,
             },
             {
+              label: $t('ui.actionTitle.import', ['瑙掕壊']),
+              type: 'primary',
+              icon: ACTION_ICON.UPLOAD,
+              auth: ['system:role:import'],
+              onClick: handleImport,
+            },
+            {
               label: $t('ui.actionTitle.deleteBatch'),
               type: 'primary',
               danger: true,

--
Gitblit v1.9.3