diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index f29d98fa79..d1ede98050 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -1056,7 +1056,7 @@ const closeAddColumnDropdown = () => { position: sticky !important; left: 80px; z-index: 5; - @apply border-r-2 border-r-gray-300; + @apply border-r-1 border-r-gray-300; } tbody td:nth-child(2) { @@ -1064,7 +1064,7 @@ const closeAddColumnDropdown = () => { left: 80px; z-index: 4; background: white; - @apply shadow-lg border-r-2 border-r-gray-300; + @apply shadow-lg border-r-1 border-r-gray-300; } } 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()) @@ -49,8 +50,20 @@ const columns = $computed(() => { if (!selectedTable?.id) { return [] } - return metas[selectedTable.id].columns.filter((c: ColumnType) => !isSystemColumn(c)) + return metas[selectedTable.id].columns.filter((c: ColumnType) => !isSystemColumn(c) && c.id !== vModel.value.id) }) + +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 + } +}) + +const onRelationColChange = () => { + vModel.value.fk_lookup_column_id = columns?.[0]?.id + onDataTypeChange() +}