feat(aireport): 新增多模板批任务功能
- 在动态路由中添加 reportTaskMulti 和 testReportMulti 的路径映射 - 新增 TestReportMulti API 接口定义,包括批任务记录、列表参数、模板目录等接口类型 - 实现批任务多模板相关 API 方法,包含列表查询、压缩包验证、创建、详情获取等功能 - 创建 testReportMulti 页面组件,实现批任务管理界面和交互逻辑 - 开发批任务创建对话框组件,支持压缩包上传和子报告配置功能
This commit is contained in:
40
frontend/src/api/aireport/testReportMulti/index.ts
Normal file
40
frontend/src/api/aireport/testReportMulti/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import http from '@/api'
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import type { ReportTaskMulti } from './interface'
|
||||
|
||||
const REPORT_TASK_MULTI_BASE_URL = '/api/test-report-multi'
|
||||
|
||||
export const listReportTaskMultisApi = (params: ReportTaskMulti.ReportTaskMultiListParams) => {
|
||||
return http.post(`${REPORT_TASK_MULTI_BASE_URL}/list`, params)
|
||||
}
|
||||
|
||||
export const validateReportTaskMultiZipApi = (formData: FormData) => {
|
||||
return http.post<ReportTaskMulti.ReportTaskMultiValidateResult>(`${REPORT_TASK_MULTI_BASE_URL}/zip/validate`, formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
export const createReportTaskMultiApi = (params: ReportTaskMulti.ReportTaskMultiCreateParam) => {
|
||||
return http.post<boolean>(`${REPORT_TASK_MULTI_BASE_URL}/create`, params)
|
||||
}
|
||||
|
||||
export const getReportTaskMultiDetailApi = (id: string) => {
|
||||
return http.get<ReportTaskMulti.ReportTaskMultiRecord>(`${REPORT_TASK_MULTI_BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
export const listReportTaskMultiChildReportsApi = (id: string) => {
|
||||
return http.get(`${REPORT_TASK_MULTI_BASE_URL}/${id}/child-report/list`)
|
||||
}
|
||||
|
||||
export const downloadReportTaskMultiApi = (id: string): Promise<AxiosResponse<Blob>> =>
|
||||
http.get(`${REPORT_TASK_MULTI_BASE_URL}/${id}/download`, undefined, {
|
||||
responseType: 'blob'
|
||||
}) as unknown as Promise<AxiosResponse<Blob>>
|
||||
|
||||
export const deleteReportTaskMultisApi = (ids: string[]) => {
|
||||
return http.post<boolean>(`${REPORT_TASK_MULTI_BASE_URL}/delete`, ids)
|
||||
}
|
||||
|
||||
export const generateReportTaskMultiApi = (id: string) => {
|
||||
return http.post<boolean>(`${REPORT_TASK_MULTI_BASE_URL}/${id}/generate`)
|
||||
}
|
||||
72
frontend/src/api/aireport/testReportMulti/interface/index.ts
Normal file
72
frontend/src/api/aireport/testReportMulti/interface/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
export namespace ReportTaskMulti {
|
||||
export interface ReportTaskMultiRecord {
|
||||
id?: string
|
||||
no?: string | null
|
||||
zipFileName?: string | null
|
||||
summaryFileName?: string | null
|
||||
dirCount?: number | null
|
||||
childReportCount?: number | null
|
||||
pointCount?: number | null
|
||||
importState?: number | null
|
||||
generateState?: number | null
|
||||
status?: number | null
|
||||
createBy?: string | null
|
||||
createByName?: string | null
|
||||
createTime?: string | null
|
||||
updateBy?: string | null
|
||||
updateByName?: string | null
|
||||
updateTime?: string | null
|
||||
}
|
||||
|
||||
export interface ReportTaskMultiListParams {
|
||||
keyword?: string
|
||||
searchBeginTime?: string
|
||||
searchEndTime?: string
|
||||
timeRange?: string[]
|
||||
generateState?: number
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface ReportTaskMultiTemplateDirRecord {
|
||||
dirName?: string | null
|
||||
dirPath?: string | null
|
||||
pointCount?: number | null
|
||||
groupCount?: number | null
|
||||
excelAttachmentCount?: number | null
|
||||
wordAttachmentCount?: number | null
|
||||
}
|
||||
|
||||
export interface ReportTaskMultiValidateResult {
|
||||
success?: boolean | null
|
||||
sessionId?: string | null
|
||||
zipFileName?: string | null
|
||||
summaryFileName?: string | null
|
||||
dirCount?: number | null
|
||||
childReportCount?: number | null
|
||||
pointCount?: number | null
|
||||
excelAttachmentCount?: number | null
|
||||
wordAttachmentCount?: number | null
|
||||
orphanAttachmentPaths?: string[] | null
|
||||
failReasons?: string[] | null
|
||||
templateDirs?: ReportTaskMultiTemplateDirRecord[] | null
|
||||
}
|
||||
|
||||
export interface ReportTaskMultiChildConfig {
|
||||
templateDirName: string
|
||||
templateDirPath: string
|
||||
no: string
|
||||
clientUnitId: string
|
||||
reportModelId: string
|
||||
createUnit: string
|
||||
contractNumber: string
|
||||
standard: string[]
|
||||
phonenumber?: string
|
||||
}
|
||||
|
||||
export interface ReportTaskMultiCreateParam {
|
||||
no: string
|
||||
sessionId: string
|
||||
childReports: ReportTaskMultiChildConfig[]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user