mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
Dmoe:修复大纲里点击节点进行拖拽会触发页面的文件拖拽蒙层的问题
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import {
|
||||
nodeRichTextToTextWithWrap,
|
||||
textToNodeRichTextWithWrap,
|
||||
@@ -91,6 +93,8 @@ export default {
|
||||
this.$bus.$off('hide_text_edit', this.handleHideTextEdit)
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setIsDragOutlineTreeNode']),
|
||||
|
||||
handleHideTextEdit() {
|
||||
if (this.notHandleDataChange) {
|
||||
this.notHandleDataChange = false
|
||||
@@ -281,6 +285,14 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
onNodeDragStart() {
|
||||
this.setIsDragOutlineTreeNode(true)
|
||||
},
|
||||
|
||||
onNodeDragEnd() {
|
||||
this.setIsDragOutlineTreeNode(false)
|
||||
},
|
||||
|
||||
// 拖拽结束事件
|
||||
onNodeDrop(data, target, postion) {
|
||||
this.notHandleDataChange = true
|
||||
|
||||
@@ -29,7 +29,8 @@ const store = new Vuex.Store({
|
||||
isSourceCodeEdit: false, // 是否是源码编辑模式
|
||||
extraTextOnExport: '', // 导出时底部添加的文字
|
||||
supportHandDrawnLikeStyle: false, // 是否支持设置手绘风格
|
||||
supportMark: false // 是否支持标记
|
||||
supportMark: false, // 是否支持标记
|
||||
isDragOutlineTreeNode: false // 当前是否正在拖拽大纲树的节点
|
||||
},
|
||||
mutations: {
|
||||
// 设置思维导图数据
|
||||
@@ -84,6 +85,11 @@ const store = new Vuex.Store({
|
||||
// 设置是否支持标记
|
||||
setSupportMark(state, data) {
|
||||
state.supportMark = data
|
||||
},
|
||||
|
||||
// 设置树节点拖拽
|
||||
setIsDragOutlineTreeNode(state, data) {
|
||||
state.isDragOutlineTreeNode = data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user