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