This commit is contained in:
80
src/types/api/exportTask.ts
Normal file
80
src/types/api/exportTask.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
import type { BaseResponse, PaginationParams } from './common'
|
||||
|
||||
export type ExportTaskScene = 'device' | 'iot_card'
|
||||
|
||||
export type ExportTaskFormat = 'xlsx' | 'csv'
|
||||
|
||||
export enum ExportTaskStatus {
|
||||
PENDING = 1,
|
||||
PROCESSING = 2,
|
||||
COMPLETED = 3,
|
||||
FAILED = 4,
|
||||
CANCELED = 5
|
||||
}
|
||||
|
||||
export interface ExportTaskQueryParams extends PaginationParams {
|
||||
scene?: ExportTaskScene
|
||||
status?: ExportTaskStatus
|
||||
start_time?: string
|
||||
end_time?: string
|
||||
}
|
||||
|
||||
export interface ExportTaskItem {
|
||||
id: number
|
||||
task_no: string
|
||||
scene: ExportTaskScene
|
||||
status: ExportTaskStatus
|
||||
status_name: string
|
||||
progress: number
|
||||
format: ExportTaskFormat
|
||||
total_rows: number
|
||||
processed_rows: number
|
||||
total_shards: number
|
||||
success_shards: number
|
||||
failed_shards: number
|
||||
file_key: string
|
||||
error_message: string
|
||||
cancel_requested: boolean
|
||||
created_at: string
|
||||
started_at: string
|
||||
completed_at: string
|
||||
}
|
||||
|
||||
export interface ExportTaskListResponse {
|
||||
page: number
|
||||
size: number
|
||||
total: number
|
||||
items: ExportTaskItem[]
|
||||
}
|
||||
|
||||
export interface CreateExportTaskRequest {
|
||||
scene: ExportTaskScene
|
||||
format: ExportTaskFormat
|
||||
query?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface CreateExportTaskResponse {
|
||||
task_id: number
|
||||
task_no: string
|
||||
status: ExportTaskStatus
|
||||
status_name: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface ExportTaskDetail extends ExportTaskItem {
|
||||
download_url?: string
|
||||
download_expires_at?: string
|
||||
}
|
||||
|
||||
export interface CancelExportTaskResponse {
|
||||
task_id: number
|
||||
status: ExportTaskStatus
|
||||
status_name: string
|
||||
cancel_requested: boolean
|
||||
message: string
|
||||
}
|
||||
|
||||
export type ExportTaskListApiResponse = BaseResponse<ExportTaskListResponse>
|
||||
export type CreateExportTaskApiResponse = BaseResponse<CreateExportTaskResponse>
|
||||
export type ExportTaskDetailApiResponse = BaseResponse<ExportTaskDetail>
|
||||
export type CancelExportTaskApiResponse = BaseResponse<CancelExportTaskResponse>
|
||||
@@ -97,3 +97,6 @@ export * from './manualTrigger'
|
||||
|
||||
// 轮询监控相关
|
||||
export * from './pollingMonitor'
|
||||
|
||||
// 导出任务相关
|
||||
export * from './exportTask'
|
||||
|
||||
2
src/types/components.d.ts
vendored
2
src/types/components.d.ts
vendored
@@ -107,6 +107,7 @@ declare module 'vue' {
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
||||
ElLink: typeof import('element-plus/es')['ElLink']
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
@@ -132,6 +133,7 @@ declare module 'vue' {
|
||||
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
||||
ElWatermark: typeof import('element-plus/es')['ElWatermark']
|
||||
ExportTaskCreateDialog: typeof import('./../components/business/ExportTaskCreateDialog.vue')['default']
|
||||
HorizontalSubmenu: typeof import('./../components/core/layouts/art-menus/art-horizontal-menu/widget/HorizontalSubmenu.vue')['default']
|
||||
ImportDialog: typeof import('./../components/business/ImportDialog.vue')['default']
|
||||
LoginLeftView: typeof import('./../components/core/views/login/LoginLeftView.vue')['default']
|
||||
|
||||
Reference in New Issue
Block a user