Bỏ qua, đến nội dung

@digiforce-nc/plugin-action-export-pro

Plugin xuất Excel nâng cao (async export) - mở rộng plugin-action-export bằng async job cho dữ liệu lớn, kèm khả năng xuất file đính kèm thành archive ZIP.

Plugin này làm gì?

Hãy hình dung bạn xuất 100.000 bản ghi - export đồng bộ sẽ timeout hoặc block server. plugin-action-export-pro giải quyết bằng cách chuyển export sang background job. Khi dữ liệu vượt ngưỡng (cấu hình qua biến môi trường), hệ thống tự động chuyển sang chế độ async - user nhận thông báo khi file sẵn sàng. Ngoài ra plugin bổ sung action exportAttachments để xuất file đính kèm thành ZIP.

Ba nhiệm vụ chính

#Nhiệm vụChi tiết
1Async exportOverride handler export với chế độ sync/async tự động theo ngưỡng EXPORT_AUTO_MODE_THRESHOLD
2Export attachmentsAction exportAttachments xuất tất cả file đính kèm thành archive ZIP
3Task managementTích hợp async-task-manager để theo dõi tiến trình, thông báo, tải file kết quả

Kiến trúc

Tổng quan

Plugin extends plugin-action-export - override handler export và bổ sung action mới. Yêu cầu plugin-async-task-manager để quản lý background job.

TầngVai tròThành phần
Client UINút export + hiển thị kết quả asyncExportProPluginProvider, ExportAttachmentActionWidget
Server HandlerOverride export, thêm exportAttachmentsExport handler, exportAttachments handler
Job WorkerXử lý export trong backgroundexportXlsxPro, exportAttachments workers
Task ManagerQuản lý job, notification, downloadplugin-async-task-manager

Yêu cầu plugin

Plugin bắt buộcVai trò
plugin-action-exportPlugin export cơ bản (được mở rộng)
plugin-async-task-managerQuản lý async job, notification, file storage

Biến môi trường

BiếnMặc địnhMô tả
EXPORT_AUTO_MODE_THRESHOLD(hệ thống)Ngưỡng số bản ghi để tự chuyển sang async mode

API endpoints

EndpointMethodMô tả
{collection}:exportPOSTExport XLSX (override - tự chọn sync/async)
{collection}:exportAttachmentsPOSTExport tất cả attachments thành ZIP (luôn async)
asyncTasks:fetchFile/{taskId}GETTải file kết quả từ async task

Job topics

TopicMô tả
exportXlsxProJob xuất dữ liệu ra file XLSX
exportAttachmentsJob xuất file đính kèm ra ZIP

CLI commands

CommandMô tả
export-xlsx-commandChạy export XLSX từ command line
export-attachment-commandChạy export attachments từ command line

Luồng hoạt động

Export XLSX (async mode)

Export Attachments (ZIP)


Thành phần client

Thành phầnMô tả
ExportProPluginProviderProvider override export UI bằng phiên bản hỗ trợ async
ExportAttachmentActionWidgetNút action xuất attachments (ZIP)
ExportTaskResultRendererHiển thị kết quả export trong async task manager UI
AsyncExportButtonNút tải file kết quả sau khi async job hoàn tất

Dependencies

PackageVai trò
@digiforce-nc/plugin-action-exportPlugin export cơ bản (peer)
@digiforce-nc/plugin-async-task-managerAsync task manager (peer)
@digiforce-nc/clientClient framework (peer)
@digiforce-nc/serverServer framework (peer)

Mục lục chi tiết