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
1b9e87fd
Commit
1b9e87fd
authored
Jan 08, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:常见问题参数
parent
e7399f86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
src/pages/Home/HomeNew.tsx
+25
-2
No files found.
src/pages/Home/HomeNew.tsx
View file @
1b9e87fd
...
@@ -86,6 +86,21 @@ export const Home: React.FC = () => {
...
@@ -86,6 +86,21 @@ export const Home: React.FC = () => {
defaultValue
:
''
,
defaultValue
:
''
,
})
})
// 根据 toolId 获取对应的 recordType
const
getRecordTypeByToolId
=
(
toolId
:
string
|
null
|
undefined
):
string
=>
{
if
(
!
toolId
)
{
return
'A16'
// 制度活化
}
if
(
toolId
===
'6712395743240'
)
{
return
'A18'
// 数据助手
}
if
(
toolId
===
'6712395743241'
)
{
return
'A14'
// 提质增效
}
// 未知的 toolId,默认返回制度活化
return
'A16'
}
// 获取会话ID并加载历史记录
// 获取会话ID并加载历史记录
const
getSessionConversationId
=
async
(
data
?:
any
):
Promise
<
string
|
null
>
=>
{
const
getSessionConversationId
=
async
(
data
?:
any
):
Promise
<
string
|
null
>
=>
{
try
{
try
{
...
@@ -135,10 +150,14 @@ export const Home: React.FC = () => {
...
@@ -135,10 +150,14 @@ export const Home: React.FC = () => {
return
return
}
}
// 从 sessionStorage 获取 toolId 并确定 recordType
const
toolId
=
safeSessionStorageGetItem
(
'currentToolId'
)
||
''
const
recordType
=
getRecordTypeByToolId
(
toolId
)
const
res
=
await
fetchEfficiencyQuestionList
({
const
res
=
await
fetchEfficiencyQuestionList
({
conversationId
,
conversationId
,
busiType
:
'01'
,
busiType
:
'01'
,
recordType
:
'A14'
,
recordType
,
})
})
if
(
res
&&
res
.
data
&&
res
.
data
.
questionList
)
{
if
(
res
&&
res
.
data
&&
res
.
data
.
questionList
)
{
setOtherQuestions
((
prev
:
any
)
=>
({
setOtherQuestions
((
prev
:
any
)
=>
({
...
@@ -194,11 +213,15 @@ export const Home: React.FC = () => {
...
@@ -194,11 +213,15 @@ export const Home: React.FC = () => {
return
return
}
}
// 从 sessionStorage 获取 toolId 并确定 recordType
const
currentToolId
=
safeSessionStorageGetItem
(
'currentToolId'
)
||
''
const
recordType
=
getRecordTypeByToolId
(
currentToolId
)
// 调用真实 API 获取常见问题列表
// 调用真实 API 获取常见问题列表
const
res
=
await
fetchEfficiencyQuestionList
({
const
res
=
await
fetchEfficiencyQuestionList
({
conversationId
,
conversationId
,
busiType
:
'01'
,
busiType
:
'01'
,
recordType
:
'A14'
,
recordType
,
})
})
if
(
res
&&
res
.
data
&&
res
.
data
.
questionList
)
{
if
(
res
&&
res
.
data
&&
res
.
data
.
questionList
)
{
setOtherQuestions
((
prev
:
any
)
=>
({
setOtherQuestions
((
prev
:
any
)
=>
({
...
...
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