Commit ef46856d by weiyudumei

feat: workflow 卡片调用流式接口时追加 recordType: 'A01'

- 在 TacticsChat 和 Chat 的 handleWorkflowSubmit 中添加 recordType: 'A01'
- 修改 Chat.tsx 的 handleSubmitQuestion,支持从 extraParams 传入 recordType
- workflow 提交时优先使用传入的 recordType 值
parent 6c2dcc2c
...@@ -198,7 +198,7 @@ export const Chat: React.FC = () => { ...@@ -198,7 +198,7 @@ export const Chat: React.FC = () => {
question: string, question: string,
productCode?: string, productCode?: string,
toolId?: string, toolId?: string,
extraParams?: { paramMap?: Record<string, string>, recordId?: string }, extraParams?: { paramMap?: Record<string, string>, recordId?: string, recordType?: string },
) => { ) => {
// 优先读取缓存中的 toolId,再回退到传参或 Redux // 优先读取缓存中的 toolId,再回退到传参或 Redux
const sessionToolId = sessionStorage.getItem('currentToolId') ?? undefined const sessionToolId = sessionStorage.getItem('currentToolId') ?? undefined
...@@ -261,8 +261,12 @@ export const Chat: React.FC = () => { ...@@ -261,8 +261,12 @@ export const Chat: React.FC = () => {
requestBody.recordId = extraParams.recordId requestBody.recordId = extraParams.recordId
} }
// 如果传入了 recordType,优先使用传入的值(workflow 提交场景)
if (extraParams?.recordType) {
requestBody.recordType = extraParams.recordType
}
// 制度活化:toolId 为空字符串或 undefined // 制度活化:toolId 为空字符串或 undefined
if (!resolvedToolId || resolvedToolId === '') { else if (!resolvedToolId || resolvedToolId === '') {
requestBody.toolId = '' requestBody.toolId = ''
requestBody.busiType = '01' requestBody.busiType = '01'
requestBody.recordType = '01' requestBody.recordType = '01'
...@@ -399,6 +403,7 @@ export const Chat: React.FC = () => { ...@@ -399,6 +403,7 @@ export const Chat: React.FC = () => {
await handleSubmitQuestion('', undefined, undefined, { await handleSubmitQuestion('', undefined, undefined, {
paramMap, paramMap,
recordId, recordId,
recordType: 'A01',
}) })
} }
......
...@@ -621,6 +621,7 @@ export const TacticsChat: React.FC = () => { ...@@ -621,6 +621,7 @@ export const TacticsChat: React.FC = () => {
includeQuestion: false, includeQuestion: false,
paramMap, paramMap,
recordId, recordId,
recordType: 'A01',
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment