feat: 说话人修改调整

dev_na
puz 2026-07-08 18:11:25 +08:00
parent e39f1405b3
commit 9e12e03481
1 changed files with 8 additions and 1 deletions

View File

@ -1085,6 +1085,7 @@ const ActiveTranscriptRow = React.memo<ActiveTranscriptRowProps>(({
highlightKeyword = '',
}) => {
const [draftValue, setDraftValue] = useState(item.content);
const [speakerEditorOpen, setSpeakerEditorOpen] = useState(false);
const rowRef = useRef<HTMLDivElement | null>(null);
useEffect(() => {
@ -1102,6 +1103,10 @@ const ActiveTranscriptRow = React.memo<ActiveTranscriptRowProps>(({
}, [isActive, audioPlaying, highlightKeyword, item.content]);
const speakerTagLabel = item.speakerLabel ? (speakerLabelMap.get(item.speakerLabel) || item.speakerLabel) : '';
const handleSpeakerUpdated = () => {
setSpeakerEditorOpen(false);
onSpeakerUpdated();
};
return (
<List.Item
@ -1126,11 +1131,13 @@ const ActiveTranscriptRow = React.memo<ActiveTranscriptRowProps>(({
speakerId={item.speakerId}
initialName={item.speakerName}
initialLabel={item.speakerLabel}
onSuccess={onSpeakerUpdated}
onSuccess={handleSpeakerUpdated}
/>
)}
title="编辑发言人"
trigger="click"
open={speakerEditorOpen}
onOpenChange={setSpeakerEditorOpen}
>
<span className="transcript-speaker editable" onClick={(event) => event.stopPropagation()}>
{item.speakerName || item.speakerId || '发言人'} <EditOutlined style={{ fontSize: 12 }} />