From 2a5c335cddfe5c04c8f9add8fb3ab71fbcaf32c0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Feb 2026 00:37:09 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20=E5=A2=9E=E5=8A=A0=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E7=9A=84=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加按钮点击和API调用的日志 - 添加弹框关闭的日志 - 添加 closeOnMaskClick 和 closeOnAction 配置 Co-Authored-By: Claude Opus 4.6 --- frontend/src/pages/approval/detail.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/approval/detail.tsx b/frontend/src/pages/approval/detail.tsx index 5d8d0f8..9c101d4 100644 --- a/frontend/src/pages/approval/detail.tsx +++ b/frontend/src/pages/approval/detail.tsx @@ -144,6 +144,7 @@ export default function ApprovalDetail() { // 打开审批意见框 const handleApprove = (action: 'approve' | 'reject') => { + console.log('🔘 打开审批弹框:', { action, id }) setActionType(action) setComment('') setCommentVisible(true) @@ -151,24 +152,30 @@ export default function ApprovalDetail() { // 提交审批 const handleConfirmApprove = async () => { + console.log('📝 提交审批:', { actionType, id, comment }) + if (document.activeElement instanceof HTMLElement) { document.activeElement.blur() } try { if (actionType === 'approve') { + console.log('✅ 调用同意API:', { id: Number(id), comment }) await approvalApi.approve(Number(id), comment) Toast.show('已同意') } else if (actionType === 'reject') { + console.log('❌ 调用拒绝API:', { id: Number(id), comment }) await approvalApi.reject(Number(id), comment) Toast.show('已拒绝') } else if (actionType === 'cancel') { + console.log('🔄 调用撤销API:', { id: Number(id) }) await approvalApi.cancel(Number(id)) Toast.show('已撤销') } setCommentVisible(false) loadDetail() } catch (error: any) { + console.error('❌ 审批操作失败:', error) Toast.show(error.message || '操作失败') } } @@ -533,9 +540,17 @@ export default function ApprovalDetail() { /> } + closeOnMaskClick={false} + closeOnAction={false} onConfirm={handleConfirmApprove} - onClose={() => setCommentVisible(false)} - onCancel={() => setCommentVisible(false)} + onClose={() => { + console.log('弹框关闭') + setCommentVisible(false) + }} + onCancel={() => { + console.log('弹框取消') + setCommentVisible(false) + }} confirmText="确认" cancelText="取消" />