EtlImportModal.vue Usage Guide
This document provides a complete developer guide for integrating and using the EtlImportModal.vue component within a parent Vue component.
(English)
1. Component Overview
TheEtlImportModal.vue is the primary frontend component for the ETL system. It orchestrates a complete, multi-stage user interface for importing files:
- Stage 1 (Upload & Buffering): The user uploads a file. The component shows real-time progress as the backend parses the file into a temporary “buffer”.
- Stage 2 (Preview & Configure): Once buffering is complete, the modal displays a preview of the imported data and allows the user to configure import options (e.g., the field to use for “upserting”).
- Stage 3 (Commit): After the user confirms, the component shows a final progress bar as the data is committed from the buffer to the production database collection.
2. Component API
Props
These are the properties you must pass to the component.| Prop Name | Type | Required | Default | Description |
|---|---|---|---|---|
schemaName | String | Yes | '' | The unique name of the schema to use. This must match a .yml filename in config/etl_schemas/ (e.g., 'user_schema'). |
baseUrl | String | Yes | '' | The base prefix for all API routes that the modal will call (e.g., '/api/etl'). |
Public Methods
You can call these methods on the component instance using aref.
| Method | Description |
|---|---|
show() | Programmatically opens the modal and starts the import workflow. |
hide() | Programmatically closes the modal. |
Events
You can listen for these events emitted by the component.| Event Name | Payload | Description |
|---|---|---|
hidden | undefined | Fired when the modal is fully closed (after any animations). This is the ideal event to listen for to refresh your parent component’s data table. |
shown | undefined | Fired when the modal is fully visible. |
3. Integration Example
Here is a complete example of how to use theEtlImportModal from a parent page (e.g., UsersPage.vue).
Step 1: Import and Register the Component
(Bahasa Indonesia)
1. Gambaran Umum Komponen
EtlImportModal.vue adalah komponen frontend utama untuk sistem ETL. Komponen ini mengatur antarmuka pengguna multi-tahap yang lengkap для mengimpor file:
- Tahap 1 (Upload & Buffering): Pengguna mengunggah file. Komponen menampilkan progres real-time saat backend mem-parsing file ke dalam “buffer” sementara.
- Tahap 2 (Preview & Konfigurasi): Setelah proses buffering selesai, modal menampilkan pratinjau data yang diimpor dan memungkinkan pengguna untuk mengkonfigurasi opsi impor (misalnya, field yang digunakan untuk “upsert”).
- Tahap 3 (Commit): Setelah pengguna mengkonfirmasi, komponen menampilkan progress bar terakhir saat data dipindahkan dari buffer ke koleksi database produksi.
2. API Komponen
Props
Ini adalah properti yang harus Anda teruskan ke komponen.| Nama Prop | Tipe | Wajib | Default | Deskripsi |
|---|---|---|---|---|
schemaName | String | Ya | '' | Nama unik dari skema yang akan digunakan. Harus cocok dengan nama file .yml di config/etl_schemas/ (contoh: 'user_schema'). |
baseUrl | String | Ya | '' | Awalan dasar untuk semua rute API yang akan dipanggil oleh modal (contoh: '/api/etl'). |
Method Publik
Anda dapat memanggil method ini pada instance komponen menggunakanref.
| Method | Deskripsi |
|---|---|
show() | Membuka modal secara terprogram dan memulai alur kerja impor. |
hide() | Menutup modal secara terprogram. |
Event
Anda dapat mendengarkan event yang dipancarkan (emit) oleh komponen ini.| Nama Event | Payload | Deskripsi |
|---|---|---|
hidden | undefined | Dijalankan saat modal sepenuhnya tertutup (setelah animasi selesai). Ini adalah event yang ideal untuk me-refresh tabel data di komponen induk Anda. |
shown | undefined | Dijalankan saat modal sepenuhnya terlihat. |
3. Contoh Integrasi
Berikut adalah contoh lengkap cara menggunakanEtlImportModal dari halaman induk (misalnya, UsersPage.vue).
Langkah 1: Impor dan Daftarkan Komponen

