From 0824602ad2dc82e717c461bded5717856ebd72b3 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Tue, 31 May 2022 21:42:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(stage):=20=E6=B5=81=E5=BC=8F=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E4=B8=8B=EF=BC=8C=E9=95=9C=E5=83=8F=E8=8A=82=E7=82=B9?= =?UTF-8?q?zindex=E5=BA=94=E8=AF=A5=E6=AF=94=E9=80=89=E4=B8=AD=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/stage/src/StageDragResize.ts | 6 +++--- packages/stage/src/const.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/stage/src/StageDragResize.ts b/packages/stage/src/StageDragResize.ts index 4289ac07..95307aae 100644 --- a/packages/stage/src/StageDragResize.ts +++ b/packages/stage/src/StageDragResize.ts @@ -23,7 +23,7 @@ import type { MoveableOptions } from 'moveable'; import Moveable from 'moveable'; import MoveableHelper from 'moveable-helper'; -import { DRAG_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, Mode } from './const'; +import { DRAG_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, Mode, ZIndex } from './const'; import StageCore from './StageCore'; import type { Offset, SortEventData, StageDragResizeConfig } from './types'; import { getAbsolutePosition, getGuideLineFromCache, getMode, getOffset } from './util'; @@ -354,7 +354,7 @@ export default class StageDragResize extends EventEmitter { const ghostEl = el.cloneNode(true) as HTMLElement; const { top, left } = getAbsolutePosition(el, getOffset(el)); ghostEl.id = `${GHOST_EL_ID_PREFIX}${el.id}`; - ghostEl.style.zIndex = '5'; + ghostEl.style.zIndex = ZIndex.GHOST_EL; ghostEl.style.opacity = '.5'; ghostEl.style.position = 'absolute'; ghostEl.style.left = `${left}px`; @@ -378,7 +378,7 @@ export default class StageDragResize extends EventEmitter { top: ${offset.top}px; width: ${width}px; height: ${height}px; - z-index: 9; + z-index: ${ZIndex.DRAG_EL}; `; this.dragEl.id = `${DRAG_EL_ID_PREFIX}${el.id}`; diff --git a/packages/stage/src/const.ts b/packages/stage/src/const.ts index 99dac45c..fce7fba2 100644 --- a/packages/stage/src/const.ts +++ b/packages/stage/src/const.ts @@ -42,6 +42,8 @@ export enum ZIndex { MASK = '99999', /** 选中的节点 */ SELECTED_EL = '666', + GHOST_EL = '700', + DRAG_EL = '9', } /** 鼠标按键 */