From c79f8a668dd8f2ef06f930489d535d70981e1c26 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 13 十一月 2025 18:39:23 +0800
Subject: [PATCH] fix: bug

---
 src/views/Reward/RewardGrant.vue |  145 +++--------------------------------------------
 1 files changed, 11 insertions(+), 134 deletions(-)

diff --git a/src/views/Reward/RewardGrant.vue b/src/views/Reward/RewardGrant.vue
index ced8dc8..a132996 100644
--- a/src/views/Reward/RewardGrant.vue
+++ b/src/views/Reward/RewardGrant.vue
@@ -121,123 +121,16 @@
 import { useQueryClient } from '@tanstack/vue-query';
 import { TransferFileEnumInRewardGrandTableItem } from '@/components/commonView/types';
 import { FourStreamsMaterialUtils } from '@/components/commonView/utils';
+import { useAccess } from '@/hooks';
 
 defineOptions({
   name: 'RewardGrant',
 });
 
-const column: API.CustomModuleColumnDto[] = [
-  {
-    id: '1',
-    enCode: 'batchNo',
-    name: '鐢宠鎵规鍙�',
-    width: 160,
-  },
-  {
-    id: '2',
-    enCode: 'parkName',
-    name: '鐢宠鍥尯',
-    width: 250,
-  },
-  {
-    id: '3',
-    enCode: 'parkTypeName',
-    name: '鍥尯绫诲瀷',
-    width: 160,
-  },
-  {
-    id: '4',
-    enCode: 'applyMonth',
-    name: '鐢宠骞冲彴濂栧姳鏈堜唤',
-    width: 160,
-  },
-  {
-    id: '5',
-    enCode: 'applySumAmount',
-    name: '骞冲彴濂栧姳姹囨�婚噾棰濓紙鍏冿級',
-    width: 180,
-  },
-  {
-    id: '6',
-    enCode: 'creationTime',
-    name: '鐢虫姤鏃ユ湡',
-    width: 180,
-  },
-  {
-    id: '7',
-    enCode: 'financeStatus',
-    name: '璐㈡斂鎷ㄤ粯鐧昏鐘舵��',
-    width: 160,
-  },
-  {
-    id: '8',
-    enCode: 'financeTime',
-    name: '璐㈡斂鎷ㄤ粯鐧昏鏃ユ湡',
-    width: 180,
-  },
-  {
-    id: '9',
-    enCode: 'settleStatus',
-    name: '骞冲彴鎷ㄤ粯鐧昏鐘舵��',
-    width: 160,
-  },
-  {
-    id: '10',
-    enCode: 'settleTime',
-    name: '骞冲彴鎷ㄤ粯鐧昏鏃ユ湡',
-    width: 180,
-  },
-  {
-    id: '11',
-    enCode: 'a',
-    name: '鐧昏浜�',
-  },
-];
-
-const operationBtns = defineOperationBtns([
-  {
-    data: {
-      enCode: 'detailBtn',
-      name: '鐢虫姤璇︽儏',
-    },
-    emits: {
-      onClick: (role) => goDetail(role),
-    },
-  },
-  // {
-  //   data: {
-  //     enCode: 'financialBtn',
-  //     name: '璐㈡斂鎷ㄤ粯',
-  //   },
-  //   emits: {
-  //     onClick: (role) => openFinancialDialog(role),
-  //   },
-  //   extraProps: {
-  //     hide: (row: API.GetParkBountyApplyListOutput) =>
-  //       row.financeStatus === FinanceStatusEnum.HasIncome,
-  //   },
-  // },
-  // {
-  //   data: {
-  //     enCode: 'plateformBtn',
-  //     name: '骞冲彴鍏呭��',
-  //   },
-  //   emits: {
-  //     onClick: (role) => openPlateformDialog(role),
-  //   },
-  //   extraProps: {
-  //     hide: (row: API.GetParkBountyApplyListOutput) =>
-  //       row.settleStatus !== SettleStatusEnum.WaitForSettle,
-  //   },
-  // },
-  {
-    data: {
-      enCode: 'registerBtn',
-      name: '鐧昏',
-    },
-    emits: {
-      onClick: (role) => goRewardGrantRegister(role),
-    },
+const operationBtnMap: Record<string, OperationBtnType> = {
+  detailBtn: { emits: { onClick: (role) => goDetail(role) } },
+  registerBtn: {
+    emits: { onClick: (role) => goRewardGrantRegister(role) },
     extraProps: {
       hide: (row: API.GetParkBountyApplyListOutput) =>
         !(
@@ -246,27 +139,7 @@
         ),
     },
   },
-  // {
-  //   data: {
-  //     enCode: 'uploadCertBtn',
-  //     name: '涓婁紶鍑瘉',
-  //   },
-  //   emits: {
-  //     onClick: (role) => openCertRewardDialog(role),
-  //   },
-  //   extraProps: {
-  //     hide: (row: API.GetParkBountyApplyListOutput) =>
-  //       !(
-  //         row.settleStatus === SettleStatusEnum.HasSettle ||
-  //         row.financeStatus === FinanceStatusEnum.HasIncome
-  //       ),
-  //   },
-  // },
-  {
-    data: {
-      enCode: 'checkBtn',
-      name: '鏌ョ湅鍑瘉',
-    },
+  checkBtn: {
     emits: {
       onClick: (row) => openMaterialFileDialog(row),
     },
@@ -278,7 +151,11 @@
         ),
     },
   },
-]);
+};
+
+const { checkSubModuleItemShow, column, operationBtns } = useAccess({
+  operationBtnMap,
+});
 
 const router = useRouter();
 const BaseState = {

--
Gitblit v1.9.1