|
|
@ -1,6 +1,5 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import type { ColumnType, TableType } from 'nocodb-sdk' |
|
|
|
import type { ColumnType, TableType } from 'nocodb-sdk' |
|
|
|
import SmartsheetGrid from '../smartsheet/Grid.vue' |
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
ActiveViewInj, |
|
|
|
ActiveViewInj, |
|
|
|
FieldsInj, |
|
|
|
FieldsInj, |
|
|
@ -10,10 +9,12 @@ import { |
|
|
|
OpenNewRecordFormHookInj, |
|
|
|
OpenNewRecordFormHookInj, |
|
|
|
ReloadViewDataHookInj, |
|
|
|
ReloadViewDataHookInj, |
|
|
|
ReloadViewMetaHookInj, |
|
|
|
ReloadViewMetaHookInj, |
|
|
|
|
|
|
|
TabMetaInj, |
|
|
|
computed, |
|
|
|
computed, |
|
|
|
createEventHook, |
|
|
|
createEventHook, |
|
|
|
inject, |
|
|
|
inject, |
|
|
|
provide, |
|
|
|
provide, |
|
|
|
|
|
|
|
ref, |
|
|
|
useMetas, |
|
|
|
useMetas, |
|
|
|
useProvideSmartsheetStore, |
|
|
|
useProvideSmartsheetStore, |
|
|
|
watch, |
|
|
|
watch, |
|
|
@ -28,7 +29,7 @@ const { metas } = useMetas() |
|
|
|
|
|
|
|
|
|
|
|
const activeView = ref() |
|
|
|
const activeView = ref() |
|
|
|
|
|
|
|
|
|
|
|
const el = ref<typeof SmartsheetGrid>() |
|
|
|
const el = ref() |
|
|
|
|
|
|
|
|
|
|
|
const fields = ref<ColumnType[]>([]) |
|
|
|
const fields = ref<ColumnType[]>([]) |
|
|
|
|
|
|
|
|
|
|
@ -36,8 +37,8 @@ provide(TabMetaInj, ref(activeTab)) |
|
|
|
const meta = computed<TableType>(() => metas.value?.[activeTab?.id as string]) |
|
|
|
const meta = computed<TableType>(() => metas.value?.[activeTab?.id as string]) |
|
|
|
|
|
|
|
|
|
|
|
const reloadEventHook = createEventHook() |
|
|
|
const reloadEventHook = createEventHook() |
|
|
|
const reloadViewMetaEventHook = createEventHook<void>() |
|
|
|
const reloadViewMetaEventHook = createEventHook() |
|
|
|
const openNewRecordFormHook = createEventHook<void>() |
|
|
|
const openNewRecordFormHook = createEventHook() |
|
|
|
|
|
|
|
|
|
|
|
const { isGallery, isGrid, isForm, isLocked } = useProvideSmartsheetStore(activeView, meta) |
|
|
|
const { isGallery, isGrid, isForm, isLocked } = useProvideSmartsheetStore(activeView, meta) |
|
|
|
|
|
|
|
|
|
|
@ -62,21 +63,24 @@ watch(isLocked, (nextValue) => (treeViewIsLockedInj.value = nextValue), { immedi |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="nc-container flex h-full"> |
|
|
|
<div class="nc-container flex h-full"> |
|
|
|
<div class="flex flex-col h-full flex-1 min-w-0"> |
|
|
|
<div class="flex flex-col h-full flex-1 min-w-0"> |
|
|
|
<SmartsheetToolbar /> |
|
|
|
<LazySmartsheetToolbar /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Transition name="layout" mode="out-in"> |
|
|
|
<template v-if="meta"> |
|
|
|
<template v-if="meta"> |
|
|
|
<div class="flex flex-1 min-h-0"> |
|
|
|
<div class="flex flex-1 min-h-0"> |
|
|
|
<div v-if="activeView" class="h-full flex-1 min-w-0 min-h-0 bg-gray-50"> |
|
|
|
<div v-if="activeView" class="h-full flex-1 min-w-0 min-h-0 bg-gray-50"> |
|
|
|
<SmartsheetGrid v-if="isGrid" :ref="el" /> |
|
|
|
<LazySmartsheetGrid v-if="isGrid" :ref="el" /> |
|
|
|
|
|
|
|
|
|
|
|
<SmartsheetGallery v-else-if="isGallery" /> |
|
|
|
<LazySmartsheetGallery v-else-if="isGallery" /> |
|
|
|
|
|
|
|
|
|
|
|
<SmartsheetForm v-else-if="isForm && !$route.query.reload" /> |
|
|
|
<LazySmartsheetForm v-else-if="isForm && !$route.query.reload" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
</Transition> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<SmartsheetSidebar v-if="meta" class="nc-right-sidebar" /> |
|
|
|
|
|
|
|
|
|
|
|
<LazySmartsheetSidebar v-if="meta" class="nc-right-sidebar" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|