'右键功能开发中'

This commit is contained in:
wanglin2
2021-07-15 17:46:36 +08:00
parent a812637cf0
commit 7982a1373f
3 changed files with 30 additions and 5 deletions

View File

@@ -560,6 +560,9 @@ class Node {
this.group.on('contextmenu', (e) => {
e.stopPropagation()
e.preventDefault()
if (this.nodeData.data.isActive) {
this.renderer.clearActive()
}
this.active(e)
this.mindMap.emit('node_contextmenu', e, this)
})

View File

@@ -62,7 +62,7 @@ class Render {
* @Desc: 设置布局结构
*/
setLayout() {
this.layout = new (layouts[this.mindMap.opt.layout] ? layouts[this.mindMap.opt.layout] : layouts.logicalStructure)(this)
this.layout = new(layouts[this.mindMap.opt.layout] ? layouts[this.mindMap.opt.layout] : layouts.logicalStructure)(this)
}
/**
@@ -108,6 +108,9 @@ class Render {
// 删除节点
this.removeNode = this.removeNode.bind(this)
this.mindMap.command.add('REMOVE_NODE', this.removeNode)
// 复制节点
this.copyNode = this.copyNode.bind(this)
this.mindMap.command.add('COPY_NODE', this.copyNode)
// 修改节点样式
this.setNodeStyle = this.setNodeStyle.bind(this)
this.mindMap.command.add('SET_NODE_STYLE', this.setNodeStyle)
@@ -418,6 +421,20 @@ class Render {
this.mindMap.render()
}
/**
* javascript comment
* @Author: 王林25
* @Date: 2021-07-15 09:53:23
* @Desc: 复制节点
*/
copyNode() {
if (this.activeNodeList.length <= 0) {
return;
}
let copyData = []
}
/**
* @Author: 王林
* @Date: 2021-07-08 21:54:30
@@ -461,13 +478,13 @@ class Render {
this.setNodeData(node, {
expand
})
if (expand) {// 展开
if (expand) { // 展开
node.children.forEach((item) => {
item.render()
})
node.renderLine()
node.updateExpandBtnNode()
} else {// 收缩
} else { // 收缩
node.children.forEach((item) => {
item.remove()
})
@@ -502,7 +519,12 @@ class Render {
* @Date: 2021-07-10 08:37:40
* @Desc: 设置节点图片
*/
setNodeImage(node, { url, title, width, height }) {
setNodeImage(node, {
url,
title,
width,
height
}) {
this.setNodeDataRender(node, {
image: url,
imageTitle: title || '',

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>思绪_一个极简的在线思维导图</title>
<title>一个简单的web思维导图实现</title>
</head>
<body>
<noscript>