Demo:增加是否允许拖拽文件进行导入的设置

This commit is contained in:
街角小林 2025-01-22 18:53:52 +08:00
parent b5209118b5
commit 01d332009c
5 changed files with 23 additions and 7 deletions

View File

@ -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'

View File

@ -80,7 +80,8 @@ export default {
cancel: '取消',
changeRichTextTip: '该操作会清空所有历史修改记录,并且修改思维导图数据,是否继续?',
changeRichTextTip2: '是否切换为富文本模式?',
changeRichTextTip3: '是否切换为非富文本模式?'
changeRichTextTip3: '是否切换为非富文本模式?',
enableDragImport: '是否允许直接拖拽文件到页面进行导入'
},
color: {
moreColor: '更多颜色'

View File

@ -81,7 +81,8 @@ export default {
cancel: '取消',
changeRichTextTip: '該操作會清空所有曆史修改記錄,並且修改思維導圖數據,是否繼續?',
changeRichTextTip2: '是否切換爲富文本模式?',
changeRichTextTip3: '是否切換爲非富文本模式?'
changeRichTextTip3: '是否切換爲非富文本模式?',
enableDragImport: '是否允許直接拖拽文件到頁面進行導入'
},
color: {
moreColor: '更多顏色'

View File

@ -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]

View File

@ -221,6 +221,16 @@
>
</div>
</div>
<!-- 是否开启文件拖入页面导入的方式 -->
<div class="row">
<div class="rowItem">
<el-checkbox
v-model="localConfigs.enableDragImport"
@change="updateLocalConfig('enableDragImport', $event)"
>{{ $t('setting.enableDragImport') }}</el-checkbox
>
</div>
</div>
<!-- 是否开启手绘风格 -->
<div class="row" v-if="supportHandDrawnLikeStyle">
<div class="rowItem">
@ -392,7 +402,8 @@ export default {
enableNodeRichText: true,
localConfigs: {
isShowScrollbar: false,
isUseHandDrawnLikeStyle: false
isUseHandDrawnLikeStyle: false,
enableDragImport: false
}
}
},
@ -437,7 +448,7 @@ export default {
this.enableNodeRichText = this.localConfig.openNodeRichText
this.mousewheelAction = this.localConfig.mousewheelAction
this.mousewheelZoomActionReverse = this.localConfig.mousewheelZoomActionReverse
;['isShowScrollbar', 'isUseHandDrawnLikeStyle'].forEach(key => {
Object.keys(this.localConfigs).forEach(key => {
this.localConfigs[key] = this.localConfig[key]
})
},