feat: 知识库对外api

This commit is contained in:
archer
2023-04-08 20:27:43 +08:00
parent 9a145f223f
commit 52d00d0562
7 changed files with 230 additions and 17 deletions

View File

@@ -300,10 +300,9 @@ const Chat = ({ chatId }: { chatId: string }) => {
// 复制内容
const onclickCopy = useCallback(
(chatId: string) => {
const dom = document.getElementById(chatId);
const innerText = dom?.innerText;
innerText && copyData(innerText);
(value: string) => {
const val = value.replace(/\n+/g, '\n');
copyData(val);
},
[copyData]
);
@@ -434,7 +433,7 @@ const Chat = ({ chatId }: { chatId: string }) => {
/>
</MenuButton>
<MenuList fontSize={'sm'}>
<MenuItem onClick={() => onclickCopy(`chat${index}`)}></MenuItem>
<MenuItem onClick={() => onclickCopy(item.value)}></MenuItem>
<MenuItem onClick={() => delChatRecord(index)}></MenuItem>
</MenuList>
</Menu>