Demo:增加是否允许拖拽文件进行导入的设置
This commit is contained in:
parent
b5209118b5
commit
01d332009c
@ -82,7 +82,8 @@ export default {
|
|||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
changeRichTextTip: 'This operation will clear all historical modification records and modify the mind map data. Do you want to continue?',
|
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?',
|
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: {
|
color: {
|
||||||
moreColor: 'More color'
|
moreColor: 'More color'
|
||||||
|
|||||||
@ -80,7 +80,8 @@ export default {
|
|||||||
cancel: '取消',
|
cancel: '取消',
|
||||||
changeRichTextTip: '该操作会清空所有历史修改记录,并且修改思维导图数据,是否继续?',
|
changeRichTextTip: '该操作会清空所有历史修改记录,并且修改思维导图数据,是否继续?',
|
||||||
changeRichTextTip2: '是否切换为富文本模式?',
|
changeRichTextTip2: '是否切换为富文本模式?',
|
||||||
changeRichTextTip3: '是否切换为非富文本模式?'
|
changeRichTextTip3: '是否切换为非富文本模式?',
|
||||||
|
enableDragImport: '是否允许直接拖拽文件到页面进行导入'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
moreColor: '更多颜色'
|
moreColor: '更多颜色'
|
||||||
|
|||||||
@ -81,7 +81,8 @@ export default {
|
|||||||
cancel: '取消',
|
cancel: '取消',
|
||||||
changeRichTextTip: '該操作會清空所有曆史修改記錄,並且修改思維導圖數據,是否繼續?',
|
changeRichTextTip: '該操作會清空所有曆史修改記錄,並且修改思維導圖數據,是否繼續?',
|
||||||
changeRichTextTip2: '是否切換爲富文本模式?',
|
changeRichTextTip2: '是否切換爲富文本模式?',
|
||||||
changeRichTextTip3: '是否切換爲非富文本模式?'
|
changeRichTextTip3: '是否切換爲非富文本模式?',
|
||||||
|
enableDragImport: '是否允許直接拖拽文件到頁面進行導入'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
moreColor: '更多顏色'
|
moreColor: '更多顏色'
|
||||||
|
|||||||
@ -197,6 +197,7 @@ export default {
|
|||||||
isZenMode: state => state.localConfig.isZenMode,
|
isZenMode: state => state.localConfig.isZenMode,
|
||||||
openNodeRichText: state => state.localConfig.openNodeRichText,
|
openNodeRichText: state => state.localConfig.openNodeRichText,
|
||||||
isShowScrollbar: state => state.localConfig.isShowScrollbar,
|
isShowScrollbar: state => state.localConfig.isShowScrollbar,
|
||||||
|
enableDragImport: state => state.localConfig.enableDragImport,
|
||||||
useLeftKeySelectionRightKeyDrag: state =>
|
useLeftKeySelectionRightKeyDrag: state =>
|
||||||
state.localConfig.useLeftKeySelectionRightKeyDrag,
|
state.localConfig.useLeftKeySelectionRightKeyDrag,
|
||||||
isUseHandDrawnLikeStyle: state =>
|
isUseHandDrawnLikeStyle: state =>
|
||||||
@ -430,7 +431,7 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// createNodePrefixContent: (node) => {
|
// createNodePrefixContent: node => {
|
||||||
// const el = document.createElement('div')
|
// const el = document.createElement('div')
|
||||||
// el.style.width = '50px'
|
// el.style.width = '50px'
|
||||||
// el.style.height = '50px'
|
// el.style.height = '50px'
|
||||||
@ -889,13 +890,14 @@ export default {
|
|||||||
|
|
||||||
// 拖拽文件到页面导入
|
// 拖拽文件到页面导入
|
||||||
onDragenter() {
|
onDragenter() {
|
||||||
if (this.isDragOutlineTreeNode) return
|
if (!this.enableDragImport || this.isDragOutlineTreeNode) return
|
||||||
this.showDragMask = true
|
this.showDragMask = true
|
||||||
},
|
},
|
||||||
onDragleave() {
|
onDragleave() {
|
||||||
this.showDragMask = false
|
this.showDragMask = false
|
||||||
},
|
},
|
||||||
onDrop(e) {
|
onDrop(e) {
|
||||||
|
if (!this.enableDragImport) return
|
||||||
this.showDragMask = false
|
this.showDragMask = false
|
||||||
const dt = e.dataTransfer
|
const dt = e.dataTransfer
|
||||||
const file = dt.files && dt.files[0]
|
const file = dt.files && dt.files[0]
|
||||||
|
|||||||
@ -221,6 +221,16 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</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="row" v-if="supportHandDrawnLikeStyle">
|
||||||
<div class="rowItem">
|
<div class="rowItem">
|
||||||
@ -392,7 +402,8 @@ export default {
|
|||||||
enableNodeRichText: true,
|
enableNodeRichText: true,
|
||||||
localConfigs: {
|
localConfigs: {
|
||||||
isShowScrollbar: false,
|
isShowScrollbar: false,
|
||||||
isUseHandDrawnLikeStyle: false
|
isUseHandDrawnLikeStyle: false,
|
||||||
|
enableDragImport: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -437,7 +448,7 @@ export default {
|
|||||||
this.enableNodeRichText = this.localConfig.openNodeRichText
|
this.enableNodeRichText = this.localConfig.openNodeRichText
|
||||||
this.mousewheelAction = this.localConfig.mousewheelAction
|
this.mousewheelAction = this.localConfig.mousewheelAction
|
||||||
this.mousewheelZoomActionReverse = this.localConfig.mousewheelZoomActionReverse
|
this.mousewheelZoomActionReverse = this.localConfig.mousewheelZoomActionReverse
|
||||||
;['isShowScrollbar', 'isUseHandDrawnLikeStyle'].forEach(key => {
|
Object.keys(this.localConfigs).forEach(key => {
|
||||||
this.localConfigs[key] = this.localConfig[key]
|
this.localConfigs[key] = this.localConfig[key]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user