From 05a07471a6e55cc82210f9ad8b74d4b5aa445cfc Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 14 四月 2025 10:46:54 +0800
Subject: [PATCH] feat: 接口
---
src/views/Reward/RewardGrant.vue | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/src/views/Reward/RewardGrant.vue b/src/views/Reward/RewardGrant.vue
index 18093e7..4b04fb9 100644
--- a/src/views/Reward/RewardGrant.vue
+++ b/src/views/Reward/RewardGrant.vue
@@ -47,6 +47,13 @@
</ProTableQueryFilterBar>
<ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
+ <template #operationBtn-checkBtn="{ data, row }">
+ <PreviewBtnV2
+ class="pro-table-operation-btn"
+ :url="convertApi2FormUrlBySeparator(row.settleFileUrl ?? '')"
+ preview-btn-text="鏌ョ湅鍑瘉"
+ />
+ </template>
</ProTableV2>
<RewardGrantDialog v-bind="dialogProps"></RewardGrantDialog>
</AppContainer>
@@ -67,15 +74,21 @@
FieldDatePicker,
useFormDialog,
UploadUserFile,
- bolePreview,
+ PreviewBtnV2,
} from '@bole-core/components';
import { Message, OrderInputType } from '@bole-core/core';
-import { convertApi2FormUrl, convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils';
+import {
+ convertApi2FormUrl,
+ convertApi2FormUrlBySeparator,
+ downloadFileByUrl,
+ format,
+} from '@/utils';
import { SettleStatusEnum, SettleStatusEnumText } from '@/constants';
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import RewardGrantDialog from './components/RewardGrantDialog.vue';
import _ from 'lodash';
import { ModelValueType } from 'element-plus';
+import { useQueryClient } from '@tanstack/vue-query';
defineOptions({
name: 'RewardGrant',
@@ -149,11 +162,8 @@
},
{
data: {
- enCode: 'previewBtn',
+ enCode: 'checkBtn',
name: '鏌ョ湅鍑瘉',
- },
- emits: {
- onClick: (role) => handlePreview(role),
},
extraProps: {
hide: (row: API.GetParkBountyApplyListOutput) =>
@@ -243,7 +253,7 @@
settleFileUrl: [] as UploadUserFile[],
});
}
-
+const queryClient = useQueryClient();
async function handleAddOrEdit() {
try {
let params: API.ParkBountyApplySettleInput = {
@@ -254,17 +264,11 @@
if (res) {
Message.successMessage('鎿嶄綔鎴愬姛');
getList(paginationState.pageIndex);
+ queryClient.invalidateQueries({
+ queryKey: ['parkBountyApplyServices/getGoverDataBoard'],
+ });
}
} catch (error) {}
-}
-
-function handlePreview(row?: API.GetParkBountyApplyListOutput) {
- const fileList = row.settleFileUrl?.split('|').map((x) => convertApi2FormUrl(x)) ?? [];
- if (fileList.length > 1) {
- console.log('fileList: ', fileList);
- } else {
- downloadFileByUrl(fileList[0]);
- }
}
</script>
--
Gitblit v1.9.1