@@ -89,7 +89,11 @@ export function ActionSection() {
8989 | 'translate_batch'
9090 | 'evaluate_single'
9191 | 'evaluate_batch'
92- | 'post_edit'
92+ | 'post_edit_single'
93+ | 'post_edit_batch'
94+ | 'signoff_single'
95+ | 'signoff_batch'
96+ | 'complete_batch'
9397 > ( 'idle' ) ;
9498 const { activeDocumentItem, setActiveDocumentItem } = useActiveDocumentItem ( ) ;
9599 const { settings } = useUserSettings ( ) ;
@@ -163,11 +167,20 @@ export function ActionSection() {
163167 toast . error ( '没有激活的文档项,无法进行预翻译' ) ;
164168 return ;
165169 }
166-
170+ let currentItemStatus = activeDocumentItem ?. status ;
171+ // 从 explorerTabs 中查找最新的状态
172+ const tabs = explorerTabs ?. documentTabs ?? [ ] ;
173+ for ( const tab of tabs ) {
174+ const item = ( tab . items ?? [ ] ) . find ( ( it : any ) => it . id === id ) ;
175+ if ( item ) {
176+ currentItemStatus = item . status ;
177+ break ;
178+ }
179+ }
167180 // 检查当前状态是否允许质检(应该在 NOT_STARTED 状态)
168- if ( activeDocumentItem ?. status !== 'NOT_STARTED' ) {
181+ if ( currentItemStatus !== 'NOT_STARTED' ) {
169182 toast . error (
170- `当前分段状态为 ${ activeDocumentItem ?. status || '未知' } ,无法进行预翻译`
183+ `当前分段状态为 ${ currentItemStatus || '未知' } ,无法进行预翻译。仅在未开始阶段允许预翻译 `
171184 ) ;
172185 return ;
173186 }
@@ -424,11 +437,20 @@ export function ActionSection() {
424437 toast . error ( '没有激活的文档项,无法进行质检' ) ;
425438 return ;
426439 }
427-
440+ let currentItemStatus = activeDocumentItem ?. status ;
441+ // 从 explorerTabs 中查找最新的状态
442+ const tabs = explorerTabs ?. documentTabs ?? [ ] ;
443+ for ( const tab of tabs ) {
444+ const item = ( tab . items ?? [ ] ) . find ( ( it : any ) => it . id === id ) ;
445+ if ( item ) {
446+ currentItemStatus = item . status ;
447+ break ;
448+ }
449+ }
428450 // 检查当前状态是否允许质检(应该在 MT_REVIEW 状态)
429- if ( activeDocumentItem ?. status !== 'MT_REVIEW' ) {
451+ if ( currentItemStatus !== 'MT_REVIEW' ) {
430452 toast . error (
431- `当前分段状态为 ${ activeDocumentItem ?. status || '未知' } ,无法进行质检。仅在预翻译复核阶段允许质检`
453+ `当前分段状态为 ${ currentItemStatus || '未知' } ,无法进行质检。仅在预翻译复核阶段允许质检`
432454 ) ;
433455 return ;
434456 }
@@ -717,7 +739,7 @@ export function ActionSection() {
717739 setBatchProgress ( 0 ) ;
718740 setBatchOpen ( true ) ;
719741 setIsRunning ( true ) ;
720- setCurrentOperation ( 'post_edit ' ) ;
742+ setCurrentOperation ( 'signoff_batch ' ) ;
721743
722744 let done = 0 ;
723745 for ( const it of itemsToSignoff ) {
@@ -921,7 +943,7 @@ export function ActionSection() {
921943
922944 // 3) 标记译后→签发→完成(当前页签)- 只处理需要推进的分段
923945 setProgressTitle ( '批量完成中' ) ;
924- setCurrentOperation ( 'post_edit ' ) ;
946+ setCurrentOperation ( 'complete_batch ' ) ;
925947 let done = 0 ;
926948
927949 for ( const it of itemsToProcess ) {
@@ -1231,7 +1253,9 @@ export function ActionSection() {
12311253 progressPercent = { batchProgress }
12321254 />
12331255 < PostEditMenu
1234- isTranslating = { isRunning && currentOperation === 'post_edit' }
1256+ isTranslating = { isRunning &&
1257+ ( currentOperation === 'post_edit_single' ||
1258+ currentOperation === 'post_edit_batch' ) }
12351259 // 修复:只允许 QA_REVIEW 状态的分段进入译后编辑
12361260 canEnter = { ( explorerTabs ?. documentTabs ?? [ ] )
12371261 . flatMap ( t => t . items ?? [ ] )
@@ -1262,12 +1286,12 @@ export function ActionSection() {
12621286 }
12631287 if ( currentItemStatus !== 'QA_REVIEW' ) {
12641288 toast . error (
1265- `当前分段状态为 ${ currentItemStatus || '未知' } ,无法进入译后编辑。需要质检复核通过状态 `
1289+ `当前分段状态为 ${ currentItemStatus || '未知' } ,无法进入译后编辑。仅质检复核通过状态可以进行译后编辑 `
12661290 ) ;
12671291 return ;
12681292 }
12691293
1270- setCurrentOperation ( 'post_edit ' ) ;
1294+ setCurrentOperation ( 'post_edit_single ' ) ;
12711295 setIsRunning ( true ) ;
12721296
12731297 try {
@@ -1319,7 +1343,7 @@ export function ActionSection() {
13191343 }
13201344
13211345 setIsRunning ( true ) ;
1322- setCurrentOperation ( 'post_edit ' ) ;
1346+ setCurrentOperation ( 'post_edit_batch ' ) ;
13231347 setProgressTitle ( '批量译后编辑中' ) ;
13241348 setBatchProgress ( 0 ) ;
13251349 setBatchOpen ( true ) ;
@@ -1385,8 +1409,25 @@ export function ActionSection() {
13851409 try {
13861410 const id = ( activeDocumentItem as any ) ?. id ;
13871411 if ( ! id ) return ;
1412+ // 检查当前分段状态是否为 POST_EDIT_REVIEW
1413+ let currentItemStatus = activeDocumentItem ?. status ;
1414+ // 从 explorerTabs 中查找最新的状态
1415+ const tabs = explorerTabs ?. documentTabs ?? [ ] ;
1416+ for ( const tab of tabs ) {
1417+ const item = ( tab . items ?? [ ] ) . find ( ( it : any ) => it . id === id ) ;
1418+ if ( item ) {
1419+ currentItemStatus = item . status ;
1420+ break ;
1421+ }
1422+ }
1423+ if ( currentItemStatus !== 'POST_EDIT_REVIEW' ) {
1424+ toast . error (
1425+ `当前分段状态为 ${ currentItemStatus || '未知' } ,无法签发。仅译后编辑复核状态可以进行签发`
1426+ ) ;
1427+ return ;
1428+ }
13881429 setIsRunning ( true ) ;
1389- setCurrentOperation ( 'post_edit ' ) ;
1430+ setCurrentOperation ( 'signoff_single ' ) ;
13901431 try {
13911432 await updateDocItemStatusAction ( id , 'SIGN_OFF' ) ;
13921433 // 只记录 SIGN_OFF 事件,COMPLETED 事件应该在后续流程中记录
@@ -1429,7 +1470,7 @@ export function ActionSection() {
14291470 setBatchProgress ( 0 ) ;
14301471 setBatchOpen ( true ) ;
14311472 setIsRunning ( true ) ;
1432- setCurrentOperation ( 'post_edit ' ) ;
1473+ setCurrentOperation ( 'signoff_batch ' ) ;
14331474
14341475 let done = 0 ;
14351476 const total = items . length ;
0 commit comments