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
9bb6ef57
Commit
9bb6ef57
authored
Dec 19, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:推荐问题新增recordType&busiType字段
parent
66a4eb6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletions
+26
-1
src/api/chat.ts
+11
-1
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
+15
-0
No files found.
src/api/chat.ts
View file @
9bb6ef57
...
...
@@ -164,13 +164,23 @@ export function fetchGetFeedbackConfig() {
* @param conversationId
* @param recordId
* @param toolId 可选的工具ID
* @param busiType 可选的业务类型
* @param recordType 可选的记录类型
* @returns Promise<any>
*/
export
function
fetchQueryRecommendQuestion
(
conversationId
:
string
,
recordId
:
string
,
toolId
?:
string
)
{
export
function
fetchQueryRecommendQuestion
(
conversationId
:
string
,
recordId
:
string
,
toolId
?:
string
,
busiType
?:
string
,
recordType
?:
string
,
)
{
return
http
.
post
(
'/conversation/api/conversation/mobile/v1/query_recommend_question'
,
{
conversationId
,
recordId
,
...(
toolId
?
{
toolId
}
:
{}),
...(
busiType
?
{
busiType
}
:
{}),
...(
recordType
?
{
recordType
}
:
{}),
})
}
...
...
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
View file @
9bb6ef57
import
{
useEffect
,
useState
}
from
'react'
import
{
useSearchParams
}
from
'react-router-dom'
import
{
Button
,
Skeleton
}
from
'@heroui/react'
import
type
{
Answer
}
from
'@/types/chat'
import
{
fetchQueryRecommendQuestion
}
from
'@/api/chat'
...
...
@@ -13,16 +14,30 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
let
isGet
=
false
const
[
questionList
,
setQuestionList
]
=
useState
<
string
[]
>
([])
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
)
const
[
searchParams
]
=
useSearchParams
()
const
getAnswerRecommend
=
async
()
=>
{
setLoading
(
true
)
onLoadingChange
?.(
true
)
// 从 sessionStorage 中获取 toolId
const
toolId
=
typeof
window
!==
'undefined'
?
sessionStorage
.
getItem
(
'currentToolId'
)
:
null
// 仅在 from=tactics 场景下,按照要求补充 busiType / recordType 参数
const
from
=
searchParams
.
get
(
'from'
)
const
place
=
searchParams
.
get
(
'place'
)
const
shouldAttachBusiParams
=
from
===
'tactics'
const
busiType
=
shouldAttachBusiParams
?
'02'
:
undefined
let
recordType
:
string
|
undefined
if
(
shouldAttachBusiParams
)
{
// from=tactics 且 place=user → recordType=A03
// from=tactics 且 place!=user/无 → recordType=A01
recordType
=
place
===
'user'
?
'A03'
:
'A01'
}
try
{
const
res
=
await
fetchQueryRecommendQuestion
(
answer
.
conversationId
||
''
,
answer
.
recordId
||
''
,
toolId
||
undefined
,
busiType
,
recordType
,
)
if
(
res
.
ok
)
{
setQuestionList
(
res
.
data
.
questionList
)
...
...
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