diff --git a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue index 845f74d574..91004c235b 100644 --- a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue +++ b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue @@ -181,10 +181,10 @@ useEventListener('keydown', (e: KeyboardEvent) => { - + - + +import { onMounted } from '@vue/runtime-core' import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk' import { UITypes, isSystemColumn } from 'nocodb-sdk' import { getRelationName } from './utils' @@ -14,7 +15,7 @@ const vModel = useVModel(props, 'value', emit) const meta = $(inject(MetaInj, ref())) -const { setAdditionalValidations, validateInfos, onDataTypeChange } = useColumnCreateStoreOrThrow() +const { setAdditionalValidations, validateInfos, onDataTypeChange, isEdit } = useColumnCreateStoreOrThrow() const { tables } = $(useProject()) @@ -51,12 +52,23 @@ const columns = $computed(() => { } return metas[selectedTable.id].columns.filter((c: ColumnType) => !isSystemColumn(c)) }) + + +onMounted(() => { + if (isEdit.value) { + vModel.value.fk_lookup_column_id = vModel.value.colOptions?.fk_lookup_column_id + vModel.value.fk_relation_column_id = vModel.value.colOptions?.fk_relation_column_id + // delete vModel.value.colOptions + } +}) +