作者 dong

日志界面修改

... ... @@ -5,6 +5,7 @@ const { createConfirm } = useMessage();
enum Api {
list = '/airaglog/airagLog/list',
listmodelid = '/airaglog/airagLog/listmodelid',
save = '/airaglog/airagLog/add',
saveToQuestionLibrary = '/airaglog/airagLog/saveToQuestionLibrary',
edit = '/airaglog/airagLog/edit',
... ... @@ -27,6 +28,7 @@ export const getImportUrl = Api.importExcel;
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
export const listmodelid = (params) => defHttp.get({ url: Api.listmodelid, params });
export const saveToQuestionLibrary = (params) =>
defHttp.post({
url: Api.saveToQuestionLibrary,
... ...
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
{
... ...