Commit 8c09d74f authored by nick zheng's avatar nick zheng

chore: 知识库列表页面增加icon用于区分不同的知识库类型

parent 8bb61cf6
import { NSwitch } from 'naive-ui'
import { NEllipsis, NSwitch } from 'naive-ui'
import { KnowledgeDocumentItem, KnowledgeItem } from './types.d'
import { formatDateTime } from '@/utils/date-formatter'
import i18n from '@/locales'
import { KnowledgeTypeIcon } from '@/enums/knowledge'
const t = i18n.global.t
......@@ -19,7 +20,15 @@ export function createKnowledgeColumn(
width: 210,
fixed: 'left',
render(row: KnowledgeItem) {
return row.knowledgeName || '--'
return (
<div class='flex items-center gap-[10px]'>
<div
class='h-[22px] w-[22px] flex-shrink-0 bg-contain bg-no-repeat'
style={{ backgroundImage: `url(${KnowledgeTypeIcon[row.knowledgeType]})` }}
/>
<NEllipsis class='flex-1'>{row.knowledgeName || '--'}</NEllipsis>
</div>
)
},
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment