From 570af17d2675662a6da74489ffddae332eea908c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 24 Oct 2022 14:51:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BFTab=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=A7=BB=E5=85=A5=E7=A7=BB=E5=87=BA=E8=87=AA=E7=94=B1=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/index.vue | 26 ++++++++++--------- frontend/src/components/canvas/DeCanvas.vue | 1 - .../canvas/components/Editor/DeEditor.vue | 1 - .../src/components/widget/DeWidget/DeTabs.vue | 8 ------ frontend/src/store/index.js | 2 -- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index 227387ac25..0ecc9460aa 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -434,10 +434,10 @@ export default { } }, computed: { - parentWidthOffset(){ - if(this.canvasId==='canvas-main'){ + parentWidthOffset() { + if (this.canvasId === 'canvas-main') { return 0 - }else{ + } else { return this.parentWidthTabOffset } }, @@ -677,7 +677,9 @@ export default { 'tabMoveInActiveId', 'tabActiveTabNameMap', 'mousePointShadowMap', - 'tabMoveOutComponentId' + 'tabMoveOutComponentId', + 'tabCollisionActiveId', + 'tabMoveInActiveId' ]) }, watch: { @@ -1495,14 +1497,14 @@ export default { const targetCanvasScale = this.curCanvasScaleMap['canvas-main'] // 按照阴影位置定位 this.element.style.left = (this.mousePointShadowMap.mouseX - (this.mousePointShadowMap.width)) / targetCanvasScale.scalePointWidth - this.element.style.top = (this.mousePointShadowMap.mouseY - (this.mousePointShadowMap.height / 2))/ targetCanvasScale.scalePointHeight - this.element.style.width = this.mousePointShadowMap.width/ targetCanvasScale.scalePointWidth - this.element.style.height = this.mousePointShadowMap.height/ targetCanvasScale.scalePointHeight + this.element.style.top = (this.mousePointShadowMap.mouseY - (this.mousePointShadowMap.height / 2)) / targetCanvasScale.scalePointHeight + this.element.style.width = this.mousePointShadowMap.width / targetCanvasScale.scalePointWidth + this.element.style.height = this.mousePointShadowMap.height / targetCanvasScale.scalePointHeight if (this.element.auxiliaryMatrix) { this.element.x = Math.round(this.element.style.left / targetCanvasScale.matrixStyleOriginWidth) + 1 this.element.y = Math.round(this.element.style.top / targetCanvasScale.matrixStyleOriginHeight) + 1 - this.element.sizex = Math.round(this.element.style.width /targetCanvasScale.matrixStyleOriginWidth) + this.element.sizex = Math.round(this.element.style.width / targetCanvasScale.matrixStyleOriginWidth) this.element.sizey = Math.round(this.element.style.height / targetCanvasScale.matrixStyleOriginHeight) this.recordMatrixCurShadowStyle(targetCanvasScale) } @@ -1922,8 +1924,8 @@ export default { const left = this.left const width = this.width const height = this.height - // tab 移入检测开启 - if (this.isTabMoveCheck) { + // tab 移入检测开启 tab组件不能相互移入另一个tab组件 + if (this.isTabMoveCheck && this.element.type !== 'de-tabs') { const nodes = this.$el.parentNode.childNodes // 获取当前父节点下所有子节点 for (const item of nodes) { if ( @@ -1953,7 +1955,7 @@ export default { const brAndBr = (collisionT + collisionH) >= (top + height) && (collisionL + collisionW) >= (left + width) if (tfAndTf && bfAndBf && trAndTr && brAndBr) { this.$store.commit('setTabCollisionActiveId', item.getAttribute('component-id')) - } else { + } else if (this.tabCollisionActiveId === item.getAttribute('component-id')) { this.$store.commit('setTabCollisionActiveId', null) } @@ -1974,7 +1976,7 @@ export default { const activeBrAndBr = (activeT + activeH) >= (top + height) && (activeL + activeW) >= (left + width) if (activeTfAndTf && activeBfAndBf && activeTrAndTr && activeBrAndBr) { this.$store.commit('setTabMoveInActiveId', item.getAttribute('component-id')) - } else { + } else if (this.tabMoveInActiveId === item.getAttribute('component-id')) { this.$store.commit('setTabMoveInActiveId', null) } diff --git a/frontend/src/components/canvas/DeCanvas.vue b/frontend/src/components/canvas/DeCanvas.vue index 30dd77c57e..0b42e9dcc1 100644 --- a/frontend/src/components/canvas/DeCanvas.vue +++ b/frontend/src/components/canvas/DeCanvas.vue @@ -268,7 +268,6 @@ export default { }) }, handleDragOver(e) { - // console.log("handleDragOver-"+this.canvasId) e.preventDefault() e.dataTransfer.dropEffect = 'copy' this.$refs[this.editorRefName].handleDragOver(e) diff --git a/frontend/src/components/canvas/components/Editor/DeEditor.vue b/frontend/src/components/canvas/components/Editor/DeEditor.vue index 04f8c99dec..1a4297e1a7 100644 --- a/frontend/src/components/canvas/components/Editor/DeEditor.vue +++ b/frontend/src/components/canvas/components/Editor/DeEditor.vue @@ -1482,7 +1482,6 @@ export default { } }, handleDragOver(e) { - console.log('handleDragOver--x='+e.pageX+';y='+e.pageY) this.dragComponentInfo.shadowStyle.x = e.pageX - 220 this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index da1c648dc1..0d72f45819 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -45,14 +45,6 @@ {{ $t('detabs.eidttitle') }} - - {{ $t('detabs.selectview') }} - - - - {{ $t('detabs.selectOthers') }} - -