解决图标容器组件拖拽图标时, 图标层级不足的bug

This commit is contained in:
luojiahao 2022-11-30 14:07:24 +08:00
parent 6158dc3e63
commit 3a114923dc
2 changed files with 17 additions and 8 deletions

View File

@ -59,6 +59,10 @@ export default css`
will-change: transform;
}
::slotted(.container-master.selected) {
order: 10 !important;
}
::slotted(.container-master) {
opacity: 1;
transform: opacity 0.15s;

View File

@ -1354,6 +1354,7 @@ export class GaiaContainer extends StarBaseElement {
if (this._dnd.active && this._dnd.child) {
this._dnd.child.container.classList.remove('dragging')
this._dnd.child.master.classList.remove('selected')
this._dnd.child.container.style.position = 'absolute'
this._dnd.child.container.style.setProperty(
'top',
@ -1425,6 +1426,7 @@ export class GaiaContainer extends StarBaseElement {
this._dnd.active = true
child.container.classList.add('dragging')
child.master.classList.add('selected')
// this._dnd.child.isStatic = false
// this._dnd.child.container.style.position = "fixed";
// let rect = this.getBoundingClientRect()
@ -1831,14 +1833,14 @@ export class GaiaContainer extends StarBaseElement {
dragIn(
mode: 'delay' | 'immediately' = 'delay',
dragInfo?: {
element: HTMLElement
centerX: number
centerY: number
row: number
column: number
gridHeight: number
gridWidth: number
isWidget?: boolean
element: HTMLElement // 要拖拽进入的节点
centerX: number // 节点中心点距离 该容器组件中首页 的上边缘距离
centerY: number // 节点中心点距离 该容器组件中首页 的左边缘距离
row: number // 节点占据的行数
column: number // 节点占据的列数
gridHeight: number // 节点高
gridWidth: number // 节点宽
isWidget?: boolean // 节点是否为小组件
}
) {
this.dragInType = DragInType.PAGES
@ -1863,6 +1865,7 @@ export class GaiaContainer extends StarBaseElement {
page.appendChild(this._dnd.child.master)
this._children.add(this._dnd.child)
this._dnd.child.container.classList.add('dragging')
this._dnd.child.master.classList.add('selected')
}
let containerX =
centerX - (dragInfo?.gridWidth || this.gridWidth) / 2 - this.left
@ -2320,6 +2323,7 @@ export class GaiaContainer extends StarBaseElement {
) {
// 松手了被提出去的子节点还没有进入文件夹, 则需要将子节点与 switchDom 进行交换
this._suspendChild.container.classList.remove('dragging')
this._suspendChild.master.classList.remove('selected')
this._suspendChild
.synchroniseWithRefElement(
this.switchDom.master,
@ -2350,6 +2354,7 @@ export class GaiaContainer extends StarBaseElement {
})
this._suspendChild.container.classList.remove('dragging')
this._suspendChild.master.classList.remove('selected')
}
}