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