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
94a7e78b
Commit
94a7e78b
authored
Dec 09, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:kuan
parent
dee25152
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
src/pages/ChatTactics/Chat.tsx
+0
-0
src/pages/Home/HomeNew.tsx
+8
-3
No files found.
src/pages/ChatTactics/Chat.tsx
View file @
94a7e78b
This diff is collapsed.
Click to expand it.
src/pages/Home/HomeNew.tsx
View file @
94a7e78b
...
...
@@ -81,7 +81,9 @@ export const Home: React.FC = () => {
}
// 处理工具按钮点击
const
requestIdRef
=
useRef
(
0
)
// 标记最新请求,避免旧响应覆盖
const
_handleToolClick
=
useCallback
(
async
(
isToolBtn
:
boolean
,
toolId
?:
string
,
ignoreUrlToolId
?:
boolean
)
=>
{
const
currentRequestId
=
++
requestIdRef
.
current
// 提质增效模式 / 数据助手 / 通用模式:都先清空数据,重新拉常见问题
setOtherQuestions
((
prev
:
any
)
=>
({
...
prev
,
...
...
@@ -115,7 +117,8 @@ export const Home: React.FC = () => {
const
res
=
await
fetchEfficiencyQuestionList
({
toolId
:
sessionToolId
||
finalToolId
,
})
if
(
res
&&
res
.
data
&&
res
.
data
.
questions
)
{
// 只接受当前最新的请求结果,避免旧请求覆盖新请求
if
(
currentRequestId
===
requestIdRef
.
current
&&
res
?.
data
?.
questions
)
{
setOtherQuestions
((
prev
:
any
)
=>
({
...
prev
,
content
:
res
.
data
.
questions
||
[],
...
...
@@ -126,7 +129,9 @@ export const Home: React.FC = () => {
console
.
error
(
'获取工具相关问题失败:'
,
error
)
}
finally
{
setIsDataLoaded
(
true
)
// 无论成功失败都标记为已加载
// 仅在当前请求仍是最新时更新加载态,避免闪烁
if
(
currentRequestId
===
requestIdRef
.
current
)
setIsDataLoaded
(
true
)
}
},
[
originalOtherQuestions
,
location
.
search
])
...
...
@@ -329,7 +334,7 @@ export const Home: React.FC = () => {
<
div
className=
"hidden sm:flex h-full flex-none ml-auto"
>
<
div
className=
"w-full h-full bg-transparent box-border rounded-[24px]"
style=
{
{
width
:
'420px'
,
height
:
'calc(100vh - 64px)'
,
background
:
'#FFFFFF'
,
padding
:
'0 30px'
}
}
style=
{
{
height
:
'calc(100vh - 64px)'
,
background
:
'#FFFFFF'
,
padding
:
'0 30px'
}
}
>
<
Outlet
/>
</
div
>
...
...
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