Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
9379fb86
Commit
9379fb86
authored
Feb 02, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 工单历史记录调用顺序
parent
56892e1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
src/pages/ChatTactics/TacticsChat.tsx
+13
-13
No files found.
src/pages/ChatTactics/TacticsChat.tsx
View file @
9379fb86
...
@@ -1015,11 +1015,18 @@ export const TacticsChat: React.FC = () => {
...
@@ -1015,11 +1015,18 @@ export const TacticsChat: React.FC = () => {
shouldSendQuestion
,
shouldSendQuestion
,
currentId
:
currentIdRef
.
current
,
currentId
:
currentIdRef
.
current
,
isLoading
,
isLoading
,
hasHistory
,
lastSentQuestion
:
lastSentQuestionRef
.
current
,
lastSentQuestion
:
lastSentQuestionRef
.
current
,
orderMeta
:
!!
orderMeta
,
orderMeta
:
!!
orderMeta
,
hasOrderMetaSecondCall
:
hasOrderMetaSecondCallRef
.
current
,
hasOrderMetaSecondCall
:
hasOrderMetaSecondCallRef
.
current
,
})
})
// 关键约束:必须等历史记录查询完成(hasHistory !== null)后,才允许触发任何“自动发送/自动二次调用”。
// 这样可以保证进入页面时的时序为:先 query_user_qa_record_list,再 submit_question_stream。
if
(
hasHistory
===
null
)
{
return
}
// orderMeta 场景下,即使没有 shouldSendQuestion,也触发第二次调用(用于第三方嵌入场景)
// orderMeta 场景下,即使没有 shouldSendQuestion,也触发第二次调用(用于第三方嵌入场景)
// 复用 shouldSendQuestion 存在时的调用逻辑,保证参数传递完全一致
// 复用 shouldSendQuestion 存在时的调用逻辑,保证参数传递完全一致
if
(
if
(
...
@@ -1030,18 +1037,11 @@ export const TacticsChat: React.FC = () => {
...
@@ -1030,18 +1037,11 @@ export const TacticsChat: React.FC = () => {
&&
!
shouldSendQuestion
&&
!
shouldSendQuestion
)
{
)
{
hasOrderMetaSecondCallRef
.
current
=
true
hasOrderMetaSecondCallRef
.
current
=
true
// 从 URL 参数中构建 paramMap(如果存在 workflow 表单字段)
// orderMeta 场景下第二次自动调用:仅透传 workOrderIds 到 paramMap
// 排除已知的业务参数,其他参数作为 paramMap 传递
// 需求:第一次自动调用不需要 paramMap;第二次自动调用的 paramMap 取路由内的 workOrderIds 值
const
paramMap
:
Record
<
string
,
string
>
|
undefined
=
(()
=>
{
const
paramMap
:
Record
<
string
,
string
>
|
undefined
=
typeof
orderMeta
.
workOrderIds
===
'string'
const
knownParams
=
[
'from'
,
'place'
,
'workOrderIds'
,
'taskId'
,
'version'
,
'pinBeginTime'
,
'pinEndTime'
,
'partOrAll'
,
'channel'
,
'channelName'
,
'cstId'
,
'userId'
,
'numberType'
]
?
{
workOrderIds
:
orderMeta
.
workOrderIds
}
const
paramMapEntries
:
[
string
,
string
][]
=
[]
:
undefined
searchParams
.
forEach
((
value
,
key
)
=>
{
if
(
!
knownParams
.
includes
(
key
)
&&
value
)
{
paramMapEntries
.
push
([
key
,
value
])
}
})
return
paramMapEntries
.
length
>
0
?
Object
.
fromEntries
(
paramMapEntries
)
:
undefined
})()
setTimeout
(()
=>
{
setTimeout
(()
=>
{
// 完全复用 shouldSendQuestion 存在时的调用逻辑(第 1063-1074 行),只是 question 为 undefined
// 完全复用 shouldSendQuestion 存在时的调用逻辑(第 1063-1074 行),只是 question 为 undefined
// 这样保证参数传递完全一致,包括 paramMap 等参数的处理逻辑
// 这样保证参数传递完全一致,包括 paramMap 等参数的处理逻辑
...
@@ -1110,7 +1110,7 @@ export const TacticsChat: React.FC = () => {
...
@@ -1110,7 +1110,7 @@ export const TacticsChat: React.FC = () => {
}
}
},
100
)
},
100
)
}
}
},
[
shouldSendQuestion
,
isLoading
,
dispatch
,
orderMeta
,
userMeta
,
handleSubmitQuestion
,
getNumberTypeWithUserMeta
])
},
[
shouldSendQuestion
,
isLoading
,
hasHistory
,
dispatch
,
orderMeta
,
userMeta
,
handleSubmitQuestion
,
getNumberTypeWithUserMeta
])
// 提供给 ChatAnswerBox/推荐问题的提交方法,保持与手动提问一致的 recordType 逻辑
// 提供给 ChatAnswerBox/推荐问题的提交方法,保持与手动提问一致的 recordType 逻辑
const
handleAnswerBoxSubmit
=
useCallback
(
const
handleAnswerBoxSubmit
=
useCallback
(
...
...
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