|
@@ -105,12 +105,11 @@ export default {
|
|
|
this.seriesData = await this.onInit()
|
|
|
this.graph.setOption(this.option)
|
|
|
this.graph.on('click', (params) => {
|
|
|
- const data = getData(params.data.id, this.seriesData)
|
|
|
if (params.event.target.type === 'tspan') {
|
|
|
- this.nodes = data
|
|
|
- this.onGraphHandles(params.event.event)
|
|
|
+ showMenu(params)
|
|
|
return
|
|
|
}
|
|
|
+ const data = getData(params.data.id, this.seriesData)
|
|
|
this.show = false
|
|
|
if (!params.data.children || !params.data.children.length) {
|
|
|
return
|
|
@@ -130,12 +129,18 @@ export default {
|
|
|
this.graph.on('contextmenu', (params) => {
|
|
|
params.event.event.preventDefault()
|
|
|
if (params.event.target.type === 'tspan') {
|
|
|
- const data = getData(params.data.id, this.seriesData)
|
|
|
- this.nodes = data
|
|
|
- this.onGraphHandles(params.event.event)
|
|
|
+ showMenu(params)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
+ const showMenu = (params) => {
|
|
|
+ if (typeof params.data.tag === 'object') {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const data = getData(params.data.id, this.seriesData)
|
|
|
+ this.nodes = data
|
|
|
+ this.onGraphHandles(params.event.event)
|
|
|
+ }
|
|
|
|
|
|
function getData (id, data) {
|
|
|
if (data.id === id) {
|