Browse Source
fix: fix `LoginExpiredModal` in some cases, `message` may be obscured (#6086)
pull/6093/head
ming4762
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
15 additions and
1 deletions
-
packages/effects/common-ui/src/ui/authentication/login-expired-modal.vue
|
|
|
@ -35,6 +35,16 @@ const getZIndex = computed(() => { |
|
|
|
return props.zIndex || calcZIndex(); |
|
|
|
}); |
|
|
|
|
|
|
|
/** |
|
|
|
* 排除ant-message和loading:9999的z-index |
|
|
|
*/ |
|
|
|
const zIndexExcludeClass = ['ant-message', 'loading']; |
|
|
|
function isZIndexExcludeClass(element: Element) { |
|
|
|
return zIndexExcludeClass.some((className) => |
|
|
|
element.classList.contains(className), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取最大的zIndex值 |
|
|
|
*/ |
|
|
|
@ -44,7 +54,11 @@ function calcZIndex() { |
|
|
|
[...elements].forEach((element) => { |
|
|
|
const style = window.getComputedStyle(element); |
|
|
|
const zIndex = style.getPropertyValue('z-index'); |
|
|
|
if (zIndex && !Number.isNaN(Number.parseInt(zIndex))) { |
|
|
|
if ( |
|
|
|
zIndex && |
|
|
|
!Number.isNaN(Number.parseInt(zIndex)) && |
|
|
|
!isZIndexExcludeClass(element) |
|
|
|
) { |
|
|
|
maxZ = Math.max(maxZ, Number.parseInt(zIndex)); |
|
|
|
} |
|
|
|
}); |
|
|
|
|