mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
(feature)(supersonic-fe) memory manage add search button (#1294)
This commit is contained in:
@@ -3,10 +3,10 @@ import { EditableProTable } from '@ant-design/pro-components';
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { MemoryType, ReviewEnum, StatusEnum } from './type';
|
import { MemoryType, ReviewEnum, StatusEnum } from './type';
|
||||||
import { getMemeoryList, saveMemory } from './service';
|
import { getMemeoryList, saveMemory } from './service';
|
||||||
import { Popover, Input, Badge, Radio, Select } from 'antd';
|
import { Popover, Input, Badge, Radio, Select, Button } from 'antd';
|
||||||
import styles from './style.less';
|
import styles from './style.less';
|
||||||
|
|
||||||
const { TextArea, Search } = Input;
|
const { TextArea } = Input;
|
||||||
const RadioGroup = Radio.Group;
|
const RadioGroup = Radio.Group;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -189,23 +189,18 @@ const MemorySection = ({ agentId }: Props) => {
|
|||||||
await saveMemory(data);
|
await saveMemory(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSearch = () => {
|
|
||||||
loadMemoryList();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.memorySection}>
|
<div className={styles.memorySection}>
|
||||||
<div className={styles.filterSection}>
|
<div className={styles.filterSection}>
|
||||||
<div className={styles.filterItem}>
|
<div className={styles.filterItem}>
|
||||||
<div className={styles.filterItemTitle}>用户问题</div>
|
<div className={styles.filterItemTitle}>用户问题</div>
|
||||||
<Search
|
<Input
|
||||||
className={styles.filterItemControl}
|
className={styles.filterItemControl}
|
||||||
placeholder="请输入用户问题"
|
placeholder="请输入用户问题"
|
||||||
value={question}
|
value={question}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setFilters({ ...filters, question: e.target.value });
|
setFilters({ ...filters, question: e.target.value });
|
||||||
}}
|
}}
|
||||||
onSearch={onSearch}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.filterItem}>
|
<div className={styles.filterItem}>
|
||||||
@@ -220,9 +215,7 @@ const MemorySection = ({ agentId }: Props) => {
|
|||||||
value={llmReviewRet}
|
value={llmReviewRet}
|
||||||
allowClear
|
allowClear
|
||||||
onChange={(value: ReviewEnum) => {
|
onChange={(value: ReviewEnum) => {
|
||||||
const filtersValue = { ...filters, llmReviewRet: value };
|
setFilters({ ...filters, llmReviewRet: value });
|
||||||
setFilters(filtersValue);
|
|
||||||
loadMemoryList({ filtersValue });
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -238,9 +231,7 @@ const MemorySection = ({ agentId }: Props) => {
|
|||||||
value={humanReviewRet}
|
value={humanReviewRet}
|
||||||
allowClear
|
allowClear
|
||||||
onChange={(value: ReviewEnum) => {
|
onChange={(value: ReviewEnum) => {
|
||||||
const filtersValue = { ...filters, humanReviewRet: value };
|
setFilters({ ...filters, humanReviewRet: value });
|
||||||
setFilters(filtersValue);
|
|
||||||
loadMemoryList({ filtersValue });
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -257,13 +248,17 @@ const MemorySection = ({ agentId }: Props) => {
|
|||||||
value={status}
|
value={status}
|
||||||
allowClear
|
allowClear
|
||||||
onChange={(value: ReviewEnum) => {
|
onChange={(value: ReviewEnum) => {
|
||||||
const filtersValue = { ...filters, status: value };
|
setFilters({ ...filters, status: value });
|
||||||
setFilters(filtersValue);
|
|
||||||
loadMemoryList({ filtersValue });
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles.search}>
|
||||||
|
<Button onClick={() => setFilters({})}>重置</Button>
|
||||||
|
<Button type="primary" onClick={() => loadMemoryList()}>
|
||||||
|
查询
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<EditableProTable<MemoryType>
|
<EditableProTable<MemoryType>
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
recordCreatorProps={false}
|
recordCreatorProps={false}
|
||||||
|
|||||||
@@ -333,9 +333,8 @@
|
|||||||
|
|
||||||
.filterSection {
|
.filterSection {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
justify-content: space-between;
|
||||||
row-gap: 12px;
|
// column-gap: 20px;
|
||||||
column-gap: 20px;
|
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
.filterItem {
|
.filterItem {
|
||||||
@@ -367,3 +366,11 @@
|
|||||||
.commentPopover {
|
.commentPopover {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: end;
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user