From cda1da5fd0c769113e8e0ad3c7142f30c2ed6fdd Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Fri, 24 Mar 2023 10:30:53 +0800 Subject: [PATCH] =?UTF-8?q?Demo=EF=BC=9AFeature=EF=BC=9A=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=92=8C=E5=AF=BC=E5=87=BA=E4=B8=BAmarkdown?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=EF=BC=8C=E4=BC=98=E5=8C=96=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E8=A7=86=E8=A7=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/config/en.js | 40 +++++++++ web/src/config/index.js | 14 ++- web/src/config/zh.js | 40 +++++++++ web/src/lang/en_us.js | 3 +- web/src/lang/zh_cn.js | 3 +- web/src/pages/Edit/components/Export.vue | 109 ++++++++++++++++++----- web/src/pages/Edit/components/Import.vue | 25 +++++- 7 files changed, 206 insertions(+), 28 deletions(-) diff --git a/web/src/config/en.js b/web/src/config/en.js index a10eba35..f813eb63 100644 --- a/web/src/config/en.js +++ b/web/src/config/en.js @@ -369,3 +369,43 @@ export const sidebarTriggerList = [ icon: 'iconjianpan' } ] + +// 下载类型列表 +export const downTypeList = [ + { + name: 'Dedicated file', + type: 'smm', + icon: 'iconwenjian', + desc: 'Available for import' + }, + { + name: 'JSON', + type: 'json', + icon: 'iconjson', + desc: 'Popular data exchange formats, Available for import' + }, + { + name: 'Image', + type: 'png', + icon: 'iconPNG', + desc: 'Suitable for viewing and sharing' + }, + { + name: 'SVG', + type: 'svg', + icon: 'iconSVG', + desc: 'Scalable Vector Graphics' + }, + { + name: 'PDF', + type: 'pdf', + icon: 'iconpdf', + desc: 'Suitable for printing' + }, + { + name: 'Markdown', + type: 'md', + icon: 'iconmarkdown', + desc: 'Easy for other software to open' + } +] \ No newline at end of file diff --git a/web/src/config/index.js b/web/src/config/index.js index 447347c4..d7a5991d 100644 --- a/web/src/config/index.js +++ b/web/src/config/index.js @@ -15,7 +15,8 @@ import { shortcutKeyList as shortcutKeyListZh, shapeList as shapeListZh, sidebarTriggerList as sidebarTriggerListZh, - backgroundSizeList as backgroundSizeListZh + backgroundSizeList as backgroundSizeListZh, + downTypeList as downTypeListZh } from './zh' import { fontFamilyList as fontFamilyListEn, @@ -26,7 +27,8 @@ import { shortcutKeyList as shortcutKeyListEn, shapeList as shapeListEn, sidebarTriggerList as sidebarTriggerListEn, - backgroundSizeList as backgroundSizeListEn + backgroundSizeList as backgroundSizeListEn, + downTypeList as downTypeListEn } from './en' const fontFamilyList = { @@ -74,6 +76,11 @@ const sidebarTriggerList = { en: sidebarTriggerListEn } +const downTypeList = { + zh: downTypeListZh, + en: downTypeListEn +} + export { fontSizeList, lineHeightList, @@ -91,5 +98,6 @@ export { backgroundSizeList, shortcutKeyList, shapeList, - sidebarTriggerList + sidebarTriggerList, + downTypeList } diff --git a/web/src/config/zh.js b/web/src/config/zh.js index e5cd9567..07080b96 100644 --- a/web/src/config/zh.js +++ b/web/src/config/zh.js @@ -441,3 +441,43 @@ export const sidebarTriggerList = [ icon: 'iconjianpan' } ] + +// 下载类型列表 +export const downTypeList = [ + { + name: '专有文件', + type: 'smm', + icon: 'iconwenjian', + desc: '可用于导入' + }, + { + name: 'JSON', + type: 'json', + icon: 'iconjson', + desc: '流行的数据交换格式,可用于导入' + }, + { + name: '图片', + type: 'png', + icon: 'iconPNG', + desc: '适合查看分享' + }, + { + name: 'SVG', + type: 'svg', + icon: 'iconSVG', + desc: '可缩放矢量图形' + }, + { + name: 'PDF', + type: 'pdf', + icon: 'iconpdf', + desc: '适合打印' + }, + { + name: 'Markdown', + type: 'md', + icon: 'iconmarkdown', + desc: '便于其他软件打开' + } +] \ No newline at end of file diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js index 27278c94..9df10eae 100644 --- a/web/src/lang/en_us.js +++ b/web/src/lang/en_us.js @@ -88,6 +88,7 @@ export default { imageFile: 'Image file', svgFile: 'svg file', pdfFile: 'pdf file', + markdownFile: 'markdown file', tips: 'tips: .smm and .json file can be import', domToImage: 'Whether to convert rich text nodes in svg into pictures', pngTips: 'tips: Exporting pictures in rich text mode is time-consuming. It is recommended to export to svg format', @@ -103,7 +104,7 @@ export default { import: { title: 'Import', selectFile: 'Select file', - supportFile: 'Support .smm、.json、.xmind、.xlsx file' + supportFile: 'Support .smm、.json、.xmind、.xlsx、.md file' }, navigatorToolbar: { openMiniMap: 'Open mini map', diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js index b017465e..09f00b2f 100644 --- a/web/src/lang/zh_cn.js +++ b/web/src/lang/zh_cn.js @@ -88,6 +88,7 @@ export default { imageFile: '图片文件', svgFile: 'svg文件', pdfFile: 'pdf文件', + markdownFile: 'markdown文件', tips: 'tips:.smm和.json文件可用于导入', domToImage: '是否将svg中富文本节点转换成图片', pngTips: 'tips:富文本模式导出图片非常耗时,建议导出为svg格式', @@ -103,7 +104,7 @@ export default { import: { title: '导入', selectFile: '选取文件', - supportFile: '支持.smm、.json、.xmind、.xlsx文件' + supportFile: '支持.smm、.json、.xmind、.xlsx、.md文件' }, navigatorToolbar: { openMiniMap: '开启小地图', diff --git a/web/src/pages/Edit/components/Export.vue b/web/src/pages/Edit/components/Export.vue index 24ed7614..3f04f061 100644 --- a/web/src/pages/Edit/components/Export.vue +++ b/web/src/pages/Edit/components/Export.vue @@ -30,26 +30,21 @@ >{{ $t('export.domToImage') }} - - {{ $t('export.dedicatedFile') }}(.smm) +
- {{ $t('export.jsonFile') }}(.json) - {{ $t('export.imageFile') }}(.png) - {{ $t('export.svgFile') }}(.svg) - {{ $t('export.pdfFile') }}(.pdf) - Markdown文件(.md) - +
+
+
{{ item.name }}
+
{{ item.desc }}
+
+
+
{{ $t('export.tips') }}
{{ $t('export.pngTips') }}
{{ $t('export.svgTips') }}
@@ -65,6 +60,7 @@