|
|
@ -1,4 +1,5 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
|
|
import type { Ref } from '@vue/reactivity' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ActiveViewInj, |
|
|
|
ActiveViewInj, |
|
|
|
IsLockedInj, |
|
|
|
IsLockedInj, |
|
|
@ -41,11 +42,19 @@ const showApiSnippetDrawer = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const showErd = ref(false) |
|
|
|
const showErd = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const quickImportDialog = ref(false) |
|
|
|
type QuickImportDialogType = 'csv' | 'excel' | 'json' |
|
|
|
|
|
|
|
const quickImportDialogTypes: QuickImportDialogType[] = ['csv', 'excel', 'json'] |
|
|
|
|
|
|
|
const quickImportDialogs: Record<typeof quickImportDialogTypes[number], Ref<boolean>> = quickImportDialogTypes.reduce( |
|
|
|
|
|
|
|
(acc: any, curr) => { |
|
|
|
|
|
|
|
acc[curr] = ref(false) |
|
|
|
|
|
|
|
return acc |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{}, |
|
|
|
|
|
|
|
) as Record<QuickImportDialogType, Ref<boolean>> |
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
|
|
|
|
|
|
|
|
const { isSharedBase } = useProject() |
|
|
|
const { bases, isSharedBase } = useProject() |
|
|
|
|
|
|
|
|
|
|
|
const Icon = computed(() => { |
|
|
|
const Icon = computed(() => { |
|
|
|
switch (selectedView.value?.lock_type) { |
|
|
|
switch (selectedView.value?.lock_type) { |
|
|
@ -173,19 +182,20 @@ useMenuCloseOnEsc(open) |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<template #expandIcon></template> |
|
|
|
<template #expandIcon></template> |
|
|
|
<a-menu-item v-if="isUIAllowed('csvImport') && !isView && !isPublicView"> |
|
|
|
<template v-for="(dialog, type) in quickImportDialogs"> |
|
|
|
<div |
|
|
|
<a-menu-item v-if="isUIAllowed(`${type}Import`) && !isView && !isPublicView" :key="type"> |
|
|
|
v-e="['a:actions:upload-csv']" |
|
|
|
<div |
|
|
|
class="nc-project-menu-item" |
|
|
|
v-e="[`a:actions:upload-${type}`]" |
|
|
|
:class="{ disabled: isLocked }" |
|
|
|
class="nc-project-menu-item" |
|
|
|
@click="!isLocked ? (quickImportDialog = true) : {}" |
|
|
|
:class="{ disabled: isLocked }" |
|
|
|
> |
|
|
|
@click="!isLocked ? (dialog.value = true) : {}" |
|
|
|
<MdiUploadOutline class="text-gray-500" /> |
|
|
|
> |
|
|
|
<!-- Upload CSV --> |
|
|
|
<MdiUploadOutline class="text-gray-500" /> |
|
|
|
{{ $t('activity.uploadCSV') }} |
|
|
|
{{ `${$t('general.upload')} ${type.toUpperCase()}` }} |
|
|
|
<div class="flex items-center text-gray-400"><MdiAlpha />version</div> |
|
|
|
<div class="flex items-center text-gray-400"><MdiAlpha />version</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-menu-item> |
|
|
|
</a-menu-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
</a-sub-menu> |
|
|
|
</a-sub-menu> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -230,7 +240,14 @@ useMenuCloseOnEsc(open) |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-dropdown> |
|
|
|
</a-dropdown> |
|
|
|
|
|
|
|
|
|
|
|
<LazyDlgQuickImport v-if="quickImportDialog" v-model="quickImportDialog" import-type="csv" :import-data-only="true" /> |
|
|
|
<LazyDlgQuickImport |
|
|
|
|
|
|
|
v-for="type in quickImportDialogTypes" |
|
|
|
|
|
|
|
:key="type" |
|
|
|
|
|
|
|
v-model="quickImportDialogs[type].value" |
|
|
|
|
|
|
|
:import-type="type" |
|
|
|
|
|
|
|
:base-id="bases[0].id" |
|
|
|
|
|
|
|
:import-data-only="true" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<LazyWebhookDrawer v-if="showWebhookDrawer" v-model="showWebhookDrawer" /> |
|
|
|
<LazyWebhookDrawer v-if="showWebhookDrawer" v-model="showWebhookDrawer" /> |
|
|
|
|
|
|
|
|
|
|
|