作者 dong

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

@@ -18,6 +18,37 @@ export const columns: BasicColumn[] = [ @@ -18,6 +18,37 @@ export const columns: BasicColumn[] = [
18 align: 'center', 18 align: 'center',
19 dataIndex: 'name', 19 dataIndex: 'name',
20 }, 20 },
  21 + {
  22 + title: '提问者',
  23 + align: 'center',
  24 + dataIndex: 'createBy',
  25 + },
  26 + {
  27 + title: '提问时间',
  28 + align: 'center',
  29 + dataIndex: 'createTime',
  30 + },
  31 + {
  32 + title: '回答方式',
  33 + align: 'center',
  34 + dataIndex: 'answerType',
  35 + customRender: ({ text }) => {
  36 + const statusMap ={
  37 + 1: '问题库回答',
  38 + 2: '模型回答',
  39 + 3: '未命中',
  40 + };
  41 + return statusMap[text];
  42 + },
  43 + },
  44 + {
  45 + title: '是否存入问题库',
  46 + align: 'center',
  47 + dataIndex: 'isStorage',
  48 + customRender: ({ text }) => {
  49 + return text === 1 ? '已存入' : '未存入';
  50 + },
  51 + },
21 ]; 52 ];
22 //查询数据 53 //查询数据
23 export const searchFormSchema: FormSchema[] = [ 54 export const searchFormSchema: FormSchema[] = [
@@ -41,6 +72,39 @@ export const searchFormSchema: FormSchema[] = [ @@ -41,6 +72,39 @@ export const searchFormSchema: FormSchema[] = [
41 }, 72 },
42 }, 73 },
43 }, 74 },
  75 + {
  76 + label: '提问时间',
  77 + field: 'createTimeStr',
  78 + component: 'RangePicker', // 改用支持时间的组件
  79 + componentProps: {
  80 + showTime: true, // 启用时间选择
  81 + format: 'YYYY-MM-DD HH:mm:ss', // 日期时间格式
  82 + valueFormat: 'YYYY-MM-DD HH:mm:ss', // 绑定值格式
  83 + placeholder: ['开始时间', '结束时间'],
  84 + },
  85 + },
  86 + {
  87 + label: '回答方式',
  88 + field: 'answerType',
  89 + component: 'Input',
  90 + },
  91 + {
  92 + label: '是否存入',
  93 + field: 'isStorage',
  94 + component: 'Select',
  95 + componentProps: {
  96 + options: [
  97 + {
  98 + label: '是',
  99 + value: 1,
  100 + },
  101 + {
  102 + label: '否',
  103 + value: 0,
  104 + },
  105 + ],
  106 + },
  107 + },
44 ]; 108 ];
45 //表单数据 109 //表单数据
46 export const formSchema: FormSchema[] = [ 110 export const formSchema: FormSchema[] = [
@@ -66,13 +66,24 @@ @@ -66,13 +66,24 @@
66 autoSubmitOnEnter: true, 66 autoSubmitOnEnter: true,
67 showAdvancedButton: true, 67 showAdvancedButton: true,
68 fieldMapToNumber: [], 68 fieldMapToNumber: [],
69 - fieldMapToTime: [], 69 + // 添加时间字段映射配置
  70 + fieldMapToTime: [
  71 + [
  72 + 'createTimeStr', // 表单字段名
  73 + ['createTime_begin', 'createTime_end'], // 映射后的开始/结束字段
  74 + 'YYYY-MM-DD HH:mm:ss', // 日期时间格式
  75 + ],
  76 + ],
70 }, 77 },
71 actionColumn: { 78 actionColumn: {
72 width: 120, 79 width: 120,
73 fixed: 'right', 80 fixed: 'right',
74 }, 81 },
75 beforeFetch: (params) => { 82 beforeFetch: (params) => {
  83 + // 将未选择的"是否存入"转换为 -1
  84 + if (params.isStorage === undefined || params.isStorage === null) {
  85 + params.isStorage = -1;
  86 + }
76 return Object.assign(params, queryParam); 87 return Object.assign(params, queryParam);
77 }, 88 },
78 }, 89 },
@@ -152,13 +163,20 @@ @@ -152,13 +163,20 @@
152 * 操作栏 163 * 操作栏
153 */ 164 */
154 function getTableAction(record) { 165 function getTableAction(record) {
155 - return [  
156 - {  
157 - label: '存入问题库',  
158 - onClick: () => handleSaveToQuestionLibrary(record),  
159 - auth: 'airaglog:airag_log:saveToQuestionLibrary',  
160 - },  
161 - ]; 166 + if (record.isStorage == 0)
  167 + return [
  168 + {
  169 + label: '存入问题库',
  170 + onClick: () => handleSaveToQuestionLibrary(record),
  171 + auth: 'airaglog:airag_log:saveToQuestionLibrary',
  172 + },
  173 + ];
  174 + else
  175 + return [
  176 + {
  177 + label: '',
  178 + },
  179 + ];
162 } 180 }
163 /** 181 /**
164 * 存入问题库事件 182 * 存入问题库事件