Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ai-chat-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenghong_tao
ai-chat-ui
Commits
5f904413
Commit
5f904413
authored
May 15, 2025
by
chenghong_tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 工作流显示
parent
98994bd5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
21 deletions
+49
-21
aiBubble.vue
src/components/chatSubassembly/aiBubble.vue
+1
-1
workflowItem.vue
src/components/chatSubassembly/workflowItem.vue
+48
-18
task.js
src/store/task.js
+0
-2
No files found.
src/components/chatSubassembly/aiBubble.vue
View file @
5f904413
...
...
@@ -7,7 +7,7 @@
<div
class=
"custom-bubble-content"
v-adjust-width
>
<!-- 工作流 -->
<workflowItem
v-if=
"taskStore.showWorkflow"
v-if=
"taskStore.showWorkflow
&& workflowContent.length > 0
"
:workflowContent=
"workflowContent"
ref=
"workflowItemRef"
/>
...
...
src/components/chatSubassembly/workflowItem.vue
View file @
5f904413
...
...
@@ -45,8 +45,10 @@ watch(
()
=>
props
.
workflowContent
,
(
val
)
=>
{
if
(
val
&&
Array
.
isArray
(
val
))
{
let
inIteration
=
false
;
for
(
let
i
=
0
;
i
<
val
.
length
;
i
++
)
{
const
item
=
val
[
i
];
const
dataId
=
item
?.
data
?.
id
;
if
(
item
.
event
===
"error"
)
{
ElMessage
.
error
(
item
.
message
)
workflowStatus
.
value
=
'error'
;
...
...
@@ -55,13 +57,47 @@ watch(
if
(
item
.
event
===
"workflow_finished"
)
{
workflowStatus
.
value
=
'success'
;
}
// 特殊处理 iteration_started 和 iteration_completed
if
(
item
.
event
===
"iteration_started"
)
{
inIteration
=
true
;
// 添加 iteration 节点到 thinkingItems 中
const
title
=
item
.
data
?.
title
||
'迭代执行数据库查询'
;
const
index
=
thinkingItems
.
value
.
findIndex
(
ti
=>
ti
.
codeId
===
dataId
);
if
(
index
===
-
1
)
{
thinkingItems
.
value
.
push
({
codeId
:
dataId
,
status
:
"loading"
,
isCanExpand
:
false
,
isDefaultExpand
:
false
,
title
:
title
,
thinkTitle
:
""
,
thinkContent
:
""
,
type
:
"iteration"
});
}
continue
;
}
if
(
item
.
event
===
"iteration_completed"
)
{
const
index
=
thinkingItems
.
value
.
findIndex
(
ti
=>
ti
.
codeId
===
dataId
);
if
(
index
!==
-
1
)
{
thinkingItems
.
value
[
index
].
status
=
"success"
;
}
inIteration
=
false
;
continue
;
}
// 如果当前处于 iteration 区间内,则跳过处理
if
(
inIteration
)
continue
;
if
(
item
.
event
!==
"workflow_started"
&&
item
.
event
!==
"workflow_finished"
&&
item
.
event
!==
"message_end"
&&
item
.
event
!==
"message"
)
{
const
dataId
=
item
?.
data
?.
id
;
const
index
=
thinkingItems
.
value
.
findIndex
(
(
ti
)
=>
ti
.
codeId
===
dataId
);
...
...
@@ -70,24 +106,18 @@ watch(
const
isExcludeNode
=
excludedNodeTypes
.
includes
(
item
?.
data
?.
node_type
);
if
(
!
isExcludeNode
)
{
if
(
index
===
-
1
)
{
// 如果存在迭代节点,且迭代节点正在执行,则不再添加后续节点
const
iterationItem
=
thinkingItems
.
value
.
filter
(
m
=>
m
.
type
===
'iteration'
)
if
(
iterationItem
.
length
>
0
&&
iterationItem
[
0
].
status
===
'loading'
)
{
console
.
log
(
'迭代中'
);
}
else
{
thinkingItems
.
value
.
push
({
codeId
:
dataId
,
status
:
"loading"
,
isCanExpand
:
false
,
isDefaultExpand
:
false
,
title
:
item
.
data
.
title
,
thinkTitle
:
""
,
thinkContent
:
""
,
type
:
item
?.
data
?.
node_type
});
}
thinkingItems
.
value
.
push
({
codeId
:
dataId
,
status
:
"loading"
,
isCanExpand
:
false
,
isDefaultExpand
:
false
,
title
:
item
.
data
.
title
,
thinkTitle
:
""
,
thinkContent
:
""
,
type
:
item
?.
data
?.
node_type
});
}
else
{
if
(
item
.
event
===
"node_finished"
||
item
.
event
===
"iteration_completed"
)
{
if
(
item
.
event
===
"node_finished"
)
{
thinkingItems
.
value
[
index
].
status
=
"success"
;
}
}
...
...
src/store/task.js
View file @
5f904413
...
...
@@ -42,8 +42,6 @@ export const useTaskStore = defineStore('task', {
this
.
message_id
=
''
this
.
workflow_run_id
=
''
this
.
isLoading
=
false
this
.
deepThink
=
false
this
.
showWorkflow
=
false
}
},
persist
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment