feat: 新增导出
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m19s

This commit is contained in:
luo
2026-06-16 11:35:45 +08:00
parent 908367ba5d
commit 2a8f4e40d6
19 changed files with 1347 additions and 0 deletions

View 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>

View File

@@ -97,3 +97,6 @@ export * from './manualTrigger'
// 轮询监控相关
export * from './pollingMonitor'
// 导出任务相关
export * from './exportTask'

View File

@@ -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']