Commit a18083f6 by luoqi

fix(ai-script ui): 前端 4 段对齐 + 去时长显示 + 告知漏诊项目→告知应治未治

页面加载中仍显示旧 4 段标题:根因 use-script-stream 硬编码旧 id/label
(opening/followup/objection/close)做加载骨架。修:
- use-script-stream:ServerSection.id + LABEL_FALLBACK + makeEmptySections 改新 4 段
  (开场白/告知应治未治/复查建议/结束回访语)
- 去掉建议时长显示(script-viewer 3 处 durationHint span;无意义)
- 告知漏诊项目 → 告知应治未治(orchestrator label + markdown header + mock + 前端 fallback)

web TS 0 + service TS 0;本地 pac-service 已重启载新标题。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parent a60137dc
...@@ -457,7 +457,7 @@ function renderMarkdown( ...@@ -457,7 +457,7 @@ function renderMarkdown(
## 开场白 ## 开场白
${out.opening} ${out.opening}
## 告知漏诊项目 ## 告知应治未治
${out.informMissed} ${out.informMissed}
## 复查建议 ## 复查建议
...@@ -494,7 +494,7 @@ function renderSections( ...@@ -494,7 +494,7 @@ function renderSections(
}, },
{ {
id: 'informMissed', id: 'informMissed',
label: '告知漏诊项目', label: '告知应治未治',
durationHint: '1–2 分钟', durationHint: '1–2 分钟',
markdown: out.informMissed ?? '', markdown: out.informMissed ?? '',
}, },
......
...@@ -409,7 +409,7 @@ export const mockScript = { ...@@ -409,7 +409,7 @@ export const mockScript = {
}, },
{ {
id: 'informMissed', id: 'informMissed',
label: '告知漏诊项目', label: '告知应治未治',
durationHint: '1 分钟', durationHint: '1 分钟',
markdown: `• 上次来检查的时候,李医生注意到您左下大牙有缺失牙的情况 markdown: `• 上次来检查的时候,李医生注意到您左下大牙有缺失牙的情况
• 缺牙的地方如果不处理,旁边的牙齿可能会慢慢歪掉,时间一长吃东西也不太舒服 • 缺牙的地方如果不处理,旁边的牙齿可能会慢慢歪掉,时间一长吃东西也不太舒服
......
...@@ -30,7 +30,6 @@ export function ScriptMarkdown({ sections, streaming = false }: { sections: Scri ...@@ -30,7 +30,6 @@ export function ScriptMarkdown({ sections, streaming = false }: { sections: Scri
<span className={cn('text-[13px] font-semibold text-slate-900', streaming && 'shimmer-text')}> <span className={cn('text-[13px] font-semibold text-slate-900', streaming && 'shimmer-text')}>
{sec.label} {sec.label}
</span> </span>
<span className="text-[10.5px] text-slate-500 tabular-nums">· {sec.durationHint}</span>
</div> </div>
<svg <svg
viewBox="0 0 24 24" viewBox="0 0 24 24"
...@@ -70,7 +69,6 @@ export function ScriptStepCards({ sections, streaming = false }: { sections: Scr ...@@ -70,7 +69,6 @@ export function ScriptStepCards({ sections, streaming = false }: { sections: Scr
{sec.label} {sec.label}
</span> </span>
</div> </div>
<span className="text-[10.5px] text-slate-500 tabular-nums">{sec.durationHint}</span>
</div> </div>
<div className="text-[12px] leading-relaxed"> <div className="text-[12px] leading-relaxed">
<MD text={sec.markdown} /> <MD text={sec.markdown} />
...@@ -132,7 +130,6 @@ export function ScriptCopilot({ sections, streaming = false }: { sections: Scrip ...@@ -132,7 +130,6 @@ export function ScriptCopilot({ sections, streaming = false }: { sections: Scrip
{cur.label} {cur.label}
</span> </span>
</div> </div>
<span className="text-[11px] text-slate-500 tabular-nums whitespace-nowrap">建议时长 {cur.durationHint}</span>
</div> </div>
<MD text={cur.markdown} /> <MD text={cur.markdown} />
<div className="mt-3 flex items-center justify-between pt-2 border-t border-teal-100"> <div className="mt-3 flex items-center justify-between pt-2 border-t border-teal-100">
......
...@@ -21,8 +21,8 @@ import type { ScriptSection } from './mock-data'; ...@@ -21,8 +21,8 @@ import type { ScriptSection } from './mock-data';
*/ */
interface ServerSection { interface ServerSection {
// B 方案:4 段对齐前端 mock(opening / followup / objection / close) // 2026-06 重构:4 模块(开场白 / 告知应治未治 / 复查建议 / 结束回访语)
id: 'opening' | 'followup' | 'objection' | 'close'; id: 'opening' | 'informMissed' | 'reviewAdvice' | 'closing';
label: string; label: string;
durationHint: string; durationHint: string;
markdown: string; markdown: string;
...@@ -52,18 +52,19 @@ export interface UseScriptStream { ...@@ -52,18 +52,19 @@ export interface UseScriptStream {
reset: () => void; reset: () => void;
} }
// B 方案(2026-05-24):后端 4 段对齐 mockScript — opening / followup / objection / close // 2026-06 重构:4 模块 — opening / informMissed / reviewAdvice / closing
const LABEL_FALLBACK: Record<ServerSection['id'], string> = { const LABEL_FALLBACK: Record<ServerSection['id'], string> = {
opening: '开场', opening: '开场',
followup: '切入话题', informMissed: '告知应治未治',
objection: '异议处理', reviewAdvice: '复查建议',
close: '结束 · 信息确认', closing: '结束回访语',
}; };
// 时长无意义,统一空串(UI 不再展示建议时长)
const DURATION_FALLBACK: Record<ServerSection['id'], string> = { const DURATION_FALLBACK: Record<ServerSection['id'], string> = {
opening: '30 秒', opening: '',
followup: '1–2 分钟', informMissed: '',
objection: '按需', reviewAdvice: '',
close: '30 秒', closing: '',
}; };
export function useScriptStream(): UseScriptStream { export function useScriptStream(): UseScriptStream {
...@@ -249,7 +250,7 @@ function parseSseFrame(frame: string): SseEvent | null { ...@@ -249,7 +250,7 @@ function parseSseFrame(frame: string): SseEvent | null {
} }
function makeEmptySections(): ScriptSection[] { function makeEmptySections(): ScriptSection[] {
return (['opening', 'followup', 'objection', 'close'] as const).map((id) => ({ return (['opening', 'informMissed', 'reviewAdvice', 'closing'] as const).map((id) => ({
id, id,
label: LABEL_FALLBACK[id], label: LABEL_FALLBACK[id],
durationHint: DURATION_FALLBACK[id], durationHint: DURATION_FALLBACK[id],
......
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