feat: 对话结构修改
This commit is contained in:
@@ -232,7 +232,7 @@
|
||||
|
||||
for (let event of events) {
|
||||
if (!event.trim()) continue
|
||||
|
||||
// debugger
|
||||
// 过滤掉 id: 等字段,只取 data:
|
||||
|
||||
let isNodeIdEvent = false
|
||||
@@ -249,7 +249,8 @@
|
||||
flag = false
|
||||
break
|
||||
}
|
||||
if (event.includes('todo') || event.includes('webAddress')) {
|
||||
// TODO: 暂时不处理webAddress
|
||||
if (event.includes('todo')) {
|
||||
break
|
||||
}
|
||||
let hasSketch = false
|
||||
@@ -262,7 +263,7 @@
|
||||
.filter((line) => line.startsWith('data:'))
|
||||
.map((line) => line.replace(/^data:\s*/, '').trim())
|
||||
.filter((content) => content.startsWith('{') || content.startsWith('['))
|
||||
// console.log('dataLInes', dataLines)
|
||||
console.log('dataLInes', dataLines)
|
||||
if (isNodeIdEvent) {
|
||||
params.versionID = dataLines[0]
|
||||
projectStore.setProject({ nodeId: dataLines[0] })
|
||||
|
||||
@@ -7,10 +7,7 @@
|
||||
<div class="thumb">
|
||||
<img :src="content.isUser ? userThumb : agentThumb" class="thumb-icon" />
|
||||
</div>
|
||||
<div
|
||||
class="message-context"
|
||||
v-show="!content.loading && !content.thinking && !content.streaming"
|
||||
>
|
||||
<div class="message-context" v-show="!content.loading">
|
||||
<div class="img-list flex" v-if="imageList.length > 0">
|
||||
<img
|
||||
v-for="(item, index) in imageList"
|
||||
@@ -19,6 +16,20 @@
|
||||
class="img-item"
|
||||
/>
|
||||
</div>
|
||||
<div class="message-context" v-show="content.thinking">
|
||||
<div class="thinking">
|
||||
<div
|
||||
class="thinking-header flex align-center"
|
||||
@click="toggleThinkingCollapsed"
|
||||
>
|
||||
<span>思考中</span>
|
||||
<!-- <SvgIcon :name="content.thinkingCollapsed ? 'arrowDown' : 'arrowUp'" size="16" color="#666" /> -->
|
||||
</div>
|
||||
<div class="thinking-content" v-show="!content.thinkingCollapsed">
|
||||
<pre>{{ content.thinkingText }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message-txt markdown-body flex flex-col">
|
||||
<!-- <div v-html="formatMessage"></div> -->
|
||||
<VueMarkdown
|
||||
@@ -27,7 +38,10 @@
|
||||
:rehype-plugins="[rehypeRaw]"
|
||||
>
|
||||
<template v-slot:s-ReportCard="" {children:children,...attrs}>
|
||||
<ReportCard :report="{ title: attrs.title, content: attrs.content }" @click="handleClickReport(content)" />
|
||||
<ReportCard
|
||||
:report="{ title: attrs.title, content: attrs.content }"
|
||||
@click="handleClickReport(content)"
|
||||
/>
|
||||
</template>
|
||||
</VueMarkdown>
|
||||
</div>
|
||||
@@ -57,17 +71,6 @@
|
||||
class="loading-gif"
|
||||
></video>
|
||||
</div>
|
||||
<div class="message-context" v-show="content.thinking">
|
||||
<div class="thinking">
|
||||
<div class="thinking-header flex align-center" @click="toggleThinkingCollapsed">
|
||||
<span>思考中</span>
|
||||
<!-- <SvgIcon :name="content.thinkingCollapsed ? 'arrowDown' : 'arrowUp'" size="16" color="#666" /> -->
|
||||
</div>
|
||||
<div class="thinking-content" v-show="!content.thinkingCollapsed">
|
||||
<pre>{{ content.thinkingText }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -195,15 +198,14 @@
|
||||
|
||||
const toggleThinkingCollapsed = () => {
|
||||
props.content.thinkingCollapsed = !props.content.thinkingCollapsed
|
||||
}
|
||||
}
|
||||
|
||||
const handleClickReport = (data) => {
|
||||
const handleClickReport = (data) => {
|
||||
// 点击显示报告
|
||||
}
|
||||
const handleClickUrls = (data) => {
|
||||
}
|
||||
const handleClickUrls = (data) => {
|
||||
// 点击显示来源
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
Reference in New Issue
Block a user