Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<!-- 问题内容 -->
<div
@mouseenter.stop="showIcon = true"
@mouseleave.stop="showIcon = false"
>
<div @mouseenter.stop="showIcon = true" @mouseleave.stop="showIcon = false">
<div class="question-content item-content lighter">
<div v-if="!isReQuestion" class="content p-12-16 border-r-8" :class="getClassName">
<div class="text break-all pre-wrap">
Expand Down Expand Up @@ -253,7 +250,7 @@ function sendReQuestionMessage(event?: any) {
? props.chatRecord.record_id
: props.chatRecord.id,
},
{ ...props.chatRecord, problem_text: editText.value },
props.chatRecord,
)
}
} else {
Expand Down
26 changes: 24 additions & 2 deletions ui/src/views/chat/pc/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,18 @@ function refresh(id: string) {
async function exportMarkdown(): Promise<void> {
const suggestedName: string = `${currentChatId.value}.md`
const markdownContent: string = currentRecordList.value
.map((record: any) => `# ${record.problem_text}\n\n${record.answer_text}\n\n`)
.map((record: any) => {
let answerText = ''
if (Array.isArray(record.answer_text_list)) {
answerText = record.answer_text_list
.flat()
.map((item: any) => item?.content || '')
.join('\n\n')
} else {
answerText = record.answer_text || ''
}
return `# ${record.problem_text}\n\n${answerText}\n\n`
})
.join('\n')

const blob: Blob = new Blob([markdownContent], { type: 'text/markdown;charset=utf-8' })
Expand All @@ -489,7 +500,18 @@ async function exportMarkdown(): Promise<void> {
async function exportHTML(): Promise<void> {
const suggestedName: string = `${currentChatId.value}.html`
const markdownContent: string = currentRecordList.value
.map((record: any) => `# ${record.problem_text}\n\n${record.answer_text}\n\n`)
.map((record: any) => {
let answerText = ''
if (Array.isArray(record.answer_text_list)) {
answerText = record.answer_text_list
.flat()
.map((item: any) => item?.content || '')
.join('\n\n')
} else {
answerText = record.answer_text || ''
}
return `# ${record.problem_text}\n\n${answerText}\n\n`
})
.join('\n')
const htmlContent: any = marked(markdownContent)

Expand Down