Commit 7c315e1e by HoMeTown

feat: 参考文档

parent 831bae4f
...@@ -26,15 +26,15 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from ...@@ -26,15 +26,15 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
window.open(attachment.content.url) window.open(attachment.content.url)
} }
const handleClickDocLink = async (docId: string) => { const handleClickDocLink = async (documentStoreKey: string) => {
if (fromParser) { if (fromParser) {
const res = await fetchGetDocumentLink(docId) const res = await fetchGetDocumentLink(documentStoreKey)
if (res.data) { if (res.data) {
window.open(res.data.docUrl) window.open(res.data.docUrl)
} }
} }
else { else {
window.open(docId) window.open(documentStoreKey)
} }
} }
return ( return (
...@@ -64,7 +64,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from ...@@ -64,7 +64,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
</p> </p>
<div className="flex flex-col gap-[9px]"> <div className="flex flex-col gap-[9px]">
{ attachment.content.docList.map(doc => ( { attachment.content.docList.map(doc => (
<Link className="cursor-pointer" onPress={() => handleClickDocLink(doc.documentName)} size="sm" key={doc.documentName} isExternal showAnchorIcon underline="hover"> <Link className="cursor-pointer" onPress={() => handleClickDocLink(doc.documentStoreKey)} size="sm" key={doc.documentStoreKey} isExternal showAnchorIcon underline="hover">
{doc.documentAlias} {doc.documentAlias}
</Link> </Link>
))} ))}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment