Browse Source

feat(gui-v2): use a-modal

pull/2795/head
Wing-Kam Wong 2 years ago
parent
commit
bac7b00143
  1. 36
      packages/nc-gui-v2/components/dlg/FileImport.vue

36
packages/nc-gui-v2/components/dlg/FileImport.vue

@ -80,12 +80,30 @@ const handleChange = (info: UploadChangeParam) => {
}
}
const loadUrl = () => {}
const handleSubmit = () => {
if (activeKey.value === 'upload') {
// TODO
} else if (activeKey.value === 'url') {
// TODO
try {
validate()
} catch (e) {
// TODO
}
} else if (activeKey.value === 'json') {
// TODO
}
}
</script>
<template>
<v-dialog v-model="dialogShow" persistent @keydown.esc="dialogShow = false">
<v-card class="w-300 min-h-200 max-h-300">
<a-modal
v-model:visible="dialogShow"
width="max(90vw, 600px)"
@keydown.esc="dialogShow = false"
@ok="handleSubmit"
okText="Import"
>
<a-tabs v-model:activeKey="activeKey" hide-add type="editable-card" :tab-position="top">
<a-tab-pane key="upload" :closable="false">
<template #tab>
@ -134,21 +152,11 @@ const loadUrl = () => {}
<a-input v-model:value="formState.url" size="large" />
</a-form-item>
</a-form-item>
<a-button
:disabled="!formState.url"
:v-t="importMeta.loadUrlDirective"
size="large"
type="primary"
@click="loadUrl"
>
{{ $t('general.load') }}
</a-button>
</a-form>
</div>
</a-tab-pane>
</a-tabs>
</v-card>
</v-dialog>
</a-modal>
</template>
<style scoped lang="scss">

Loading…
Cancel
Save