mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-24 02:20:07 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fb35d656f | ||
|
|
cec1f59189 | ||
|
|
a6a890362e | ||
|
|
83b6d5793b | ||
|
|
9b40a7bedd | ||
|
|
11f2078ee0 | ||
|
|
4fb9bd5135 | ||
|
|
cf56b5db24 | ||
|
|
40ea595e62 | ||
|
|
91a9d7b556 | ||
|
|
0669e73a5b | ||
|
|
fde6fc2583 | ||
|
|
f92146a1f4 | ||
|
|
38c6966d13 | ||
|
|
4894d9e6e6 |
12
README.md
12
README.md
@@ -103,7 +103,9 @@ const mindMap = new MindMap({
|
||||
|
||||
# 微信交流群
|
||||
|
||||
群聊人数较多,无法通过二维码入群,可以微信添加`wanglinguanfang`拉你入群。思维导图相关问题皆可在群里提问,不必私聊作者。
|
||||
一群已满,可以扫描如下二维码进入二群,如已过期,可以微信添加`wanglinguanfang`拉你入群。思维导图相关问题皆可在群里提问,不必私聊作者。
|
||||
|
||||
<img src="./qrcode.jpg" style="width: 300px" />
|
||||
|
||||
# star
|
||||
|
||||
@@ -439,4 +441,12 @@ const mindMap = new MindMap({
|
||||
<img src="./web/src/assets/avatar/ccccs.jpg" style="width: 50px;height: 50px;" />
|
||||
<span>ccccs</span>
|
||||
</span>
|
||||
<span>
|
||||
<img src="./web/src/assets/avatar/。.png" style="width: 50px;height: 50px;" />
|
||||
<span>。</span>
|
||||
</span>
|
||||
<span>
|
||||
<img src="./web/src/assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;" />
|
||||
<span>Jeffrey</span>
|
||||
</span>
|
||||
</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
dist/img/Jeffrey.jpg
vendored
Normal file
BIN
dist/img/Jeffrey.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
BIN
dist/img/qrcode.jpg
vendored
Normal file
BIN
dist/img/qrcode.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
BIN
dist/img/。.png
vendored
Normal file
BIN
dist/img/。.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
2
dist/js/app.js
vendored
2
dist/js/app.js
vendored
File diff suppressed because one or more lines are too long
1
dist/js/chunk-18bcf3fc.js
vendored
Normal file
1
dist/js/chunk-18bcf3fc.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/js/chunk-2d0ab10b.js
vendored
2
dist/js/chunk-2d0ab10b.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/chunk-2d0b1c6f.js
vendored
2
dist/js/chunk-2d0b1c6f.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/chunk-2d0c191e.js
vendored
2
dist/js/chunk-2d0c191e.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/chunk-2d0d5cb9.js
vendored
2
dist/js/chunk-2d0d5cb9.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/chunk-2d0f026c.js
vendored
2
dist/js/chunk-2d0f026c.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/chunk-2d208ffa.js
vendored
2
dist/js/chunk-2d208ffa.js
vendored
File diff suppressed because one or more lines are too long
1
dist/js/chunk-3324bc8a.js
vendored
Normal file
1
dist/js/chunk-3324bc8a.js
vendored
Normal file
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-47ab6502.js
vendored
Normal file
1
dist/js/chunk-47ab6502.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/js/chunk-583efa32.js
vendored
1
dist/js/chunk-583efa32.js
vendored
File diff suppressed because one or more lines are too long
1
dist/js/chunk-63012c17.js
vendored
1
dist/js/chunk-63012c17.js
vendored
File diff suppressed because one or more lines are too long
1
dist/js/chunk-cba4e134.js
vendored
1
dist/js/chunk-cba4e134.js
vendored
File diff suppressed because one or more lines are too long
@@ -9,7 +9,7 @@
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}</script><link href="dist/css/chunk-vendors.css?4d8e2833c3860a9a5265" rel="stylesheet"><link href="dist/css/app.css?4d8e2833c3860a9a5265" 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 = () => {
|
||||
}</script><link href="dist/css/chunk-vendors.css?23a496a1094c82432df0" rel="stylesheet"><link href="dist/css/app.css?23a496a1094c82432df0" 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({
|
||||
@@ -74,4 +74,4 @@
|
||||
// 可以通过window.$bus.$on()来监听应用的一些事件
|
||||
// 实例化页面
|
||||
window.initApp()
|
||||
}</script><script src="dist/js/chunk-vendors.js?4d8e2833c3860a9a5265"></script><script src="dist/js/app.js?4d8e2833c3860a9a5265"></script></body></html>
|
||||
}</script><script src="dist/js/chunk-vendors.js?23a496a1094c82432df0"></script><script src="dist/js/app.js?23a496a1094c82432df0"></script></body></html>
|
||||
BIN
qrcode.jpg
Normal file
BIN
qrcode.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
@@ -31,7 +31,7 @@ MindMap.iconList = icons.nodeIconList
|
||||
MindMap.constants = constants
|
||||
MindMap.themes = themes
|
||||
MindMap.defaultTheme = defaultTheme
|
||||
MindMap.version = '0.10.4'
|
||||
MindMap.version = '0.10.5'
|
||||
|
||||
MindMap.usePlugin(MiniMap)
|
||||
.usePlugin(Watermark)
|
||||
|
||||
@@ -208,8 +208,14 @@ class MindMap {
|
||||
|
||||
// 容器尺寸变化,调整尺寸
|
||||
resize() {
|
||||
const oldWidth = this.width
|
||||
const oldHeight = this.height
|
||||
this.getElRectInfo()
|
||||
this.svg.size(this.width, this.height)
|
||||
if (oldWidth !== this.width || oldHeight !== this.height) {
|
||||
// 如果画布宽高改变了需要触发一次渲染
|
||||
this.render()
|
||||
}
|
||||
this.emit('resize')
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "simple-mind-map",
|
||||
"version": "0.10.4",
|
||||
"version": "0.10.5",
|
||||
"description": "一个简单的web在线思维导图",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
@@ -1264,6 +1264,10 @@ class Render {
|
||||
// 如果是富文本模式,那么某些层级变化需要更新样式
|
||||
checkNodeLayerChange(node, toNode, toNodeIsParent = false) {
|
||||
if (this.mindMap.richText) {
|
||||
// 如果设置了自定义样式那么不需要更新
|
||||
if (this.mindMap.richText.checkNodeHasCustomRichTextStyle(node)) {
|
||||
return
|
||||
}
|
||||
const toIndex = toNodeIsParent ? toNode.layerIndex + 1 : toNode.layerIndex
|
||||
let nodeLayerChanged =
|
||||
(node.layerIndex === 1 && toIndex !== 1) ||
|
||||
@@ -1462,6 +1466,9 @@ class Render {
|
||||
this.checkNodeLayerChange(item, toNode, true)
|
||||
this.removeNodeFromActiveList(item)
|
||||
removeFromParentNodeData(item)
|
||||
toNode.setData({
|
||||
expand: true
|
||||
})
|
||||
toNode.nodeData.children.push(item.nodeData)
|
||||
})
|
||||
this.emitNodeActiveEvent()
|
||||
@@ -1475,10 +1482,24 @@ class Render {
|
||||
return
|
||||
}
|
||||
this.activeNodeList.forEach(node => {
|
||||
node.setData({
|
||||
expand: true
|
||||
})
|
||||
node.nodeData.children.push(
|
||||
...data.map(item => {
|
||||
const newData = simpleDeepClone(item)
|
||||
createUidForAppointNodes([newData], true)
|
||||
createUidForAppointNodes([newData], true, node => {
|
||||
// 可能跨层级复制,那么富文本样式需要更新
|
||||
if (this.mindMap.richText) {
|
||||
// 如果设置了自定义样式那么不需要更新
|
||||
if (
|
||||
this.mindMap.richText.checkNodeHasCustomRichTextStyle(node.data)
|
||||
) {
|
||||
return
|
||||
}
|
||||
node.data.resetRichText = true
|
||||
}
|
||||
})
|
||||
return newData
|
||||
})
|
||||
)
|
||||
|
||||
@@ -780,10 +780,12 @@ class Node {
|
||||
this.renderLine()
|
||||
const { openPerformance, performanceConfig } = this.mindMap.opt
|
||||
// 强制渲染、或没有开启性能模式、或不在画布可视区域内不渲染节点内容
|
||||
// 根节点不进行懒加载,始终渲染,因为滚动条插件依赖根节点进行计算
|
||||
if (
|
||||
forceRender ||
|
||||
!openPerformance ||
|
||||
this.checkIsInClient(performanceConfig.padding)
|
||||
this.checkIsInClient(performanceConfig.padding) ||
|
||||
this.isRoot
|
||||
) {
|
||||
if (!this.group) {
|
||||
// 创建组
|
||||
|
||||
@@ -68,6 +68,7 @@ class AssociativeLine {
|
||||
this.onNodeDragging = this.onNodeDragging.bind(this)
|
||||
this.onNodeDragend = this.onNodeDragend.bind(this)
|
||||
this.onControlPointMouseup = this.onControlPointMouseup.bind(this)
|
||||
this.cancelCreateLine = this.cancelCreateLine.bind(this)
|
||||
|
||||
// 节点树渲染完毕后渲染连接线
|
||||
this.mindMap.on('node_tree_render_end', this.renderAllLines)
|
||||
@@ -76,6 +77,7 @@ class AssociativeLine {
|
||||
// 监听画布和节点点击事件,用于清除当前激活的连接线
|
||||
this.mindMap.on('draw_click', this.onDrawClick)
|
||||
this.mindMap.on('node_click', this.onNodeClick)
|
||||
this.mindMap.on('contextmenu', this.cancelCreateLine)
|
||||
// 注册删除快捷键
|
||||
this.mindMap.keyCommand.addShortcut('Del|Backspace', this.removeLine)
|
||||
// 注册添加连接线的命令
|
||||
@@ -97,6 +99,7 @@ class AssociativeLine {
|
||||
this.mindMap.off('data_change', this.renderAllLines)
|
||||
this.mindMap.off('draw_click', this.onDrawClick)
|
||||
this.mindMap.off('node_click', this.onNodeClick)
|
||||
this.mindMap.off('contextmenu', this.cancelCreateLine)
|
||||
this.mindMap.keyCommand.removeShortcut('Del|Backspace', this.removeLine)
|
||||
this.mindMap.command.remove('ADD_ASSOCIATIVE_LINE', this.addLine)
|
||||
this.mindMap.off('mousemove', this.onMousemove)
|
||||
@@ -108,10 +111,14 @@ class AssociativeLine {
|
||||
|
||||
// 画布点击事件
|
||||
onDrawClick() {
|
||||
if (this.isControlPointMousedown) {
|
||||
return
|
||||
// 取消创建关联线
|
||||
if (this.isCreatingLine) {
|
||||
this.cancelCreateLine()
|
||||
}
|
||||
// 取消激活关联线
|
||||
if (this.isControlPointMousedown) {
|
||||
this.clearActiveLine()
|
||||
}
|
||||
this.clearActiveLine()
|
||||
}
|
||||
|
||||
// 节点点击事件
|
||||
@@ -346,6 +353,16 @@ class AssociativeLine {
|
||||
this.creatingLine.marker('end', this.marker)
|
||||
}
|
||||
|
||||
// 取消创建关联线
|
||||
cancelCreateLine() {
|
||||
this.isCreatingLine = false
|
||||
this.creatingStartNode = null
|
||||
this.creatingLine.remove()
|
||||
this.creatingLine = null
|
||||
this.overlapNode = null
|
||||
this.back()
|
||||
}
|
||||
|
||||
// 鼠标移动事件
|
||||
onMousemove(e) {
|
||||
this.onControlPointMousemove(e)
|
||||
@@ -420,12 +437,7 @@ class AssociativeLine {
|
||||
if (this.overlapNode && this.overlapNode.getData('isActive')) {
|
||||
this.mindMap.execCommand('SET_NODE_ACTIVE', this.overlapNode, false)
|
||||
}
|
||||
this.isCreatingLine = false
|
||||
this.creatingStartNode = null
|
||||
this.creatingLine.remove()
|
||||
this.creatingLine = null
|
||||
this.overlapNode = null
|
||||
this.back()
|
||||
this.cancelCreateLine()
|
||||
}
|
||||
|
||||
// 添加连接线
|
||||
|
||||
@@ -40,6 +40,7 @@ class Demonstrate {
|
||||
{ ...defaultConfig },
|
||||
this.mindMap.opt.demonstrateConfig || {}
|
||||
)
|
||||
this.needRestorePerformanceMode = false
|
||||
}
|
||||
|
||||
// 进入演示模式
|
||||
@@ -56,6 +57,8 @@ class Demonstrate {
|
||||
}
|
||||
|
||||
_enter() {
|
||||
// 如果开启了性能模式,那么需要暂停
|
||||
this.pausePerformanceMode()
|
||||
// 添加演示用的临时的样式
|
||||
this.addTmpStyles()
|
||||
// 记录演示前的画布状态
|
||||
@@ -97,9 +100,27 @@ class Demonstrate {
|
||||
this.removeHighlightEl()
|
||||
this.mindMap.command.recovery()
|
||||
this.mindMap.keyCommand.recovery()
|
||||
this.restorePerformanceMode()
|
||||
this.mindMap.emit('exit_demonstrate')
|
||||
}
|
||||
|
||||
// 暂停性能模式
|
||||
pausePerformanceMode() {
|
||||
const { openPerformance } = this.mindMap.opt
|
||||
if (openPerformance) {
|
||||
this.needRestorePerformanceMode = true
|
||||
this.mindMap.opt.openPerformance = false
|
||||
this.mindMap.renderer.forceLoadNode()
|
||||
}
|
||||
}
|
||||
|
||||
// 恢复性能模式
|
||||
restorePerformanceMode() {
|
||||
if (!this.needRestorePerformanceMode) return
|
||||
this.mindMap.opt.openPerformance = true
|
||||
this.mindMap.renderer.forceLoadNode()
|
||||
}
|
||||
|
||||
// 添加临时的样式
|
||||
addTmpStyles() {
|
||||
this.tmpStyleEl = document.createElement('style')
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
nodeRichTextToTextWithWrap
|
||||
} from '../utils'
|
||||
import { CONSTANTS } from '../constants/constant'
|
||||
import Node from '../core/render/node/Node'
|
||||
|
||||
let extended = false
|
||||
|
||||
@@ -666,6 +667,25 @@ class RichText {
|
||||
}
|
||||
}
|
||||
|
||||
// 检查指定节点是否存在自定义的富文本样式
|
||||
checkNodeHasCustomRichTextStyle(node) {
|
||||
const list = [
|
||||
'fontFamily',
|
||||
'fontSize',
|
||||
'fontWeight',
|
||||
'fontStyle',
|
||||
'textDecoration',
|
||||
'color'
|
||||
]
|
||||
const nodeData = node instanceof Node ? node.getData() : node
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (nodeData[list[i]] !== undefined) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 将所有节点转换成非富文本节点
|
||||
transformAllNodesToNormalNode() {
|
||||
if (!this.mindMap.renderer.renderTree) return
|
||||
|
||||
@@ -948,7 +948,7 @@ export const addDataToAppointNodes = (appointNodes, data = {}) => {
|
||||
|
||||
// 给指定的节点列表树数据添加uid,会修改原数据
|
||||
// createNewId默认为false,即如果节点不存在uid的话,会创建新的uid。如果传true,那么无论节点数据原来是否存在uid,都会创建新的uid
|
||||
export const createUidForAppointNodes = (appointNodes, createNewId = false) => {
|
||||
export const createUidForAppointNodes = (appointNodes, createNewId = false, handle = null) => {
|
||||
const walk = list => {
|
||||
list.forEach(node => {
|
||||
if (!node.data) {
|
||||
@@ -957,6 +957,7 @@ export const createUidForAppointNodes = (appointNodes, createNewId = false) => {
|
||||
if (createNewId || isUndef(node.data.uid)) {
|
||||
node.data.uid = createUid()
|
||||
}
|
||||
handle && handle(node)
|
||||
if (node.children && node.children.length > 0) {
|
||||
walk(node.children)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import exampleData from 'simple-mind-map/example/exampleData'
|
||||
import { simpleDeepClone } from 'simple-mind-map/src/utils/index'
|
||||
import Vue from 'vue'
|
||||
import vuexStore from '@/store'
|
||||
|
||||
const SIMPLE_MIND_MAP_DATA = 'SIMPLE_MIND_MAP_DATA'
|
||||
const SIMPLE_MIND_MAP_LANG = 'SIMPLE_MIND_MAP_LANG'
|
||||
@@ -36,6 +37,9 @@ export const getData = () => {
|
||||
mindMapData = window.takeOverAppMethods.getMindMapData()
|
||||
return mindMapData
|
||||
}
|
||||
if (vuexStore.state.isHandleLocalFile) {
|
||||
return Vue.prototype.getCurrentData()
|
||||
}
|
||||
let store = localStorage.getItem(SIMPLE_MIND_MAP_DATA)
|
||||
if (store === null) {
|
||||
return simpleDeepClone(exampleData)
|
||||
@@ -68,6 +72,9 @@ export const storeData = data => {
|
||||
return
|
||||
}
|
||||
Vue.prototype.$bus.$emit('write_local_file', originData)
|
||||
if (vuexStore.state.isHandleLocalFile) {
|
||||
return
|
||||
}
|
||||
let dataStr = JSON.stringify(originData)
|
||||
localStorage.setItem(SIMPLE_MIND_MAP_DATA, dataStr)
|
||||
} catch (error) {
|
||||
@@ -98,6 +105,9 @@ export const storeConfig = config => {
|
||||
return
|
||||
}
|
||||
Vue.prototype.$bus.$emit('write_local_file', originData)
|
||||
if (vuexStore.state.isHandleLocalFile) {
|
||||
return
|
||||
}
|
||||
let dataStr = JSON.stringify(originData)
|
||||
localStorage.setItem(SIMPLE_MIND_MAP_DATA, dataStr)
|
||||
} catch (error) {
|
||||
|
||||
BIN
web/src/assets/avatar/Jeffrey.jpg
Normal file
BIN
web/src/assets/avatar/Jeffrey.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
BIN
web/src/assets/avatar/。.png
Normal file
BIN
web/src/assets/avatar/。.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
@@ -290,9 +290,9 @@ export default {
|
||||
creatingTip: 'Creating file',
|
||||
directory: 'Directory',
|
||||
newFileTip:
|
||||
'Please export the currently edited file before creating a new one, otherwise the content will be lost',
|
||||
'Please export the currently edited file before creating a new one, Beware of content loss',
|
||||
openFileTip:
|
||||
'Please export the currently edited file before opening it, otherwise the content will be lost'
|
||||
'Please export the currently edited file before opening it, Beware of content loss'
|
||||
},
|
||||
edit: {
|
||||
newFeatureNoticeTitle: 'New feature reminder',
|
||||
|
||||
@@ -285,8 +285,8 @@ export default {
|
||||
defaultFileName: '思维导图',
|
||||
creatingTip: '正在创建文件',
|
||||
directory: '目录',
|
||||
newFileTip: '新建文件前请先导出当前编辑的文件,否则内容会丢失',
|
||||
openFileTip: '打开文件前请先导出当前编辑的文件,否则内容会丢'
|
||||
newFileTip: '新建文件前请先导出当前编辑的文件,谨防内容丢失',
|
||||
openFileTip: '打开文件前请先导出当前编辑的文件,谨防内容丢失'
|
||||
},
|
||||
edit: {
|
||||
newFeatureNoticeTitle: '新特性提醒',
|
||||
|
||||
@@ -55,6 +55,12 @@ The currently active connection line and array type are the same as the structur
|
||||
|
||||
## Methods
|
||||
|
||||
### cancelCreateLine()
|
||||
|
||||
> v0.10.5+
|
||||
|
||||
Cancel the creation of the associated line midway.
|
||||
|
||||
### renderAllLines()
|
||||
|
||||
Re-render all associated lines.
|
||||
|
||||
@@ -49,6 +49,11 @@ MindMap.usePlugin(AssociativeLine)
|
||||
<h3>mindMap.associativeLine.activeLine</h3>
|
||||
<p>The currently active connection line and array type are the same as the structure of each item in the <code>lineList</code> array.</p>
|
||||
<h2>Methods</h2>
|
||||
<h3>cancelCreateLine()</h3>
|
||||
<blockquote>
|
||||
<p>v0.10.5+</p>
|
||||
</blockquote>
|
||||
<p>Cancel the creation of the associated line midway.</p>
|
||||
<h3>renderAllLines()</h3>
|
||||
<p>Re-render all associated lines.</p>
|
||||
<h3>removeAllLines()</h3>
|
||||
|
||||
@@ -1,5 +1,37 @@
|
||||
# Changelog
|
||||
|
||||
## 0.10.5
|
||||
|
||||
> 2024.8.2
|
||||
|
||||
Fix:
|
||||
|
||||
> 1.Fixed the issue of error when dragging the scrollbar after enabling the scrollbar plugin and performance mode;
|
||||
>
|
||||
> 2.Fixed the issue where the rich text style of nodes was not updated when copying across levels;
|
||||
>
|
||||
> 3.Fixed the issue where the demo plugin did not work properly after enabling performance mode;
|
||||
>
|
||||
> 4.Fixed the issue of canvas jumping when the first rendering canvas is triggered after adjusting the canvas size;
|
||||
|
||||
New:
|
||||
|
||||
> 1.Move the node and change the node hierarchy. Nodes that have set custom rich text styles do not need to update the styles;
|
||||
>
|
||||
> 2.Support clicking on the canvas to cancel the creation of associated lines;
|
||||
>
|
||||
> 3.Automatically expand a node by moving it or copying it to a collapsed node;
|
||||
|
||||
Demo:
|
||||
|
||||
> 1.When the number of subordinate nodes is greater than 100, the collapse button displays ellipsis;
|
||||
>
|
||||
> 2.No longer write data to the browser cache when opening local file editing, to avoid the problem of local file data loss caused by triggering storage restrictions;
|
||||
>
|
||||
> 3.If the local file is not saved, close the page and add an interception prompt;
|
||||
>
|
||||
> 4.Fixed the issue in the outline where clicking and dragging a node would trigger a file drag mask on the page;
|
||||
|
||||
## 0.10.4
|
||||
|
||||
> 2024.7.25
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Changelog</h1>
|
||||
<h2>0.10.5</h2>
|
||||
<blockquote>
|
||||
<p>2024.8.2</p>
|
||||
</blockquote>
|
||||
<p>Fix:</p>
|
||||
<blockquote>
|
||||
<p>1.Fixed the issue of error when dragging the scrollbar after enabling the scrollbar plugin and performance mode;</p>
|
||||
<p>2.Fixed the issue where the rich text style of nodes was not updated when copying across levels;</p>
|
||||
<p>3.Fixed the issue where the demo plugin did not work properly after enabling performance mode;</p>
|
||||
<p>4.Fixed the issue of canvas jumping when the first rendering canvas is triggered after adjusting the canvas size;</p>
|
||||
</blockquote>
|
||||
<p>New:</p>
|
||||
<blockquote>
|
||||
<p>1.Move the node and change the node hierarchy. Nodes that have set custom rich text styles do not need to update the styles;</p>
|
||||
<p>2.Support clicking on the canvas to cancel the creation of associated lines;</p>
|
||||
<p>3.Automatically expand a node by moving it or copying it to a collapsed node;</p>
|
||||
</blockquote>
|
||||
<p>Demo:</p>
|
||||
<blockquote>
|
||||
<p>1.When the number of subordinate nodes is greater than 100, the collapse button displays ellipsis;</p>
|
||||
<p>2.No longer write data to the browser cache when opening local file editing, to avoid the problem of local file data loss caused by triggering storage restrictions;</p>
|
||||
<p>3.If the local file is not saved, close the page and add an interception prompt;</p>
|
||||
<p>4.Fixed the issue in the outline where clicking and dragging a node would trigger a file drag mask on the page;</p>
|
||||
</blockquote>
|
||||
<h2>0.10.4</h2>
|
||||
<blockquote>
|
||||
<p>2024.7.25</p>
|
||||
|
||||
@@ -84,10 +84,12 @@ The folder containing the packaged resources for the `web` folder.
|
||||
|
||||
## Special Note
|
||||
|
||||
This project can be used for learning and reference. Please deeply experience whether it can meet your needs when using it for actual projects.
|
||||
When applying this project to actual projects, please first experience in depth whether it can meet your needs.
|
||||
|
||||
This project may not have fully tested every function point, so there may be bugs. In addition, when the number of nodes is very large, there may be some performance issues. Because everyone can accept different levels of congestion, you can test the maximum number of nodes yourself. Generally speaking, within 500 nodes, it is more smooth, while over 1000 nodes have more noticeable lag.
|
||||
|
||||
In v0.10.4+version, a performance mode has been added to only render nodes within the visible area of the canvas, which can improve rendering speed under large data volumes. You can experience it by turning on the 'openPerformance' instantiation option, and in the online demo, you can turn on the 'Basic Styles' - 'Enable Performance Mode' switch.
|
||||
|
||||
If you have suggestions or find bugs, you can submit [issues](https://github.com/wanglin2/mind-map/issues) here.
|
||||
|
||||
The built-in themes and icons in the project part come from:[Baidu Mind Map](https://naotu.baidu.com/)、[Zhixi Mind Map](https://www.zhixi.com/)。Respect the copyright, and do not use the theme and icons directly for commercial projects.
|
||||
@@ -108,7 +110,7 @@ There are many other online mind mapping products similar to Zhixi, such as [Git
|
||||
|
||||
These open-source mind maps are also good, each with its own characteristics, but they also have certain drawbacks, such as stopping updates, average interface aesthetics, less functionality, relying on a certain framework, and so on.
|
||||
|
||||
In summary, in open-source mind maps, it is difficult to find a better choice than `simple-mind-map`. Of course, `simple-mind-map` is far from being the best, and it also has many shortcomings, as you saw in the previous [special note]. However, `simple-mind-map` has always been in a fast iteration process, and we welcome you to join and improve it together.
|
||||
In summary, in open-source mind maps, it is difficult to find a better choice than `simple-mind-map`. Of course, `simple-mind-map` is far from being the best, and it also has many shortcomings. However, `simple-mind-map` has always been in a fast iteration process, and we welcome you to join and improve it together.
|
||||
|
||||
## Browser Compatibility
|
||||
|
||||
@@ -126,7 +128,7 @@ Unsupported: `IE` browser.
|
||||
|
||||
## Invite the author to a cup of coffee
|
||||
|
||||
Open source is not easy. If this project is helpful to you, you can invite the author to have a cup of coffee~
|
||||
Open source is not easy. If this project is helpful to you, you can invite the author to have a cup of coffee, Your support is the biggest driving force for developers to continuously maintain~
|
||||
|
||||
> Please note the 【mind map】 for transfer.
|
||||
|
||||
@@ -459,3 +461,13 @@ Open source is not easy. If this project is helpful to you, you can invite the a
|
||||
<p>ccccs</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/。.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>。</p>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
|
||||
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>Jeffrey</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -8,18 +8,18 @@
|
||||
</blockquote>
|
||||
<h2>Features</h2>
|
||||
<ul>
|
||||
<li><input type="checkbox" id="checkbox17" checked="true" /><label for="checkbox17">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="checkbox18" checked="true" /><label for="checkbox18">Support logical structure chart(Left and Right Logical Structure Diagram), mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
|
||||
<li><input type="checkbox" id="checkbox19" checked="true" /><label for="checkbox19">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
|
||||
<li><input type="checkbox" id="checkbox20" checked="true" /><label for="checkbox20">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
|
||||
<li><input type="checkbox" id="checkbox21" checked="true" /><label for="checkbox21">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, Support for expanding node content, and fully customize node content using DDM</label></li>
|
||||
<li><input type="checkbox" id="checkbox22" checked="true" /><label for="checkbox22">Support canvas dragging and scaling</label></li>
|
||||
<li><input type="checkbox" id="checkbox23" checked="true" /><label for="checkbox23">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
|
||||
<li><input type="checkbox" id="checkbox24" checked="true" /><label for="checkbox24">Supoorts to export as </label><code>json</code>、<code>png</code>、<code>svg</code>、<code>pdf</code>、<code>markdown</code>、<code>xmind</code>、<code>txt</code>, support import from <code>json</code>、<code>xmind</code>、<code>markdown</code></li>
|
||||
<li><input type="checkbox" id="checkbox25" checked="true" /><label for="checkbox25">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, scrollbar, Hand drawn style, and rainbow lines</label></li>
|
||||
<li><input type="checkbox" id="checkbox26" checked="true" /><label for="checkbox26">Provide rich configurations to meet various scenarios and usage habits</label></li>
|
||||
<li><input type="checkbox" id="checkbox27" checked="true" /><label for="checkbox27">Support collaborative editing</label></li>
|
||||
<li><input type="checkbox" id="checkbox28" checked="true" /><label for="checkbox28">Support demonstration mode</label></li>
|
||||
<li><input type="checkbox" id="checkbox34" checked="true" /><label for="checkbox34">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="checkbox35" checked="true" /><label for="checkbox35">Support logical structure chart(Left and Right Logical Structure Diagram), mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
|
||||
<li><input type="checkbox" id="checkbox36" checked="true" /><label for="checkbox36">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
|
||||
<li><input type="checkbox" id="checkbox37" checked="true" /><label for="checkbox37">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
|
||||
<li><input type="checkbox" id="checkbox38" checked="true" /><label for="checkbox38">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, Support for expanding node content, and fully customize node content using DDM</label></li>
|
||||
<li><input type="checkbox" id="checkbox39" checked="true" /><label for="checkbox39">Support canvas dragging and scaling</label></li>
|
||||
<li><input type="checkbox" id="checkbox40" checked="true" /><label for="checkbox40">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
|
||||
<li><input type="checkbox" id="checkbox41" checked="true" /><label for="checkbox41">Supoorts to export as </label><code>json</code>、<code>png</code>、<code>svg</code>、<code>pdf</code>、<code>markdown</code>、<code>xmind</code>、<code>txt</code>, support import from <code>json</code>、<code>xmind</code>、<code>markdown</code></li>
|
||||
<li><input type="checkbox" id="checkbox42" checked="true" /><label for="checkbox42">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, scrollbar, Hand drawn style, and rainbow lines</label></li>
|
||||
<li><input type="checkbox" id="checkbox43" checked="true" /><label for="checkbox43">Provide rich configurations to meet various scenarios and usage habits</label></li>
|
||||
<li><input type="checkbox" id="checkbox44" checked="true" /><label for="checkbox44">Support collaborative editing</label></li>
|
||||
<li><input type="checkbox" id="checkbox45" checked="true" /><label for="checkbox45">Support demonstration mode</label></li>
|
||||
</ul>
|
||||
<p>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:</p>
|
||||
<blockquote>
|
||||
@@ -39,16 +39,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="checkbox29" checked="true" /><label for="checkbox29">Toolbar, which supports inserting and deleting nodes, and editing node</label>
|
||||
<li><input type="checkbox" id="checkbox46" checked="true" /><label for="checkbox46">Toolbar, which supports inserting and deleting nodes, and editing node</label>
|
||||
images, icons, hyperlinks, notes, tags, and summaries</li>
|
||||
<li><input type="checkbox" id="checkbox30" checked="true" /><label for="checkbox30">Sidebar, with panels for basic style settings, node style settings,</label>
|
||||
<li><input type="checkbox" id="checkbox47" checked="true" /><label for="checkbox47">Sidebar, with panels for basic style settings, node style settings,</label>
|
||||
outline, theme selection, and structure selection</li>
|
||||
<li><input type="checkbox" id="checkbox31" checked="true" /><label for="checkbox31">Import and export functionality; data is saved in the browser's local</label>
|
||||
<li><input type="checkbox" id="checkbox48" checked="true" /><label for="checkbox48">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="checkbox32" checked="true" /><label for="checkbox32">Right-click menu, which supports operations such as expanding, collapsing,</label>
|
||||
<li><input type="checkbox" id="checkbox49" checked="true" /><label for="checkbox49">Right-click menu, which supports operations such as expanding, collapsing,</label>
|
||||
and organizing layout</li>
|
||||
<li><input type="checkbox" id="checkbox33" checked="true" /><label for="checkbox33">Bottom bar, which supports node and word count statistics, switching</label>
|
||||
<li><input type="checkbox" id="checkbox50" checked="true" /><label for="checkbox50">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>
|
||||
@@ -65,8 +65,9 @@ full screen, support mini map</li>
|
||||
<p><a href="https://juejin.cn/post/7287913415803764747">How does the dom-to-image library convert HTML into images</a></p>
|
||||
<p><a href="https://juejin.cn/post/7295669711533998117">Two days to achieve collaborative editing of mind maps? It's really possible to use Yjs</a></p>
|
||||
<h2>Special Note</h2>
|
||||
<p>This project can be used for learning and reference. Please deeply experience whether it can meet your needs when using it for actual projects.</p>
|
||||
<p>When applying this project to actual projects, please first experience in depth whether it can meet your needs.</p>
|
||||
<p>This project may not have fully tested every function point, so there may be bugs. In addition, when the number of nodes is very large, there may be some performance issues. Because everyone can accept different levels of congestion, you can test the maximum number of nodes yourself. Generally speaking, within 500 nodes, it is more smooth, while over 1000 nodes have more noticeable lag.</p>
|
||||
<p>In v0.10.4+version, a performance mode has been added to only render nodes within the visible area of the canvas, which can improve rendering speed under large data volumes. You can experience it by turning on the 'openPerformance' instantiation option, and in the online demo, you can turn on the 'Basic Styles' - 'Enable Performance Mode' switch.</p>
|
||||
<p>If you have suggestions or find bugs, you can submit <a href="https://github.com/wanglin2/mind-map/issues">issues</a> here.</p>
|
||||
<p>The built-in themes and icons in the project part come from:<a href="https://naotu.baidu.com/">Baidu Mind Map</a>、<a href="https://www.zhixi.com/">Zhixi Mind Map</a>。Respect the copyright, and do not use the theme and icons directly for commercial projects.</p>
|
||||
<h2>Why not?</h2>
|
||||
@@ -77,7 +78,7 @@ full screen, support mini map</li>
|
||||
<p><code>kityminder-core</code> is an open source brain mapping tool developed by Baidu. It has powerful functions and good performance, but it is no longer maintained. Therefore, the code is relatively old, and the interface beauty is relatively ordinary. In addition, bugs can only be fixed by yourself, and the functions can only be developed by yourself. It has high requirements for front-end development capabilities.</p>
|
||||
<p>3.<a href="https://github.com/hizzgdev/jsmind">jsmind</a>、<a href="https://github.com/ssshooter/mind-elixir-core">Mind-elixir</a>、<a href="https://github.com/ondras/my-mind">my-mind</a>、<a href="https://github.com/awehook/blink-mind">blink-mind</a>、<a href="https://github.com/luvsic3/remind">remind</a>、<a href="https://github.com/hellowuxin/vue3-mindmap">vue3-mindmap</a>、<a href="https://github.com/zyascend/ZMindMap">ZMindMap</a>、<a href="https://github.com/RockyRen/mindmaptree">mindmaptree</a>...</p>
|
||||
<p>These open-source mind maps are also good, each with its own characteristics, but they also have certain drawbacks, such as stopping updates, average interface aesthetics, less functionality, relying on a certain framework, and so on.</p>
|
||||
<p>In summary, in open-source mind maps, it is difficult to find a better choice than <code>simple-mind-map</code>. Of course, <code>simple-mind-map</code> is far from being the best, and it also has many shortcomings, as you saw in the previous [special note]. However, <code>simple-mind-map</code> has always been in a fast iteration process, and we welcome you to join and improve it together.</p>
|
||||
<p>In summary, in open-source mind maps, it is difficult to find a better choice than <code>simple-mind-map</code>. Of course, <code>simple-mind-map</code> is far from being the best, and it also has many shortcomings. However, <code>simple-mind-map</code> has always been in a fast iteration process, and we welcome you to join and improve it together.</p>
|
||||
<h2>Browser Compatibility</h2>
|
||||
<p>We recommend using the latest version of the <code>Chrome</code> browser.</p>
|
||||
<p>Limited testing situation:</p>
|
||||
@@ -86,7 +87,7 @@ full screen, support mini map</li>
|
||||
<h2>License</h2>
|
||||
<p><a href="https://github.com/wanglin2/mind-map/blob/main/LICENSE">MIT</a>. You can use it for commercial purposes without retaining the copyright statement of 'mind-map'. If you don't want to keep it, you can contact the author.</p>
|
||||
<h2>Invite the author to a cup of coffee</h2>
|
||||
<p>Open source is not easy. If this project is helpful to you, you can invite the author to have a cup of coffee~</p>
|
||||
<p>Open source is not easy. If this project is helpful to you, you can invite the author to have a cup of coffee, Your support is the biggest driving force for developers to continuously maintain~</p>
|
||||
<blockquote>
|
||||
<p>Please note the 【mind map】 for transfer.</p>
|
||||
</blockquote>
|
||||
@@ -416,7 +417,16 @@ full screen, support mini map</li>
|
||||
<p>ccccs</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/。.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>。</p>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
|
||||
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>Jeffrey</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ Focus and select all specified input boxes.
|
||||
|
||||
Adding additional data to the specified node list tree data will modify the original data.
|
||||
|
||||
#### createUidForAppointNodes(appointNodes, createNewId)
|
||||
#### createUidForAppointNodes(appointNodes, createNewId, handle)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
@@ -306,6 +306,8 @@ Adding additional data to the specified node list tree data will modify the orig
|
||||
|
||||
- `createNewId`:v0.7.3-fix.1+, `Boolean`, default is `false`, If the node does not have a 'uid', a new 'uid' will be created. If 'true' is passed, a new 'uid' will be created regardless of whether the node data originally exists or not`
|
||||
|
||||
- `handle`:v0.10.5+, `null、Function`, default is `null`, You can pass a function that will be called when traversing each node, with the callback parameter being the current node being traversed.
|
||||
|
||||
Adding a uid to the specified node list tree data (if the uid does not exist) will modify the original data.
|
||||
|
||||
#### getNodeIndex(node)
|
||||
|
||||
@@ -235,7 +235,7 @@ and copying the <code>data</code> of the data object, example:</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Adding additional data to the specified node list tree data will modify the original data.</p>
|
||||
<h4>createUidForAppointNodes(appointNodes, createNewId)</h4>
|
||||
<h4>createUidForAppointNodes(appointNodes, createNewId, handle)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
@@ -246,6 +246,9 @@ and copying the <code>data</code> of the data object, example:</p>
|
||||
<li>
|
||||
<p><code>createNewId</code>:v0.7.3-fix.1+, <code>Boolean</code>, default is <code>false</code>, If the node does not have a 'uid', a new 'uid' will be created. If 'true' is passed, a new 'uid' will be created regardless of whether the node data originally exists or not`</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>handle</code>:v0.10.5+, <code>null、Function</code>, default is <code>null</code>, You can pass a function that will be called when traversing each node, with the callback parameter being the current node being traversed.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Adding a uid to the specified node list tree data (if the uid does not exist) will modify the original data.</p>
|
||||
<h4>getNodeIndex(node)</h4>
|
||||
|
||||
@@ -55,6 +55,12 @@ MindMap.usePlugin(AssociativeLine)
|
||||
|
||||
## 方法
|
||||
|
||||
### cancelCreateLine()
|
||||
|
||||
> v0.10.5+
|
||||
|
||||
中途取消创建关联线。
|
||||
|
||||
### renderAllLines()
|
||||
|
||||
重新渲染所有关联线。
|
||||
|
||||
@@ -49,6 +49,11 @@ MindMap.usePlugin(AssociativeLine)
|
||||
<h3>mindMap.associativeLine.activeLine</h3>
|
||||
<p>当前激活的连接线,数组类型,同<code>lineList</code>数组的每一项的结构。</p>
|
||||
<h2>方法</h2>
|
||||
<h3>cancelCreateLine()</h3>
|
||||
<blockquote>
|
||||
<p>v0.10.5+</p>
|
||||
</blockquote>
|
||||
<p>中途取消创建关联线。</p>
|
||||
<h3>renderAllLines()</h3>
|
||||
<p>重新渲染所有关联线。</p>
|
||||
<h3>removeAllLines()</h3>
|
||||
|
||||
@@ -1,5 +1,37 @@
|
||||
# Changelog
|
||||
|
||||
## 0.10.5
|
||||
|
||||
> 2024.8.2
|
||||
|
||||
修复:
|
||||
|
||||
> 1.修复开启滚动条插件和性能模式后拖动滚动条报错的问题;
|
||||
>
|
||||
> 2.修复跨层级复制节点时,节点的富文本样式没有更新的问题;
|
||||
>
|
||||
> 3.修复开启性能模式后,演示插件无法正常工作的问题;
|
||||
>
|
||||
> 4.修复画布尺寸调整后第一次触发渲染画布会发生跳动的问题;
|
||||
|
||||
新增:
|
||||
|
||||
> 1.移动节点且节点层级发生了改变,设置过自定义富文本样式的节点不需要更新样式;
|
||||
>
|
||||
> 2.支持点击画布取消创建关联线;
|
||||
>
|
||||
> 3.移动节点或复制节点到收起的节点上自动展开该节点;
|
||||
|
||||
Demo:
|
||||
|
||||
> 1.节点下级数量大于100时,收起按钮显示省略号;
|
||||
>
|
||||
> 2.打开本地文件编辑的情况下不再将数据写入浏览器缓存,避免因触发存储限制导致本地文件数据丢失的问题;
|
||||
>
|
||||
> 3.编辑本地文件时如果未保存关闭页面增加拦截提示;
|
||||
>
|
||||
> 4.修复大纲里点击节点进行拖拽会触发页面的文件拖拽蒙层的问题;
|
||||
|
||||
## 0.10.4
|
||||
|
||||
> 2024.7.25
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Changelog</h1>
|
||||
<h2>0.10.5</h2>
|
||||
<blockquote>
|
||||
<p>2024.8.2</p>
|
||||
</blockquote>
|
||||
<p>修复:</p>
|
||||
<blockquote>
|
||||
<p>1.修复开启滚动条插件和性能模式后拖动滚动条报错的问题;</p>
|
||||
<p>2.修复跨层级复制节点时,节点的富文本样式没有更新的问题;</p>
|
||||
<p>3.修复开启性能模式后,演示插件无法正常工作的问题;</p>
|
||||
<p>4.修复画布尺寸调整后第一次触发渲染画布会发生跳动的问题;</p>
|
||||
</blockquote>
|
||||
<p>新增:</p>
|
||||
<blockquote>
|
||||
<p>1.移动节点且节点层级发生了改变,设置过自定义富文本样式的节点不需要更新样式;</p>
|
||||
<p>2.支持点击画布取消创建关联线;</p>
|
||||
<p>3.移动节点或复制节点到收起的节点上自动展开该节点;</p>
|
||||
</blockquote>
|
||||
<p>Demo:</p>
|
||||
<blockquote>
|
||||
<p>1.节点下级数量大于100时,收起按钮显示省略号;</p>
|
||||
<p>2.打开本地文件编辑的情况下不再将数据写入浏览器缓存,避免因触发存储限制导致本地文件数据丢失的问题;</p>
|
||||
<p>3.编辑本地文件时如果未保存关闭页面增加拦截提示;</p>
|
||||
<p>4.修复大纲里点击节点进行拖拽会触发页面的文件拖拽蒙层的问题;</p>
|
||||
</blockquote>
|
||||
<h2>0.10.4</h2>
|
||||
<blockquote>
|
||||
<p>2024.7.25</p>
|
||||
|
||||
@@ -76,9 +76,11 @@
|
||||
|
||||
## 特别说明
|
||||
|
||||
本项目可用于学习和参考,用于实际项目时请先深度体验一下是否能满足您的需求。
|
||||
将本项目用于实际项目时请先深度体验一下是否能满足您的需求。
|
||||
|
||||
本项目可能没有完整测试到每一个功能点,所以可能存在bug,另外,当节点数量非常多的时候,性能也存在一些问题,因为每个人能接受的卡顿程度不一样,所以你可以自行测试节点数量上限。一般来说,500个节点以内比较流畅,1000个节点以上卡顿比较明显。
|
||||
本项目可能没有完整测试到每一个功能点,可能存在bug,另外,当节点数量非常多的时候,性能也存在一些问题,因为每个人能接受的卡顿程度不一样,所以你可以自行测试节点数量上限。一般来说,500个节点以内比较流畅,1000个节点以上卡顿比较明显。
|
||||
|
||||
在v0.10.4+版本新增了性能模式,只渲染画布可视区域内的节点,可以提升大数据量下的渲染速度,可以通过开启`openPerformance`实例化选项进行体验,在线Demo里可以通过打开【基础样式】-【开启性能模式】开关进行体验。
|
||||
|
||||
如果有建议或发现了bug,可以在此提交[issues](https://github.com/wanglin2/mind-map/issues)。
|
||||
|
||||
@@ -100,7 +102,7 @@
|
||||
|
||||
这些开源的思维导图也都不错,各有各的特点,但是它们也都有一定缺点,比如停止更新、界面美观度一般、功能比较少、依赖某个框架等等。
|
||||
|
||||
综上,在开源的思维导图中,你很难找到一个比`simple-mind-map`更好的选择。当然,`simple-mind-map`也远远谈不上最好,它也有很多不足,如你在前面的【特别说明】所看到的那样,不过`simple-mind-map`一直处于快速迭代中,欢迎你加入进来一起完善它。
|
||||
综上,在开源的思维导图中,你很难找到一个比`simple-mind-map`更好的选择。当然,`simple-mind-map`也远远谈不上最好,它也有很多不足,不过`simple-mind-map`一直处于快速迭代中,欢迎你加入进来一起完善它。
|
||||
|
||||
## 浏览器兼容性
|
||||
|
||||
@@ -118,11 +120,13 @@
|
||||
|
||||
# 微信交流群
|
||||
|
||||
群聊人数较多,无法通过二维码入群,可以微信添加`wanglinguanfang`拉你入群。思维导图相关问题皆可在群里提问,不必私聊作者。
|
||||
一群已满,可以扫描如下二维码进入二群,如已过期,可以微信添加`wanglinguanfang`拉你入群。思维导图相关问题皆可在群里提问,不必私聊作者。
|
||||
|
||||
<img src="../../../../../../qrcode.jpg" style="width: 300px" />
|
||||
|
||||
## 请作者喝杯咖啡
|
||||
|
||||
开源不易,如果本项目有帮助到你的话,可以考虑请作者喝杯咖啡~
|
||||
开源不易,如果本项目有帮助到你的话,可以考虑请作者喝杯咖啡,你的支持是开发者持续维护的最大动力~
|
||||
|
||||
> 推荐使用支付宝,微信获取不到头像。转账请备注【思维导图】。
|
||||
|
||||
@@ -455,3 +459,13 @@
|
||||
<p>ccccs</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/。.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>。</p>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
|
||||
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>Jeffrey</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -8,18 +8,18 @@
|
||||
</blockquote>
|
||||
<h2>特性</h2>
|
||||
<ul>
|
||||
<li><input type="checkbox" id="checkbox0" checked="true" /><label for="checkbox0">插件化架构,除核心功能外,其他功能作为插件提供,按需使用,减小打包体积</label></li>
|
||||
<li><input type="checkbox" id="checkbox1" checked="true" /><label for="checkbox1">支持逻辑结构图(向左、向右逻辑结构图)、思维导图、组织结构图、目录组织图、时间轴(横向、竖向)、鱼骨图等结构</label></li>
|
||||
<li><input type="checkbox" id="checkbox2" checked="true" /><label for="checkbox2">内置多种主题,允许高度自定义样式,支持注册新主题</label></li>
|
||||
<li><input type="checkbox" id="checkbox3" checked="true" /><label for="checkbox3">节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要、数学公式</label></li>
|
||||
<li><input type="checkbox" id="checkbox4" checked="true" /><label for="checkbox4">节点支持拖拽(拖拽移动、自由调整)、多种节点形状;支持扩展节点内容、支持使用 DDM 完全自定义节点内容</label></li>
|
||||
<li><input type="checkbox" id="checkbox5" checked="true" /><label for="checkbox5">支持画布拖动、缩放</label></li>
|
||||
<li><input type="checkbox" id="checkbox6" checked="true" /><label for="checkbox6">支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式</label></li>
|
||||
<li><input type="checkbox" id="checkbox7" checked="true" /><label for="checkbox7">支持导出为</label><code>json</code>、<code>png</code>、<code>svg</code>、<code>pdf</code>、<code>markdown</code>、<code>xmind</code>、<code>txt</code>,支持从<code>json</code>、<code>xmind</code>、<code>markdown</code>导入</li>
|
||||
<li><input type="checkbox" id="checkbox8" checked="true" /><label for="checkbox8">支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条、手绘风格、彩虹线条</label></li>
|
||||
<li><input type="checkbox" id="checkbox9" checked="true" /><label for="checkbox9">提供丰富的配置,满足各种场景各种使用习惯</label></li>
|
||||
<li><input type="checkbox" id="checkbox10" checked="true" /><label for="checkbox10">支持协同编辑</label></li>
|
||||
<li><input type="checkbox" id="checkbox11" checked="true" /><label for="checkbox11">支持演示模式</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">节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要、数学公式</label></li>
|
||||
<li><input type="checkbox" id="checkbox21" checked="true" /><label for="checkbox21">节点支持拖拽(拖拽移动、自由调整)、多种节点形状;支持扩展节点内容、支持使用 DDM 完全自定义节点内容</label></li>
|
||||
<li><input type="checkbox" id="checkbox22" checked="true" /><label for="checkbox22">支持画布拖动、缩放</label></li>
|
||||
<li><input type="checkbox" id="checkbox23" checked="true" /><label for="checkbox23">支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式</label></li>
|
||||
<li><input type="checkbox" id="checkbox24" checked="true" /><label for="checkbox24">支持导出为</label><code>json</code>、<code>png</code>、<code>svg</code>、<code>pdf</code>、<code>markdown</code>、<code>xmind</code>、<code>txt</code>,支持从<code>json</code>、<code>xmind</code>、<code>markdown</code>导入</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>
|
||||
<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>
|
||||
</ul>
|
||||
<p>官方提供了如下插件,可根据需求按需引入(某个功能不生效大概率是因为你没有引入对应的插件),具体使用方式请查看文档:</p>
|
||||
<blockquote>
|
||||
@@ -37,11 +37,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="checkbox12" checked="true" /><label for="checkbox12">工具栏,支持插入节点、删除节点;编辑节点图片、图标、超链接、备注、标签、概要</label></li>
|
||||
<li><input type="checkbox" id="checkbox13" checked="true" /><label for="checkbox13">侧边栏,基础样式设置面板、节点样式设置面板、大纲面板、主题选择面板、结构选择面板</label></li>
|
||||
<li><input type="checkbox" id="checkbox14" checked="true" /><label for="checkbox14">导入导出功能;数据默认保存在浏览器本地存储,也支持直接创建、打开、编辑电脑本地文件</label></li>
|
||||
<li><input type="checkbox" id="checkbox15" checked="true" /><label for="checkbox15">右键菜单,支持展开、收起、整理布局等操作</label></li>
|
||||
<li><input type="checkbox" id="checkbox16" checked="true" /><label for="checkbox16">底部栏,支持节点数量、字数统计;支持切换编辑和只读模式;支持放大缩小;支持全屏切换;支持小地图</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>
|
||||
<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>
|
||||
</ul>
|
||||
<p>提供文档页面服务。</p>
|
||||
<p>3.<code>dist</code></p>
|
||||
@@ -56,8 +56,9 @@
|
||||
<p><a href="https://juejin.cn/post/7287913415803764747">dom-to-image库是如何将html转换成图片的</a></p>
|
||||
<p><a href="https://juejin.cn/post/7295669711533998117">两天实现思维导图的协同编辑?用Yjs真的可以</a></p>
|
||||
<h2>特别说明</h2>
|
||||
<p>本项目可用于学习和参考,用于实际项目时请先深度体验一下是否能满足您的需求。</p>
|
||||
<p>本项目可能没有完整测试到每一个功能点,所以可能存在bug,另外,当节点数量非常多的时候,性能也存在一些问题,因为每个人能接受的卡顿程度不一样,所以你可以自行测试节点数量上限。一般来说,500个节点以内比较流畅,1000个节点以上卡顿比较明显。</p>
|
||||
<p>将本项目用于实际项目时请先深度体验一下是否能满足您的需求。</p>
|
||||
<p>本项目可能没有完整测试到每一个功能点,可能存在bug,另外,当节点数量非常多的时候,性能也存在一些问题,因为每个人能接受的卡顿程度不一样,所以你可以自行测试节点数量上限。一般来说,500个节点以内比较流畅,1000个节点以上卡顿比较明显。</p>
|
||||
<p>在v0.10.4+版本新增了性能模式,只渲染画布可视区域内的节点,可以提升大数据量下的渲染速度,可以通过开启<code>openPerformance</code>实例化选项进行体验,在线Demo里可以通过打开【基础样式】-【开启性能模式】开关进行体验。</p>
|
||||
<p>如果有建议或发现了bug,可以在此提交<a href="https://github.com/wanglin2/mind-map/issues">issues</a>。</p>
|
||||
<p>项目内置的主题和图标部分来自于:<a href="https://naotu.baidu.com/">百度脑图</a>、<a href="https://www.zhixi.com/">知犀思维导图</a>。尊重版权,主题和图标请勿直接用于商业项目。</p>
|
||||
<h2>为什么不是?</h2>
|
||||
@@ -68,7 +69,7 @@
|
||||
<p><code>kityminder-core</code>是百度开发的开源的脑图工具,功能很强大,性能也很好,但是它已经不维护了,所以代码比较陈旧,界面美观度也比较一般,另外bug只能自己修,功能只能自己开发,对前端开发能力要求比较高。</p>
|
||||
<p>3.<a href="https://github.com/hizzgdev/jsmind">jsmind</a>、<a href="https://github.com/ssshooter/mind-elixir-core">Mind-elixir</a>、<a href="https://github.com/ondras/my-mind">my-mind</a>、<a href="https://github.com/awehook/blink-mind">blink-mind</a>、<a href="https://github.com/luvsic3/remind">remind</a>、<a href="https://github.com/hellowuxin/vue3-mindmap">vue3-mindmap</a>、<a href="https://github.com/zyascend/ZMindMap">ZMindMap</a>、<a href="https://github.com/RockyRen/mindmaptree">mindmaptree</a>...</p>
|
||||
<p>这些开源的思维导图也都不错,各有各的特点,但是它们也都有一定缺点,比如停止更新、界面美观度一般、功能比较少、依赖某个框架等等。</p>
|
||||
<p>综上,在开源的思维导图中,你很难找到一个比<code>simple-mind-map</code>更好的选择。当然,<code>simple-mind-map</code>也远远谈不上最好,它也有很多不足,如你在前面的【特别说明】所看到的那样,不过<code>simple-mind-map</code>一直处于快速迭代中,欢迎你加入进来一起完善它。</p>
|
||||
<p>综上,在开源的思维导图中,你很难找到一个比<code>simple-mind-map</code>更好的选择。当然,<code>simple-mind-map</code>也远远谈不上最好,它也有很多不足,不过<code>simple-mind-map</code>一直处于快速迭代中,欢迎你加入进来一起完善它。</p>
|
||||
<h2>浏览器兼容性</h2>
|
||||
<p>推荐使用最新版<code>chrome</code>浏览器。</p>
|
||||
<p>有限测试情况:</p>
|
||||
@@ -77,9 +78,10 @@
|
||||
<h2>License</h2>
|
||||
<p><a href="https://github.com/wanglin2/mind-map/blob/main/LICENSE">MIT</a>。保留<code>mind-map</code>版权声明的情况下可随意商用。如不想保留可联系作者。</p>
|
||||
<h1>微信交流群</h1>
|
||||
<p>群聊人数较多,无法通过二维码入群,可以微信添加<code>wanglinguanfang</code>拉你入群。思维导图相关问题皆可在群里提问,不必私聊作者。</p>
|
||||
<p>一群已满,可以扫描如下二维码进入二群,如已过期,可以微信添加<code>wanglinguanfang</code>拉你入群。思维导图相关问题皆可在群里提问,不必私聊作者。</p>
|
||||
<img src="../../../../../../qrcode.jpg" style="width: 300px" />
|
||||
<h2>请作者喝杯咖啡</h2>
|
||||
<p>开源不易,如果本项目有帮助到你的话,可以考虑请作者喝杯咖啡~</p>
|
||||
<p>开源不易,如果本项目有帮助到你的话,可以考虑请作者喝杯咖啡,你的支持是开发者持续维护的最大动力~</p>
|
||||
<blockquote>
|
||||
<p>推荐使用支付宝,微信获取不到头像。转账请备注【思维导图】。</p>
|
||||
</blockquote>
|
||||
@@ -409,7 +411,16 @@
|
||||
<p>ccccs</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/。.png" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>。</p>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 5px;">
|
||||
<img src="../../../../assets/avatar/Jeffrey.jpg" style="width: 50px;height: 50px;object-fit: cover;border-radius: 50%;" />
|
||||
<p>Jeffrey</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ copyNodeTree({}, node)
|
||||
|
||||
给指定的节点列表树数据添加附加数据,会修改原数据。
|
||||
|
||||
#### createUidForAppointNodes(appointNodes, createNewId)
|
||||
#### createUidForAppointNodes(appointNodes, createNewId, handle)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
@@ -310,6 +310,8 @@ copyNodeTree({}, node)
|
||||
|
||||
- `createNewId`:v0.7.3-fix.1+,`Boolean`,默认为`false`,即如果节点不存在`uid`的话,会创建新的`uid`。如果传`true`,那么无论节点数据原来是否存在`uid`,都会创建新的`uid`
|
||||
|
||||
- `handle`:v0.10.5+,`null、Function`,默认为`null`,可以传递一个函数,遍历到每个节点时会调用该函数,回调参数为当前遍历到的节点。
|
||||
|
||||
给指定的节点列表树数据添加 uid(如果 uid 不存在的话),会修改原数据。
|
||||
|
||||
#### getNodeIndex(node)
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
<p>给指定的节点列表树数据添加附加数据,会修改原数据。</p>
|
||||
<h4>createUidForAppointNodes(appointNodes, createNewId)</h4>
|
||||
<h4>createUidForAppointNodes(appointNodes, createNewId, handle)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
@@ -250,6 +250,9 @@
|
||||
<li>
|
||||
<p><code>createNewId</code>:v0.7.3-fix.1+,<code>Boolean</code>,默认为<code>false</code>,即如果节点不存在<code>uid</code>的话,会创建新的<code>uid</code>。如果传<code>true</code>,那么无论节点数据原来是否存在<code>uid</code>,都会创建新的<code>uid</code></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>handle</code>:v0.10.5+,<code>null、Function</code>,默认为<code>null</code>,可以传递一个函数,遍历到每个节点时会调用该函数,回调参数为当前遍历到的节点。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>给指定的节点列表树数据添加 uid(如果 uid 不存在的话),会修改原数据。</p>
|
||||
<h4>getNodeIndex(node)</h4>
|
||||
|
||||
@@ -192,7 +192,8 @@ export default {
|
||||
state.localConfig.useLeftKeySelectionRightKeyDrag,
|
||||
isUseHandDrawnLikeStyle: state =>
|
||||
state.localConfig.isUseHandDrawnLikeStyle,
|
||||
extraTextOnExport: state => state.extraTextOnExport
|
||||
extraTextOnExport: state => state.extraTextOnExport,
|
||||
isDragOutlineTreeNode: state => state.isDragOutlineTreeNode
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
@@ -412,6 +413,9 @@ export default {
|
||||
cssText,
|
||||
height: 30
|
||||
}
|
||||
},
|
||||
expandBtnNumHandler: num => {
|
||||
return num >= 100 ? '…' : num
|
||||
}
|
||||
// createNodePrefixContent: (node) => {
|
||||
// const el = document.createElement('div')
|
||||
@@ -578,6 +582,12 @@ export default {
|
||||
if (hasFileURL) {
|
||||
this.$bus.$emit('handle_file_url')
|
||||
}
|
||||
// api/index.js文件使用
|
||||
// 当正在编辑本地文件时通过该方法获取最新数据
|
||||
Vue.prototype.getCurrentData = () => {
|
||||
const fullData = this.mindMap.getData(true)
|
||||
return { ...fullData, config: this.mindMapData.config }
|
||||
}
|
||||
// 协同测试
|
||||
this.cooperateTest()
|
||||
// 销毁
|
||||
@@ -848,6 +858,7 @@ export default {
|
||||
|
||||
// 拖拽文件到页面导入
|
||||
onDragenter() {
|
||||
if (this.isDragOutlineTreeNode) return
|
||||
this.showDragMask = true
|
||||
},
|
||||
onDragleave() {
|
||||
@@ -857,6 +868,7 @@ export default {
|
||||
this.showDragMask = false
|
||||
const dt = e.dataTransfer
|
||||
const file = dt.files && dt.files[0]
|
||||
if (!file) return
|
||||
this.$bus.$emit('importFile', file)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
:expand-on-click-node="false"
|
||||
:allow-drag="checkAllowDrag"
|
||||
@node-drop="onNodeDrop"
|
||||
@node-drag-start="onNodeDragStart"
|
||||
@node-drag-end="onNodeDragEnd"
|
||||
@current-change="onCurrentChange"
|
||||
@mouseenter.native="isInTreArea = true"
|
||||
@mouseleave.native="isInTreArea = false"
|
||||
@@ -37,7 +39,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import {
|
||||
nodeRichTextToTextWithWrap,
|
||||
textToNodeRichTextWithWrap,
|
||||
@@ -91,6 +93,8 @@ export default {
|
||||
this.$bus.$off('hide_text_edit', this.handleHideTextEdit)
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setIsDragOutlineTreeNode']),
|
||||
|
||||
handleHideTextEdit() {
|
||||
if (this.notHandleDataChange) {
|
||||
this.notHandleDataChange = false
|
||||
@@ -281,6 +285,14 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
onNodeDragStart() {
|
||||
this.setIsDragOutlineTreeNode(true)
|
||||
},
|
||||
|
||||
onNodeDragEnd() {
|
||||
this.setIsDragOutlineTreeNode(false)
|
||||
},
|
||||
|
||||
// 拖拽结束事件
|
||||
onNodeDrop(data, target, postion) {
|
||||
this.notHandleDataChange = true
|
||||
|
||||
@@ -208,7 +208,8 @@ export default {
|
||||
},
|
||||
fileTreeVisible: false,
|
||||
rootDirName: '',
|
||||
fileTreeExpand: true
|
||||
fileTreeExpand: true,
|
||||
waitingWriteToLocalFile: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -232,11 +233,13 @@ export default {
|
||||
this.computeToolbarShowThrottle = throttle(this.computeToolbarShow, 300)
|
||||
window.addEventListener('resize', this.computeToolbarShowThrottle)
|
||||
this.$bus.$on('lang_change', this.computeToolbarShowThrottle)
|
||||
window.addEventListener('beforeunload', this.onUnload)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$bus.$off('write_local_file', this.onWriteLocalFile)
|
||||
window.removeEventListener('resize', this.computeToolbarShowThrottle)
|
||||
this.$bus.$off('lang_change', this.computeToolbarShowThrottle)
|
||||
window.removeEventListener('beforeunload', this.onUnload)
|
||||
},
|
||||
methods: {
|
||||
// 计算工具按钮如何显示
|
||||
@@ -269,11 +272,22 @@ export default {
|
||||
// 监听本地文件读写
|
||||
onWriteLocalFile(content) {
|
||||
clearTimeout(this.timer)
|
||||
if (fileHandle && this.isHandleLocalFile) {
|
||||
this.waitingWriteToLocalFile = true
|
||||
}
|
||||
this.timer = setTimeout(() => {
|
||||
this.writeLocalFile(content)
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
onUnload(e) {
|
||||
if (this.waitingWriteToLocalFile) {
|
||||
const msg = '存在未保存的数据'
|
||||
e.returnValue = msg
|
||||
return msg
|
||||
}
|
||||
},
|
||||
|
||||
// 加载本地文件树
|
||||
async loadFileTreeNode(node, resolve) {
|
||||
try {
|
||||
@@ -429,6 +443,7 @@ export default {
|
||||
// 写入本地文件
|
||||
async writeLocalFile(content) {
|
||||
if (!fileHandle || !this.isHandleLocalFile) {
|
||||
this.waitingWriteToLocalFile = false
|
||||
return
|
||||
}
|
||||
if (!this.isFullDataFile) {
|
||||
@@ -438,6 +453,7 @@ export default {
|
||||
const writable = await fileHandle.createWritable()
|
||||
await writable.write(string)
|
||||
await writable.close()
|
||||
this.waitingWriteToLocalFile = false
|
||||
},
|
||||
|
||||
// 创建本地文件
|
||||
|
||||
@@ -42,15 +42,15 @@ export default {
|
||||
dataList: [
|
||||
{
|
||||
icon: 'iconstar',
|
||||
value: 'Github star数量4000+'
|
||||
value: 'Github star数量5000+'
|
||||
},
|
||||
{
|
||||
icon: 'iconfork',
|
||||
value: 'Github fork数量500+'
|
||||
value: 'Github fork数量700+'
|
||||
},
|
||||
{
|
||||
icon: 'iconxiazai',
|
||||
value: 'npm总下载次数20000+'
|
||||
value: 'npm总下载次数30000+'
|
||||
},
|
||||
{
|
||||
icon: 'iconteamwork',
|
||||
|
||||
@@ -29,7 +29,8 @@ const store = new Vuex.Store({
|
||||
isSourceCodeEdit: false, // 是否是源码编辑模式
|
||||
extraTextOnExport: '', // 导出时底部添加的文字
|
||||
supportHandDrawnLikeStyle: false, // 是否支持设置手绘风格
|
||||
supportMark: false // 是否支持标记
|
||||
supportMark: false, // 是否支持标记
|
||||
isDragOutlineTreeNode: false // 当前是否正在拖拽大纲树的节点
|
||||
},
|
||||
mutations: {
|
||||
// 设置思维导图数据
|
||||
@@ -84,6 +85,11 @@ const store = new Vuex.Store({
|
||||
// 设置是否支持标记
|
||||
setSupportMark(state, data) {
|
||||
state.supportMark = data
|
||||
},
|
||||
|
||||
// 设置树节点拖拽
|
||||
setIsDragOutlineTreeNode(state, data) {
|
||||
state.isDragOutlineTreeNode = data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user