diff --git a/simple-mind-map/src/constants/defaultOptions.js b/simple-mind-map/src/constants/defaultOptions.js
index ee9417ce..ea801d67 100644
--- a/simple-mind-map/src/constants/defaultOptions.js
+++ b/simple-mind-map/src/constants/defaultOptions.js
@@ -49,7 +49,8 @@ export const defaultOpt = {
color: '#999',
opacity: 0.5,
fontSize: 14
- }
+ },
+ belowNode: false
},
// 达到该宽度文本自动换行
textAutoWrapWidth: 500,
@@ -326,5 +327,5 @@ export const defaultOpt = {
// 添加附加的节点前置内容,前置内容指和文本同一行的区域中的前置内容,不包括节点图片部分
createNodePrefixContent: null,
// 添加附加的节点后置内容,后置内容指和文本同一行的区域中的后置内容,不包括节点图片部分
- createNodePostfixContent: null
+ createNodePostfixContent: null,
}
diff --git a/simple-mind-map/src/core/render/Render.js b/simple-mind-map/src/core/render/Render.js
index 83fa8116..2e5de67f 100644
--- a/simple-mind-map/src/core/render/Render.js
+++ b/simple-mind-map/src/core/render/Render.js
@@ -448,6 +448,7 @@ class Render {
this.mindMap.emit('node_tree_render_end')
return
}
+ this.mindMap.emit('node_tree_render_start')
// 计算布局
this.layout.doLayout(root => {
// 删除本次渲染时不再需要的节点
diff --git a/simple-mind-map/src/core/render/node/Node.js b/simple-mind-map/src/core/render/node/Node.js
index ff471177..3c04dceb 100644
--- a/simple-mind-map/src/core/render/node/Node.js
+++ b/simple-mind-map/src/core/render/node/Node.js
@@ -521,7 +521,7 @@ class Node {
}
}
// 多选和取消多选
- if ((e.ctrlKey || e.metaKey) && enableCtrlKeyNodeSelection) {
+ if (!readonly && (e.ctrlKey || e.metaKey) && enableCtrlKeyNodeSelection) {
this.isMultipleChoice = true
let isActive = this.getData('isActive')
if (!isActive)
diff --git a/simple-mind-map/src/parse/xmind.js b/simple-mind-map/src/parse/xmind.js
index 294e8ded..3040e26a 100644
--- a/simple-mind-map/src/parse/xmind.js
+++ b/simple-mind-map/src/parse/xmind.js
@@ -15,7 +15,7 @@ import {
} from '../utils/xmind'
// 解析.xmind文件
-const parseXmindFile = file => {
+const parseXmindFile = (file, handleMultiCanvas) => {
return new Promise((resolve, reject) => {
JSZip.loadAsync(file).then(
async zip => {
@@ -25,7 +25,7 @@ const parseXmindFile = file => {
let xmlFile = zip.files['content.xml'] || zip.files['/content.xml']
if (jsonFile) {
let json = await jsonFile.async('string')
- content = await transformXmind(json, zip.files)
+ content = await transformXmind(json, zip.files, handleMultiCanvas)
} else if (xmlFile) {
let xml = await xmlFile.async('string')
let json = xmlConvert.xml2json(xml)
@@ -48,8 +48,15 @@ const parseXmindFile = file => {
}
// 转换xmind数据
-const transformXmind = async (content, files) => {
- const data = JSON.parse(content)[0]
+const transformXmind = async (content, files, handleMultiCanvas) => {
+ content = JSON.parse(content)
+ let data = null
+ if (content.length > 1 && typeof handleMultiCanvas === 'function') {
+ data = await handleMultiCanvas(content)
+ }
+ if (!data) {
+ data = content[0]
+ }
const nodeTree = data.rootTopic
const newTree = {}
const waitLoadImageList = []
diff --git a/simple-mind-map/src/plugins/TouchEvent.js b/simple-mind-map/src/plugins/TouchEvent.js
index dc25739a..c2e17783 100644
--- a/simple-mind-map/src/plugins/TouchEvent.js
+++ b/simple-mind-map/src/plugins/TouchEvent.js
@@ -16,10 +16,12 @@ class TouchEvent {
this.onTouchmove = this.onTouchmove.bind(this)
this.onTouchcancel = this.onTouchcancel.bind(this)
this.onTouchend = this.onTouchend.bind(this)
- window.addEventListener('touchstart', this.onTouchstart)
- window.addEventListener('touchmove', this.onTouchmove)
- window.addEventListener('touchcancel', this.onTouchcancel)
- window.addEventListener('touchend', this.onTouchend)
+ window.addEventListener('touchstart', this.onTouchstart, { passive: false })
+ window.addEventListener('touchmove', this.onTouchmove, { passive: false })
+ window.addEventListener('touchcancel', this.onTouchcancel, {
+ passive: false
+ })
+ window.addEventListener('touchend', this.onTouchend, { passive: false })
}
// 解绑事件
@@ -32,6 +34,7 @@ class TouchEvent {
// 手指按下事件
onTouchstart(e) {
+ e.preventDefault()
this.touchesNum = e.touches.length
this.touchStartScaleView = null
if (this.touchesNum === 1) {
@@ -43,6 +46,7 @@ class TouchEvent {
// 手指移动事件
onTouchmove(e) {
+ e.preventDefault()
let len = e.touches.length
if (len === 1) {
let touch = e.touches[0]
@@ -103,6 +107,7 @@ class TouchEvent {
// 手指松开事件
onTouchend(e) {
+ e.preventDefault()
this.dispatchMouseEvent('mouseup', e.target)
if (this.touchesNum === 1) {
// 模拟双击事件
diff --git a/simple-mind-map/src/plugins/Watermark.js b/simple-mind-map/src/plugins/Watermark.js
index fe40fe96..6042f56b 100644
--- a/simple-mind-map/src/plugins/Watermark.js
+++ b/simple-mind-map/src/plugins/Watermark.js
@@ -41,10 +41,21 @@ class Watermark {
// 创建水印容器
createContainer() {
if (this.watermarkDraw) return
- this.watermarkDraw = this.mindMap.svg
- .group()
+ this.watermarkDraw = new G()
.css({ 'pointer-events': 'none', 'user-select': 'none' })
.addClass('smm-water-mark-container')
+ this.updateLayer()
+ }
+
+ // 更新水印容器层级
+ updateLayer() {
+ if (!this.watermarkDraw) return
+ const { belowNode } = this.mindMap.opt.watermarkConfig
+ if (belowNode) {
+ this.watermarkDraw.insertBefore(this.mindMap.draw)
+ } else {
+ this.mindMap.svg.add(this.watermarkDraw)
+ }
}
// 删除水印容器
@@ -160,6 +171,7 @@ class Watermark {
this.mindMap.opt.watermarkConfig,
config
)
+ this.updateLayer()
this.handleConfig(config)
this.draw()
}
@@ -167,11 +179,13 @@ class Watermark {
// 插件被移除前做的事情
beforePluginRemove() {
this.unBindEvent()
+ this.removeContainer()
}
// 插件被卸载前做的事情
beforePluginDestroy() {
this.unBindEvent()
+ this.removeContainer()
}
}
diff --git a/web/public/index.html b/web/public/index.html
index c1a04503..7b08fffa 100644
--- a/web/public/index.html
+++ b/web/public/index.html
@@ -24,7 +24,7 @@
LA.init({
id: 'KRO0WxK8GT66tYCQ',
ck: 'KRO0WxK8GT66tYCQ',
- autoTrack: true
+ autoTrack: false
})
diff --git a/web/src/assets/avatar/ZX.jpg b/web/src/assets/avatar/ZX.jpg
new file mode 100644
index 00000000..eca18a9f
Binary files /dev/null and b/web/src/assets/avatar/ZX.jpg differ
diff --git a/web/src/assets/avatar/峰.jpg b/web/src/assets/avatar/峰.jpg
new file mode 100644
index 00000000..acf432be
Binary files /dev/null and b/web/src/assets/avatar/峰.jpg differ
diff --git a/web/src/assets/avatar/最多5个字.jpg b/web/src/assets/avatar/最多5个字.jpg
new file mode 100644
index 00000000..3c15791e
Binary files /dev/null and b/web/src/assets/avatar/最多5个字.jpg differ
diff --git a/web/src/assets/avatar/雨馨.jpg b/web/src/assets/avatar/雨馨.jpg
new file mode 100644
index 00000000..9db35a24
Binary files /dev/null and b/web/src/assets/avatar/雨馨.jpg differ
diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js
index a0e7333a..fd245f27 100644
--- a/web/src/lang/en_us.js
+++ b/web/src/lang/en_us.js
@@ -38,6 +38,7 @@ export default {
watermarkAngle: 'Angle',
watermarkTextOpacity: 'Text opacity',
watermarkTextFontSize: 'Font size',
+ belowNode: 'Display below nodes',
isEnableNodeRichText: 'Enable node rich text editing',
mousewheelAction: 'Mouse wheel behavior',
zoomView: 'Zoom view',
@@ -151,7 +152,8 @@ export default {
notSelectTip: 'Please select the file to import',
fileContentError: 'The file content is incorrect',
importSuccess: 'Import success',
- fileParsingFailed: 'File parsing failed'
+ fileParsingFailed: 'File parsing failed',
+ xmindCanvasSelectDialogTitle: 'Select the canvas to import'
},
navigatorToolbar: {
openMiniMap: 'Open mini map',
diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js
index 148a31bf..e478aa1c 100644
--- a/web/src/lang/zh_cn.js
+++ b/web/src/lang/zh_cn.js
@@ -38,6 +38,7 @@ export default {
watermarkAngle: '旋转角度',
watermarkTextOpacity: '文字透明度',
watermarkTextFontSize: '文字字号',
+ belowNode: '显示在节点下方',
isEnableNodeRichText: '是否开启节点富文本编辑',
mousewheelAction: '鼠标滚轮行为',
zoomView: '缩放视图',
@@ -149,7 +150,8 @@ export default {
notSelectTip: '请选择要导入的文件',
fileContentError: '文件内容有误',
importSuccess: '导入成功',
- fileParsingFailed: '文件解析失败'
+ fileParsingFailed: '文件解析失败',
+ xmindCanvasSelectDialogTitle: '选择要导入的画布'
},
navigatorToolbar: {
openMiniMap: '开启小地图',
diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js
index 947e1529..d80210d7 100644
--- a/web/src/pages/Doc/catalogList.js
+++ b/web/src/pages/Doc/catalogList.js
@@ -11,7 +11,7 @@ let langList = [
}
]
let StartList = ['introduction', 'start', 'deploy', 'client', 'translate', 'changelog']
-let CourseList = new Array(28).fill(0).map((_, index) => {
+let CourseList = new Array(29).fill(0).map((_, index) => {
return 'course' + (index + 1)
})
let APIList = [
diff --git a/web/src/pages/Doc/en/constructor/index.md b/web/src/pages/Doc/en/constructor/index.md
index 3665975c..0770e8b6 100644
--- a/web/src/pages/Doc/en/constructor/index.md
+++ b/web/src/pages/Doc/en/constructor/index.md
@@ -120,8 +120,8 @@ const mindMap = new MindMap({
| addContentToFooter(v0.9.9+) | Function、null | null | The basic definition is the same as addContentToHeader, adding custom content at the end | |
| demonstrateConfig(v0.9.11+) | Object、null | null | Demonstration plugin configuration. If not transmitted, the default configuration will be used. An object can be transmitted. If only a certain property is configured, only that property can be set. Other properties that have not been set will also use the default configuration. For complete configuration, please refer to the 【Demonstration Plugin Configuration】 section below | |
| resetScaleOnMoveNodeToCenter(v0.9.12+) | Boolean | false | Whether to reset the scaling level to 100% when moving nodes to the canvas center, returning to the root node, and other operations(The underlying impact is on the moveNodeToCenter method of the render class) | |
-| createNodePrefixContent(v0.9.12+) | Function、null | null | Add additional node pre content.Pre content refers to the pre content in the area of the same line as the text, excluding the node image section.You can pass a function that takes the parameters of a node instance, returns a DOM node, or returns null | |
-| createNodePostfixContent(v0.9.12+) | Function、null | null | Add additional node post content.Post content refers to the post content in the area of the same line as the text, excluding the node image section.You can pass a function that takes the parameters of a node instance, returns a DOM node, or returns null | |
+| createNodePrefixContent(v0.9.12+) | Function、null | null | Add additional node pre content.Pre content refers to the pre content in the area of the same line as the text, excluding the node image section.You can pass a function that takes the parameters of a node instance, Can return objects in {el, width, height} format, el is a DOM node object, width and height represent the width, height, and numerical type of the content. If custom content is not required, null can also be returned | |
+| createNodePostfixContent(v0.9.12+) | Function、null | null | Add additional node post content.Post content refers to the post content in the area of the same line as the text, excluding the node image section. The usage is the same as createNodePrefixContent | |
### Data structure
diff --git a/web/src/pages/Doc/en/constructor/index.vue b/web/src/pages/Doc/en/constructor/index.vue
index 9e4ecda0..39f8c0b4 100644
--- a/web/src/pages/Doc/en/constructor/index.vue
+++ b/web/src/pages/Doc/en/constructor/index.vue
@@ -704,14 +704,14 @@
createNodePrefixContent(v0.9.12+)
Function、null
null
-
Add additional node pre content.Pre content refers to the pre content in the area of the same line as the text, excluding the node image section.You can pass a function that takes the parameters of a node instance, returns a DOM node, or returns null
+
Add additional node pre content.Pre content refers to the pre content in the area of the same line as the text, excluding the node image section.You can pass a function that takes the parameters of a node instance, Can return objects in {el, width, height} format, el is a DOM node object, width and height represent the width, height, and numerical type of the content. If custom content is not required, null can also be returned
createNodePostfixContent(v0.9.12+)
Function、null
null
-
Add additional node post content.Post content refers to the post content in the area of the same line as the text, excluding the node image section.You can pass a function that takes the parameters of a node instance, returns a DOM node, or returns null
+
Add additional node post content.Post content refers to the post content in the area of the same line as the text, excluding the node image section. The usage is the same as createNodePrefixContent
diff --git a/web/src/pages/Doc/en/introduction/index.md b/web/src/pages/Doc/en/introduction/index.md
index 80e3b187..11017448 100644
--- a/web/src/pages/Doc/en/introduction/index.md
+++ b/web/src/pages/Doc/en/introduction/index.md
@@ -394,4 +394,20 @@ Open source is not easy. If this project is helpful to you, you can invite the a
宏涛
+
+
+
最多5个字
+
+
+
+
雨馨
+
+
+
+
ZX
+
+
+
+
峰
+
\ No newline at end of file
diff --git a/web/src/pages/Doc/en/introduction/index.vue b/web/src/pages/Doc/en/introduction/index.vue
index 5b002cad..501f32e8 100644
--- a/web/src/pages/Doc/en/introduction/index.vue
+++ b/web/src/pages/Doc/en/introduction/index.vue
@@ -8,18 +8,18 @@
Features
-
-
-
-
-
-
-
-
json、png、svg、pdf、markdown、xmind、txt, support import from json、xmind、markdown
-
-
-
-
+
+
+
+
+
+
+
+
json、png、svg、pdf、markdown、xmind、txt, support import from json、xmind、markdown
+
+
+
+
The official provides the following plugins, which can be introduced as needed (a certain function may not be effective because you did not introduce the corresponding plugin). Please refer to the documentation for specific usage methods:
@@ -39,16 +39,16 @@ frameworks such as Vue and React, or without a framework.
This is an online mind map built using the simple-mind-map library and based
on Vue2.x and ElementUI. Features include:
-
+
images, icons, hyperlinks, notes, tags, and summaries
-
+
outline, theme selection, and structure selection
-
+
storage by default, but it also supports creating, opening, and editing
local files on the computer directly
-
+
and organizing layout
-
+
between edit and read-only modes, zooming in and out, and switching to
full screen, support mini map
@@ -348,6 +348,22 @@ full screen, support mini map
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/pages/Doc/zh/introduction/index.md b/web/src/pages/Doc/zh/introduction/index.md
index 52a0936c..30ce728a 100644
--- a/web/src/pages/Doc/zh/introduction/index.md
+++ b/web/src/pages/Doc/zh/introduction/index.md
@@ -390,4 +390,20 @@
宏涛
+
+
+
最多5个字
+
+
+
+
雨馨
+
+
+
+
ZX
+
+
+
+
峰
+
\ No newline at end of file
diff --git a/web/src/pages/Doc/zh/introduction/index.vue b/web/src/pages/Doc/zh/introduction/index.vue
index 7df760b6..ca21c062 100644
--- a/web/src/pages/Doc/zh/introduction/index.vue
+++ b/web/src/pages/Doc/zh/introduction/index.vue
@@ -8,18 +8,18 @@