mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
2 years ago
|
<script setup lang="ts">
|
||
|
import type { Ref } from 'vue'
|
||
2 years ago
|
import type { TableType } from 'nocodb-sdk'
|
||
2 years ago
|
import { message } from 'ant-design-vue'
|
||
2 years ago
|
|
||
|
import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReadonlyInj, ReloadViewDataHookInj } from '~/context'
|
||
|
|
||
2 years ago
|
const { sharedView, meta, sorts, nestedFilters } = useSharedView()
|
||
2 years ago
|
const { signedIn } = useGlobal()
|
||
2 years ago
|
const { loadProject } = useProject(meta?.value.project_id)
|
||
2 years ago
|
|
||
|
const reloadEventHook = createEventHook<void>()
|
||
|
provide(ReloadViewDataHookInj, reloadEventHook)
|
||
2 years ago
|
provide(ReadonlyInj, true)
|
||
2 years ago
|
provide(MetaInj, meta)
|
||
|
provide(ActiveViewInj, sharedView)
|
||
2 years ago
|
provide(FieldsInj, ref(meta.value.columns as any[]))
|
||
2 years ago
|
provide(IsPublicInj, ref(true))
|
||
|
|
||
2 years ago
|
useProvideSmartsheetStore(sharedView as Ref<TableType>, meta, true, sorts, nestedFilters)
|
||
2 years ago
|
|
||
2 years ago
|
if (signedIn.value) {
|
||
2 years ago
|
try {
|
||
|
await loadProject()
|
||
|
} catch (e: any) {
|
||
|
console.error(e)
|
||
|
message.error(await extractSdkResponseErrorMsg(e))
|
||
|
}
|
||
|
}
|
||
2 years ago
|
</script>
|
||
|
|
||
|
<template>
|
||
2 years ago
|
<div class="nc-container flex flex-col h-full mt-1.5 px-12">
|
||
2 years ago
|
<SmartsheetToolbar />
|
||
2 years ago
|
<SmartsheetGrid />
|
||
2 years ago
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<style scoped>
|
||
|
.nc-container {
|
||
2 years ago
|
height: 100%;
|
||
|
padding-bottom: 0.5rem;
|
||
2 years ago
|
flex: 1 1 100%;
|
||
|
}
|
||
|
</style>
|