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
79a6875b
Commit
79a6875b
authored
Feb 03, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete : 无用代码
parent
2549858d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
+0
-33
src/pages/ChatTactics/TacticsChat.tsx
+0
-33
No files found.
src/pages/ChatTactics/TacticsChat.tsx
View file @
79a6875b
...
@@ -272,12 +272,6 @@ export const TacticsChat: React.FC = () => {
...
@@ -272,12 +272,6 @@ export const TacticsChat: React.FC = () => {
},
},
],
],
}
}
console
.
log
(
'[TacticsChat] handleStreamMesageData:updated'
,
{
filteredAnswer
,
answerList
:
newItems
[
lastAiIndex
].
answerList
,
updatedItem
:
newItems
[
lastAiIndex
],
})
}
}
else
{
else
{
// 如果没有找到 AI 项,创建一个新的 AI 项
// 如果没有找到 AI 项,创建一个新的 AI 项
...
@@ -441,12 +435,7 @@ export const TacticsChat: React.FC = () => {
...
@@ -441,12 +435,7 @@ export const TacticsChat: React.FC = () => {
// 优先级:orderMeta > userMeta > tacticsMeta
// 优先级:orderMeta > userMeta > tacticsMeta
// 优先使用 orderMeta,如果存在 orderMeta 且需要包含,则传入 orderMeta 的字段
// 优先使用 orderMeta,如果存在 orderMeta 且需要包含,则传入 orderMeta 的字段
if
(
orderMeta
&&
shouldIncludeOrderMeta
)
{
if
(
orderMeta
&&
shouldIncludeOrderMeta
)
{
console
.
log
(
'[TacticsChat] handleSubmitQuestion: orderMeta'
,
orderMeta
)
Object
.
assign
(
requestBody
,
orderMeta
)
Object
.
assign
(
requestBody
,
orderMeta
)
console
.
log
(
'[TacticsChat] handleSubmitQuestion: requestBody after orderMeta'
,
{
workOrderIds
:
requestBody
.
workOrderIds
,
hasWorkOrderIds
:
'workOrderIds'
in
requestBody
,
})
}
}
// 如果没有 orderMeta 或不需要包含 orderMeta,则使用 userMeta
// 如果没有 orderMeta 或不需要包含 orderMeta,则使用 userMeta
else
if
(
userMeta
&&
shouldIncludeUserMeta
)
{
else
if
(
userMeta
&&
shouldIncludeUserMeta
)
{
...
@@ -514,7 +503,6 @@ export const TacticsChat: React.FC = () => {
...
@@ -514,7 +503,6 @@ export const TacticsChat: React.FC = () => {
if
(
extra
?.
recordId
)
{
if
(
extra
?.
recordId
)
{
requestBody
.
recordId
=
extra
.
recordId
requestBody
.
recordId
=
extra
.
recordId
}
}
// workFlowSessionId 的传递逻辑:
// workFlowSessionId 的传递逻辑:
// 1. 如果是重新分析(isReanalyze === true),不传递 workFlowSessionId
// 1. 如果是重新分析(isReanalyze === true),不传递 workFlowSessionId
// 2. 如果有历史记录且是第一次自动调用(question 为空且 includeQuestion === false),不传递 workFlowSessionId
// 2. 如果有历史记录且是第一次自动调用(question 为空且 includeQuestion === false),不传递 workFlowSessionId
...
@@ -538,15 +526,6 @@ export const TacticsChat: React.FC = () => {
...
@@ -538,15 +526,6 @@ export const TacticsChat: React.FC = () => {
}
}
}
}
}
}
// 调试日志:检查最终请求参数
console
.
log
(
'[TacticsChat] handleSubmitQuestion: final requestBody'
,
{
workOrderIds
:
requestBody
.
workOrderIds
,
hasWorkOrderIds
:
'workOrderIds'
in
requestBody
,
orderMeta
,
shouldIncludeOrderMeta
,
requestBodyKeys
:
Object
.
keys
(
requestBody
),
requestBodyStringified
:
JSON
.
stringify
(
requestBody
),
})
fetchStreamResponse
(
fetchStreamResponse
(
fetchUrl
,
fetchUrl
,
requestBody
,
requestBody
,
...
@@ -556,7 +535,6 @@ export const TacticsChat: React.FC = () => {
...
@@ -556,7 +535,6 @@ export const TacticsChat: React.FC = () => {
if
(
abortControllerRef
.
current
?.
signal
.
aborted
)
{
if
(
abortControllerRef
.
current
?.
signal
.
aborted
)
{
return
return
}
}
// 处理错误
// 处理错误
if
(
msg
?.
type
===
'ERROR'
)
{
if
(
msg
?.
type
===
'ERROR'
)
{
// 出错时需要重置 isAsking 状态
// 出错时需要重置 isAsking 状态
...
@@ -1016,21 +994,11 @@ export const TacticsChat: React.FC = () => {
...
@@ -1016,21 +994,11 @@ export const TacticsChat: React.FC = () => {
// 处理shouldSendQuestion的变化 - 自动发送问题
// 处理shouldSendQuestion的变化 - 自动发送问题
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
'[TacticsChat] autoSend check'
,
{
shouldSendQuestion
,
currentId
:
currentIdRef
.
current
,
isLoading
,
hasHistory
,
lastSentQuestion
:
lastSentQuestionRef
.
current
,
orderMeta
:
!!
orderMeta
,
})
// 关键约束:必须等历史记录查询完成(hasHistory !== null)后,才允许触发任何"自动发送"。
// 关键约束:必须等历史记录查询完成(hasHistory !== null)后,才允许触发任何"自动发送"。
// 这样可以保证进入页面时的时序为:先 query_user_qa_record_list,再 submit_question_stream。
// 这样可以保证进入页面时的时序为:先 query_user_qa_record_list,再 submit_question_stream。
if
(
hasHistory
===
null
)
{
if
(
hasHistory
===
null
)
{
return
return
}
}
if
(
if
(
shouldSendQuestion
shouldSendQuestion
&&
currentIdRef
.
current
&&
currentIdRef
.
current
...
@@ -1136,7 +1104,6 @@ export const TacticsChat: React.FC = () => {
...
@@ -1136,7 +1104,6 @@ export const TacticsChat: React.FC = () => {
},
},
[
orderMeta
,
userMeta
,
getNumberTypeWithUserMeta
,
handleSubmitQuestion
],
[
orderMeta
,
userMeta
,
getNumberTypeWithUserMeta
,
handleSubmitQuestion
],
)
)
return
(
return
(
<
div
<
div
className=
{
styles
.
scrollView
}
className=
{
styles
.
scrollView
}
...
...
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