From 468a2ed194591d87485e2d4ad40c6731f706d1bf Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 1 Mar 2022 10:50:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=A7=86=E5=9B=BE=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=A2=9E=E5=8A=A0=E6=A0=A1=E9=AA=8C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/view/ChartEdit.vue | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 818637badb..5b59684eff 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1952,13 +1952,17 @@ export default { } } }, - dragMoveDuplicate(list, e) { - const that = this - const dup = list.filter(function(m) { - return m.id === that.moveId - }) - if (dup && dup.length > 1) { + dragMoveDuplicate(list, e, mode) { + if (mode === 'ds') { list.splice(e.newDraggableIndex, 1) + } else { + const that = this + const dup = list.filter(function(m) { + return m.id === that.moveId + }) + if (dup && dup.length > 1) { + list.splice(e.newDraggableIndex, 1) + } } }, addXaxis(e) { @@ -1998,13 +2002,11 @@ export default { this.calcData(true) }, moveToDimension(e) { - this.dragCheckType(this.dimensionData, 'd') - this.dragMoveDuplicate(this.dimensionData, e) + this.dragMoveDuplicate(this.dimensionData, e, 'ds') this.calcData(true) }, moveToQuota(e) { - this.dragCheckType(this.quotaData, 'q') - this.dragMoveDuplicate(this.quotaData, e) + this.dragMoveDuplicate(this.quotaData, e, 'ds') this.calcData(true) }, addCustomFilter(e) {