mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Fix:修复同时选中多个节点,可以不停插入概要的问题
This commit is contained in:
@@ -25,7 +25,7 @@ Github:[releases](https://github.com/wanglin2/mind-map/releases)。百度云
|
||||
|
||||
> 客户端版本会落后于在线版本,尝试最新功能请优先使用在线版。
|
||||
|
||||
如果你需要带后端的可部署版本,可以尝试我们开发的另一个项目[理想文档](https://github.com/wanglin2/lx-doc)。
|
||||
【云存储版本】如果你需要带后端的云存储版本,可以尝试我们开发的另一个项目[理想文档](https://github.com/wanglin2/lx-doc)。
|
||||
|
||||
# 特性
|
||||
|
||||
@@ -37,7 +37,7 @@ Github:[releases](https://github.com/wanglin2/mind-map/releases)。百度云
|
||||
- [x] 支持画布拖动、缩放
|
||||
- [x] 支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式
|
||||
- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`、`txt`,支持从`json`、`xmind`、`markdown`导入
|
||||
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条、手绘风格、彩虹线条
|
||||
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条、手绘风格、彩虹线条、标记、外框
|
||||
- [x] 提供丰富的配置,满足各种场景各种使用习惯
|
||||
- [x] 支持协同编辑
|
||||
- [x] 支持演示模式
|
||||
|
||||
@@ -1665,11 +1665,13 @@ class Render {
|
||||
)
|
||||
})
|
||||
const list = parseAddGeneralizationNodeList(nodeList)
|
||||
if (list.length <= 0) return
|
||||
const isRichText = !!this.mindMap.richText
|
||||
const { focusNewNode, inserting } = this.getNewNodeBehavior(
|
||||
openEdit,
|
||||
list.length > 1
|
||||
)
|
||||
let needRender = false
|
||||
list.forEach(item => {
|
||||
const newData = {
|
||||
inserting,
|
||||
@@ -1683,15 +1685,30 @@ class Render {
|
||||
isActive: focusNewNode
|
||||
}
|
||||
let generalization = item.node.getData('generalization')
|
||||
if (generalization) {
|
||||
if (Array.isArray(generalization)) {
|
||||
generalization.push(newData)
|
||||
} else {
|
||||
generalization = [generalization, newData]
|
||||
generalization = generalization
|
||||
? Array.isArray(generalization)
|
||||
? generalization
|
||||
: [generalization]
|
||||
: []
|
||||
// 如果是范围概要,那么检查该范围是否存在
|
||||
if (item.range) {
|
||||
const isExist = !!generalization.find(item2 => {
|
||||
return (
|
||||
item2.range &&
|
||||
item2.range[0] === item.range[0] &&
|
||||
item2.range[1] === item.range[1]
|
||||
)
|
||||
})
|
||||
if (isExist) {
|
||||
return
|
||||
}
|
||||
// 不存在则添加
|
||||
generalization.push(newData)
|
||||
} else {
|
||||
generalization = [newData]
|
||||
// 不是范围概要直接添加,因为前面已经判断过是否存在
|
||||
generalization.push(newData)
|
||||
}
|
||||
needRender = true
|
||||
this.mindMap.execCommand('SET_NODE_DATA', item.node, {
|
||||
generalization
|
||||
})
|
||||
@@ -1700,6 +1717,7 @@ class Render {
|
||||
expand: true
|
||||
})
|
||||
})
|
||||
if (!needRender) return
|
||||
// 需要清除原来激活的节点
|
||||
if (focusNewNode) {
|
||||
this.clearActiveNodeList()
|
||||
|
||||
@@ -21,11 +21,15 @@
|
||||
src="//sdk.51.la/js-sdk-pro.min.js"
|
||||
></script>
|
||||
<script>
|
||||
LA.init({
|
||||
id: 'KRO0WxK8GT66tYCQ',
|
||||
ck: 'KRO0WxK8GT66tYCQ',
|
||||
autoTrack: false
|
||||
})
|
||||
try {
|
||||
LA.init({
|
||||
id: 'KRO0WxK8GT66tYCQ',
|
||||
ck: 'KRO0WxK8GT66tYCQ',
|
||||
autoTrack: false
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user