Commit 934f1a45 by weiw

fix:文件预览的功能调整

parent d2f9ca52
......@@ -12,10 +12,9 @@ import { fetchGetDocumentLink } from '@/api/common'
interface ChatAnswerAttachmentProps {
answer: Answer
isLastAnswer?: boolean
fromParser?: boolean
onSubmitQuestion?: (question: string, productCode?: string) => void
}
export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ fromParser, answer, isLastAnswer, onSubmitQuestion }) => {
export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ answer, isLastAnswer, onSubmitQuestion }) => {
const handleClickBoxItem = (produceName: string, productCode: string) => {
if (onSubmitQuestion) {
onSubmitQuestion(produceName, productCode)
......@@ -27,14 +26,9 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
}
const handleClickDocLink = async (documentStoreKey: string) => {
if (fromParser) {
const res = await fetchGetDocumentLink(documentStoreKey)
if (res.data) {
window.open(res.data.docUrl)
}
}
else {
window.open(documentStoreKey)
const res = await fetchGetDocumentLink(documentStoreKey)
if (res.data) {
window.open(res.data.docUrl)
}
}
return (
......
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