diff --git a/web/src/assets/icon-font/iconfont.css b/web/src/assets/icon-font/iconfont.css index a7b6d1bc..063864fb 100644 --- a/web/src/assets/icon-font/iconfont.css +++ b/web/src/assets/icon-font/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 2479351 */ - src: url('iconfont.woff2?t=1711536835850') format('woff2'), - url('iconfont.woff?t=1711536835850') format('woff'), - url('iconfont.ttf?t=1711536835850') format('truetype'); + src: url('iconfont.woff2?t=1711935414521') format('woff2'), + url('iconfont.woff?t=1711935414521') format('woff'), + url('iconfont.ttf?t=1711935414521') format('truetype'); } .iconfont { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.iconfujian:before { + content: "\e88a"; +} + .icongeshihua:before { content: "\e7a3"; } diff --git a/web/src/assets/icon-font/iconfont.ttf b/web/src/assets/icon-font/iconfont.ttf index 530a259c..bb0fbedf 100644 Binary files a/web/src/assets/icon-font/iconfont.ttf and b/web/src/assets/icon-font/iconfont.ttf differ diff --git a/web/src/assets/icon-font/iconfont.woff b/web/src/assets/icon-font/iconfont.woff index 670ceb03..fdb5ff4b 100644 Binary files a/web/src/assets/icon-font/iconfont.woff and b/web/src/assets/icon-font/iconfont.woff differ diff --git a/web/src/assets/icon-font/iconfont.woff2 b/web/src/assets/icon-font/iconfont.woff2 index f330a8bb..4225466d 100644 Binary files a/web/src/assets/icon-font/iconfont.woff2 and b/web/src/assets/icon-font/iconfont.woff2 differ diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js index 235fdcee..4720e297 100644 --- a/web/src/lang/en_us.js +++ b/web/src/lang/en_us.js @@ -259,6 +259,7 @@ export default { associativeLine: 'Associative line', painter: 'Painter', formula: 'Formula', + attachment: 'Attachment', more: 'More', selectFileTip: 'Please select a file', notSupportTip: @@ -331,5 +332,8 @@ export default { formatErrorTip: 'The JSON format is incorrect. Please check and try again', copyTip: 'Copied to clipboard', formatTip: 'Format complete' + }, + attachment: { + deleteAttachment: 'Delete attachment' } } diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js index 630eef93..2a6ad3bd 100644 --- a/web/src/lang/zh_cn.js +++ b/web/src/lang/zh_cn.js @@ -256,6 +256,7 @@ export default { associativeLine: '关联线', painter: '格式刷', formula: '公式', + attachment: '附件', more: '更多', selectFileTip: '请选择文件', notSupportTip: '你的浏览器不支持该功能,或者当前页面非https协议', @@ -325,5 +326,8 @@ export default { formatErrorTip: 'JSON格式有误,请检查后再试', copyTip: '已复制到剪贴板', formatTip: '格式化完成' + }, + attachment: { + deleteAttachment: '删除附件' } } diff --git a/web/src/pages/Edit/components/Contextmenu.vue b/web/src/pages/Edit/components/Contextmenu.vue index 42934637..6caa2cca 100644 --- a/web/src/pages/Edit/components/Contextmenu.vue +++ b/web/src/pages/Edit/components/Contextmenu.vue @@ -221,6 +221,7 @@ export default { this.$bus.$on('expand_btn_click', this.hide) this.$bus.$on('svg_mousedown', this.onMousedown) this.$bus.$on('mouseup', this.onMouseup) + this.$bus.$on('translate', this.hide) }, beforeDestroy() { this.$bus.$off('node_contextmenu', this.show) @@ -229,6 +230,7 @@ export default { this.$bus.$off('expand_btn_click', this.hide) this.$bus.$off('svg_mousedown', this.onMousedown) this.$bus.$off('mouseup', this.onMouseup) + this.$bus.$off('translate', this.hide) }, methods: { ...mapMutations(['setLocalConfig']), diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index 309c9f1c..a68b7790 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -16,6 +16,7 @@ v-if="mindMap" :mindMap="mindMap" > + @@ -85,6 +86,7 @@ import Scrollbar from './Scrollbar.vue' import exampleData from 'simple-mind-map/example/exampleData' import FormulaSidebar from './FormulaSidebar.vue' import SourceCodeEdit from './SourceCodeEdit.vue' +import NodeAttachment from './NodeAttachment.vue' // 注册插件 MindMap.usePlugin(MiniMap) @@ -137,7 +139,8 @@ export default { OutlineEdit, Scrollbar, FormulaSidebar, - SourceCodeEdit + SourceCodeEdit, + NodeAttachment }, data() { return { @@ -491,7 +494,10 @@ export default { 'painter_start', 'painter_end', 'scrollbar_change', - 'scale' + 'scale', + 'translate', + 'node_attachmentClick', + 'node_attachmentContextmenu' ].forEach(event => { this.mindMap.on(event, (...args) => { this.$bus.$emit(event, ...args) diff --git a/web/src/pages/Edit/components/NodeAttachment.vue b/web/src/pages/Edit/components/NodeAttachment.vue new file mode 100644 index 00000000..63d92250 --- /dev/null +++ b/web/src/pages/Edit/components/NodeAttachment.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/web/src/pages/Edit/components/NodeNoteContentShow.vue b/web/src/pages/Edit/components/NodeNoteContentShow.vue index 19a7c9e4..ac5cdf21 100644 --- a/web/src/pages/Edit/components/NodeNoteContentShow.vue +++ b/web/src/pages/Edit/components/NodeNoteContentShow.vue @@ -37,6 +37,7 @@ export default { document.body.addEventListener('click', this.hideNoteContent) this.$bus.$on('node_active', this.hideNoteContent) this.$bus.$on('scale', this.onScale) + this.$bus.$on('translate', this.onScale) this.$bus.$on('svg_mousedown', this.hideNoteContent) }, mounted() { @@ -48,6 +49,7 @@ export default { document.body.removeEventListener('click', this.hideNoteContent) this.$bus.$off('node_active', this.hideNoteContent) this.$bus.$off('scale', this.onScale) + this.$bus.$off('translate', this.onScale) this.$bus.$off('svg_mousedown', this.hideNoteContent) }, methods: { @@ -97,6 +99,8 @@ export default { border-radius: 5px; max-height: 300px; overflow-y: auto; + box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.06); + border: 1px solid rgba(0, 0, 0, 0.06); &::-webkit-scrollbar { width: 7px; diff --git a/web/src/pages/Edit/components/Toolbar.vue b/web/src/pages/Edit/components/Toolbar.vue index 5b8279a7..15a3a55d 100644 --- a/web/src/pages/Edit/components/Toolbar.vue +++ b/web/src/pages/Edit/components/Toolbar.vue @@ -178,6 +178,7 @@ export default { 'summary', 'associativeLine', 'formula' + // 'attachment' ], horizontalList: [], verticalList: [], diff --git a/web/src/pages/Edit/components/ToolbarNodeBtnList.vue b/web/src/pages/Edit/components/ToolbarNodeBtnList.vue index 7e84e0b2..70eedb6f 100644 --- a/web/src/pages/Edit/components/ToolbarNodeBtnList.vue +++ b/web/src/pages/Edit/components/ToolbarNodeBtnList.vue @@ -156,6 +156,17 @@ {{ $t('toolbar.formula') }} +
+ + {{ $t('toolbar.attachment') }} +
@@ -258,6 +269,11 @@ export default { // 打开公式侧边栏 showFormula() { this.setActiveSidebar('formulaSidebar') + }, + + // 选择附件 + selectAttachmentFile() { + this.$bus.$emit('selectAttachment', this.activeNodes) } } }