fix: Bug详情图片放大关闭不影响抽屉 + 仅修复人可操作

1. Lightbox 点击关闭时 stopPropagation,不会冒泡关闭 drawer
   - 点击背景关闭图片
   - 新增右上角 X 关闭按钮
   - 点击图片本身不触发关闭

2. 仅当前修复人(assigneeId)可操作 Bug:
   - 只有当前用户 === bug.assigneeId 时显示状态流转按钮和转交按钮
   - 其他人查看时显示提示"仅修复人可操作"

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Script Generator
2026-06-15 13:45:08 +08:00
parent 273182bb0f
commit 101a6be9b7

View File

@@ -103,7 +103,7 @@ export function BugDetailDrawer({ bugId, onClose }: Props) {
<span className="text-[11px] text-[var(--ink-muted)]">{bug.priority}</span> <span className="text-[11px] text-[var(--ink-muted)]">{bug.priority}</span>
</div> </div>
{nextStatuses.length > 0 && !showResolutionInput && ( {nextStatuses.length > 0 && !showResolutionInput && operator === bug.assigneeId && (
<div className="flex items-center gap-2 pt-1 flex-wrap"> <div className="flex items-center gap-2 pt-1 flex-wrap">
<ChevronRight className="h-3.5 w-3.5 text-[var(--ink-muted)]" /> <ChevronRight className="h-3.5 w-3.5 text-[var(--ink-muted)]" />
{nextStatuses.map((s) => ( {nextStatuses.map((s) => (
@@ -118,6 +118,9 @@ export function BugDetailDrawer({ bugId, onClose }: Props) {
)} )}
</div> </div>
)} )}
{nextStatuses.length > 0 && !showResolutionInput && operator !== bug.assigneeId && (
<div className="text-[11px] text-[var(--ink-muted)] pt-1"> {bug.assigneeId}</div>
)}
{showResolutionInput && ( {showResolutionInput && (
<div className="space-y-2 pt-1"> <div className="space-y-2 pt-1">
@@ -209,8 +212,11 @@ export function BugDetailDrawer({ bugId, onClose }: Props) {
{/* Lightbox */} {/* Lightbox */}
{lightboxSrc && ( {lightboxSrc && (
<div className="fixed inset-0 z-[70] flex items-center justify-center bg-black/70" onClick={() => setLightboxSrc(null)}> <div className="fixed inset-0 z-[70] flex items-center justify-center bg-black/70" onClick={(e) => { e.stopPropagation(); setLightboxSrc(null); }}>
<img src={lightboxSrc} alt="大图预览" className="max-h-[85vh] max-w-[85vw] rounded-lg shadow-2xl" /> <img src={lightboxSrc} alt="大图预览" className="max-h-[85vh] max-w-[85vw] rounded-lg shadow-2xl" onClick={(e) => e.stopPropagation()} />
<button onClick={(e) => { e.stopPropagation(); setLightboxSrc(null); }} className="absolute top-4 right-4 h-8 w-8 flex items-center justify-center rounded-full bg-white/20 hover:bg-white/40 text-white">
<X className="h-5 w-5" />
</button>
</div> </div>
)} )}
</div> </div>