From a6a890362e14ed4d3e4f71726fe0e0ddbdbdff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Thu, 1 Aug 2024 10:36:03 +0800 Subject: [PATCH] =?UTF-8?q?Dmoe=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=A4=A7?= =?UTF-8?q?=E7=BA=B2=E9=87=8C=E7=82=B9=E5=87=BB=E8=8A=82=E7=82=B9=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=8B=96=E6=8B=BD=E4=BC=9A=E8=A7=A6=E5=8F=91=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=96=87=E4=BB=B6=E6=8B=96=E6=8B=BD=E8=92=99?= =?UTF-8?q?=E5=B1=82=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/Edit/components/Edit.vue | 5 ++++- web/src/pages/Edit/components/Outline.vue | 14 +++++++++++++- web/src/store.js | 8 +++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index db0d3994..f3a82e1b 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -192,7 +192,8 @@ export default { state.localConfig.useLeftKeySelectionRightKeyDrag, isUseHandDrawnLikeStyle: state => state.localConfig.isUseHandDrawnLikeStyle, - extraTextOnExport: state => state.extraTextOnExport + extraTextOnExport: state => state.extraTextOnExport, + isDragOutlineTreeNode: state => state.isDragOutlineTreeNode }) }, watch: { @@ -857,6 +858,7 @@ export default { // 拖拽文件到页面导入 onDragenter() { + if (this.isDragOutlineTreeNode) return this.showDragMask = true }, onDragleave() { @@ -866,6 +868,7 @@ export default { this.showDragMask = false const dt = e.dataTransfer const file = dt.files && dt.files[0] + if (!file) return this.$bus.$emit('importFile', file) } } diff --git a/web/src/pages/Edit/components/Outline.vue b/web/src/pages/Edit/components/Outline.vue index 279a27c5..c660d9af 100644 --- a/web/src/pages/Edit/components/Outline.vue +++ b/web/src/pages/Edit/components/Outline.vue @@ -12,6 +12,8 @@ :expand-on-click-node="false" :allow-drag="checkAllowDrag" @node-drop="onNodeDrop" + @node-drag-start="onNodeDragStart" + @node-drag-end="onNodeDragEnd" @current-change="onCurrentChange" @mouseenter.native="isInTreArea = true" @mouseleave.native="isInTreArea = false" @@ -37,7 +39,7 @@