mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-04-22 11:04:26 +08:00
修改重新回答功能,撤回千面的问答内容为可编辑内容,撤回的内容不会增加额外的上下文
This commit is contained in:
@@ -29,7 +29,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-html="content"></div>
|
||||
<div class="content position-relative">
|
||||
<div v-html="content"></div>
|
||||
</div>
|
||||
<div class="bar" v-if="data.created_at > 0">
|
||||
<span class="bar-item"
|
||||
><el-icon><Clock /></el-icon> {{ dateFormat(data.created_at) }}</span
|
||||
@@ -71,7 +73,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<div class="content" v-html="content"></div>
|
||||
<div class="content position-relative">
|
||||
<div v-html="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bar" v-if="data.created_at > 0">
|
||||
<span class="bar-item"
|
||||
@@ -88,7 +92,7 @@
|
||||
import { FormatFileSize, GetFileIcon, GetFileType } from '@/store/system'
|
||||
import { httpPost } from '@/utils/http'
|
||||
import { dateFormat, isImage, processPrompt } from '@/utils/libs'
|
||||
import { Clock } from '@element-plus/icons-vue'
|
||||
import { Clock, Edit } from '@element-plus/icons-vue'
|
||||
import hl from 'highlight.js'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
import emoji from 'markdown-it-emoji'
|
||||
@@ -144,6 +148,9 @@ const finalTokens = ref(props.data.tokens)
|
||||
const content = ref(processPrompt(props.data.content))
|
||||
const files = ref([])
|
||||
|
||||
// 定义emit事件
|
||||
const emit = defineEmits(['edit'])
|
||||
|
||||
onMounted(() => {
|
||||
processFiles()
|
||||
})
|
||||
@@ -475,4 +482,39 @@ const isExternalImg = (link, files) => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.operations
|
||||
display none
|
||||
position absolute
|
||||
right 5px
|
||||
top 5px
|
||||
|
||||
.text-box
|
||||
&:hover
|
||||
.operations
|
||||
display flex
|
||||
gap 5px
|
||||
|
||||
.op-edit
|
||||
cursor pointer
|
||||
color #409eff
|
||||
font-size 16px
|
||||
|
||||
&:hover
|
||||
color darken(#409eff, 10%)
|
||||
|
||||
.position-relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content:hover .action-buttons {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<span v-if="!readOnly" class="flex">
|
||||
<span class="bar-item" @click="reGenerate(data.prompt)">
|
||||
<span class="bar-item" @click="reGenerate()">
|
||||
<el-tooltip class="box-item" effect="dark" content="重新生成" placement="bottom">
|
||||
<el-icon><Refresh /></el-icon>
|
||||
</el-tooltip>
|
||||
@@ -92,7 +92,7 @@
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<span v-if="!readOnly" class="flex">
|
||||
<span class="bar-item bg" @click="reGenerate(data.prompt)">
|
||||
<span class="bar-item bg" @click="reGenerate()">
|
||||
<el-tooltip class="box-item" effect="dark" content="重新生成" placement="bottom">
|
||||
<el-icon><Refresh /></el-icon>
|
||||
</el-tooltip>
|
||||
@@ -233,9 +233,8 @@ const stopSynthesis = () => {
|
||||
}
|
||||
|
||||
// 重新生成
|
||||
const reGenerate = (prompt) => {
|
||||
console.log(prompt)
|
||||
emits('regen', prompt)
|
||||
const reGenerate = () => {
|
||||
emits('regen')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user