|
|
@ -17,7 +17,7 @@ const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => { |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
return { icon: iconMap.bt_solid } |
|
|
|
return { icon: iconMap.bt_solid } |
|
|
|
case RelationTypes.ONE_TO_ONE: |
|
|
|
case RelationTypes.ONE_TO_ONE: |
|
|
|
return { icon: iconMap.oneToOneSolid, color: 'text-blue-500' } |
|
|
|
return { icon: iconMap.oneToOneSolid, color: 'text-purple-500' } |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
case UITypes.SpecificDBType: |
|
|
|
case UITypes.SpecificDBType: |
|
|
@ -36,6 +36,8 @@ const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => { |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-orange-500' } |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-orange-500' } |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-blue-500' } |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-blue-500' } |
|
|
|
|
|
|
|
case RelationTypes.ONE_TO_ONE: |
|
|
|
|
|
|
|
return { icon: iconMap.cellLookup, color: 'text-purple-500' } |
|
|
|
} |
|
|
|
} |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellLookup, color: 'text-grey' } |
|
|
|
case UITypes.Rollup: |
|
|
|
case UITypes.Rollup: |
|
|
@ -46,6 +48,8 @@ const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => { |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-orange-500' } |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-orange-500' } |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
case RelationTypes.BELONGS_TO: |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-blue-500' } |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-blue-500' } |
|
|
|
|
|
|
|
case RelationTypes.ONE_TO_ONE: |
|
|
|
|
|
|
|
return { icon: iconMap.cellRollup, color: 'text-purple-500' } |
|
|
|
} |
|
|
|
} |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-grey' } |
|
|
|
return { icon: iconMap.cellRollup, color: 'text-grey' } |
|
|
|
case UITypes.Count: |
|
|
|
case UITypes.Count: |
|
|
@ -76,15 +80,16 @@ export default defineComponent({ |
|
|
|
|
|
|
|
|
|
|
|
const column = computed(() => columnMeta.value ?? injectedColumn.value) |
|
|
|
const column = computed(() => columnMeta.value ?? injectedColumn.value) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { metas } = useMetas() |
|
|
|
|
|
|
|
|
|
|
|
let relationColumn: ColumnType |
|
|
|
let relationColumn: ColumnType |
|
|
|
|
|
|
|
|
|
|
|
return () => { |
|
|
|
return () => { |
|
|
|
if (!column.value) return null |
|
|
|
if (!column.value) return null |
|
|
|
|
|
|
|
|
|
|
|
if (column && column.value) { |
|
|
|
if (column && column.value) { |
|
|
|
if (isMm(column.value) || isHm(column.value) || isBt(column.value) || isLookup(column.value) || isRollup(column.value)) { |
|
|
|
if (isLookup(column.value) || isRollup(column.value)) { |
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
relationColumn = metas.value?.[column.value.fk_model_id]?.columns?.find( |
|
|
|
relationColumn = meta.value?.columns?.find( |
|
|
|
|
|
|
|
(c) => c.id === column.value?.colOptions?.fk_relation_column_id, |
|
|
|
(c) => c.id === column.value?.colOptions?.fk_relation_column_id, |
|
|
|
) as ColumnType |
|
|
|
) as ColumnType |
|
|
|
} |
|
|
|
} |
|
|
@ -92,7 +97,7 @@ export default defineComponent({ |
|
|
|
|
|
|
|
|
|
|
|
const { icon: Icon, color } = renderIcon(column.value, relationColumn) |
|
|
|
const { icon: Icon, color } = renderIcon(column.value, relationColumn) |
|
|
|
|
|
|
|
|
|
|
|
return h(Icon, { class: `${color} mx-1 nc-virtual-cell-icon` }) |
|
|
|
return h(Icon, { class: `${color || 'text-grey'} mx-1 nc-virtual-cell-icon` }) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|