|
|
@ -1,4 +1,4 @@ |
|
|
|
import { UITypes, ViewTypes } from 'nocodb-sdk' |
|
|
|
import { UITypes, ViewTypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import type { AuditType, ColumnType, TableType } from 'nocodb-sdk' |
|
|
|
import type { AuditType, ColumnType, TableType } from 'nocodb-sdk' |
|
|
|
import type { Ref } from 'vue' |
|
|
|
import type { Ref } from 'vue' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import dayjs from 'dayjs' |
|
|
@ -295,8 +295,8 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m |
|
|
|
changedColumns.value = new Set() |
|
|
|
changedColumns.value = new Set() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const loadRow = async (rowId?: string) => { |
|
|
|
const loadRow = async (rowId?: string, onlyVirtual = false) => { |
|
|
|
const record = await $api.dbTableRow.read( |
|
|
|
let record = await $api.dbTableRow.read( |
|
|
|
NOCO, |
|
|
|
NOCO, |
|
|
|
// todo: base_id missing on view type
|
|
|
|
// todo: base_id missing on view type
|
|
|
|
(base?.value?.id || (sharedView.value?.view as any)?.base_id) as string, |
|
|
|
(base?.value?.id || (sharedView.value?.view as any)?.base_id) as string, |
|
|
@ -307,6 +307,19 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m |
|
|
|
}, |
|
|
|
}, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// update only virtual columns value if `onlyVirtual` is true
|
|
|
|
|
|
|
|
if (onlyVirtual) { |
|
|
|
|
|
|
|
record = { |
|
|
|
|
|
|
|
...row.value.row, |
|
|
|
|
|
|
|
...meta.value.columns.reduce((partialRecord, col) => { |
|
|
|
|
|
|
|
if (isVirtualCol(col) && col.title in record) { |
|
|
|
|
|
|
|
partialRecord[col.title] = record[col.title] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return partialRecord |
|
|
|
|
|
|
|
}, {} as Record<string, any>), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Object.assign(row.value, { |
|
|
|
Object.assign(row.value, { |
|
|
|
row: record, |
|
|
|
row: record, |
|
|
|
oldRow: { ...record }, |
|
|
|
oldRow: { ...record }, |
|
|
|