|
|
@ -1,5 +1,13 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import type { ColumnReqType, ColumnType, FormulaType, LinkToAnotherRecordType, LookupType, RollupType } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
|
|
|
|
type ColumnReqType, |
|
|
|
|
|
|
|
type ColumnType, |
|
|
|
|
|
|
|
type FormulaType, |
|
|
|
|
|
|
|
type LinkToAnotherRecordType, |
|
|
|
|
|
|
|
type LookupType, |
|
|
|
|
|
|
|
type RollupType, |
|
|
|
|
|
|
|
isLinksOrLTAR, |
|
|
|
|
|
|
|
} from 'nocodb-sdk' |
|
|
|
import { RelationTypes, UITypes, UITypesName, substituteColumnIdWithAliasInFormula } from 'nocodb-sdk' |
|
|
|
import { RelationTypes, UITypes, UITypesName, substituteColumnIdWithAliasInFormula } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ColumnInj, |
|
|
|
ColumnInj, |
|
|
@ -12,6 +20,7 @@ import { |
|
|
|
isHm, |
|
|
|
isHm, |
|
|
|
isLookup, |
|
|
|
isLookup, |
|
|
|
isMm, |
|
|
|
isMm, |
|
|
|
|
|
|
|
isOo, |
|
|
|
isRollup, |
|
|
|
isRollup, |
|
|
|
isVirtualColRequired, |
|
|
|
isVirtualColRequired, |
|
|
|
provide, |
|
|
|
provide, |
|
|
@ -57,7 +66,7 @@ const colOptions = computed(() => column.value?.colOptions) |
|
|
|
const tableTile = computed(() => meta?.value?.title) |
|
|
|
const tableTile = computed(() => meta?.value?.title) |
|
|
|
|
|
|
|
|
|
|
|
const relationColumnOptions = computed<LinkToAnotherRecordType | null>(() => { |
|
|
|
const relationColumnOptions = computed<LinkToAnotherRecordType | null>(() => { |
|
|
|
if (isMm(column.value) || isHm(column.value) || isBt(column.value)) { |
|
|
|
if (isLinksOrLTAR(column.value)) { |
|
|
|
return column.value?.colOptions as LinkToAnotherRecordType |
|
|
|
return column.value?.colOptions as LinkToAnotherRecordType |
|
|
|
} else if ((column?.value?.colOptions as LookupType | RollupType)?.fk_relation_column_id) { |
|
|
|
} else if ((column?.value?.colOptions as LookupType | RollupType)?.fk_relation_column_id) { |
|
|
|
return meta?.value?.columns?.find( |
|
|
|
return meta?.value?.columns?.find( |
|
|
@ -101,6 +110,8 @@ const tooltipMsg = computed(() => { |
|
|
|
return `'${tableTile.value}' & '${relatedTableTitle.value}' ${t('labels.manyToMany')}` |
|
|
|
return `'${tableTile.value}' & '${relatedTableTitle.value}' ${t('labels.manyToMany')}` |
|
|
|
} else if (isBt(column.value)) { |
|
|
|
} else if (isBt(column.value)) { |
|
|
|
return `'${column?.value?.title}' ${t('labels.belongsTo')} '${relatedTableTitle.value}'` |
|
|
|
return `'${column?.value?.title}' ${t('labels.belongsTo')} '${relatedTableTitle.value}'` |
|
|
|
|
|
|
|
} else if (isOo(column.value)) { |
|
|
|
|
|
|
|
return `'${tableTile.value}' & '${relatedTableTitle.value}' ${t('labels.oneToOne')}` |
|
|
|
} else if (isLookup(column.value)) { |
|
|
|
} else if (isLookup(column.value)) { |
|
|
|
return `'${childColumn.value.title}' from '${relatedTableTitle.value}' (${childColumn.value.uidt})` |
|
|
|
return `'${childColumn.value.title}' from '${relatedTableTitle.value}' (${childColumn.value.uidt})` |
|
|
|
} else if (isFormula(column.value)) { |
|
|
|
} else if (isFormula(column.value)) { |
|
|
@ -116,6 +127,10 @@ const tooltipMsg = computed(() => { |
|
|
|
return column?.value?.title || '' |
|
|
|
return column?.value?.title || '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showTooltipAlways = computed(() => { |
|
|
|
|
|
|
|
return isLinksOrLTAR(column.value) || isFormula(column.value) || isRollup(column.value) || isLookup(column.value) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const columnOrder = ref<Pick<ColumnReqType, 'column_order'> | null>(null) |
|
|
|
const columnOrder = ref<Pick<ColumnReqType, 'column_order'> | null>(null) |
|
|
|
|
|
|
|
|
|
|
|
const columnTypeName = computed(() => { |
|
|
|
const columnTypeName = computed(() => { |
|
|
@ -172,7 +187,7 @@ const openDropDown = (e: Event) => { |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
<LazySmartsheetHeaderVirtualCellIcon v-else /> |
|
|
|
<LazySmartsheetHeaderVirtualCellIcon v-else /> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<NcTooltip placement="bottom" class="truncate name pl-1" show-on-truncate-only> |
|
|
|
<NcTooltip placement="bottom" class="truncate name pl-1" :show-on-truncate-only="!showTooltipAlways"> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
{{ tooltipMsg }} |
|
|
|
{{ tooltipMsg }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|