import type { ProColumns } from '@ant-design/pro-components'; import { EditableProTable } from '@ant-design/pro-components'; import React, { useState } from 'react'; import { MemoryType, ReviewEnum, StatusEnum } from './type'; import { getMemeoryList, saveMemory } from './service'; import { Popover, Input, Badge } from 'antd'; import styles from './style.less'; const { TextArea } = Input; const MemorySection = () => { const [editableKeys, setEditableRowKeys] = useState([]); const [dataSource, setDataSource] = useState([]); const [loading, setLoading] = useState(false); const columns: ProColumns[] = [ { title: '用户问题', dataIndex: 'question', readonly: true, }, { title: 'Schema映射', dataIndex: 'dbSchema', width: 300, valueType: 'textarea', }, { title: '大模型解析SQL', dataIndex: 's2sql', width: 300, valueType: 'textarea', }, { title: '大模型评估意见', dataIndex: 'llmReviewCmt', readonly: true, render: (value) => { return ( {value}}>
{value}
); }, }, { title: '大模型评估结果', key: 'llmReviewRet', dataIndex: 'llmReviewRet', readonly: true, width: 150, valueEnum: { [ReviewEnum.POSITIVE]: { text: '正确', status: 'Success', }, [ReviewEnum.NEGATIVE]: { text: '错误', status: 'Error', }, }, }, { title: '管理员评估意见', dataIndex: 'humanReviewCmt', valueType: 'textarea', renderFormItem: () =>