|
|
|
import { BasicColumn } from '/@/components/Table';
|
|
|
|
import { FormSchema } from '/@/components/Table';
|
|
|
|
import { listmodelid } from '@/views/super/airag/airaglog/AiragLog.api';
|
|
|
|
//列表数据
|
|
|
|
export const columns: BasicColumn[] = [
|
|
|
|
{
|
|
...
|
...
|
@@ -25,11 +26,20 @@ export const searchFormSchema: FormSchema[] = [ |
|
|
|
field: 'question',
|
|
|
|
component: 'JInput',
|
|
|
|
},
|
|
|
|
// 新增知识库选择字段
|
|
|
|
{
|
|
|
|
label: '模型ID',
|
|
|
|
field: 'modelId',
|
|
|
|
component: 'Input',
|
|
|
|
//colProps: {span: 6},
|
|
|
|
label: '模型名称',
|
|
|
|
field: 'name', // 注意:这里使用knowledgeId作为字段名
|
|
|
|
component: 'ApiSelect',
|
|
|
|
componentProps: {
|
|
|
|
api: listmodelid,
|
|
|
|
labelField: 'name', // 显示知识库名称
|
|
|
|
valueField: 'id', // 提交知识库ID
|
|
|
|
showSearch: true,
|
|
|
|
filterOption: (input: string, option: any) => {
|
|
|
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
//表单数据
|
|
...
|
...
|
@@ -42,12 +52,23 @@ export const formSchema: FormSchema[] = [ |
|
|
|
{
|
|
|
|
label: '回答',
|
|
|
|
field: 'answer',
|
|
|
|
component: 'Input',
|
|
|
|
component: 'InputTextArea',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '模型名称',
|
|
|
|
field: 'name',
|
|
|
|
field: 'name', // 注意:这里使用knowledgeId作为字段名
|
|
|
|
component: 'Input',
|
|
|
|
required: true,
|
|
|
|
componentProps: {
|
|
|
|
api: listmodelid, // 使用知识库接口
|
|
|
|
labelField: 'name', // 显示知识库名称
|
|
|
|
valueField: 'id', // 提交知识库ID
|
|
|
|
showSearch: true,
|
|
|
|
readonly: true,
|
|
|
|
filterOption: (input: string, option: any) => {
|
|
|
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// TODO 主键隐藏字段,目前写死为ID
|
|
|
|
{
|
...
|
...
|
|