Skip to content

Commit a71c844

Browse files
authored
fix: Copy and delete form information (#2778)
1 parent 74d10b6 commit a71c844

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ui/src/components/ai-chat/component/operation-button/ChatOperationButton.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</span>
4242
<span v-if="type == 'ai-chat' || type == 'log'">
4343
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
44-
<el-button text @click="copyClick(data?.answer_text.trim())">
44+
<el-button text @click="copy(data)">
4545
<AppIcon iconName="app-copy"></AppIcon>
4646
</el-button>
4747
</el-tooltip>
@@ -106,7 +106,16 @@ import applicationApi from '@/api/application'
106106
import { datetimeFormat } from '@/utils/time'
107107
import { MsgError } from '@/utils/message'
108108
import bus from '@/bus'
109-
109+
const copy = (data: any) => {
110+
try {
111+
const text = data.answer_text_list
112+
.map((item: Array<any>) => item.map((i) => i.content).join('\n'))
113+
.join('\n\n')
114+
copyClick(text)
115+
} catch (e: any) {
116+
copyClick(removeFormRander(data?.answer_text.trim()))
117+
}
118+
}
110119
const route = useRoute()
111120
const {
112121
params: { id }

0 commit comments

Comments
 (0)