feat: 执行详情

This commit is contained in:
wangdan-fit2cloud 2024-06-24 19:35:04 +08:00
parent 226759e668
commit 1140e0c4f3
4 changed files with 42 additions and 11 deletions

View File

@ -33,10 +33,17 @@
</template>
<!-- 知识库检索 -->
<template v-if="item.type == WorkflowType.SearchDataset">
<div class="card-never border-r-4">
<h5 class="p-8-12">检索内容</h5>
<div class="p-8-12 border-t-dashed lighter">{{ item.question }}</div>
</div>
<div class="card-never border-r-4">
<h5 class="p-8-12">检索结果</h5>
<div class="p-8-12 border-t-dashed lighter">
<template v-for="(paragraph, index) in item.paragraph_list" :key="index">
<template
v-for="(paragraph, paragraphIndex) in item.paragraph_list"
:key="paragraphIndex"
>
<CardBox
shadow="never"
:title="paragraph.title || '-'"
@ -92,17 +99,28 @@
</div>
</div>
</template>
<!-- AI 对话 -->
<template v-if="item.type == WorkflowType.AiChat">
<!-- AI 对话 / 问题优化-->
<template
v-if="item.type == WorkflowType.AiChat || item.type == WorkflowType.Question"
>
<div class="card-never border-r-4">
<h5 class="p-8-12">角色设定 (System)</h5>
<div class="p-8-12 border-t-dashed lighter">
{{ item.branch_name }}
{{ item.system || '-' }}
</div>
</div>
<div class="card-never border-r-4 mt-8">
<h5 class="p-8-12">历史记录</h5>
<div class="p-8-12 border-t-dashed lighter"></div>
<div class="p-8-12 border-t-dashed lighter">
<p
class="mt-4 mb-4"
v-for="(history, historyIndex) in item.history_message"
:key="historyIndex"
>
<span class="color-secondary mr-4">{{ history.role }}:</span
><span>{{ history.content }}</span>
</p>
</div>
</div>
<div class="card-never border-r-4 mt-8">
<h5 class="p-8-12">本次对话</h5>
@ -115,10 +133,28 @@
ref="editorRef"
editorId="preview-only"
:modelValue="item.answer"
style="background: none"
/>
</div>
</div>
</template>
<!-- 指定回复 -->
<template v-if="item.type === WorkflowType.Reply">
<div class="card-never border-r-4">
<h5 class="p-8-12">回复内容</h5>
<div class="p-8-12 border-t-dashed lighter">
<el-scrollbar height="150">
<MdPreview
ref="editorRef"
editorId="preview-only"
:modelValue="item.answer"
style="background: none"
/>
</el-scrollbar>
</div>
</div>
</template>
</div>
</el-collapse-transition>
</el-card>

View File

@ -653,7 +653,3 @@ h5 {
border: 1px solid var(--el-color-primary);
}
}
.md-editor {
background: none;
}

View File

@ -1,5 +1,5 @@
<template>
<div class="custom-edge">
<div class="custom-edge cursor">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M12 23.0001C5.925 23.0001 1 18.0751 1 12.0001C1 5.92512 5.925 1.00012 12 1.00012C18.075 1.00012 23 5.92512 23 12.0001C23 18.0751 18.075 23.0001 12 23.0001Z"

View File

@ -89,7 +89,6 @@ export class WorkFlowInstance {
private is_valid_nodes() {
for (const node of this.nodes) {
if (node.type !== WorkflowType.Base && node.type !== WorkflowType.Start) {
console.log(node.properties.stepName)
if (!this.edges.some((edge) => edge.targetNodeId === node.id)) {
throw `未在流程中的节点:${node.properties.stepName}`
}