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/hrm/salary/leave-type-config/index.vue |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/src/views/hrm/salary/leave-type-config/index.vue b/src/views/hrm/salary/leave-type-config/index.vue
index a22d4c7..c1a9929 100644
--- a/src/views/hrm/salary/leave-type-config/index.vue
+++ b/src/views/hrm/salary/leave-type-config/index.vue
@@ -7,14 +7,21 @@
 import { message, Tag } from 'ant-design-vue';
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
-import { getLeaveTypeConfigList } from '#/api/hrm/leave-type-config';
+import { getLeaveTypeConfigList, importLeaveTypeConfig, importLeaveTypeConfigTemplate } from '#/api/hrm/leave-type-config';
 import { $t } from '#/locales';
+
+import ImportModalComponent from '#/components/import-modal';
 
 import { useGridColumns } 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 +33,18 @@
 /** 缂栬緫閰嶇疆 */
 function handleEdit(row: HrmLeaveTypeConfigApi.LeaveTypeConfig) {
   formModalApi.setData({ id: row.id, row }).open();
+}
+
+/** 瀵煎叆璇峰亣绫诲瀷鎵f閰嶇疆 */
+function handleImport() {
+  importModalApi
+    .setData({
+      title: $t('ui.actionTitle.import', ['璇峰亣绫诲瀷鎵f閰嶇疆']),
+      fileName: '璇峰亣绫诲瀷鎵f閰嶇疆瀵煎叆妯℃澘.xls',
+      importFn: importLeaveTypeConfig,
+      templateFn: importLeaveTypeConfigTemplate,
+    })
+    .open();
 }
 
 const [Grid, gridApi] = useVbenVxeGrid({
@@ -55,7 +74,21 @@
 <template>
   <Page auto-content-height>
     <FormModal @success="handleRefresh" />
+    <ImportModal @success="handleRefresh" />
     <Grid table-title="璇峰亣鎵f閰嶇疆鍒楄〃">
+      <template #toolbar-tools>
+        <TableAction
+          :actions="[
+            {
+              label: $t('ui.actionTitle.import', ['璇峰亣绫诲瀷鎵f閰嶇疆']),
+              type: 'primary',
+              icon: ACTION_ICON.UPLOAD,
+              auth: ['hrm:leave-type-config:import'],
+              onClick: handleImport,
+            },
+          ]"
+        />
+      </template>
       <template #deductionRatio="{ row }">
         <Tag :color="row.deductionRatio === 0 ? 'success' : row.deductionRatio === 1 ? 'error' : 'warning'">
           {{ row.deductionRatio === 0 ? '涓嶆墸娆�' : `${(row.deductionRatio * 100).toFixed(0)}%` }}

--
Gitblit v1.9.3