From 5f06fc57c848d073ba61867c2915869f1c97957b Mon Sep 17 00:00:00 2001 From: wisonic Date: Tue, 9 Jul 2024 18:25:58 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E8=A7=86=E5=9B=BE):=20=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/editor/index.vue | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index 37786e0e67..9940efe9bf 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -354,9 +354,9 @@ const realQuota = computed(() => { }) provide('quotaData', realQuota) -const startToMove = (e, item) => { +const startToMove = (e: DragEvent, item) => { e.dataTransfer.setData( - 'dimension', + 'fields', JSON.stringify( item .filter(ele => ele.id) @@ -1533,6 +1533,7 @@ const singleDragStart = (e: DragEvent, ele, type) => { if (!activeChild.value.length) { activeChild.value = [ele] } + startToMove(e, unref(activeQuota.value)) } const dragEnd = () => { @@ -1594,16 +1595,6 @@ const deleteChartFieldItem = id => { fieldLoading.value = false }) } - -const callMethod = (method, ...args) => { - editorInstance?.setupState[method](...args) -} - -let editorInstance = null -onMounted(() => { - editorInstance = getCurrentInstance() - console.log(editorInstance) -})