AI分析内容支持Markdown渲染,标题、列表、加粗正常显示
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.7",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
|
"marked": "^15.0.0",
|
||||||
"element-plus": "^2.8.4",
|
"element-plus": "^2.8.4",
|
||||||
"pinia": "^2.2.4",
|
"pinia": "^2.2.4",
|
||||||
"vue": "^3.5.10",
|
"vue": "^3.5.10",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, watch } from 'vue'
|
import { computed, ref, watch } from 'vue'
|
||||||
|
import { marked } from 'marked'
|
||||||
import { getScore, type Score } from '@/api/scores'
|
import { getScore, type Score } from '@/api/scores'
|
||||||
import { parseTsCode } from '@/utils/contract'
|
import { parseTsCode } from '@/utils/contract'
|
||||||
import { useMobile } from '@/composables/useMobile'
|
import { useMobile } from '@/composables/useMobile'
|
||||||
@@ -273,7 +274,7 @@ const quadrantLabel = (q: string) => {
|
|||||||
<el-button text size="small" @click="closeAI" v-if="aiLoading">取消</el-button>
|
<el-button text size="small" @click="closeAI" v-if="aiLoading">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="ai-body">
|
<div class="ai-body">
|
||||||
<div v-if="aiContent" class="ai-text" v-html="aiContent.replace(/\n/g, '<br>')"></div>
|
<div v-if="aiContent" class="ai-text" v-html="marked(aiContent)"></div>
|
||||||
<div v-if="aiError" class="ai-error">{{ aiError }}</div>
|
<div v-if="aiError" class="ai-error">{{ aiError }}</div>
|
||||||
<div v-if="aiLoading && !aiContent" class="ai-loading">
|
<div v-if="aiLoading && !aiContent" class="ai-loading">
|
||||||
<el-icon class="is-loading"><span>⏳</span></el-icon> 正在分析...
|
<el-icon class="is-loading"><span>⏳</span></el-icon> 正在分析...
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { nextTick, onMounted, reactive, ref, watch, computed } from 'vue'
|
import { nextTick, onMounted, reactive, ref, watch, computed } from 'vue'
|
||||||
|
import { marked } from 'marked'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { listScores, listContracts, type Score } from '@/api/scores'
|
import { listScores, listContracts, type Score } from '@/api/scores'
|
||||||
import { runPipeline, type RunResponse } from '@/api/run'
|
import { runPipeline, type RunResponse } from '@/api/run'
|
||||||
@@ -248,7 +249,7 @@ onMounted(async () => {
|
|||||||
<el-button v-if="aiLoading" text size="small" @click="closeAI">取消</el-button>
|
<el-button v-if="aiLoading" text size="small" @click="closeAI">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="ai-body">
|
<div class="ai-body">
|
||||||
<div v-if="aiContent" class="ai-text" v-html="aiContent.replace(/\n/g, '<br>')" />
|
<div v-if="aiContent" class="ai-text" v-html="marked(aiContent)" />
|
||||||
<div v-if="aiError" class="ai-error">{{ aiError }}</div>
|
<div v-if="aiError" class="ai-error">{{ aiError }}</div>
|
||||||
<div v-if="aiLoading && !aiContent" class="ai-loading">⏳ 正在分析...</div>
|
<div v-if="aiLoading && !aiContent" class="ai-loading">⏳ 正在分析...</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user