|
|
@ -1,7 +1,7 @@ |
|
|
|
import type { PropType } from '@vue/runtime-core' |
|
|
|
import type { PropType } from '@vue/runtime-core' |
|
|
|
import type { ColumnType, LinkToAnotherRecordType, LookupType, RollupType } from 'nocodb-sdk' |
|
|
|
import type { ColumnType, LinkToAnotherRecordType, LookupType, RollupType } from 'nocodb-sdk' |
|
|
|
import type { Ref } from 'vue' |
|
|
|
|
|
|
|
import { RelationTypes, UITypes } from 'nocodb-sdk' |
|
|
|
import { RelationTypes, UITypes } from 'nocodb-sdk' |
|
|
|
|
|
|
|
import type { Ref } from 'vue' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ColumnInj, |
|
|
|
ColumnInj, |
|
|
|
MetaInj, |
|
|
|
MetaInj, |
|
|
@ -33,44 +33,44 @@ const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => { |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
case UITypes.SpecificDBType: |
|
|
|
case UITypes.SpecificDBType: |
|
|
|
return { icon: iconMap.specificDbType, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellDb, color: 'text-grey' } |
|
|
|
case UITypes.Formula: |
|
|
|
case UITypes.Formula: |
|
|
|
return { icon: iconMap.formula, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellFormula, color: 'text-grey' } |
|
|
|
case UITypes.QrCode: |
|
|
|
case UITypes.QrCode: |
|
|
|
return { icon: iconMap.qrCode, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellQrCode, color: 'text-grey' } |
|
|
|
case UITypes.Barcode: |
|
|
|
case UITypes.Barcode: |
|
|
|
return { icon: iconMap.barCode, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellBarcode, color: 'text-grey' } |
|
|
|
case UITypes.Lookup: |
|
|
|
case UITypes.Lookup: |
|
|
|
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) { |
|
|
|
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) { |
|
|
|
case RelationTypes.MANY_TO_MANY: |
|
|
|
case RelationTypes.MANY_TO_MANY: |
|
|
|
return { icon: iconMap.lookup, color: 'text-pink-500' } |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-pink-500' } |
|
|
|
case RelationTypes.HAS_MANY: |
|
|
|
case RelationTypes.HAS_MANY: |
|
|
|
return { icon: iconMap.lookup, color: 'text-orange-500' } |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-orange-500' } |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
return { icon: iconMap.lookup, color: 'text-blue-500' } |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-blue-500' } |
|
|
|
} |
|
|
|
} |
|
|
|
return { icon: iconMap.lookup, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-grey' } |
|
|
|
case UITypes.Rollup: |
|
|
|
case UITypes.Rollup: |
|
|
|
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) { |
|
|
|
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) { |
|
|
|
case RelationTypes.MANY_TO_MANY: |
|
|
|
case RelationTypes.MANY_TO_MANY: |
|
|
|
return { icon: iconMap.rollup, color: 'text-pink-500' } |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-pink-500' } |
|
|
|
case RelationTypes.HAS_MANY: |
|
|
|
case RelationTypes.HAS_MANY: |
|
|
|
return { icon: iconMap.rollup, color: 'text-orange-500' } |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-orange-500' } |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
return { icon: iconMap.rollup, color: 'text-blue-500' } |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-blue-500' } |
|
|
|
} |
|
|
|
} |
|
|
|
return { icon: iconMap.rollup, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-grey' } |
|
|
|
case UITypes.Count: |
|
|
|
case UITypes.Count: |
|
|
|
return { icon: CountIcon, color: 'text-grey' } |
|
|
|
return { icon: CountIcon, color: 'text-grey' } |
|
|
|
case UITypes.CreatedTime: |
|
|
|
case UITypes.CreatedTime: |
|
|
|
case UITypes.LastModifiedTime: |
|
|
|
case UITypes.LastModifiedTime: |
|
|
|
return { icon: iconMap.datetime, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellSystemDate, color: 'text-grey' } |
|
|
|
case UITypes.CreatedBy: |
|
|
|
case UITypes.CreatedBy: |
|
|
|
case UITypes.LastModifiedBy: |
|
|
|
case UITypes.LastModifiedBy: |
|
|
|
return { icon: iconMap.phUser, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellSystemUser, color: 'text-grey' } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { icon: iconMap.generic, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellSystemText, color: 'text-grey' } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
|
export default defineComponent({ |
|
|
|