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
c1b6b8a5
Commit
c1b6b8a5
authored
Jan 06, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:工单推荐问题
parent
3c4efd49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
27 deletions
+47
-27
src/api/chat.ts
+25
-0
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
+22
-14
src/pages/Home/HomeNew.tsx
+0
-13
No files found.
src/api/chat.ts
View file @
c1b6b8a5
...
@@ -185,6 +185,31 @@ export function fetchQueryRecommendQuestion(
...
@@ -185,6 +185,31 @@ export function fetchQueryRecommendQuestion(
}
}
/**
/**
* 查询推荐问题
* @param conversationId
* @param recordId
* @param toolId 可选的工具ID
* @param busiType 可选的业务类型
* @param recordType 可选的记录类型
* @returns Promise<any>
*/
export
function
fetchOrderQueryRecommendQuestion
(
conversationId
:
string
,
recordId
:
string
,
toolId
?:
string
,
busiType
?:
string
,
recordType
?:
string
,
)
{
return
http
.
post
(
'/conversation/api/conversation/mobile/v1/query_strategy_recommend_question'
,
{
conversationId
,
recordId
,
...(
toolId
?
{
toolId
}
:
{}),
...(
busiType
?
{
busiType
}
:
{}),
...(
recordType
?
{
recordType
}
:
{}),
})
}
/**
* 停止问答
* 停止问答
* @param params
* @param params
* @returns Promise<any>
* @returns Promise<any>
...
...
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
View file @
c1b6b8a5
...
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
...
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
import
{
useSearchParams
}
from
'react-router-dom'
import
{
useSearchParams
}
from
'react-router-dom'
import
{
Button
,
Skeleton
}
from
'@heroui/react'
import
{
Button
,
Skeleton
}
from
'@heroui/react'
import
type
{
Answer
}
from
'@/types/chat'
import
type
{
Answer
}
from
'@/types/chat'
import
{
fetchQueryRecommendQuestion
}
from
'@/api/chat'
import
{
fetch
OrderQueryRecommendQuestion
,
fetch
QueryRecommendQuestion
}
from
'@/api/chat'
import
SendIcon
from
'@/assets/svg/sendBlack.svg?react'
import
SendIcon
from
'@/assets/svg/sendBlack.svg?react'
interface
ChatAnswerRecommendProps
{
interface
ChatAnswerRecommendProps
{
...
@@ -23,32 +23,40 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
...
@@ -23,32 +23,40 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
// 仅在 from=tactics 场景下,按照要求补充 busiType / recordType 参数
// 仅在 from=tactics 场景下,按照要求补充 busiType / recordType 参数
const
from
=
searchParams
.
get
(
'from'
)
const
from
=
searchParams
.
get
(
'from'
)
const
place
=
searchParams
.
get
(
'place'
)
const
place
=
searchParams
.
get
(
'place'
)
const
fromValues
=
searchParams
.
getAll
(
'from'
)
const
shouldAttachBusiParams
=
from
===
'tactics'
const
shouldAttachBusiParams
=
from
===
'tactics'
const
isOrderTactics
=
from
===
'tactics'
&&
place
===
'order'
const
busiType
=
shouldAttachBusiParams
?
'02'
:
undefined
const
busiType
=
shouldAttachBusiParams
?
'02'
:
undefined
let
recordType
:
string
|
undefined
let
recordType
:
string
|
undefined
if
(
shouldAttachBusiParams
)
{
if
(
shouldAttachBusiParams
)
{
// from=tactics 且 from=order → recordType=A11
// from=tactics 且 place=order → recordType=A13 (使用 fetchOrderQueryRecommendQuestion)
// from=tactics 且 place=user → recordType=A03
if
(
isOrderTactics
)
{
// from=tactics 且 place!=user/无 → recordType=A01
recordType
=
'A13'
if
(
fromValues
.
includes
(
'order'
))
{
recordType
=
'A11'
}
}
// from=tactics 且 place=user → recordType=A03
else
if
(
place
===
'user'
)
{
else
if
(
place
===
'user'
)
{
recordType
=
'A03'
recordType
=
'A03'
}
}
// from=tactics 且 place!=user/无 → recordType=A01
else
{
else
{
recordType
=
'A01'
recordType
=
'A01'
}
}
}
}
try
{
try
{
const
res
=
await
fetchQueryRecommendQuestion
(
const
res
=
isOrderTactics
answer
.
conversationId
||
''
,
?
await
fetchOrderQueryRecommendQuestion
(
answer
.
recordId
||
''
,
answer
.
conversationId
||
''
,
toolId
||
undefined
,
answer
.
recordId
||
''
,
busiType
,
toolId
||
undefined
,
recordType
,
busiType
,
)
recordType
,
)
:
await
fetchQueryRecommendQuestion
(
answer
.
conversationId
||
''
,
answer
.
recordId
||
''
,
toolId
||
undefined
,
busiType
,
recordType
,
)
if
(
res
.
ok
)
{
if
(
res
.
ok
)
{
setQuestionList
(
res
.
data
.
questionList
)
setQuestionList
(
res
.
data
.
questionList
)
}
}
...
...
src/pages/Home/HomeNew.tsx
View file @
c1b6b8a5
...
@@ -452,19 +452,6 @@ export const Home: React.FC = () => {
...
@@ -452,19 +452,6 @@ export const Home: React.FC = () => {
className=
"flex flex-col gap-[20px] items-center overflow-y-auto scrollbar-hide"
className=
"flex flex-col gap-[20px] items-center overflow-y-auto scrollbar-hide"
style=
{
{
height
:
shouldChangeStyle
?
'calc(-64px + 100vh)'
:
'500px'
,
background
:
shouldChangeStyle
?
'linear-gradient(180deg, #DEF6FF 0%, #FFFFFF 50%, #FFFFFF 100%)'
:
''
,
borderRadius
:
'24px'
}
}
style=
{
{
height
:
shouldChangeStyle
?
'calc(-64px + 100vh)'
:
'500px'
,
background
:
shouldChangeStyle
?
'linear-gradient(180deg, #DEF6FF 0%, #FFFFFF 50%, #FFFFFF 100%)'
:
''
,
borderRadius
:
'24px'
}
}
>
>
{
/* {!shouldChangeStyle && (
<motion.div className="w-full sm:w-auto" {...getAnimationProps(2)}>
<QuestionList
questions={productQuestions.content}
dotColor="#D4CCFF"
background="linear-gradient(180deg, #EBE6FF 0%, #FFFFFF 50%, #FFFFFF 100%)"
title={productQuestions.configName}
iconImg={HomeIcon1}
isToolBtn={shouldChangeStyle}
isLoaded={isDataLoaded}
/>
</motion.div>
)} */
}
<
motion
.
div
className=
"w-full sm:w-auto"
{
...
getAnimationProps
(3)}
>
<
motion
.
div
className=
"w-full sm:w-auto"
{
...
getAnimationProps
(3)}
>
<
QuestionList
<
QuestionList
questions=
{
otherQuestions
.
content
}
questions=
{
otherQuestions
.
content
}
...
...
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