Skip to content

Commit

Permalink
Demo:支持配置仅在导出时显示水印
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglin2 committed Dec 25, 2023
1 parent 2bcf763 commit d19fd7e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/src/lang/en_us.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
enableFreeDrag: 'Enable node free drag',
watermark: 'Watermark',
showWatermark: 'Is show watermark',
onlyExport: 'Only export',
watermarkDefaultText: 'Watermark text',
watermarkText: 'Watermark text',
watermarkTextColor: 'Text color',
Expand Down
1 change: 1 addition & 0 deletions web/src/lang/zh_cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default {
watermark: '水印',
showWatermark: '是否显示水印',
watermarkDefaultText: '水印文字',
onlyExport: '是否仅在导出时显示',
watermarkText: '水印文字',
watermarkTextColor: '文字颜色',
watermarkLineSpacing: '水印行间距',
Expand Down
13 changes: 12 additions & 1 deletion web/src/pages/Edit/components/BaseStyle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,16 @@
</div>
</div>
<template v-if="watermarkConfig.show">
<!-- 是否仅在导出时显示 -->
<div class="row">
<div class="rowItem">
<el-checkbox
v-model="watermarkConfig.onlyExport"
@change="updateWatermarkConfig"
>{{ $t('baseStyle.onlyExport') }}</el-checkbox
>
</div>
</div>
<!-- 水印文字 -->
<div class="row">
<div class="rowItem">
Expand Down Expand Up @@ -878,6 +888,7 @@ export default {
},
watermarkConfig: {
show: false,
onlyExport: false,
text: '',
lineSpacing: 100,
textSpacing: 100,
Expand Down Expand Up @@ -1019,7 +1030,7 @@ export default {
// 初始化水印配置
initWatermark() {
let config = this.mindMap.getConfig('watermarkConfig')
;['text', 'lineSpacing', 'textSpacing', 'angle'].forEach(key => {
;['text', 'lineSpacing', 'textSpacing', 'angle', 'onlyExport'].forEach(key => {
this.watermarkConfig[key] = config[key]
})
this.watermarkConfig.show = !!config.text
Expand Down

0 comments on commit d19fd7e

Please sign in to comment.