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
bb6b1466
Commit
bb6b1466
authored
Dec 16, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:重新分析按钮保持与提问按钮逻辑一致
parent
aa90f3a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
src/pages/ChatTactics/TacticsChat.tsx
+18
-2
No files found.
src/pages/ChatTactics/TacticsChat.tsx
View file @
bb6b1466
...
...
@@ -42,6 +42,7 @@ export const TacticsChat: React.FC = () => {
shouldNavigateToNewConversation
,
currentConversationId
,
}
=
useAppSelector
((
state
:
RootState
)
=>
state
.
tactics
)
const
isAsking
=
useAppSelector
((
state
:
RootState
)
=>
state
.
chat
.
isAsking
)
const
[
searchParams
]
=
useSearchParams
()
const
hasFetched
=
useRef
(
false
)
// 使用 useLocalStorageState 管理 token,与原有逻辑保持一致
...
...
@@ -583,6 +584,16 @@ export const TacticsChat: React.FC = () => {
},
[
dispatch
,
getConversationExtra
])
const
handleReanalyze
=
useCallback
(
async
()
=>
{
// 正在回答或尚未就绪时不触发重新分析
if
(
!
currentIdRef
.
current
||
isLoading
||
isAsking
)
{
// eslint-disable-next-line no-console
console
.
log
(
'[TacticsChat] handleReanalyze blocked'
,
{
currentId
:
currentIdRef
.
current
,
isLoading
,
isAsking
,
})
return
}
// 重新触发一次提问,与首次自动调用保持一致:
// - 无 userMeta:沿用原逻辑,传 recordType=A02,使用 tacticsMeta
// - 有 userMeta:按 userMeta.numberType 映射 numberType(A03/A05/A07/A09),不传 recordType,仅传 userMeta
...
...
@@ -610,7 +621,7 @@ export const TacticsChat: React.FC = () => {
if
(
currentIdRef
.
current
)
{
navigate
(
`/tactics/chat/
${
currentIdRef
.
current
}
`
)
}
},
[
dispatch
,
navigate
,
handleSubmitQuestion
,
userMeta
,
getNumberTypeWithUserMeta
])
},
[
dispatch
,
navigate
,
handleSubmitQuestion
,
userMeta
,
getNumberTypeWithUserMeta
,
isLoading
,
isAsking
])
const
handleCancelClear
=
useCallback
(()
=>
{
setShowClearConfirm
(
false
)
...
...
@@ -812,7 +823,12 @@ export const TacticsChat: React.FC = () => {
<
button
type=
"button"
onClick=
{
handleReanalyze
}
className=
"flex items-center gap-[4px] text-[#4A90E2] text-[14px] hover:opacity-80 transition-opacity cursor-pointer bg-transparent border-none outline-none"
disabled=
{
!
currentIdRef
.
current
||
isLoading
||
isAsking
}
className=
{
`flex items-center gap-[4px] text-[14px] transition-opacity bg-transparent border-none outline-none ${
!currentIdRef.current || isLoading || isAsking
? 'text-[#B2B8C1] cursor-not-allowed opacity-60'
: 'text-[#4A90E2] hover:opacity-80 cursor-pointer'
}`
}
>
<
RefreshIcon
className=
"w-[16px] h-[16px] text-[#B2B8C1]"
/>
<
span
>
重新分析
</
span
>
...
...
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