Commit 934f1a45 by weiw

fix:文件预览的功能调整

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