From 0847e5e15a9db2793840beaab6a84ffd1319f795 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 27 Apr 2022 19:37:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=89=8D=E7=AB=AF=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/index.vue | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 474aa993ea..8f6a94c459 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -499,19 +499,22 @@ function movePlayer(item, position) { } function removeItem(index) { - const vm = this - const item = this.yourList[index] - removeItemFromPositionBox(item) + try { + const vm = this + const item = this.yourList[index] + removeItemFromPositionBox(item) - const belowItems = findBelowItems.call(this, item) - _.forEach(belowItems, function(upItem) { - const canGoUpRows = canItemGoUp(upItem) - if (canGoUpRows > 0) { - moveItemUp.call(vm, upItem, canGoUpRows) - } - }) - - this.yourList.splice(index, 1, {}) + const belowItems = findBelowItems.call(this, item) + _.forEach(belowItems, function(upItem) { + const canGoUpRows = canItemGoUp(upItem) + if (canGoUpRows > 0) { + moveItemUp.call(vm, upItem, canGoUpRows) + } + }) + this.yourList.splice(index, 1, {}) + } catch (e) { + console.log('removeItem have some ignore error') + } } // 矩阵设计初始化的时候 预占位,防止编辑仪表板页面,初始化和视图编辑返回时出现组件位置变化问题