From d892aef5d3879ae702d404c60aa9bbeb422ab6e7 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 18 Oct 2022 11:41:10 +0800 Subject: [PATCH] feat(nc-gui): add spinner during parsing large data --- .../nc-gui/components/dlg/QuickImport.vue | 210 +++++++++--------- 1 file changed, 108 insertions(+), 102 deletions(-) diff --git a/packages/nc-gui/components/dlg/QuickImport.vue b/packages/nc-gui/components/dlg/QuickImport.vue index d569e572c0..ee7432a30e 100644 --- a/packages/nc-gui/components/dlg/QuickImport.vue +++ b/packages/nc-gui/components/dlg/QuickImport.vue @@ -51,6 +51,8 @@ const importColumns = ref([]) const templateEditorModal = ref(false) +const isParsingData = ref(false) + const useForm = Form.useForm const importState = reactive({ @@ -134,6 +136,7 @@ const modalWidth = computed(() => { async function handlePreImport() { loading.value = true + isParsingData.value = true if (activeKey.value === 'uploadTab') { // TODO: update @@ -149,7 +152,9 @@ async function handlePreImport() { await parseAndExtractData(JSON.stringify(importState.jsonEditor)) } - loading.value = false + // TODO: fix + // loading.value = false + // isParsingData.value = false } async function handleImport() { @@ -188,8 +193,8 @@ async function parseAndExtractData2(val: UploadFile[]) { // importData.value = templateGenerator.getData() // if (importOnly) importColumns.value = templateGenerator.getColumns() - templateEditorModal.value = true + isParsingData.value = false }) } catch (e: any) { message.error(await extractSdkResponseErrorMsg(e)) @@ -338,115 +343,116 @@ const customReqCbk = (customReqArgs: { file: any; onSuccess: () => void }) => { wrap-class-name="nc-modal-quick-import" @keydown.esc="dialogShow = false" > -
-
{{ importMeta.header }}
- -
- - - - - - -
- - - - -

{{ $t('msg.info.import.clickOrDrag') }}

- -

- {{ importMeta.uploadHint }} -

-
-
-
- - - - -
- -
-
- - - - -
- - - - - -
-
-
-
+ + + + + +
+ +
+
+ + + + +
+ + + + + +
+
+ +
-
- +
+ -
- - {{ $t('title.advancedSettings') }} +
+ + {{ $t('title.advancedSettings') }} - - - + + + - -
- - {{ $t('labels.flattenNested') }} - -
+ +
+ + {{ $t('labels.flattenNested') }} + +
- -
- {{ $t('labels.importData') }} + +
+ {{ $t('labels.importData') }} +
-
- +