Fix:修复同时选中多个节点,可以不停插入概要的问题
This commit is contained in:
parent
4777ab3e58
commit
c1f600dc1f
@ -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] 支持画布拖动、缩放
|
||||||
- [x] 支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式
|
- [x] 支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式
|
||||||
- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`、`txt`,支持从`json`、`xmind`、`markdown`导入
|
- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`、`txt`,支持从`json`、`xmind`、`markdown`导入
|
||||||
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条、手绘风格、彩虹线条
|
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条、手绘风格、彩虹线条、标记、外框
|
||||||
- [x] 提供丰富的配置,满足各种场景各种使用习惯
|
- [x] 提供丰富的配置,满足各种场景各种使用习惯
|
||||||
- [x] 支持协同编辑
|
- [x] 支持协同编辑
|
||||||
- [x] 支持演示模式
|
- [x] 支持演示模式
|
||||||
|
|||||||
@ -1665,11 +1665,13 @@ class Render {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
const list = parseAddGeneralizationNodeList(nodeList)
|
const list = parseAddGeneralizationNodeList(nodeList)
|
||||||
|
if (list.length <= 0) return
|
||||||
const isRichText = !!this.mindMap.richText
|
const isRichText = !!this.mindMap.richText
|
||||||
const { focusNewNode, inserting } = this.getNewNodeBehavior(
|
const { focusNewNode, inserting } = this.getNewNodeBehavior(
|
||||||
openEdit,
|
openEdit,
|
||||||
list.length > 1
|
list.length > 1
|
||||||
)
|
)
|
||||||
|
let needRender = false
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
const newData = {
|
const newData = {
|
||||||
inserting,
|
inserting,
|
||||||
@ -1683,15 +1685,30 @@ class Render {
|
|||||||
isActive: focusNewNode
|
isActive: focusNewNode
|
||||||
}
|
}
|
||||||
let generalization = item.node.getData('generalization')
|
let generalization = item.node.getData('generalization')
|
||||||
if (generalization) {
|
generalization = generalization
|
||||||
if (Array.isArray(generalization)) {
|
? Array.isArray(generalization)
|
||||||
generalization.push(newData)
|
? generalization
|
||||||
} else {
|
: [generalization]
|
||||||
generalization = [generalization, newData]
|
: []
|
||||||
|
// 如果是范围概要,那么检查该范围是否存在
|
||||||
|
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 {
|
} else {
|
||||||
generalization = [newData]
|
// 不是范围概要直接添加,因为前面已经判断过是否存在
|
||||||
|
generalization.push(newData)
|
||||||
}
|
}
|
||||||
|
needRender = true
|
||||||
this.mindMap.execCommand('SET_NODE_DATA', item.node, {
|
this.mindMap.execCommand('SET_NODE_DATA', item.node, {
|
||||||
generalization
|
generalization
|
||||||
})
|
})
|
||||||
@ -1700,6 +1717,7 @@ class Render {
|
|||||||
expand: true
|
expand: true
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
if (!needRender) return
|
||||||
// 需要清除原来激活的节点
|
// 需要清除原来激活的节点
|
||||||
if (focusNewNode) {
|
if (focusNewNode) {
|
||||||
this.clearActiveNodeList()
|
this.clearActiveNodeList()
|
||||||
|
|||||||
@ -21,11 +21,15 @@
|
|||||||
src="//sdk.51.la/js-sdk-pro.min.js"
|
src="//sdk.51.la/js-sdk-pro.min.js"
|
||||||
></script>
|
></script>
|
||||||
<script>
|
<script>
|
||||||
LA.init({
|
try {
|
||||||
id: 'KRO0WxK8GT66tYCQ',
|
LA.init({
|
||||||
ck: 'KRO0WxK8GT66tYCQ',
|
id: 'KRO0WxK8GT66tYCQ',
|
||||||
autoTrack: false
|
ck: 'KRO0WxK8GT66tYCQ',
|
||||||
})
|
autoTrack: false
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user