作者 dong

知识库列表没有进行分页,问题库列表没有及进行分页处理,存入问题库增加重复校验,日志管理增加回答方式,是否存入问题库,五个需要已实现

... ... @@ -18,6 +18,37 @@ export const columns: BasicColumn[] = [
align: 'center',
dataIndex: 'name',
},
{
title: '提问者',
align: 'center',
dataIndex: 'createBy',
},
{
title: '提问时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '回答方式',
align: 'center',
dataIndex: 'answerType',
customRender: ({ text }) => {
const statusMap ={
1: '问题库回答',
2: '模型回答',
3: '未命中',
};
return statusMap[text];
},
},
{
title: '是否存入问题库',
align: 'center',
dataIndex: 'isStorage',
customRender: ({ text }) => {
return text === 1 ? '已存入' : '未存入';
},
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
... ... @@ -41,6 +72,39 @@ export const searchFormSchema: FormSchema[] = [
},
},
},
{
label: '提问时间',
field: 'createTimeStr',
component: 'RangePicker', // 改用支持时间的组件
componentProps: {
showTime: true, // 启用时间选择
format: 'YYYY-MM-DD HH:mm:ss', // 日期时间格式
valueFormat: 'YYYY-MM-DD HH:mm:ss', // 绑定值格式
placeholder: ['开始时间', '结束时间'],
},
},
{
label: '回答方式',
field: 'answerType',
component: 'Input',
},
{
label: '是否存入',
field: 'isStorage',
component: 'Select',
componentProps: {
options: [
{
label: '是',
value: 1,
},
{
label: '否',
value: 0,
},
],
},
},
];
//表单数据
export const formSchema: FormSchema[] = [
... ...
... ... @@ -66,13 +66,24 @@
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [],
fieldMapToTime: [],
// 添加时间字段映射配置
fieldMapToTime: [
[
'createTimeStr', // 表单字段名
['createTime_begin', 'createTime_end'], // 映射后的开始/结束字段
'YYYY-MM-DD HH:mm:ss', // 日期时间格式
],
],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
// 将未选择的"是否存入"转换为 -1
if (params.isStorage === undefined || params.isStorage === null) {
params.isStorage = -1;
}
return Object.assign(params, queryParam);
},
},
... ... @@ -152,6 +163,7 @@
* 操作栏
*/
function getTableAction(record) {
if (record.isStorage == 0)
return [
{
label: '存入问题库',
... ... @@ -159,6 +171,12 @@
auth: 'airaglog:airag_log:saveToQuestionLibrary',
},
];
else
return [
{
label: '',
},
];
}
/**
* 存入问题库事件
... ...