commit
This commit is contained in:
@@ -50,6 +50,11 @@
|
||||
})
|
||||
},
|
||||
handleNodeClick (node) {
|
||||
let json = {
|
||||
id: '123',
|
||||
name: '123',
|
||||
|
||||
}
|
||||
},
|
||||
handleEdgeClick (node) {},
|
||||
renderGraph(row) {
|
||||
@@ -182,11 +187,8 @@
|
||||
{
|
||||
type: 'collapse-expand',
|
||||
onChange: function onChange(item, collapsed) {
|
||||
console.log(1);
|
||||
const data = item.get('model');
|
||||
const icon = item.get('group').find((element) => element.get('name') === 'collapse-icon');
|
||||
console.log(data);
|
||||
console.log(icon);
|
||||
if (collapsed) {
|
||||
icon.attr('symbol', G6.Marker.expand);
|
||||
} else {
|
||||
@@ -197,7 +199,7 @@
|
||||
},
|
||||
shouldBegin: (e) => {
|
||||
const target = e.target
|
||||
const nodeType = target.cfg.nature
|
||||
const nodeType = target.cfg.name
|
||||
if (nodeType === 'collapse-icon') return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,9 @@
|
||||
// }
|
||||
// this.$message.success('节点被点击' + data.name)
|
||||
},
|
||||
handleEdgeClick (node) {},
|
||||
handleEdgeClick (node) {
|
||||
console.log(4);
|
||||
},
|
||||
renderGraph() {
|
||||
G6.registerNode(
|
||||
'tree-node',
|
||||
@@ -281,6 +283,7 @@
|
||||
},
|
||||
handleGraphDraw () {},
|
||||
handleGraphNodeClickEvent(graph) {
|
||||
console.log(1);
|
||||
// 点击节点
|
||||
graph.on('node:click', (e) => {
|
||||
// 先将所有当前是 click 状态的节点置为非 click 状态
|
||||
@@ -294,6 +297,7 @@
|
||||
});
|
||||
},
|
||||
handleGraphEdgeClickEvent(graph) {
|
||||
console.log(2);
|
||||
// 点击边
|
||||
graph.on('edge:click', (e) => {
|
||||
// 先将所有当前是 click 状态的边置为非 click 状态
|
||||
|
||||
Reference in New Issue
Block a user