diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js index 641e8f14..277a908d 100644 --- a/web/src/lang/en_us.js +++ b/web/src/lang/en_us.js @@ -82,7 +82,8 @@ export default { cancel: 'Cancel', changeRichTextTip: 'This operation will clear all historical modification records and modify the mind map data. Do you want to continue?', changeRichTextTip2: 'Do you want to switch to rich text mode?', - changeRichTextTip3: 'Do you want to switch to non rich text mode?' + changeRichTextTip3: 'Do you want to switch to non rich text mode?', + enableDragImport: 'Is it allowed to directly drag and drop files to the page for import' }, color: { moreColor: 'More color' diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js index 1744cb20..a7cf7615 100644 --- a/web/src/lang/zh_cn.js +++ b/web/src/lang/zh_cn.js @@ -80,7 +80,8 @@ export default { cancel: '取消', changeRichTextTip: '该操作会清空所有历史修改记录,并且修改思维导图数据,是否继续?', changeRichTextTip2: '是否切换为富文本模式?', - changeRichTextTip3: '是否切换为非富文本模式?' + changeRichTextTip3: '是否切换为非富文本模式?', + enableDragImport: '是否允许直接拖拽文件到页面进行导入' }, color: { moreColor: '更多颜色' diff --git a/web/src/lang/zh_tw.js b/web/src/lang/zh_tw.js index 1e1280fb..a966e96d 100644 --- a/web/src/lang/zh_tw.js +++ b/web/src/lang/zh_tw.js @@ -81,7 +81,8 @@ export default { cancel: '取消', changeRichTextTip: '該操作會清空所有曆史修改記錄,並且修改思維導圖數據,是否繼續?', changeRichTextTip2: '是否切換爲富文本模式?', - changeRichTextTip3: '是否切換爲非富文本模式?' + changeRichTextTip3: '是否切換爲非富文本模式?', + enableDragImport: '是否允許直接拖拽文件到頁面進行導入' }, color: { moreColor: '更多顏色' diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index b2e90be0..08098da6 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -197,6 +197,7 @@ export default { isZenMode: state => state.localConfig.isZenMode, openNodeRichText: state => state.localConfig.openNodeRichText, isShowScrollbar: state => state.localConfig.isShowScrollbar, + enableDragImport: state => state.localConfig.enableDragImport, useLeftKeySelectionRightKeyDrag: state => state.localConfig.useLeftKeySelectionRightKeyDrag, isUseHandDrawnLikeStyle: state => @@ -430,7 +431,7 @@ export default { }) }) } - // createNodePrefixContent: (node) => { + // createNodePrefixContent: node => { // const el = document.createElement('div') // el.style.width = '50px' // el.style.height = '50px' @@ -889,13 +890,14 @@ export default { // 拖拽文件到页面导入 onDragenter() { - if (this.isDragOutlineTreeNode) return + if (!this.enableDragImport || this.isDragOutlineTreeNode) return this.showDragMask = true }, onDragleave() { this.showDragMask = false }, onDrop(e) { + if (!this.enableDragImport) return this.showDragMask = false const dt = e.dataTransfer const file = dt.files && dt.files[0] diff --git a/web/src/pages/Edit/components/Setting.vue b/web/src/pages/Edit/components/Setting.vue index 7f8e659e..1cdf88ca 100644 --- a/web/src/pages/Edit/components/Setting.vue +++ b/web/src/pages/Edit/components/Setting.vue @@ -221,6 +221,16 @@ > + +