|
|
|
@ -1,8 +1,7 @@
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { onMounted } from '@vue/runtime-core' |
|
|
|
|
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk' |
|
|
|
|
import { isLinksOrLTAR, isSystemColumn, isVirtualCol, RelationTypes } from 'nocodb-sdk' |
|
|
|
|
import { getRelationName } from './utils' |
|
|
|
|
import { RelationTypes, isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk' |
|
|
|
|
import { MetaInj, inject, ref, storeToRefs, useColumnCreateStoreOrThrow, useMetas, useProject, useVModel } from '#imports' |
|
|
|
|
|
|
|
|
|
const props = defineProps<{ |
|
|
|
@ -37,7 +36,13 @@ const refTables = $computed(() => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const _refTables = meta.columns |
|
|
|
|
.filter((column) => isLinksOrLTAR(column) && (deprecatedEnabled || column.colOptions?.type === RelationTypes.BELONGS_TO) && !column.system && column.base_id === meta?.base_id) |
|
|
|
|
.filter( |
|
|
|
|
(column) => |
|
|
|
|
isLinksOrLTAR(column) && |
|
|
|
|
(deprecatedEnabled || column.colOptions?.type === RelationTypes.BELONGS_TO) && |
|
|
|
|
!column.system && |
|
|
|
|
column.base_id === meta?.base_id, |
|
|
|
|
) |
|
|
|
|
.map((column) => ({ |
|
|
|
|
col: column.colOptions, |
|
|
|
|
column, |
|
|
|
@ -67,7 +72,6 @@ const onRelationColChange = () => {
|
|
|
|
|
onDataTypeChange() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cellIcon = (column: ColumnType) => |
|
|
|
|
h(isVirtualCol(column) ? resolveComponent('SmartsheetHeaderVirtualCellIcon') : resolveComponent('SmartsheetHeaderCellIcon'), { |
|
|
|
|
columnMeta: column, |
|
|
|
@ -89,7 +93,7 @@ const cellIcon = (column: ColumnType) =>
|
|
|
|
|
<div class="font-semibold text-xs">{{ table.column.title }}</div> |
|
|
|
|
<div class="text-[0.65rem] text-gray-600"> |
|
|
|
|
<span v-if="table.col.type !== RelationTypes.BELONGS_TO" class="text-[0.65rem] text-gray-600">(Deprecated)</span> |
|
|
|
|
{{ getRelationName(table.col.type) }} {{ table.title || table.table_name }} |
|
|
|
|
<span class="uppercase">{{ table.col.type }}</span> {{ table.title || table.table_name }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</a-select-option> |
|
|
|
|