Demo:支持设置是否开启演示模式的填空功能

This commit is contained in:
wanglin2
2025-04-13 13:42:18 +08:00
parent b79076baa3
commit 896121f6b6
5 changed files with 48 additions and 6 deletions

View File

@@ -64,6 +64,7 @@ export default {
isShowScrollbar: 'Is show scrollbar', isShowScrollbar: 'Is show scrollbar',
isUseHandDrawnLikeStyle: 'Is use hand drawn like style', isUseHandDrawnLikeStyle: 'Is use hand drawn like style',
isUseMomentum: 'Is open drag momentum', isUseMomentum: 'Is open drag momentum',
openBlankMode: 'Is open blank mode of the demonstrate',
watermark: 'Watermark', watermark: 'Watermark',
showWatermark: 'Is show watermark', showWatermark: 'Is show watermark',
onlyExport: 'Only export', onlyExport: 'Only export',

View File

@@ -62,6 +62,7 @@ export default {
isShowScrollbar: '是否显示滚动条', isShowScrollbar: '是否显示滚动条',
isUseHandDrawnLikeStyle: '是否开启手绘风格', isUseHandDrawnLikeStyle: '是否开启手绘风格',
isUseMomentum: '是否开启拖动画布的动量效果', isUseMomentum: '是否开启拖动画布的动量效果',
openBlankMode: '是否开启演示模式的填空功能',
watermark: '水印', watermark: '水印',
showWatermark: '是否显示水印', showWatermark: '是否显示水印',
watermarkDefaultText: '水印文字', watermarkDefaultText: '水印文字',

View File

@@ -63,6 +63,7 @@ export default {
isShowScrollbar: '顯示捲軸', isShowScrollbar: '顯示捲軸',
isUseHandDrawnLikeStyle: '使用手繪風格', isUseHandDrawnLikeStyle: '使用手繪風格',
isUseMomentum: '是否開啓拖動畫布的動量效果', isUseMomentum: '是否開啓拖動畫布的動量效果',
openBlankMode: '是否開啓演示模式的填空功能',
watermark: '浮水印', watermark: '浮水印',
showWatermark: '顯示浮水印', showWatermark: '顯示浮水印',
onlyExport: '僅在匯出時顯示', onlyExport: '僅在匯出時顯示',

View File

@@ -417,6 +417,9 @@ export default {
}, },
openRealtimeRenderOnNodeTextEdit: true, openRealtimeRenderOnNodeTextEdit: true,
enableAutoEnterTextEditWhenKeydown: true, enableAutoEnterTextEditWhenKeydown: true,
demonstrateConfig: {
openBlankMode: true
},
...(config || {}), ...(config || {}),
iconList: [...icon], iconList: [...icon],
useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag, useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag,

View File

@@ -276,6 +276,20 @@
> >
</div> </div>
</div> </div>
<!-- 是否开启演示模式的填空功能 -->
<div class="row">
<div class="rowItem">
<el-checkbox
v-model="config.demonstrateConfig.openBlankMode"
@change="
value => {
updateOtherConfig('openBlankMode', value)
}
"
>{{ $t('setting.openBlankMode') }}</el-checkbox
>
</div>
</div>
<!-- 配置鼠标滚轮行为 --> <!-- 配置鼠标滚轮行为 -->
<div class="row"> <div class="row">
<div class="rowItem"> <div class="rowItem">
@@ -424,7 +438,10 @@ export default {
enableAutoEnterTextEditWhenKeydown: true, enableAutoEnterTextEditWhenKeydown: true,
imgTextMargin: 0, imgTextMargin: 0,
textContentMargin: 0, textContentMargin: 0,
enableInheritAncestorLineStyle: false enableInheritAncestorLineStyle: false,
demonstrateConfig: {
openBlankMode: false
}
}, },
watermarkConfig: { watermarkConfig: {
show: false, show: false,
@@ -483,7 +500,13 @@ export default {
// 初始化其他配置 // 初始化其他配置
initConfig() { initConfig() {
Object.keys(this.config).forEach(key => { Object.keys(this.config).forEach(key => {
this.config[key] = this.mindMap.getConfig(key) if (typeof this.config[key] === 'object') {
this.config[key] = {
...(this.mindMap.getConfig(key) || {})
}
} else {
this.config[key] = this.mindMap.getConfig(key)
}
}) })
}, },
@@ -511,10 +534,23 @@ export default {
// 更新其他配置 // 更新其他配置
updateOtherConfig(key, value) { updateOtherConfig(key, value) {
this.mindMap.updateConfig({ if (key === 'openBlankMode') {
[key]: value this.mindMap.updateConfig({
}) demonstrateConfig: {
this.configData[key] = value ...(this.mindMap.getConfig('demonstrateConfig') || {}),
openBlankMode: value
}
})
if (!this.configData.demonstrateConfig) {
this.configData.demonstrateConfig = {}
}
this.configData.demonstrateConfig[key] = value
} else {
this.mindMap.updateConfig({
[key]: value
})
this.configData[key] = value
}
storeConfig(this.configData) storeConfig(this.configData)
if ( if (
[ [