|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { UITypes, ViewTypes } from 'nocodb-sdk' |
|
|
|
|
import type { Api, ColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' |
|
|
|
|
import type { Api, ColumnType, FormColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' |
|
|
|
|
import type { ComputedRef, Ref } from 'vue' |
|
|
|
|
import { |
|
|
|
|
IsPublicInj, |
|
|
|
@ -54,7 +54,7 @@ export function useViewData(
|
|
|
|
|
|
|
|
|
|
const galleryData = ref<GalleryType>() |
|
|
|
|
|
|
|
|
|
const formColumnData = ref<FormType>() |
|
|
|
|
const formColumnData = ref<Record<string, any>[]>() |
|
|
|
|
|
|
|
|
|
const formViewData = ref<FormType>() |
|
|
|
|
|
|
|
|
@ -395,14 +395,14 @@ export function useViewData(
|
|
|
|
|
async function loadFormView() { |
|
|
|
|
if (!viewMeta?.value?.id) return |
|
|
|
|
try { |
|
|
|
|
const { columns, ...view } = (await $api.dbView.formRead(viewMeta.value.id)) as Record<string, any> |
|
|
|
|
const { columns, ...view } = await $api.dbView.formRead(viewMeta.value.id) |
|
|
|
|
|
|
|
|
|
const fieldById = columns.reduce( |
|
|
|
|
const fieldById = (columns || []).reduce( |
|
|
|
|
(o: Record<string, any>, f: Record<string, any>) => ({ |
|
|
|
|
...o, |
|
|
|
|
[f.fk_column_id]: f, |
|
|
|
|
}), |
|
|
|
|
{}, |
|
|
|
|
{} as Record<string, FormColumnType>, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
let order = 1 |
|
|
|
|