Skip to content
Merged
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
Expand Up @@ -8,7 +8,7 @@
</div>
<div>
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
<el-button text @click="copyClick(data?.answer_text)">
<el-button text @click="copy(data)">
<AppIcon iconName="app-copy" class="color-secondary"></AppIcon>
</el-button>
</el-tooltip>
Expand All @@ -17,7 +17,6 @@
</div>
</template>
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { copyClick } from '@/utils/clipboard'

import { datetimeFormat } from '@/utils/time'
Expand All @@ -35,5 +34,19 @@ const props = defineProps({
default: () => {},
},
})

function removeFormRander(text: string) {
return text.replace(/<form_rander>.*?<\/form_rander>/gs, '').trim()
}
Comment on lines +38 to +40
const copy = (data: any) => {
try {
const text = data.answer_text_list
.map((item: Array<any>) => item.map((i) => i.content).join('\n'))
.join('\n\n')
copyClick(removeFormRander(text))
} catch (e: any) {
copyClick(removeFormRander(data?.answer_text.trim()))
}
}
Comment on lines +41 to +50
</script>
<style lang="scss" scoped></style>
Loading