Demo:导出图片支持选择是否显示完整背景图片

This commit is contained in:
wanglin2 2025-04-06 17:08:57 +08:00
parent f9eff11a27
commit 08df73aec4
4 changed files with 22 additions and 6 deletions

View File

@ -171,7 +171,8 @@ export default {
addFooterTextPlaceholder: 'For example: From simple-mind-map', addFooterTextPlaceholder: 'For example: From simple-mind-map',
addFooterText: 'Add text at the footer', addFooterText: 'Add text at the footer',
desc: 'Desc', desc: 'Desc',
options: 'Options' options: 'Options',
isFitBg: 'Whether to display the complete background image (effective when a background image is used)'
}, },
fullscreen: { fullscreen: {
fullscreenShow: 'Full screen show', fullscreenShow: 'Full screen show',

View File

@ -166,7 +166,8 @@ export default {
addFooterText: '底部添加文字', addFooterText: '底部添加文字',
addFooterTextPlaceholder: '比如来自simple-mind-map', addFooterTextPlaceholder: '比如来自simple-mind-map',
desc: '说明', desc: '说明',
options: '选项' options: '选项',
isFitBg: '是否显示完整背景图片(使用了背景图片时生效)'
}, },
fullscreen: { fullscreen: {
fullscreenShow: '全屏查看', fullscreenShow: '全屏查看',

View File

@ -167,7 +167,8 @@ export default {
addFooterText: '在底部新增文字', addFooterText: '在底部新增文字',
addFooterTextPlaceholder: '例如:來自 simple-mind-map', addFooterTextPlaceholder: '例如:來自 simple-mind-map',
desc: '說明', desc: '說明',
options: '選項' options: '選項',
isFitBg: '是否顯示完整背景圖片(使用了背景圖片時生效)'
}, },
fullscreen: { fullscreen: {
fullscreenShow: '全螢幕檢視', fullscreenShow: '全螢幕檢視',

View File

@ -100,6 +100,11 @@
>{{ $t('export.isTransparent') }}</el-checkbox >{{ $t('export.isTransparent') }}</el-checkbox
> >
</div> </div>
<div class="valueSubItem">
<el-checkbox v-show="showFitBgOption" v-model="isFitBg">{{
$t('export.isFitBg')
}}</el-checkbox>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -136,7 +141,8 @@ export default {
paddingX: 10, paddingX: 10,
paddingY: 10, paddingY: 10,
extraText: '', extraText: '',
isMobile: isMobile() isMobile: isMobile(),
isFitBg: true
} }
}, },
computed: { computed: {
@ -166,6 +172,10 @@ export default {
return item.type === this.exportType return item.type === this.exportType
}) })
return cur return cur
},
showFitBgOption() {
return ['png', 'pdf'].includes(this.exportType) && !this.isTransparent
} }
}, },
created() { created() {
@ -220,7 +230,9 @@ export default {
this.exportType, this.exportType,
true, true,
this.fileName, this.fileName,
this.isTransparent this.isTransparent,
null,
this.isFitBg
) )
} else if (this.exportType === 'pdf') { } else if (this.exportType === 'pdf') {
this.$bus.$emit( this.$bus.$emit(
@ -228,7 +240,8 @@ export default {
this.exportType, this.exportType,
true, true,
this.fileName, this.fileName,
this.isTransparent this.isTransparent,
this.isFitBg
) )
} else if (this.exportType === 'mm') { } else if (this.exportType === 'mm') {
this.$bus.$emit('export', this.exportType, true, this.fileName, { this.$bus.$emit('export', this.exportType, true, this.fileName, {