diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js index 16da1f1e..235fdcee 100644 --- a/web/src/lang/en_us.js +++ b/web/src/lang/en_us.js @@ -130,7 +130,9 @@ export default { paddingX: 'Padding x', paddingY: 'Padding y', useMultiPageExport: 'Export multi page', - defaultFileName: 'Mind map' + defaultFileName: 'Mind map', + addFooterTextPlaceholder: 'For example: From simple-mind-map', + addFooterText: 'Add text at the footer' }, fullscreen: { fullscreenShow: 'Full screen show', @@ -278,7 +280,8 @@ export default { splitByWrap: 'Is automatically split nodes based on line breaks?', tip: 'Tip', yes: 'Yes', - no: 'No' + no: 'No', + exportError: 'Export failed' }, mouseAction: { tip1: diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js index b0e50ee2..630eef93 100644 --- a/web/src/lang/zh_cn.js +++ b/web/src/lang/zh_cn.js @@ -128,7 +128,9 @@ export default { paddingX: '水平内边距', paddingY: '垂直内边距', useMultiPageExport: '是否多页导出', - defaultFileName: '思维导图' + defaultFileName: '思维导图', + addFooterText: '底部添加文字', + addFooterTextPlaceholder: '比如:来自simple-mind-map' }, fullscreen: { fullscreenShow: '全屏查看', @@ -274,7 +276,8 @@ export default { splitByWrap: '是否按换行自动分割节点?', tip: '提示', yes: '是', - no: '否' + no: '否', + exportError: '导出失败' }, mouseAction: { tip1: '当前:左键拖动画布,右键框选节点', diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index 1b0ef38b..309c9f1c 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -156,7 +156,8 @@ export default { useLeftKeySelectionRightKeyDrag: state => state.localConfig.useLeftKeySelectionRightKeyDrag, isUseHandDrawnLikeStyle: state => - state.localConfig.isUseHandDrawnLikeStyle + state.localConfig.isUseHandDrawnLikeStyle, + extraTextOnExport: state => state.extraTextOnExport }) }, watch: { @@ -348,12 +349,55 @@ export default { console.error(err) switch (code) { case 'export_error': - this.$message.error('导出失败') + this.$message.error(this.$t('edit.exportError')) break default: break } + }, + addContentToFooter: () => { + const text = this.extraTextOnExport.trim() + if (!text) return null + const el = document.createElement('div') + el.className = 'footer' + el.innerHTML = text + const cssText = ` + .footer { + width: 100%; + height: 30px; + display: flex; + justify-content: center; + align-items: center; + font-size: 12px; + color: #979797; + } + ` + return { + el, + cssText, + height: 30 + } } + // addContentToHeader: () => { + // const el = document.createElement('div') + // el.className = 'footer' + // el.innerHTML = '理想青年实验室' + // const cssText = ` + // .header { + // width: 100%; + // height: 50px; + // background: #f5f5f5; + // display: flex; + // justify-content: center; + // align-items: center + // } + // ` + // return { + // el, + // cssText, + // height: 50 + // } + // }, // beforeShortcutRun: (key, activeNodeList) => { // console.log(key, activeNodeList) // // 阻止删除快捷键行为 diff --git a/web/src/pages/Edit/components/Export.vue b/web/src/pages/Edit/components/Export.vue index 28a46cd7..aa96e22c 100644 --- a/web/src/pages/Edit/components/Export.vue +++ b/web/src/pages/Edit/components/Export.vue @@ -50,6 +50,16 @@ @keydown.native.stop > +