feat: ai code
This commit is contained in:
@@ -209,8 +209,15 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
},
|
||||
{
|
||||
title: '角色头像',
|
||||
slots: { default: 'avatar' },
|
||||
field: 'avatar',
|
||||
minWidth: 140,
|
||||
cellRender: {
|
||||
name: 'CellImage',
|
||||
props: {
|
||||
width: 40,
|
||||
height: 40,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '角色类别',
|
||||
@@ -229,13 +236,23 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
},
|
||||
{
|
||||
title: '知识库',
|
||||
slots: { default: 'knowledgeIds' },
|
||||
field: 'knowledgeIds',
|
||||
minWidth: 100,
|
||||
formatter: ({ cellValue }) => {
|
||||
return !cellValue || cellValue.length === 0
|
||||
? '-'
|
||||
: `引用${cellValue.length}个`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '工具',
|
||||
slots: { default: 'toolIds' },
|
||||
field: 'toolIds',
|
||||
minWidth: 100,
|
||||
formatter: ({ cellValue }) => {
|
||||
return !cellValue || cellValue.length === 0
|
||||
? '-'
|
||||
: `引用${cellValue.length}个`;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'publicStatus',
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { AiModelChatRoleApi } from '#/api/ai/model/chatRole';
|
||||
|
||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { Image, message } from 'ant-design-vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { deleteChatRole, getChatRolePage } from '#/api/ai/model/chatRole';
|
||||
@@ -100,17 +100,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #knowledgeIds="{ row }">
|
||||
<span v-if="!row.knowledgeIds || row.knowledgeIds.length === 0">-</span>
|
||||
<span v-else>引用 {{ row.knowledgeIds.length }} 个</span>
|
||||
</template>
|
||||
<template #toolIds="{ row }">
|
||||
<span v-if="!row.toolIds || row.toolIds.length === 0">-</span>
|
||||
<span v-else>引用 {{ row.toolIds.length }} 个</span>
|
||||
</template>
|
||||
<template #avatar="{ row }">
|
||||
<Image :src="row.avatar" class="h-8 w-8" />
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
|
||||
Reference in New Issue
Block a user