feat(frontend): unify attachment management spec and implement fetch+blob download\n\n- Implement forced download via fetch blob, delayed delete etc in repairOrder module\n- Add Attachment Management Unified Standard doctrine to cursorrules-frontend.md so future pages keep consistency\n- Update change log for download preview fix
This commit is contained in:
1 parent
1540bd1a1b
commit
4ef2208a0c
11 files changed
+1318
-108
No files matched your search
@@ -11,7 +11,7 @@ import {
|
||||
RepairStatisticsVO,
|
||||
ServiceEvaluationForm,
|
||||
ServiceEvaluationVO
|
||||
} from '@/api/hq/hq/pm/types';
|
||||
} from '@/api/hq/pm/types';
|
||||
|
||||
/**
|
||||
* 查询报修工单列表
|
||||
@@ -161,7 +161,7 @@ export const uploadAttachment = (orderId: string | number, uploadStage: string,
|
||||
if (description) {
|
||||
formData.append('description', description);
|
||||
}
|
||||
|
||||
|
||||
return request({
|
||||
url: '/hq/pm/attachment/upload',
|
||||
method: 'post',
|
||||
@@ -183,17 +183,17 @@ export const uploadAttachments = (orderId: string | number, uploadStage: string,
|
||||
const formData = new FormData();
|
||||
formData.append('orderId', orderId.toString());
|
||||
formData.append('uploadStage', uploadStage);
|
||||
|
||||
|
||||
files.forEach((file, index) => {
|
||||
formData.append('files', file);
|
||||
});
|
||||
|
||||
|
||||
if (descriptions) {
|
||||
descriptions.forEach((desc, index) => {
|
||||
formData.append('descriptions', desc);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return request({
|
||||
url: '/hq/pm/attachment/upload/batch',
|
||||
method: 'post',
|
||||
@@ -293,3 +293,31 @@ export const getServiceEvaluation = (orderId: string | number): AxiosPromise<Ser
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 更新附件的工单ID(用于新增工单时关联已上传的附件)
|
||||
* @param attachmentId 附件ID
|
||||
* @param orderId 工单ID
|
||||
*/
|
||||
export const updateAttachmentOrderId = (attachmentId: string | number, orderId: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: `/hq/pm/attachment/${attachmentId}/order/${orderId}`,
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量更新附件的工单ID(用于新增工单时关联已上传的附件)
|
||||
* @param attachmentIds 附件ID列表
|
||||
* @param orderId 工单ID
|
||||
*/
|
||||
export const batchUpdateAttachmentOrderId = (attachmentIds: Array<string | number>, orderId: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/hq/pm/attachment/batch-update-order',
|
||||
method: 'put',
|
||||
data: {
|
||||
attachmentIds: attachmentIds,
|
||||
orderId: orderId
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user