From fee2f2532144fca6c81b1523aeef54165c5263b2 Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期二, 25 八月 2026 16:50:38 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev_pro2.0' into fix/hsy/20260812

---
 src/views/hrm/salary/leave-type-config/index.vue |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 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..c92af92 100644
--- a/src/views/hrm/salary/leave-type-config/index.vue
+++ b/src/views/hrm/salary/leave-type-config/index.vue
@@ -7,7 +7,10 @@
 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 {
+  deleteLeaveTypeConfig,
+  getLeaveTypeConfigList,
+} from '#/api/hrm/leave-type-config';
 import { $t } from '#/locales';
 
 import { useGridColumns } from './data';
@@ -23,9 +26,21 @@
   gridApi.query();
 }
 
+/** 鏂板閰嶇疆 */
+function handleCreate() {
+  formModalApi.setData({ formType: 'create' }).open();
+}
+
 /** 缂栬緫閰嶇疆 */
 function handleEdit(row: HrmLeaveTypeConfigApi.LeaveTypeConfig) {
-  formModalApi.setData({ id: row.id, row }).open();
+  formModalApi.setData({ formType: 'update', row }).open();
+}
+
+/** 鍒犻櫎閰嶇疆 */
+async function handleDelete(row: HrmLeaveTypeConfigApi.LeaveTypeConfig) {
+  await deleteLeaveTypeConfig(row.id!);
+  message.success($t('ui.actionMessage.deleteSuccess', ['璇峰亣鎵f閰嶇疆']));
+  handleRefresh();
 }
 
 const [Grid, gridApi] = useVbenVxeGrid({
@@ -56,6 +71,19 @@
   <Page auto-content-height>
     <FormModal @success="handleRefresh" />
     <Grid table-title="璇峰亣鎵f閰嶇疆鍒楄〃">
+      <template #toolbar-tools>
+        <TableAction
+          :actions="[
+            {
+              label: $t('ui.actionTitle.create', ['璇峰亣鎵f閰嶇疆']),
+              type: 'primary',
+              icon: ACTION_ICON.ADD,
+              auth: ['hrm:leave-type-config:create'],
+              onClick: handleCreate,
+            },
+          ]"
+        />
+      </template>
       <template #deductionRatio="{ row }">
         <Tag :color="row.deductionRatio === 0 ? 'success' : row.deductionRatio === 1 ? 'error' : 'warning'">
           {{ row.deductionRatio === 0 ? '涓嶆墸娆�' : `${(row.deductionRatio * 100).toFixed(0)}%` }}
@@ -76,6 +104,17 @@
               auth: ['hrm:leave-type-config:update'],
               onClick: handleEdit.bind(null, row),
             },
+            {
+              label: $t('common.delete'),
+              type: 'link',
+              danger: true,
+              icon: ACTION_ICON.DELETE,
+              auth: ['hrm:leave-type-config:delete'],
+              popConfirm: {
+                title: $t('ui.actionMessage.deleteConfirm', ['璇峰亣鎵f閰嶇疆']),
+                confirm: handleDelete.bind(null, row),
+              },
+            },
           ]"
         />
       </template>

--
Gitblit v1.9.3