This commit is contained in:
街角小林 2024-04-02 19:00:23 +08:00
commit 7683944cc9
55 changed files with 567 additions and 144 deletions

View File

@ -316,4 +316,8 @@ const mindMap = new MindMap({
<img src="./web/src/assets/avatar/L.jpg" style="width: 50px;height: 50px;" />
<span>L</span>
</span>
<span>
<img src="./web/src/assets/avatar/default.png" style="width: 50px;height: 50px;" />
<span>sunniberg</span>
</span>
</p>

2
dist/css/app.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
dist/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/js/chunk-2d0a4b03.js vendored Normal file
View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0a4b03"],{"0805":function(t,s,_){"use strict";_.r(s);var a=function(){var t=this;t._self._c;return t._m(0)},v=[function(){var t=this,s=t._self._c;return s("div",[s("h1",[t._v("快捷键操作如何传递自定义参数")]),s("p",[t._v("库提供了很多命令,比如插入子节点的"),s("code",[t._v("INSERT_CHILD_NODE")]),t._v("等这些命令大多可以接收一定参数比如在插入节点时我想指定初始文本和节点uid那么可以这样调用")]),s("pre",{staticClass:"hljs"},[s("code",[t._v("mindMap.execCommand("),s("span",{staticClass:"hljs-string"},[t._v("'INSERT_CHILD_NODE'")]),t._v(", "),s("span",{staticClass:"hljs-literal"},[t._v("true")]),t._v(", [], {\n "),s("span",{staticClass:"hljs-attr"},[t._v("text")]),t._v(": "),s("span",{staticClass:"hljs-string"},[t._v("'初始文本'")]),t._v(",\n "),s("span",{staticClass:"hljs-attr"},[t._v("uid")]),t._v(": "),s("span",{staticClass:"hljs-string"},[t._v("'xxx'")]),t._v("\n})\n")])]),s("p",[t._v("但是同时库内部也默认注册了很多快捷键,比如插入下级节点的"),s("code",[t._v("Tab")]),t._v("快捷键,很遗憾,目前快捷键操作无法让你传入自定义的参数,那么该怎么办呢,可以这样处理,首先确定你要给什么快捷键传入参数,比如"),s("code",[t._v("Tab")]),t._v(",那么首先可以调用如下方法删除库默认注册的快捷键:")]),s("pre",{staticClass:"hljs"},[s("code",[s("span",{staticClass:"hljs-keyword"},[t._v("const")]),t._v(" keyName = "),s("span",{staticClass:"hljs-string"},[t._v("'Tab'")]),t._v("\nmindMap.keyCommand.removeShortcut(keyName)\n")])]),s("p",[t._v("然后再重新注册即可:")]),s("pre",{staticClass:"hljs"},[s("code",[t._v("mindMap.keyCommand.addShortcut(keyName, "),s("span",{staticClass:"hljs-function"},[t._v("() =>")]),t._v(" {\n mindMap.execCommand("),s("span",{staticClass:"hljs-string"},[t._v("'INSERT_CHILD_NODE'")]),t._v(", "),s("span",{staticClass:"hljs-literal"},[t._v("true")]),t._v(", [], {\n "),s("span",{staticClass:"hljs-attr"},[t._v("text")]),t._v(": "),s("span",{staticClass:"hljs-string"},[t._v("'初始文本'")]),t._v(",\n "),s("span",{staticClass:"hljs-attr"},[t._v("uid")]),t._v(": "),s("span",{staticClass:"hljs-string"},[t._v("'xxx'")]),t._v("\n })\n})\n")])]),s("p",[t._v("库内部默认注册的快捷键对应的命令一览:")]),s("table",[s("thead",[s("tr",[s("th",[t._v("快捷键")]),s("th",[t._v("命令")])])]),s("tbody",[s("tr",[s("td",[t._v("Control+z")]),s("td",[t._v("BACK")])]),s("tr",[s("td",[t._v("Control+y")]),s("td",[t._v("FORWARD")])]),s("tr",[s("td",[t._v("Tab")]),s("td",[t._v("INSERT_CHILD_NODE")])]),s("tr",[s("td",[t._v("Insert")]),s("td",[t._v("INSERT_CHILD_NODE")])]),s("tr",[s("td",[t._v("Enter")]),s("td",[t._v("INSERT_NODE")])]),s("tr",[s("td",[t._v("Shift+Tab")]),s("td",[t._v("INSERT_PARENT_NODE")])]),s("tr",[s("td",[t._v("Control+g")]),s("td",[t._v("ADD_GENERALIZATION")])]),s("tr",[s("td",[t._v("Del或Backspace")]),s("td",[t._v("REMOVE_NODE")])]),s("tr",[s("td",[t._v("Shift+Backspace")]),s("td",[t._v("REMOVE_CURRENT_NODE")])]),s("tr",[s("td",[t._v("Control+a")]),s("td",[t._v("SELECT_ALL")])]),s("tr",[s("td",[t._v("Control+l")]),s("td",[t._v("RESET_LAYOUT")])]),s("tr",[s("td",[t._v("Control+Up")]),s("td",[t._v("UP_NODE")])]),s("tr",[s("td",[t._v("Control+Down")]),s("td",[t._v("DOWN_NODE")])])])])])}],n={},l=n,r=_("2877"),d=Object(r["a"])(l,a,v,!1,null,null,null);s["default"]=d.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216037"],{c13f:function(s,t,n){"use strict";n.r(t);var a=function(){var s=this;s._self._c;return s._m(0)},e=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("开启节点自由拖拽")]),t("blockquote",[t("p",[s._v("节点自由拖拽的连线可能不会符合你的预期,这个问题基本上不会改,所以自由拖拽功能不建议使用。")])]),t("p",[s._v("节点支持自由拖拽,也就是可以把它拖动到你指定的位置,默认是不开启的,如果需要开启可以在实例化"),t("code",[s._v("simple-mind-map")]),s._v("时传入开启的选项:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v("\n})\n")])]),t("p",[s._v("也可以动态切换是否开启:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.updateConfig({\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),t("span",{staticClass:"hljs-comment"},[s._v("// false")]),s._v("\n})\n")])]),t("p",[s._v("自由拖拽很容器将节点拖的乱七八糟,所以也可以通过命令回到默认的位置:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'RESET_LAYOUT'")]),s._v(")\n")])]),t("p",[s._v("也可以使用快捷键"),t("code",[s._v("Ctrl + L")]),s._v("来恢复。")]),t("h2",[s._v("完整示例")]),t("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVd1uG0UUfpVhEVoH2buuxJVxSksbJKSEolAuUDeqxrtje8rszLIzm8SyVgoF1EKIFASiFdxAVQFCQFWBEE2oeJmsnb4FZ3b2L44veldLa82c853znZnzM1PrchQ52wmxelZf+jGNFJJEJdFFj9MwErFCUxSTYRsJviESrkjQRnKMGRM7m2SIUjSMRYhs8GBXFhuUBxs4MirPkiBmpBOCtBPiyLM8jpDHGVFIyzRyFfGEMSN3XZQ9/Tr7/GD2397sr+P5d5+efnF7fvtJdvfe6Y+/eNwXXCqEfUW3yTsiIBKs64haN7ZWPF6iqLwWEf5WTMjVGI8ACEdpDTGTJAdpqrt3ZgcPZvcfZYc/Zf/uZYePTu/8Ov/m8Wz/29n+09KPEqMRIw0/rRW0ehFNdcRnOZxtzBICiJeWyTW+OLOTRAFW5IrgQzpq5Z4QIhwPap7eUt8QuEoh/LQ4wezjB9nDg2fH90//eJj980n2eK+MOiaQynU8EYk6G3IZAtkl/hURhpgHLXtz7b216zfXL39w7f3rdum/ynrrvLnOGtkps10dgfVQIPwkJFw5I6LWGNHLNydvA0dhCYdWmHIS2yttYwVXgXvGu/55lhZ4VkNkxIrsKi32rNkPT0xdmHrSv7RwpoH+mLIgJlyDb9Q+FtwtZVlkOjn6cn708yLZWcIlpFu1rol7QRGUy0JW2lFO1aYQSjfSu0JSRQUHS5uRobLbyPYhdZCmrQK+WJ95K2lVuvK66V6EoCTn33+VHf5m4jVdfHK0f3L8d7P2BG/ZHFhvmk4GspbetpH+X6dS1fWGmt1eNViJM/RQr/D1XTPDYHrBRhEYPNBjsEOoH9Bt5DMs5apnFUFcJaHwrFxdAGhQa6sqBUjfBW0TWHpSQrAB1hCj9FR/kCglOLrkM+p/mEOawwOQ0+niYHoD2dlnfz6793tz+NioB+JzM8lGadp3DUlBCjEtkjZ6HxjPz4gFD/X5ylXfbVwfbKWaMHOTl4ox71mOa2Z7MQIcIkPHl9KzqmJwGjddJnOHBmrcQxe63VdyHEJRVXkxAUZIda7Ii1Z/Ly9mpHRVG+KBFCxRxhAhXb891C12SkT15jz9mNDRGOCvdbvRbsm8nPfVkjnE8YgCb+k1wkFAObSEEVShO0WBPGfEF8oIiqCrPTiE4s5zYLUtkwH9mjq3pODweOfuvUIBGagmimfB22zGiOPC0olhntOQ6GR1BrHYkSQGJ55VtPiS91rbjpWKZM912e5HXE6kI6Ts+LwzIPQWHNvBjE4S7kvHF6ELnUGUXFIbmqY4TGql/wPpBfrv"}})])}],l={},r=l,i=n("2877"),p=Object(i["a"])(r,a,e,!1,null,null,null);t["default"]=p.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216037"],{c13f:function(s,t,a){"use strict";a.r(t);var n=function(){var s=this;s._self._c;return s._m(0)},e=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("开启节点自由拖拽")]),t("blockquote",[t("p",[s._v("节点自由拖拽的连线可能不会符合你的预期,这个问题基本上不会改,所以自由拖拽功能不建议使用。")])]),t("blockquote",[t("p",[s._v("另外不要把节点拖拽和自由拖拽搞混,节点拖拽指拖动节点到其他节点上成为其子节点或兄弟节点,自由拖拽只是可以把节点放置在你拖动到的画布位置,并不能改变节点的层级。")])]),t("blockquote",[t("p",[s._v("最后要注意这两个功能都需要先注册Drag插件。")])]),t("p",[s._v("节点支持自由拖拽,也就是可以把它拖动到你指定的位置,默认是不开启的,如果需要开启可以在实例化"),t("code",[s._v("simple-mind-map")]),s._v("时传入开启的选项:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v("\n})\n")])]),t("p",[s._v("也可以动态切换是否开启:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.updateConfig({\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),t("span",{staticClass:"hljs-comment"},[s._v("// false")]),s._v("\n})\n")])]),t("p",[s._v("自由拖拽很容器将节点拖的乱七八糟,所以也可以通过命令回到默认的位置:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'RESET_LAYOUT'")]),s._v(")\n")])]),t("p",[s._v("也可以使用快捷键"),t("code",[s._v("Ctrl + L")]),s._v("来恢复。")]),t("h2",[s._v("完整示例")]),t("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVd1uG0UUfpVhEVoH2buuxJVxSksbJKSEolAuUDeqxrtje8rszLIzm8SyVgoF1EKIFASiFdxAVQFCQFWBEE2oeJmsnb4FZ3b2L44veldLa82c853znZnzM1PrchQ52wmxelZf+jGNFJJEJdFFj9MwErFCUxSTYRsJviESrkjQRnKMGRM7m2SIUjSMRYhs8GBXFhuUBxs4MirPkiBmpBOCtBPiyLM8jpDHGVFIyzRyFfGEMSN3XZQ9/Tr7/GD2397sr+P5d5+efnF7fvtJdvfe6Y+/eNwXXCqEfUW3yTsiIBKs64haN7ZWPF6iqLwWEf5WTMjVGI8ACEdpDTGTJAdpqrt3ZgcPZvcfZYc/Zf/uZYePTu/8Ov/m8Wz/29n+09KPEqMRIw0/rRW0ehFNdcRnOZxtzBICiJeWyTW+OLOTRAFW5IrgQzpq5Z4QIhwPap7eUt8QuEoh/LQ4wezjB9nDg2fH90//eJj980n2eK+MOiaQynU8EYk6G3IZAtkl/hURhpgHLXtz7b216zfXL39w7f3rdum/ynrrvLnOGtkps10dgfVQIPwkJFw5I6LWGNHLNydvA0dhCYdWmHIS2yttYwVXgXvGu/55lhZ4VkNkxIrsKi32rNkPT0xdmHrSv7RwpoH+mLIgJlyDb9Q+FtwtZVlkOjn6cn708yLZWcIlpFu1rol7QRGUy0JW2lFO1aYQSjfSu0JSRQUHS5uRobLbyPYhdZCmrQK+WJ95K2lVuvK66V6EoCTn33+VHf5m4jVdfHK0f3L8d7P2BG/ZHFhvmk4GspbetpH+X6dS1fWGmt1eNViJM/RQr/D1XTPDYHrBRhEYPNBjsEOoH9Bt5DMs5apnFUFcJaHwrFxdAGhQa6sqBUjfBW0TWHpSQrAB1hCj9FR/kCglOLrkM+p/mEOawwOQ0+niYHoD2dlnfz6793tz+NioB+JzM8lGadp3DUlBCjEtkjZ6HxjPz4gFD/X5ylXfbVwfbKWaMHOTl4ox71mOa2Z7MQIcIkPHl9KzqmJwGjddJnOHBmrcQxe63VdyHEJRVXkxAUZIda7Ii1Z/Ly9mpHRVG+KBFCxRxhAhXb891C12SkT15jz9mNDRGOCvdbvRbsm8nPfVkjnE8YgCb+k1wkFAObSEEVShO0WBPGfEF8oIiqCrPTiE4s5zYLUtkwH9mjq3pODweOfuvUIBGagmimfB22zGiOPC0olhntOQ6GR1BrHYkSQGJ55VtPiS91rbjpWKZM912e5HXE6kI6Ts+LwzIPQWHNvBjE4S7kvHF6ELnUGUXFIbmqY4TGql/wPpBfrv"}})])}],l={},r=l,i=a("2877"),p=Object(i["a"])(r,n,e,!1,null,null,null);t["default"]=p.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><link rel="icon" href="dist/logo.ico"><title>思绪思维导图</title><script>//
window.externalPublicPath = './dist/'
// 接管应用
window.takeOverApp = false</script><link href="dist/css/chunk-vendors.css?265c9df28df3bfd4566f" rel="stylesheet"><link href="dist/css/app.css?265c9df28df3bfd4566f" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>const getDataFromBackend = () => {
window.takeOverApp = false</script><link href="dist/css/chunk-vendors.css?ac10265d54028b4359f6" rel="stylesheet"><link href="dist/css/app.css?ac10265d54028b4359f6" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>const getDataFromBackend = () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve({
@ -66,4 +66,4 @@
// 可以通过window.$bus.$on()来监听应用的一些事件
// 实例化页面
window.initApp()
}</script><script src="dist/js/chunk-vendors.js?265c9df28df3bfd4566f"></script><script src="dist/js/app.js?265c9df28df3bfd4566f"></script></body></html>
}</script><script src="dist/js/chunk-vendors.js?ac10265d54028b4359f6"></script><script src="dist/js/app.js?ac10265d54028b4359f6"></script></body></html>

View File

@ -29,7 +29,7 @@ MindMap.iconList = icons.nodeIconList
MindMap.constants = constants
MindMap.themes = themes
MindMap.defaultTheme = defaultTheme
MindMap.version = '0.9.9-fix.2'
MindMap.version = '0.9.10'
MindMap.usePlugin(MiniMap)
.usePlugin(Watermark)

View File

@ -1,6 +1,6 @@
{
"name": "simple-mind-map",
"version": "0.9.9-fix.2",
"version": "0.9.10",
"description": "一个简单的web在线思维导图",
"authors": [
{

View File

@ -312,7 +312,9 @@ export const nodeDataNoStylePropList = [
'associativeLineTargets',
'associativeLineTargetControlOffsets',
'associativeLinePoint',
'associativeLineText'
'associativeLineText',
'attachmentUrl',
'attachmentName'
]
// 数据缓存

View File

@ -335,7 +335,7 @@ class Render {
})
// 一键整理布局
this.mindMap.keyCommand.addShortcut('Control+l', () => {
this.mindMap.execCommand('RESET_LAYOUT', this.resetLayout)
this.mindMap.execCommand('RESET_LAYOUT')
})
// 上移节点
this.mindMap.keyCommand.addShortcut('Control+Up', () => {

View File

@ -93,10 +93,7 @@ class MiniMap {
return {
getImgUrl: async callback => {
const blob = new Blob([svgStr], {
type: 'image/svg+xml'
})
const res = await readBlob(blob)
const res = await this.mindMap.doExport.fixSvgStrAndToBlob(svgStr)
callback(res)
},
svgHTML: svgStr, // 小地图html

View File

@ -1,6 +1,6 @@
{
"name": "thoughts",
"version": "0.9.9",
"version": "0.9.10",
"private": true,
"description": "一个简洁的思维导图",
"author": "街角小林<1013335014@qq.com>",

View File

@ -284,7 +284,8 @@ export default {
tip: 'Tip',
yes: 'Yes',
no: 'No',
exportError: 'Export failed'
exportError: 'Export failed',
dragTip: 'Release here to import the file'
},
mouseAction: {
tip1:
@ -337,6 +338,7 @@ export default {
},
attachment: {
deleteAttachment: 'Delete attachment',
openFileInDir: 'Show in dir'
openFileInDir: 'Show in dir',
tip: 'The attachment function is only available on the client side'
}
}

View File

@ -280,7 +280,8 @@ export default {
tip: '提示',
yes: '是',
no: '否',
exportError: '导出失败'
exportError: '导出失败',
dragTip: '在此释放以导入该文件'
},
mouseAction: {
tip1: '当前:左键拖动画布,右键框选节点',
@ -331,6 +332,7 @@ export default {
},
attachment: {
deleteAttachment: '删除附件',
openFileInDir: '在目录中显示'
openFileInDir: '在目录中显示',
tip: '附件功能仅在客户端可用'
}
}

View File

@ -11,7 +11,7 @@ let langList = [
}
]
let StartList = ['introduction', 'start', 'deploy', 'client', 'translate', 'changelog']
let CourseList = new Array(26).fill(0).map((_, index) => {
let CourseList = new Array(27).fill(0).map((_, index) => {
return 'course' + (index + 1)
})
let APIList = [

View File

@ -1,5 +1,27 @@
# Changelog
## 0.9.10
Fix:
> 1.Fix the issue of all replace operation error during search;
>
> 2.Fix the issue of rendering the mini map with entity characters that are not supported by SVG in node text;
New:
> 1.Add an event translate when moving the canvas;
>
> 2.Node content supports setting attachments;
Demo
> 1.Support dragging and dropping files onto the page for import;
Client:
> 1.Nodes support adding attachments;
## 0.9.9-fix.2
Fix:

View File

@ -1,6 +1,25 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.9.10</h2>
<p>Fix:</p>
<blockquote>
<p>1.Fix the issue of all replace operation error during search;</p>
<p>2.Fix the issue of rendering the mini map with entity characters that are not supported by SVG in node text;</p>
</blockquote>
<p>New:</p>
<blockquote>
<p>1.Add an event translate when moving the canvas;</p>
<p>2.Node content supports setting attachments;</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.Support dragging and dropping files onto the page for import;</p>
</blockquote>
<p>Client:</p>
<blockquote>
<p>1.Nodes support adding attachments;</p>
</blockquote>
<h2>0.9.9-fix.2</h2>
<p>Fix:</p>
<blockquote>

View File

@ -455,7 +455,8 @@ Listen to an event. Event list:
| expand_btn_click | Node expand or collapse event | this (node instance) |
| before_show_text_edit | Event before node text edit box opens | |
| hide_text_edit | Node text edit box close event | textEditNode (text edit box DOM node), activeNodeList (current list of active nodes) |
| scale | Zoom event | scale (zoom ratio) |
| scale | Canvas zoom event | scale (zoom ratio) |
| translatev0.9.10+ | Canvas movement event | xtranslate x、ytranslate y |
| node_img_dblclickv0.2.15+ | Node image double-click event | this (node instance), e (event object) |
| node_img_mouseenterv0.6.5+ | Node image mouseenter event | thisnode instance、imgNodeimg node、eevent object |
| node_img_mouseleavev0.6.5+ | Node image mouseleave event | thisnode instance、imgNodeimg node、eevent object |
@ -581,6 +582,7 @@ redo. All commands are as follows:
| SET_NODE_ICON | Set Node Icon | node (node to set), icons (array, predefined image names array, available icons can be obtained in the nodeIconList list in the [icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js) file, icon name is type_name, such as ['priority_1']) |
| SET_NODE_HYPERLINK | Set Node Hyperlink | node (node to set), link (hyperlink address), title (hyperlink name, optional) |
| SET_NODE_NOTE | Set Node Note | node (node to set), note (note text) |
| SET_NODE_ATTACHMENTv0.9.10+ | Set node attachment | nodenode to set、urlattachment url、nameattachment name, optional |
| SET_NODE_TAG | Set Node Tag | node (node to set), tag (string array, built-in color information can be obtained in [constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js)) |
| INSERT_AFTER (v0.1.5+) | Move Node to After Another Node | node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node) |
| INSERT_BEFORE (v0.1.5+) | Move Node to Before Another Node | node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node) |

View File

@ -1116,10 +1116,15 @@ poor performance and should be used sparingly.</p>
</tr>
<tr>
<td>scale</td>
<td>Zoom event</td>
<td>Canvas zoom event</td>
<td>scale (zoom ratio)</td>
</tr>
<tr>
<td>translatev0.9.10+</td>
<td>Canvas movement event</td>
<td>xtranslate xytranslate y</td>
</tr>
<tr>
<td>node_img_dblclickv0.2.15+</td>
<td>Node image double-click event</td>
<td>this (node instance), e (event object)</td>
@ -1425,6 +1430,11 @@ redo. All commands are as follows:</p>
<td>node (node to set), note (note text)</td>
</tr>
<tr>
<td>SET_NODE_ATTACHMENTv0.9.10+</td>
<td>Set node attachment</td>
<td>nodenode to seturlattachment urlnameattachment name, optional</td>
</tr>
<tr>
<td>SET_NODE_TAG</td>
<td>Set Node Tag</td>
<td>node (node to set), tag (string array, built-in color information can be obtained in <a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js">constant.js</a>)</td>

View File

@ -351,4 +351,10 @@ Open source is not easy. If this project is helpful to you, you can invite the a
<img src="../../../../assets/avatar/L.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>L</p>
</div>
</div>
<div style="display: flex;">
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/default.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>sunniberg</p>
</div>
</div>

View File

@ -8,17 +8,17 @@
</blockquote>
<h2>Features</h2>
<ul>
<li><input type="checkbox" id="checkbox48" checked="true" /><label for="checkbox48">Pluggable architecture, in addition to core functions, other functions are provided as plugins, which can be used as needed to reduce packaging volume</label></li>
<li><input type="checkbox" id="checkbox49" checked="true" /><label for="checkbox49">Support logical structure chart, mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
<li><input type="checkbox" id="checkbox50" checked="true" /><label for="checkbox50">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
<li><input type="checkbox" id="checkbox51" checked="true" /><label for="checkbox51">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
<li><input type="checkbox" id="checkbox52" checked="true" /><label for="checkbox52">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, and fully customize node content using DDM</label></li>
<li><input type="checkbox" id="checkbox53" checked="true" /><label for="checkbox53">Support canvas dragging and scaling</label></li>
<li><input type="checkbox" id="checkbox54" checked="true" /><label for="checkbox54">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
<li><input type="checkbox" id="checkbox55" checked="true" /><label for="checkbox55">Supoorts to export as </label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>, support import from <code>json</code><code>xmind</code><code>markdown</code></li>
<li><input type="checkbox" id="checkbox56" checked="true" /><label for="checkbox56">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, and scrollbar</label></li>
<li><input type="checkbox" id="checkbox57" checked="true" /><label for="checkbox57">Provide rich configurations to meet various scenarios and usage habits</label></li>
<li><input type="checkbox" id="checkbox58" checked="true" /><label for="checkbox58">Support collaborative editing</label></li>
<li><input type="checkbox" id="checkbox32" checked="true" /><label for="checkbox32">Pluggable architecture, in addition to core functions, other functions are provided as plugins, which can be used as needed to reduce packaging volume</label></li>
<li><input type="checkbox" id="checkbox33" checked="true" /><label for="checkbox33">Support logical structure chart, mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
<li><input type="checkbox" id="checkbox34" checked="true" /><label for="checkbox34">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
<li><input type="checkbox" id="checkbox35" checked="true" /><label for="checkbox35">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
<li><input type="checkbox" id="checkbox36" checked="true" /><label for="checkbox36">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, and fully customize node content using DDM</label></li>
<li><input type="checkbox" id="checkbox37" checked="true" /><label for="checkbox37">Support canvas dragging and scaling</label></li>
<li><input type="checkbox" id="checkbox38" checked="true" /><label for="checkbox38">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
<li><input type="checkbox" id="checkbox39" checked="true" /><label for="checkbox39">Supoorts to export as </label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>, support import from <code>json</code><code>xmind</code><code>markdown</code></li>
<li><input type="checkbox" id="checkbox40" checked="true" /><label for="checkbox40">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, and scrollbar</label></li>
<li><input type="checkbox" id="checkbox41" checked="true" /><label for="checkbox41">Provide rich configurations to meet various scenarios and usage habits</label></li>
<li><input type="checkbox" id="checkbox42" checked="true" /><label for="checkbox42">Support collaborative editing</label></li>
</ul>
<blockquote>
<p>Features that will not be implemented:</p>
@ -34,16 +34,16 @@ frameworks such as Vue and React, or without a framework.</p>
<p>This is an online mind map built using the <code>simple-mind-map</code> library and based
on <code>Vue2.x</code> and <code>ElementUI</code>. Features include:</p>
<ul>
<li><input type="checkbox" id="checkbox59" checked="true" /><label for="checkbox59">Toolbar, which supports inserting and deleting nodes, and editing node</label>
<li><input type="checkbox" id="checkbox43" checked="true" /><label for="checkbox43">Toolbar, which supports inserting and deleting nodes, and editing node</label>
images, icons, hyperlinks, notes, tags, and summaries</li>
<li><input type="checkbox" id="checkbox60" checked="true" /><label for="checkbox60">Sidebar, with panels for basic style settings, node style settings,</label>
<li><input type="checkbox" id="checkbox44" checked="true" /><label for="checkbox44">Sidebar, with panels for basic style settings, node style settings,</label>
outline, theme selection, and structure selection</li>
<li><input type="checkbox" id="checkbox61" checked="true" /><label for="checkbox61">Import and export functionality; data is saved in the browser's local</label>
<li><input type="checkbox" id="checkbox45" checked="true" /><label for="checkbox45">Import and export functionality; data is saved in the browser's local</label>
storage by default, but it also supports creating, opening, and editing
local files on the computer directly</li>
<li><input type="checkbox" id="checkbox62" checked="true" /><label for="checkbox62">Right-click menu, which supports operations such as expanding, collapsing,</label>
<li><input type="checkbox" id="checkbox46" checked="true" /><label for="checkbox46">Right-click menu, which supports operations such as expanding, collapsing,</label>
and organizing layout</li>
<li><input type="checkbox" id="checkbox63" checked="true" /><label for="checkbox63">Bottom bar, which supports node and word count statistics, switching</label>
<li><input type="checkbox" id="checkbox47" checked="true" /><label for="checkbox47">Bottom bar, which supports node and word count statistics, switching</label>
between edit and read-only modes, zooming in and out, and switching to
full screen, support mini map</li>
</ul>
@ -305,6 +305,12 @@ full screen, support mini map</li>
<img src="../../../../assets/avatar/L.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>L</p>
</div>
</div>
<div style="display: flex;">
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/default.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>sunniberg</p>
</div>
</div>
</div>
</template>

View File

@ -261,9 +261,19 @@ Setting the node hyperlink, a shortcut for the `SET_NODE_HYPERLINK` command
Setting the node note, a shortcut for the `SET_NODE_NOTE` command
### setAttachment(url, name)
> v0.9.10+
- `url`Attachment url
- `name`Attachment name, optional
Set node attachments, a shortcut for the `SET_NODE_ATTACHMENT` command
### setTag(tag)
Setting the node tag, a shortcut for the `SET_NODE_TAG` command"
Setting the node tag, a shortcut for the `SET_NODE_TAG` command
### hide()

View File

@ -195,8 +195,21 @@ nodeData, <code>SET_NODE_DATA</code> command's shortcut method. This method and
<p>Setting the node hyperlink, a shortcut for the <code>SET_NODE_HYPERLINK</code> command</p>
<h3>setNote(note)</h3>
<p>Setting the node note, a shortcut for the <code>SET_NODE_NOTE</code> command</p>
<h3>setAttachment(url, name)</h3>
<blockquote>
<p>v0.9.10+</p>
</blockquote>
<ul>
<li>
<p><code>url</code>Attachment url</p>
</li>
<li>
<p><code>name</code>Attachment name, optional</p>
</li>
</ul>
<p>Set node attachments, a shortcut for the <code>SET_NODE_ATTACHMENT</code> command</p>
<h3>setTag(tag)</h3>
<p>Setting the node tag, a shortcut for the <code>SET_NODE_TAG</code> command&quot;</p>
<p>Setting the node tag, a shortcut for the <code>SET_NODE_TAG</code> command</p>
<h3>hide()</h3>
<blockquote>
<p>v0.1.5+</p>

View File

@ -33,6 +33,7 @@ export default [
{ path: 'course24', title: '如何开发一个插件' },
{ path: 'course25', title: '关于概要' },
{ path: 'course26', title: '如何实现AI生成节点内容' },
{ path: 'course27', title: '快捷键操作如何传递自定义参数' },
{ path: 'doExport', title: 'Export 插件' },
{ path: 'drag', title: 'Drag插件' },
{ path: 'introduction', title: '简介' },

View File

@ -1,5 +1,27 @@
# Changelog
## 0.9.10
修复:
> 1.修复搜索时全部替换操作报错的问题;
>
> 2.修复节点文本存在svg不支持的实体字符时小地图无法渲染的问题
新增:
> 1.新增画布移动时的事件translate
>
> 2.节点内容支持设置附件;
Demo
> 1.支持拖拽文件到页面进行导入;
客户端:
> 1.节点支持添加附件;
## 0.9.9-fix.2
修复:

View File

@ -1,6 +1,25 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.9.10</h2>
<p>修复</p>
<blockquote>
<p>1.修复搜索时全部替换操作报错的问题</p>
<p>2.修复节点文本存在svg不支持的实体字符时小地图无法渲染的问题</p>
</blockquote>
<p>新增</p>
<blockquote>
<p>1.新增画布移动时的事件translate</p>
<p>2.节点内容支持设置附件</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.支持拖拽文件到页面进行导入</p>
</blockquote>
<p>客户端</p>
<blockquote>
<p>1.节点支持添加附件</p>
</blockquote>
<h2>0.9.9-fix.2</h2>
<p>修复</p>
<blockquote>

View File

@ -141,6 +141,8 @@ const mindMap = new MindMap({
hyperlink: '', // 超链接地址
hyperlinkTitle: '', // 超链接的标题
note: '', // 备注的内容
attachmentUrl: '',// v0.9.10+附件url
attachmentName: '',// v0.9.10+,附件名称
tag: [], // 标签列表
generalization: {// 节点的概要如果没有概要generalization设为null即可
text: ''// 概要的文本
@ -452,7 +454,8 @@ mindMap.setTheme('主题名称')
| expand_btn_click | 节点展开或收缩事件 | this节点实例 |
| before_show_text_edit | 节点文本编辑框即将打开事件 | |
| hide_text_edit | 节点文本编辑框关闭事件 | textEditNode文本编辑框DOM节点、activeNodeList当前激活的所有节点列表 |
| scale | 放大缩小事件 | scale缩放比例 |
| scale | 画布放大缩小事件 | scale缩放比例 |
| translatev0.9.10+ | 画布移动事件 | x水平位移、y垂直位移 |
| node_img_dblclickv0.2.15+ | 节点内图片的双击事件 | this节点实例、e事件对象 |
| node_img_mouseenterv0.6.5+ | 节点内图片的鼠标移入事件 | this节点实例、imgNode图片节点、e事件对象 |
| node_img_mouseleavev0.6.5+ | 节点内图片的鼠标移出事件 | this节点实例、imgNode图片节点、e事件对象 |
@ -576,6 +579,7 @@ mindMap.updateConfig({
| SET_NODE_ICON | 设置节点图标 | node要设置的节点、icons数组预定义的图片名称组成的数组可用图标可在[icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js)文件里的`nodeIconList`列表里获取到,图标名称为`type_name`,如`['priority_1']` |
| SET_NODE_HYPERLINK | 设置节点超链接 | node要设置的节点、link超链接地址、title超链接名称可选 |
| SET_NODE_NOTE | 设置节点备注 | node要设置的节点、note备注文字 |
| SET_NODE_ATTACHMENTv0.9.10+ | 设置节点附件 | node要设置的节点、url附件url、name附件名称可选 |
| SET_NODE_TAG | 设置节点标签 | node要设置的节点、tag字符串数组内置颜色信息可在[constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js)里获取到) |
| INSERT_AFTERv0.1.5+ | 将节点移动到另一个节点的后面 | node要移动的节点v0.7.2+支持传递节点数组实现同时移动多个节点))、 exist目标节点 |
| INSERT_BEFOREv0.1.5+ | 将节点移动到另一个节点的前面v0.7.2+支持传递节点数组实现同时移动多个节点) | node要移动的节点、 exist目标节点 |

View File

@ -606,6 +606,8 @@
<span class="hljs-attr">hyperlink</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">hyperlinkTitle</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">note</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">attachmentUrl</span>: <span class="hljs-string">&#x27;&#x27;</span>,<span class="hljs-comment">// v0.9.10+url</span>
<span class="hljs-attr">attachmentName</span>: <span class="hljs-string">&#x27;&#x27;</span>,<span class="hljs-comment">// v0.9.10+</span>
<span class="hljs-attr">tag</span>: [], <span class="hljs-comment">// </span>
<span class="hljs-attr">generalization</span>: {<span class="hljs-comment">// generalizationnull</span>
<span class="hljs-attr">text</span>: <span class="hljs-string">&#x27;&#x27;</span><span class="hljs-comment">// </span>
@ -1008,10 +1010,15 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
</tr>
<tr>
<td>scale</td>
<td>放大缩小事件</td>
<td>画布放大缩小事件</td>
<td>scale缩放比例</td>
</tr>
<tr>
<td>translatev0.9.10+</td>
<td>画布移动事件</td>
<td>x水平位移y垂直位移</td>
</tr>
<tr>
<td>node_img_dblclickv0.2.15+</td>
<td>节点内图片的双击事件</td>
<td>this节点实例e事件对象</td>
@ -1319,6 +1326,11 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
<td>node要设置的节点note备注文字</td>
</tr>
<tr>
<td>SET_NODE_ATTACHMENTv0.9.10+</td>
<td>设置节点附件</td>
<td>node要设置的节点url附件urlname附件名称可选</td>
</tr>
<tr>
<td>SET_NODE_TAG</td>
<td>设置节点标签</td>
<td>node要设置的节点tag字符串数组内置颜色信息可在<a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js">constant.js</a>里获取到</td>

View File

@ -25,33 +25,38 @@
```js
{
data: {
// 节点文本
text: '根节点',
// 图片
image: 'xxx.jpg',
imageTitle: '图片名称',
imageSize: {
width: 1152,
height: 1152
},
// 图标
icon: ['priority_1'],
// 标签
tag: ['标签1', '标签2'],
// 链接
hyperlink: 'http://lxqnsys.com/',
hyperlinkTitle: '理想青年实验室',
// 备注内容
note: '理想青年实验室\n一个有意思的角落',
// 概要
generalization: {
text: '概要的内容'
},
// 节点是否展开
expand: true,
data: {
text: '', // 节点的文本可以是富文本也就是html格式的此时richText要设为true
richText: false, // 节点的文本是否是富文本模式
expand: true, // 节点是否展开
uid: '',// 节点唯一的id可不传内部会生成
icon: [], // 图标,格式可参考教程里的【插入和扩展节点图标】章节
image: '', // 图片的url
imageTitle: '', // 图片的标题,可为空
imageSize: { // 图片的尺寸
width: 100, // 图片的宽度,必传
height: 100, // 图片的高度,必传
custom: false // 如果设为true图片的显示大小不受主题控制以imageSize.width和imageSize.height为准
},
children: []// 子节点
hyperlink: '', // 超链接地址
hyperlinkTitle: '', // 超链接的标题
note: '', // 备注的内容
attachmentUrl: '',// v0.9.10+附件url
attachmentName: '',// v0.9.10+,附件名称
tag: [], // 标签列表
generalization: {// 节点的概要如果没有概要generalization设为null即可
text: ''// 概要的文本
},
associativeLineTargets: [''],// 如果存在关联线那么为目标节点的uid列表
associativeLineText: '',// 关联线文本
// ...其他样式字段,可以参考主题
},
children [// 子节点,结构和根节点一致
{
data: {},
children: []
}
]
}
```

View File

@ -17,33 +17,38 @@
<p>这是为了避免节点内的文字因为默认样式而出现偏移</p>
<p>一个节点的基本数据结构如下所示</p>
<pre class="hljs"><code>{
<span class="hljs-attr">data</span>: {
<span class="hljs-comment">// </span>
<span class="hljs-attr">text</span>: <span class="hljs-string">&#x27;根节点&#x27;</span>,
<span class="hljs-comment">// </span>
<span class="hljs-attr">image</span>: <span class="hljs-string">&#x27;xxx.jpg&#x27;</span>,
<span class="hljs-attr">imageTitle</span>: <span class="hljs-string">&#x27;图片名称&#x27;</span>,
<span class="hljs-attr">imageSize</span>: {
<span class="hljs-attr">width</span>: <span class="hljs-number">1152</span>,
<span class="hljs-attr">height</span>: <span class="hljs-number">1152</span>
},
<span class="hljs-comment">// </span>
<span class="hljs-attr">icon</span>: [<span class="hljs-string">&#x27;priority_1&#x27;</span>],
<span class="hljs-comment">// </span>
<span class="hljs-attr">tag</span>: [<span class="hljs-string">&#x27;标签1&#x27;</span>, <span class="hljs-string">&#x27;标签2&#x27;</span>],
<span class="hljs-comment">// </span>
<span class="hljs-attr">hyperlink</span>: <span class="hljs-string">&#x27;http://lxqnsys.com/&#x27;</span>,
<span class="hljs-attr">hyperlinkTitle</span>: <span class="hljs-string">&#x27;理想青年实验室&#x27;</span>,
<span class="hljs-comment">// </span>
<span class="hljs-attr">note</span>: <span class="hljs-string">&#x27;理想青年实验室\n一个有意思的角落&#x27;</span>,
<span class="hljs-comment">// </span>
<span class="hljs-attr">generalization</span>: {
<span class="hljs-attr">text</span>: <span class="hljs-string">&#x27;概要的内容&#x27;</span>
},
<span class="hljs-comment">// </span>
<span class="hljs-attr">expand</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">data</span>: {
<span class="hljs-attr">text</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// htmlrichTexttrue</span>
<span class="hljs-attr">richText</span>: <span class="hljs-literal">false</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">expand</span>: <span class="hljs-literal">true</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">uid</span>: <span class="hljs-string">&#x27;&#x27;</span>,<span class="hljs-comment">// id</span>
<span class="hljs-attr">icon</span>: [], <span class="hljs-comment">// </span>
<span class="hljs-attr">image</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// url</span>
<span class="hljs-attr">imageTitle</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">imageSize</span>: { <span class="hljs-comment">// </span>
<span class="hljs-attr">width</span>: <span class="hljs-number">100</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">height</span>: <span class="hljs-number">100</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">custom</span>: <span class="hljs-literal">false</span> <span class="hljs-comment">// trueimageSize.widthimageSize.height</span>
},
<span class="hljs-attr">children</span>: []<span class="hljs-comment">// </span>
<span class="hljs-attr">hyperlink</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">hyperlinkTitle</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">note</span>: <span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-comment">// </span>
<span class="hljs-attr">attachmentUrl</span>: <span class="hljs-string">&#x27;&#x27;</span>,<span class="hljs-comment">// v0.9.10+url</span>
<span class="hljs-attr">attachmentName</span>: <span class="hljs-string">&#x27;&#x27;</span>,<span class="hljs-comment">// v0.9.10+</span>
<span class="hljs-attr">tag</span>: [], <span class="hljs-comment">// </span>
<span class="hljs-attr">generalization</span>: {<span class="hljs-comment">// generalizationnull</span>
<span class="hljs-attr">text</span>: <span class="hljs-string">&#x27;&#x27;</span><span class="hljs-comment">// </span>
},
<span class="hljs-attr">associativeLineTargets</span>: [<span class="hljs-string">&#x27;&#x27;</span>],<span class="hljs-comment">// 线uid</span>
<span class="hljs-attr">associativeLineText</span>: <span class="hljs-string">&#x27;&#x27;</span>,<span class="hljs-comment">// 线</span>
<span class="hljs-comment">// ...</span>
},
children [<span class="hljs-comment">// </span>
{
<span class="hljs-attr">data</span>: {},
<span class="hljs-attr">children</span>: []
}
]
}
</code></pre>
<p><code>icon</code>可以使用内置的图标完整图标可以在<a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js">icons.js</a>文件中查看也可以扩展图标参考<a href="https://wanglin2.github.io/mind-map/#/doc/zh/course19/%E6%89%A9%E5%B1%95%E5%9B%BE%E6%A0%87">扩展图标</a></p>

View File

@ -0,0 +1,49 @@
# 快捷键操作如何传递自定义参数
库提供了很多命令,比如插入子节点的`INSERT_CHILD_NODE`等这些命令大多可以接收一定参数比如在插入节点时我想指定初始文本和节点uid那么可以这样调用
```js
mindMap.execCommand('INSERT_CHILD_NODE', true, [], {
text: '初始文本',
uid: 'xxx'
})
```
但是同时库内部也默认注册了很多快捷键,比如插入下级节点的`Tab`快捷键,很遗憾,目前快捷键操作无法让你传入自定义的参数,那么该怎么办呢,可以这样处理,首先确定你要给什么快捷键传入参数,比如`Tab`,那么首先可以调用如下方法删除库默认注册的快捷键:
```js
const keyName = 'Tab'
mindMap.keyCommand.removeShortcut(keyName)
```
然后再重新注册即可:
```js
mindMap.keyCommand.addShortcut(keyName, () => {
mindMap.execCommand('INSERT_CHILD_NODE', true, [], {
text: '初始文本',
uid: 'xxx'
})
})
```
库内部默认注册的快捷键对应的命令一览:
| 快捷键 | 命令 |
| --------------- | ------------------- |
| Control+z | BACK |
| Control+y | FORWARD |
| Tab | INSERT_CHILD_NODE |
| Insert | INSERT_CHILD_NODE |
| Enter | INSERT_NODE |
| Shift+Tab | INSERT_PARENT_NODE |
| Control+g | ADD_GENERALIZATION |
| Del或Backspace | REMOVE_NODE |
| Shift+Backspace | REMOVE_CURRENT_NODE |
| Control+a | SELECT_ALL |
| Control+l | RESET_LAYOUT |
| Control+Up | UP_NODE |
| Control+Down | DOWN_NODE |

View File

@ -0,0 +1,97 @@
<template>
<div>
<h1>快捷键操作如何传递自定义参数</h1>
<p>库提供了很多命令比如插入子节点的<code>INSERT_CHILD_NODE</code>这些命令大多可以接收一定参数比如在插入节点时我想指定初始文本和节点uid那么可以这样调用</p>
<pre class="hljs"><code>mindMap.execCommand(<span class="hljs-string">&#x27;INSERT_CHILD_NODE&#x27;</span>, <span class="hljs-literal">true</span>, [], {
<span class="hljs-attr">text</span>: <span class="hljs-string">&#x27;初始文本&#x27;</span>,
<span class="hljs-attr">uid</span>: <span class="hljs-string">&#x27;xxx&#x27;</span>
})
</code></pre>
<p>但是同时库内部也默认注册了很多快捷键比如插入下级节点的<code>Tab</code>快捷键很遗憾目前快捷键操作无法让你传入自定义的参数那么该怎么办呢可以这样处理首先确定你要给什么快捷键传入参数比如<code>Tab</code>那么首先可以调用如下方法删除库默认注册的快捷键</p>
<pre class="hljs"><code><span class="hljs-keyword">const</span> keyName = <span class="hljs-string">&#x27;Tab&#x27;</span>
mindMap.keyCommand.removeShortcut(keyName)
</code></pre>
<p>然后再重新注册即可</p>
<pre class="hljs"><code>mindMap.keyCommand.addShortcut(keyName, <span class="hljs-function">() =&gt;</span> {
mindMap.execCommand(<span class="hljs-string">&#x27;INSERT_CHILD_NODE&#x27;</span>, <span class="hljs-literal">true</span>, [], {
<span class="hljs-attr">text</span>: <span class="hljs-string">&#x27;初始文本&#x27;</span>,
<span class="hljs-attr">uid</span>: <span class="hljs-string">&#x27;xxx&#x27;</span>
})
})
</code></pre>
<p>库内部默认注册的快捷键对应的命令一览</p>
<table>
<thead>
<tr>
<th>快捷键</th>
<th>命令</th>
</tr>
</thead>
<tbody>
<tr>
<td>Control+z</td>
<td>BACK</td>
</tr>
<tr>
<td>Control+y</td>
<td>FORWARD</td>
</tr>
<tr>
<td>Tab</td>
<td>INSERT_CHILD_NODE</td>
</tr>
<tr>
<td>Insert</td>
<td>INSERT_CHILD_NODE</td>
</tr>
<tr>
<td>Enter</td>
<td>INSERT_NODE</td>
</tr>
<tr>
<td>Shift+Tab</td>
<td>INSERT_PARENT_NODE</td>
</tr>
<tr>
<td>Control+g</td>
<td>ADD_GENERALIZATION</td>
</tr>
<tr>
<td>Del或Backspace</td>
<td>REMOVE_NODE</td>
</tr>
<tr>
<td>Shift+Backspace</td>
<td>REMOVE_CURRENT_NODE</td>
</tr>
<tr>
<td>Control+a</td>
<td>SELECT_ALL</td>
</tr>
<tr>
<td>Control+l</td>
<td>RESET_LAYOUT</td>
</tr>
<tr>
<td>Control+Up</td>
<td>UP_NODE</td>
</tr>
<tr>
<td>Control+Down</td>
<td>DOWN_NODE</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -2,6 +2,10 @@
> 节点自由拖拽的连线可能不会符合你的预期,这个问题基本上不会改,所以自由拖拽功能不建议使用。
> 另外不要把节点拖拽和自由拖拽搞混,节点拖拽指拖动节点到其他节点上成为其子节点或兄弟节点,自由拖拽只是可以把节点放置在你拖动到的画布位置,并不能改变节点的层级。
> 最后要注意这两个功能都需要先注册Drag插件。
节点支持自由拖拽,也就是可以把它拖动到你指定的位置,默认是不开启的,如果需要开启可以在实例化`simple-mind-map`时传入开启的选项:
```js

View File

@ -4,6 +4,12 @@
<blockquote>
<p>节点自由拖拽的连线可能不会符合你的预期这个问题基本上不会改所以自由拖拽功能不建议使用</p>
</blockquote>
<blockquote>
<p>另外不要把节点拖拽和自由拖拽搞混节点拖拽指拖动节点到其他节点上成为其子节点或兄弟节点自由拖拽只是可以把节点放置在你拖动到的画布位置并不能改变节点的层级</p>
</blockquote>
<blockquote>
<p>最后要注意这两个功能都需要先注册Drag插件</p>
</blockquote>
<p>节点支持自由拖拽也就是可以把它拖动到你指定的位置默认是不开启的如果需要开启可以在实例化<code>simple-mind-map</code>时传入开启的选项</p>
<pre class="hljs"><code><span class="hljs-keyword">new</span> MindMap({
<span class="hljs-comment">// ...</span>

View File

@ -344,4 +344,10 @@
<img src="../../../../assets/avatar/L.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>L</p>
</div>
</div>
<div style="display: flex;">
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/default.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>sunniberg</p>
</div>
</div>

View File

@ -8,17 +8,17 @@
</blockquote>
<h2>特性</h2>
<ul>
<li><input type="checkbox" id="checkbox32" checked="true" /><label for="checkbox32">插件化架构除核心功能外其他功能作为插件提供按需使用减小打包体积</label></li>
<li><input type="checkbox" id="checkbox33" checked="true" /><label for="checkbox33">支持逻辑结构图思维导图组织结构图目录组织图时间轴横向竖向鱼骨图等结构</label></li>
<li><input type="checkbox" id="checkbox34" checked="true" /><label for="checkbox34">内置多种主题允许高度自定义样式支持注册新主题</label></li>
<li><input type="checkbox" id="checkbox35" checked="true" /><label for="checkbox35">节点内容支持文本普通文本富文本图片图标超链接备注标签概要数学公式</label></li>
<li><input type="checkbox" id="checkbox36" checked="true" /><label for="checkbox36">节点支持拖拽拖拽移动自由调整多种节点形状支持使用 DDM 完全自定义节点内容</label></li>
<li><input type="checkbox" id="checkbox37" checked="true" /><label for="checkbox37">支持画布拖动缩放</label></li>
<li><input type="checkbox" id="checkbox38" checked="true" /><label for="checkbox38">支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式</label></li>
<li><input type="checkbox" id="checkbox39" checked="true" /><label for="checkbox39">支持导出为</label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>支持从<code>json</code><code>xmind</code><code>markdown</code>导入</li>
<li><input type="checkbox" id="checkbox40" checked="true" /><label for="checkbox40">支持快捷键前进后退关联线搜索替换小地图水印滚动条</label></li>
<li><input type="checkbox" id="checkbox41" checked="true" /><label for="checkbox41">提供丰富的配置满足各种场景各种使用习惯</label></li>
<li><input type="checkbox" id="checkbox42" checked="true" /><label for="checkbox42">支持协同编辑</label></li>
<li><input type="checkbox" id="checkbox16" checked="true" /><label for="checkbox16">插件化架构除核心功能外其他功能作为插件提供按需使用减小打包体积</label></li>
<li><input type="checkbox" id="checkbox17" checked="true" /><label for="checkbox17">支持逻辑结构图思维导图组织结构图目录组织图时间轴横向竖向鱼骨图等结构</label></li>
<li><input type="checkbox" id="checkbox18" checked="true" /><label for="checkbox18">内置多种主题允许高度自定义样式支持注册新主题</label></li>
<li><input type="checkbox" id="checkbox19" checked="true" /><label for="checkbox19">节点内容支持文本普通文本富文本图片图标超链接备注标签概要数学公式</label></li>
<li><input type="checkbox" id="checkbox20" checked="true" /><label for="checkbox20">节点支持拖拽拖拽移动自由调整多种节点形状支持使用 DDM 完全自定义节点内容</label></li>
<li><input type="checkbox" id="checkbox21" checked="true" /><label for="checkbox21">支持画布拖动缩放</label></li>
<li><input type="checkbox" id="checkbox22" checked="true" /><label for="checkbox22">支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式</label></li>
<li><input type="checkbox" id="checkbox23" checked="true" /><label for="checkbox23">支持导出为</label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>支持从<code>json</code><code>xmind</code><code>markdown</code>导入</li>
<li><input type="checkbox" id="checkbox24" checked="true" /><label for="checkbox24">支持快捷键前进后退关联线搜索替换小地图水印滚动条</label></li>
<li><input type="checkbox" id="checkbox25" checked="true" /><label for="checkbox25">提供丰富的配置满足各种场景各种使用习惯</label></li>
<li><input type="checkbox" id="checkbox26" checked="true" /><label for="checkbox26">支持协同编辑</label></li>
</ul>
<blockquote>
<p>不会实现的特性</p>
@ -32,11 +32,11 @@
<p>2.<code>web</code></p>
<p>使用<code>simple-mind-map</code>基于<code>vue2.x</code><code>ElementUI</code>搭建的在线思维导图特性</p>
<ul>
<li><input type="checkbox" id="checkbox43" checked="true" /><label for="checkbox43">工具栏支持插入节点删除节点编辑节点图片图标超链接备注标签概要</label></li>
<li><input type="checkbox" id="checkbox44" checked="true" /><label for="checkbox44">侧边栏基础样式设置面板节点样式设置面板大纲面板主题选择面板结构选择面板</label></li>
<li><input type="checkbox" id="checkbox45" checked="true" /><label for="checkbox45">导入导出功能数据默认保存在浏览器本地存储也支持直接创建打开编辑电脑本地文件</label></li>
<li><input type="checkbox" id="checkbox46" checked="true" /><label for="checkbox46">右键菜单支持展开收起整理布局等操作</label></li>
<li><input type="checkbox" id="checkbox47" checked="true" /><label for="checkbox47">底部栏支持节点数量字数统计支持切换编辑和只读模式支持放大缩小支持全屏切换支持小地图</label></li>
<li><input type="checkbox" id="checkbox27" checked="true" /><label for="checkbox27">工具栏支持插入节点删除节点编辑节点图片图标超链接备注标签概要</label></li>
<li><input type="checkbox" id="checkbox28" checked="true" /><label for="checkbox28">侧边栏基础样式设置面板节点样式设置面板大纲面板主题选择面板结构选择面板</label></li>
<li><input type="checkbox" id="checkbox29" checked="true" /><label for="checkbox29">导入导出功能数据默认保存在浏览器本地存储也支持直接创建打开编辑电脑本地文件</label></li>
<li><input type="checkbox" id="checkbox30" checked="true" /><label for="checkbox30">右键菜单支持展开收起整理布局等操作</label></li>
<li><input type="checkbox" id="checkbox31" checked="true" /><label for="checkbox31">底部栏支持节点数量字数统计支持切换编辑和只读模式支持放大缩小支持全屏切换支持小地图</label></li>
</ul>
<p>提供文档页面服务</p>
<p>3.<code>dist</code></p>
@ -299,6 +299,12 @@
<img src="../../../../assets/avatar/L.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>L</p>
</div>
</div>
<div style="display: flex;">
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
<img src="../../../../assets/avatar/default.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
<p>sunniberg</p>
</div>
</div>
</div>
</template>

View File

@ -258,6 +258,16 @@
设置节点备注,`SET_NODE_NOTE`命令的快捷方法
### setAttachment(url, name)
> v0.9.10+
- `url`附件的url
- `name`:附件的名称,可选
设置节点附件,`SET_NODE_ATTACHMENT`命令的快捷方法
### setTag(tag)
设置节点标签,`SET_NODE_TAG`的快捷方法

View File

@ -188,6 +188,19 @@
<p>设置节点超链接<code>SET_NODE_HYPERLINK</code>命令的快捷方法</p>
<h3>setNote(note)</h3>
<p>设置节点备注<code>SET_NODE_NOTE</code>命令的快捷方法</p>
<h3>setAttachment(url, name)</h3>
<blockquote>
<p>v0.9.10+</p>
</blockquote>
<ul>
<li>
<p><code>url</code>附件的url</p>
</li>
<li>
<p><code>name</code>附件的名称可选</p>
</li>
</ul>
<p>设置节点附件<code>SET_NODE_ATTACHMENT</code>命令的快捷方法</p>
<h3>setTag(tag)</h3>
<p>设置节点标签<code>SET_NODE_TAG</code>的快捷方法</p>
<h3>hide()</h3>

View File

@ -1,5 +1,12 @@
<template>
<div class="editContainer" :style="{top: IS_ELECTRON ? '40px' : 0}">
<div
class="editContainer"
:style="{ top: IS_ELECTRON ? '40px' : 0 }"
@dragenter.stop.prevent="onDragenter"
@dragleave.stop.prevent
@dragover.stop.prevent
@drop.stop.prevent
>
<div class="mindMapContainer" ref="mindMapContainer"></div>
<Count :mindMap="mindMap" v-if="!isZenMode"></Count>
<Navigator :mindMap="mindMap"></Navigator>
@ -26,6 +33,15 @@
<Scrollbar v-if="isShowScrollbar && mindMap" :mindMap="mindMap"></Scrollbar>
<FormulaSidebar v-if="mindMap" :mindMap="mindMap"></FormulaSidebar>
<SourceCodeEdit v-if="mindMap" :mindMap="mindMap"></SourceCodeEdit>
<div
class="dragMask"
v-if="showDragMask"
@dragleave.stop.prevent="onDragleave"
@dragover.stop.prevent
@drop.stop.prevent="onDrop"
>
<div class="dragTip">{{ $t('edit.dragTip') }}</div>
</div>
</div>
</template>
@ -80,7 +96,10 @@ import i18n from '../../../i18n'
import Search from './Search.vue'
import NodeIconSidebar from './NodeIconSidebar.vue'
import NodeIconToolbar from './NodeIconToolbar.vue'
import { removeMindMapNodeStickerProtocol, addMindMapNodeStickerProtocol } from '@/utils'
import {
removeMindMapNodeStickerProtocol,
addMindMapNodeStickerProtocol
} from '@/utils'
import OutlineEdit from './OutlineEdit.vue'
import { showLoading, hideLoading } from '@/utils/loading'
import handleClipboardText from '@/utils/handleClipboardText'
@ -153,7 +172,8 @@ export default {
isFirst: true,
autoSaveTimer: null,
isNewFile: false,
storeConfigTimer: null
storeConfigTimer: null,
showDragMask: false
}
},
computed: {
@ -511,11 +531,12 @@ export default {
})
if (this.openNodeRichText) this.addRichTextPlugin()
if (this.isShowScrollbar) this.addScrollbarPlugin()
if (this.isUseHandDrawnLikeStyle) this.addHandDrawnLikeStylePlugin()
// this.mindMap.keyCommand.addShortcut('Control+s', () => {
// this.manualSave()
// })
//
if (this.isUseHandDrawnLikeStyle)
this.addHandDrawnLikeStylePlugin()
// this.mindMap.keyCommand.addShortcut('Control+s', () => {
// this.manualSave()
// })
//
;[
'node_active',
'data_change',
@ -678,14 +699,18 @@ export default {
let id = this.$route.params.id
let data = this.mindMap.getData(true)
removeMindMapNodeStickerProtocol(data.root)
let res = await window.electronAPI.save(id, JSON.stringify(data), this.fileName)
let res = await window.electronAPI.save(
id,
JSON.stringify(data),
this.fileName
)
if (res) {
this.isNewFile = false
this.setFileName(res)
}
this.setIsUnSave(false)
},
//
addScrollbarPlugin() {
if (!this.mindMap) return
@ -844,6 +869,20 @@ export default {
: ''
})
}
},
//
onDragenter() {
this.showDragMask = true
},
onDragleave() {
this.showDragMask = false
},
onDrop(e) {
this.showDragMask = false
const dt = e.dataTransfer
const file = dt.files && dt.files[0]
this.$bus.$emit('importFile', file)
}
}
}
@ -857,6 +896,24 @@ export default {
top: 0;
bottom: 0;
.dragMask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 3999;
.dragTip {
pointer-events: none;
font-weight: bold;
}
}
.mindMapContainer {
position: absolute;
left: 0px;

View File

@ -63,10 +63,12 @@ export default {
created() {
this.$bus.$on('showImport', this.handleShowImport)
this.$bus.$on('handle_file_url', this.handleFileURL)
this.$bus.$on('importFile', this.handleImportFile)
},
beforeDestroy() {
this.$bus.$off('showImport', this.handleShowImport)
this.$bus.$off('handle_file_url', this.handleFileURL)
this.$bus.$off('importFile', this.handleImportFile)
},
methods: {
...mapMutations(['setActiveSidebar']),
@ -287,6 +289,16 @@ export default {
this.$message.error(this.$t('import.fileParsingFailed'))
}
}
},
//
handleImportFile(file) {
this.onChange({
raw: file,
name: file.name
})
if (this.fileList.length <= 0) return
this.confirm()
}
}
}

View File

@ -119,7 +119,6 @@ export default {
//
onScale() {
console.log(1)
if (!this.node || !this.show) return
this.updatePosition()
},