fix 文档管理模块 & 法规对话模块

This commit is contained in:
2026-05-20 23:34:08 +08:00
parent c22b03dc07
commit b065d55c86
39 changed files with 1671 additions and 540 deletions

View File

@@ -250,11 +250,20 @@ export const CompliancePage: React.FC = () => {
setChatInput('');
setChatLoading(true);
const segmentContext = [
`意图:${chunk.intent}`,
`内容:${chunk.content.slice(0, 300)}`,
chunk.regulations.length > 0
? `相关法规:${chunk.regulations.slice(0, 3).map(r => `${r.name}${r.clause ? ' ' + r.clause : ''}(相关性 ${Math.round(r.score * 100)}%`).join('')}`
: '',
].filter(Boolean).join('\n');
let currentResponse = '';
complianceChat(
activeChunkId,
chatInput,
segmentContext,
(data: unknown) => {
const sseData = data as { type: string; text?: string };
if (sseData.type === 'chunk' && sseData.text) {