feat(api): uploadDocumentToServer 增加 attribute_type 参数
This commit is contained in:
@@ -2,6 +2,7 @@ import { postgrestGet, type PostgrestParams } from '../postgrest-client';
|
||||
import dayjs from 'dayjs';
|
||||
import { UPLOAD_URL, API_BASE_URL } from '../../config/api-config';
|
||||
import axios from 'axios';
|
||||
import { CONTRACT_TYPES, DEFAULT_CONTRACT_TYPE, type ContractType } from '~/constants/contractTypes';
|
||||
|
||||
/**
|
||||
* 检查文档名称是否重复
|
||||
@@ -371,9 +372,9 @@ export async function appendContractAttachments(
|
||||
}
|
||||
|
||||
export async function uploadDocumentToServer(
|
||||
binaryData: ArrayBuffer,
|
||||
fileName: string,
|
||||
fileType: string,
|
||||
binaryData: ArrayBuffer,
|
||||
fileName: string,
|
||||
fileType: string,
|
||||
typeId: string | number,
|
||||
priority: string,
|
||||
documentNumber?: string | null,
|
||||
@@ -382,7 +383,8 @@ export async function uploadDocumentToServer(
|
||||
documentId?: number | null,
|
||||
isReupload: boolean = false,
|
||||
jwtToken?: string,
|
||||
attachments?: File[]
|
||||
attachments?: File[],
|
||||
attributeType?: string
|
||||
): Promise<{data: FileUploadResponse; error?: never} | {data?: never; error: string; status?: number}> {
|
||||
try {
|
||||
// console.log('【调试】开始上传文档:', { fileName, fileSize: binaryData.byteLength });
|
||||
@@ -397,13 +399,14 @@ export async function uploadDocumentToServer(
|
||||
|
||||
// 将信息添加到一个JSON对象中
|
||||
const uploadInfo = {
|
||||
type_id: Number(typeId),
|
||||
type_id: Number(typeId),
|
||||
evaluation_level: priority,
|
||||
document_number: documentNumber || null,
|
||||
remark: remark || null,
|
||||
is_test_document: isTestDocument,
|
||||
document_id: documentId || null,
|
||||
is_reupload: isReupload
|
||||
is_reupload: isReupload,
|
||||
attribute_type: attributeType || null
|
||||
};
|
||||
|
||||
// 添加JSON字符串到FormData
|
||||
|
||||
Reference in New Issue
Block a user