From 0b73bba28e2a8473ab71f5c8b4760c1995ff4fc1 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 21 十月 2025 18:29:07 +0800
Subject: [PATCH] fix: s
---
src/components/commonView/utils/index.ts | 81 +++++++++++++++++++++++++++++++---------
1 files changed, 63 insertions(+), 18 deletions(-)
diff --git a/src/components/commonView/utils/index.ts b/src/components/commonView/utils/index.ts
index 9550a10..2372a8d 100644
--- a/src/components/commonView/utils/index.ts
+++ b/src/components/commonView/utils/index.ts
@@ -13,6 +13,8 @@
FourStreamsMaterialFileBusinessTypeEnumKey,
TransferFileEnumInRewardGrand,
TransferFileEnumInRewardGrandKey,
+ FourStreamsExtraMaterialFileSearchType,
+ SearchType,
} from '@/constants';
export class FourStreamsMaterialUtils {
@@ -120,6 +122,7 @@
export type CustomerApplyFileTypeListItem = {
id?: string;
fileSearchTypeId?: string;
+ searchType?: number;
fileTypeName?: string;
lastUpdateTime?: string;
listFiles?: (API.CustomerUploadMonthApplyFileTypeDto & UploadUserFile)[];
@@ -154,29 +157,71 @@
);
}
+ static convertApiFileToExtraListFiles(listFiles: API.CustomerUploadMonthApplyFileTypeDto[]) {
+ if (listFiles.length > 0) {
+ return this.convertApiFileToParkCollectFileList(listFiles);
+ } else {
+ return [
+ {
+ fileSearchTypeId: FourStreamsExtraMaterialFileSearchType[SearchType.BountyExtraFileType],
+ fileTypeName: '琛ュ厖鏉愭枡',
+ listFiles: [],
+ } as CustomerApplyFileTypeListItem,
+ ];
+ }
+ }
+
static initParkCollectFileListApplyFiles(
applyUploadFiles: API.GetEnterpriseParkApplyUploadFileOutput[],
applyFiles: API.GetCustomerUploadApplyFilesOutput[],
- lastUploadEnterPactFile: API.CustomerUploadMonthApplyFileTypeDto[]
+ lastUploadEnterPactFile: API.CustomerUploadMonthApplyFileTypeDto[],
+ applyUploadExtraFiles: API.GetEnterpriseParkApplyUploadFileOutput[]
) {
- return applyUploadFiles.map((x) => {
- const applyFile = applyFiles.find((a) => a.fileSearchTypeId === x.fileSearchTypeId);
- let listFiles: API.CustomerUploadMonthApplyFileTypeDto[];
- if (x.fileSearchTypeName === '鍥尯鍏ラ┗鍗忚') {
- listFiles = !x.listFiles.length ? lastUploadEnterPactFile : x.listFiles;
- } else {
- listFiles =
- !x.listFiles.length && applyFile?.listFiles?.length > 0
- ? applyFile.listFiles
- : x.listFiles;
- }
+ const extraFiles =
+ applyUploadExtraFiles.length > 0
+ ? applyUploadExtraFiles.map((x) => {
+ return {
+ fileSearchTypeId: x.fileSearchTypeId,
+ fileTypeName: x.fileSearchTypeName,
+ listFiles: x.listFiles.map((a) => ({ ...a, ...convertApi2FormUrl(a.fileUrl) })),
+ } as CustomerApplyFileTypeListItem;
+ })
+ : [
+ {
+ fileSearchTypeId:
+ FourStreamsExtraMaterialFileSearchType[SearchType.BountyApplyExtraFileType],
+ fileTypeName: '琛ュ厖鏉愭枡',
+ listFiles: [],
+ } as CustomerApplyFileTypeListItem,
+ ];
- return {
- fileSearchTypeId: x.fileSearchTypeId,
- fileTypeName: x.fileSearchTypeName,
- listFiles: listFiles.map((a) => ({ ...a, ...convertApi2FormUrl(a.fileUrl) })),
- } as CustomerApplyFileTypeListItem;
- });
+ return applyUploadFiles
+ .map((x) => {
+ const applyFile = applyFiles.find((a) => a.fileSearchTypeId === x.fileSearchTypeId);
+ let listFiles: API.CustomerUploadMonthApplyFileTypeDto[];
+ if (x.fileSearchTypeName === '鍥尯鍏ラ┗鍗忚') {
+ listFiles = !x.listFiles.length ? lastUploadEnterPactFile : x.listFiles;
+ } else {
+ listFiles =
+ !x.listFiles.length && applyFile?.listFiles?.length > 0
+ ? applyFile.listFiles
+ : x.listFiles;
+ }
+
+ return {
+ fileSearchTypeId: x.fileSearchTypeId,
+ fileTypeName: x.fileSearchTypeName,
+ listFiles: listFiles.map((a) => ({ ...a, ...convertApi2FormUrl(a.fileUrl) })),
+ } as CustomerApplyFileTypeListItem;
+ })
+ .concat(extraFiles);
+ }
+
+ static isApplyUploadExtraFileSearchTypeId(fileSearchTypeId: string) {
+ return (
+ (fileSearchTypeId ?? '').toLowerCase() ===
+ FourStreamsExtraMaterialFileSearchType[SearchType.BountyApplyExtraFileType].toLowerCase()
+ );
}
static convertFileTableListToApi(fileTableList: CustomerApplyFileTypeListItem[]) {
--
Gitblit v1.9.1