feat:【antd】【ai】modal 部分的代码优化
This commit is contained in:
@@ -8,6 +8,7 @@ import { z } from '#/adapter/form';
|
||||
import { getSimpleKnowledgeList } from '#/api/ai/knowledge/knowledge';
|
||||
import { getModelSimpleList } from '#/api/ai/model/model';
|
||||
import { getToolSimpleList } from '#/api/ai/model/tool';
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
@@ -32,6 +33,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
fieldName: 'name',
|
||||
label: '角色名称',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
placeholder: '请输入角色名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'ImageUpload',
|
||||
@@ -62,6 +66,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
fieldName: 'category',
|
||||
label: '角色类别',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
placeholder: '请输入角色类别',
|
||||
},
|
||||
dependencies: {
|
||||
triggerFields: ['formType'],
|
||||
show: (values) => {
|
||||
@@ -113,6 +120,17 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'mcpClientNames',
|
||||
label: '引用 MCP',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
placeholder: '请选择 MCP',
|
||||
options: getDictOptions(DICT_TYPE.AI_MCP_CLIENT_NAME, 'string'),
|
||||
mode: 'multiple',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'publicStatus',
|
||||
label: '是否公开',
|
||||
@@ -254,6 +272,16 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
: `引用${cellValue.length}个`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'MCP',
|
||||
field: 'mcpClientNames',
|
||||
minWidth: 100,
|
||||
formatter: ({ cellValue }) => {
|
||||
return !cellValue || cellValue.length === 0
|
||||
? '-'
|
||||
: `引用${cellValue.length}个`;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'publicStatus',
|
||||
title: '是否公开',
|
||||
|
||||
Reference in New Issue
Block a user