|
@@ -9,21 +9,26 @@
|
|
|
<i class="el-icon-loading"></i>
|
|
|
</div>
|
|
|
<div v-if="message.type === 'ai'" class="message-actions">
|
|
|
- <button class="action-btn" @click="copyMessage(message.content)" title="复制">
|
|
|
- <i class="fas fa-copy"></i>
|
|
|
- </button>
|
|
|
- <button v-if="message === currentStreamingMessage"
|
|
|
- class="action-btn"
|
|
|
+ <template v-if="message === currentStreamingMessage">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
@click="stopGeneration"
|
|
|
title="停止生成">
|
|
|
- <i class="fas fa-stop"></i>
|
|
|
- </button>
|
|
|
- <button class="action-btn"
|
|
|
- @click="regenerateResponse(index)"
|
|
|
- title="重新生成"
|
|
|
- :disabled="isLoading">
|
|
|
- <i class="fas fa-redo"></i>
|
|
|
- </button>
|
|
|
+ 停止生成
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-button type="text" @click="copyMessage(message.content)" title="复制">
|
|
|
+ <i class="el-icon-document-copy"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button type="text"
|
|
|
+ @click="regenerateResponse(index)"
|
|
|
+ title="重新生成"
|
|
|
+ :disabled="isLoading">
|
|
|
+ <i class="el-icon-refresh"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
</div>
|
|
|
<!-- <div class="content-text">{{ message.isTyping ? message.displayContent : message.content }}</div> -->
|
|
|
<!-- <div class="content-text markdown-body"
|
|
@@ -425,16 +430,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- renderMarkdown(text) {
|
|
|
- try {
|
|
|
- text = this.preprocessCodeBlocks(text);
|
|
|
- const rendered = this.md.render(text);
|
|
|
- return DOMPurify.sanitize(rendered);
|
|
|
- } catch (e) {
|
|
|
- console.error('Markdown rendering error:', e);
|
|
|
- return text;
|
|
|
- }
|
|
|
- },
|
|
|
+ // renderMarkdown(text) {
|
|
|
+ // try {
|
|
|
+ // text = this.preprocessCodeBlocks(text);
|
|
|
+ // const rendered = this.md.render(text);
|
|
|
+ // return DOMPurify.sanitize(rendered);
|
|
|
+ // } catch (e) {
|
|
|
+ // console.error('Markdown rendering error:', e);
|
|
|
+ // return text;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
parseMessage(text) {
|
|
|
const blocks = [];
|
|
|
let currentText = '';
|
|
@@ -567,7 +572,7 @@ input {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
|
|
|
-button {
|
|
|
+/* button {
|
|
|
padding: 8px 20px;
|
|
|
background: #007bff;
|
|
|
color: white;
|
|
@@ -578,7 +583,7 @@ button {
|
|
|
|
|
|
button:hover {
|
|
|
background: #0056b3;
|
|
|
-}
|
|
|
+} */
|
|
|
|
|
|
.preset-questions {
|
|
|
width: 100%;
|