Commit 328e4b3d authored by 周远喜's avatar 周远喜

事件添加 右键菜单

parent 1529a735
......@@ -17,7 +17,7 @@ export default {
data() {
return {
go: null,
show: true,
show: false,
data: [
{ key: 39, name: "增材制造中心", parent: 0 },
{ key: 40, name: "北京星驰恒动工厂", parent: 39 },
......@@ -92,6 +92,7 @@ export default {
{ angle: 90, layerSpacing: 35 }
)
});
var myModel = $(go.TreeModel);
// in the model data, each node is represented by a JavaScript object:
......@@ -104,7 +105,16 @@ export default {
"Hi,henq",
{ margin: 12, stroke: "#fff", font: "bold 16px '宋体'" },
new go.Binding("text", "name")
)
),{
contextClick:(e,obj)=>{
// alert(obj.data.key+":"+obj.data.name);
console.warn("info",e,obj)
this.onContextmenu(e.event,obj.data)
},
doubleClick:(e,obj)=>{
alert(321);
}
}
);
this.go.linkTemplate = $(
go.Link,
......@@ -124,10 +134,9 @@ export default {
maxSize: new go.Size(1200, NaN)
});
console.log(this.$refs.svg);
setTimeout(()=>{
this.$nextTick(()=>{
document.getElementById("svg").appendChild(svg);
},300)
})
}
},
onContextmenu(event, a) {
......@@ -173,7 +182,7 @@ export default {
//x: event.clientX,
//y: event.clientY,
customClass: "class-a",
zIndex: 3,
zIndex: 3000,
minWidth: 230
});
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment