|
1
|
import { BasicColumn } from '/@/components/Table';
|
1
|
import { BasicColumn } from '/@/components/Table';
|
|
2
|
import { FormSchema } from '/@/components/Table';
|
2
|
import { FormSchema } from '/@/components/Table';
|
|
|
|
3
|
+import { listmodelid } from '@/views/super/airag/airaglog/AiragLog.api';
|
|
3
|
//列表数据
|
4
|
//列表数据
|
|
4
|
export const columns: BasicColumn[] = [
|
5
|
export const columns: BasicColumn[] = [
|
|
5
|
{
|
6
|
{
|
|
@@ -25,11 +26,20 @@ export const searchFormSchema: FormSchema[] = [ |
|
@@ -25,11 +26,20 @@ export const searchFormSchema: FormSchema[] = [ |
|
25
|
field: 'question',
|
26
|
field: 'question',
|
|
26
|
component: 'JInput',
|
27
|
component: 'JInput',
|
|
27
|
},
|
28
|
},
|
|
|
|
29
|
+ // 新增知识库选择字段
|
|
28
|
{
|
30
|
{
|
|
29
|
- label: '模型ID',
|
|
|
|
30
|
- field: 'modelId',
|
|
|
|
31
|
- component: 'Input',
|
|
|
|
32
|
- //colProps: {span: 6},
|
31
|
+ label: '模型名称',
|
|
|
|
32
|
+ field: 'name', // 注意:这里使用knowledgeId作为字段名
|
|
|
|
33
|
+ component: 'ApiSelect',
|
|
|
|
34
|
+ componentProps: {
|
|
|
|
35
|
+ api: listmodelid,
|
|
|
|
36
|
+ labelField: 'name', // 显示知识库名称
|
|
|
|
37
|
+ valueField: 'id', // 提交知识库ID
|
|
|
|
38
|
+ showSearch: true,
|
|
|
|
39
|
+ filterOption: (input: string, option: any) => {
|
|
|
|
40
|
+ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
|
41
|
+ },
|
|
|
|
42
|
+ },
|
|
33
|
},
|
43
|
},
|
|
34
|
];
|
44
|
];
|
|
35
|
//表单数据
|
45
|
//表单数据
|
|
@@ -42,12 +52,23 @@ export const formSchema: FormSchema[] = [ |
|
@@ -42,12 +52,23 @@ export const formSchema: FormSchema[] = [ |
|
42
|
{
|
52
|
{
|
|
43
|
label: '回答',
|
53
|
label: '回答',
|
|
44
|
field: 'answer',
|
54
|
field: 'answer',
|
|
45
|
- component: 'Input',
|
55
|
+ component: 'InputTextArea',
|
|
46
|
},
|
56
|
},
|
|
47
|
{
|
57
|
{
|
|
48
|
label: '模型名称',
|
58
|
label: '模型名称',
|
|
49
|
- field: 'name',
|
59
|
+ field: 'name', // 注意:这里使用knowledgeId作为字段名
|
|
50
|
component: 'Input',
|
60
|
component: 'Input',
|
|
|
|
61
|
+ required: true,
|
|
|
|
62
|
+ componentProps: {
|
|
|
|
63
|
+ api: listmodelid, // 使用知识库接口
|
|
|
|
64
|
+ labelField: 'name', // 显示知识库名称
|
|
|
|
65
|
+ valueField: 'id', // 提交知识库ID
|
|
|
|
66
|
+ showSearch: true,
|
|
|
|
67
|
+ readonly: true,
|
|
|
|
68
|
+ filterOption: (input: string, option: any) => {
|
|
|
|
69
|
+ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
|
70
|
+ },
|
|
|
|
71
|
+ },
|
|
51
|
},
|
72
|
},
|
|
52
|
// TODO 主键隐藏字段,目前写死为ID
|
73
|
// TODO 主键隐藏字段,目前写死为ID
|
|
53
|
{
|
74
|
{
|