From 02bcadae107276506805355a01b48684c39c636b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 29 Nov 2021 19:18:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=BF=87=E6=BB=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=B7=E5=BC=8F=E8=BE=B9=E7=95=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/index.vue | 4 +- .../components/Editor/ComponentWrapper.vue | 2 +- .../canvas/components/Editor/index.vue | 55 +++++------------ .../canvas/custom-component/DeVideo.vue | 2 +- .../src/components/dataease/DeOutWidget.vue | 60 +++++++++---------- frontend/src/views/chart/group/Group.vue | 4 +- frontend/src/views/panel/edit/index.vue | 11 ++-- .../src/views/panel/filter/filterDialog.vue | 1 + .../src/views/panel/list/PanelViewShow.vue | 2 +- 9 files changed, 56 insertions(+), 85 deletions(-) diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index 20dd0b5074..3991959526 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -30,7 +30,7 @@ :style="mainSlotStyle" > - +
= vm.yourList.length) { @@ -470,6 +471,15 @@ function removeItem(index) { this.yourList.splice(index, 1, {}) } +function initPosition(_this) { + _this.yourList.forEach(item => { + checkItemPosition.call(_this, item, { + x: item.x, + y: item.y + }) + }) +} + function addItem(item, index) { // console.log('addItem') if (index < 0) { @@ -807,7 +817,7 @@ export default { }, data() { return { - psDebug: false, // 定位调试模式 + psDebug: true, // 定位调试模式 editorX: 0, editorY: 0, start: { // 选中区域的起点 @@ -995,41 +1005,6 @@ export default { e.preventDefault() } this.hideArea() - // 获取编辑器的位移信息,每次点击时都需要获取一次。主要是为了方便开发时调试用。 - const rectInfo = this.editor.getBoundingClientRect() - this.editorX = rectInfo.x - this.editorY = rectInfo.y - - const startX = e.clientX - const startY = e.clientY - this.start.x = startX - this.editorX - this.start.y = startY - this.editorY - // 展示选中区域 - this.isShowArea = true - - const move = (moveEvent) => { - this.width = Math.abs(moveEvent.clientX - startX) - this.height = Math.abs(moveEvent.clientY - startY) - if (moveEvent.clientX < startX) { - this.start.x = moveEvent.clientX - this.editorX - } - - if (moveEvent.clientY < startY) { - this.start.y = moveEvent.clientY - this.editorY - } - } - const up = (e) => { - document.removeEventListener('mousemove', move) - document.removeEventListener('mouseup', up) - if (e.clientX === startX && e.clientY === startY) { - this.hideArea() - return - } - this.createGroup() - } - document.addEventListener('mousemove', move) - document.addEventListener('mouseup', up) - // 挤占式画布设计 this.containerMouseDown(e) }, diff --git a/frontend/src/components/canvas/custom-component/DeVideo.vue b/frontend/src/components/canvas/custom-component/DeVideo.vue index 8d6315cf72..19dd595701 100644 --- a/frontend/src/components/canvas/custom-component/DeVideo.vue +++ b/frontend/src/components/canvas/custom-component/DeVideo.vue @@ -66,7 +66,7 @@ export default { return (this.element.optStatus.dragging || this.element.optStatus.resizing) }, curGap() { - return this.canvasStyleData.panel.gap === 'yes' && this.element.auxiliaryMatrix ? this.componentGap : 0 + return this.element.auxiliaryMatrix ? this.componentGap : 0 }, player() { return this.$refs.videoPlayer.player diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index b3057257d0..47316d13da 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -1,31 +1,29 @@