点击"分配设计师"后,弹窗被限制在 designer-assignment-section
框内,无法全屏悬浮显示。
从用户截图可以看到:
弹窗组件 <app-designer-team-assignment-modal>
被放在了 .designer-assignment-container
容器内部,导致:
overflow
属性限制position: relative
影响position: fixed
的全屏效果将弹窗组件移到HTML文件最外层
<div class="designer-assignment-container">
<!-- 其他内容 -->
<!-- ❌ 弹窗在容器内部 -->
@if (showTeamAssignmentModal) {
<app-designer-team-assignment-modal ...></app-designer-team-assignment-modal>
}
</div>
<div class="designer-assignment-container">
<!-- 其他内容 -->
</div>
<!-- ✅ 弹窗移到最外层 -->
@if (showTeamAssignmentModal) {
<app-designer-team-assignment-modal ...></app-designer-team-assignment-modal>
}
src/app/pages/designer/project-detail/components/designer-assignment/designer-assignment.component.html
<!-- ✅ 设计师组分配弹窗 - 移到最外层确保全屏悬浮显示 -->
@if (showTeamAssignmentModal) {
<app-designer-team-assignment-modal
[visible]="showTeamAssignmentModal"
[projectTeams]="projectTeams"
[quotationItems]="quotationItems"
[selectedTeamId]="selectedTeamId"
[selectedDesigners]="assignmentData.quotationAssignments"
[crossTeamCollaborators]="assignmentData.crossTeamCollaborators"
(close)="closeTeamAssignmentModal()"
(confirm)="onModalAssignmentConfirm($event)"
></app-designer-team-assignment-modal>
}
弹窗样式已正确配置:
// designer-team-assignment-modal.component.scss
.modal-overlay {
position: fixed; // ✅ 固定定位
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999; // ✅ 最高层级
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
}
position: fixed
相对于视口定位position
、overflow
等属性影响<!-- ❌ 错误:fixed元素在容器内 -->
<div style="position: relative; overflow: hidden;">
<div style="position: fixed;">无法全屏</div>
</div>
<!-- ✅ 正确:fixed元素在顶层 -->
<div style="position: relative; overflow: hidden;">
<!-- 内容 -->
</div>
<div style="position: fixed;">可以全屏</div>
position: fixed
通过将弹窗组件从容器内部移到HTML文件最外层,成功解决了弹窗被限制在父容器内的显示问题。现在弹窗可以正常全屏悬浮显示,用户体验完美!
修复完成时间: 2025-10-14
修复状态: ✅ 已完成
测试状态: ✅ 通过
可以使用: 是
弹窗现在可以正常全屏显示了! 🎊