多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
1.1 KiB

<script setup lang="ts">
import { LinkToAnotherRecordType, RelationTypes, UITypes } from "nocodb-sdk";
import { ColumnInj } from '~/components'
import GenericIcon from '~icons/mdi/square-rounded'
import HMIcon from '~icons/mdi/table-arrow-right'
import BTIcon from '~icons/mdi/table-arrow-left'
import MMIcon from '~icons/mdi/table-network'
import FormulaIcon from '~icons/mdi/math-integral'
import RollupIcon from '~icons/mdi/movie-roll'
const column = inject(ColumnInj)
const icon = computed(() => {
switch (column?.uidt) {
case UITypes.LinkToAnotherRecord:
switch ((<LinkToAnotherRecordType>column?.colOptions)?.type) {
case RelationTypes.MANY_TO_MANY:
return MMIcon
case RelationTypes.HAS_MANY:
return HMIcon
case RelationTypes.BELONGS_TO:
return BTIcon
}
break
case UITypes.Formula:
return FormulaIcon
case UITypes.Lookup:
return GenericIcon
case UITypes.Rollup:
return RollupIcon
}
return GenericIcon
})
</script>
<template>
<component :is="icon" class="text-grey mx-1" />
</template>