fix(血缘关系): 修复默认仪表板查询结果为空

This commit is contained in:
wisonic-s 2023-01-16 18:05:36 +08:00
parent 228ad775ee
commit de99f0a893
2 changed files with 25 additions and 14 deletions

View File

@ -32,17 +32,17 @@ export default {
}, },
watch: { watch: {
chartSize: { chartSize: {
handler(val) { handler(val) {
if (this.myChart) { if (this.myChart) {
this.myChart.resize(val) this.myChart.resize(val)
} }
}, },
deep: true deep: true
} }
}, },
methods: { methods: {
getChartData(current) { getChartData(current) {
this.current = {...current} this.current = { ...current }
const { queryType, num: id } = current const { queryType, num: id } = current
this.activeId = id this.activeId = id
switch (queryType) { switch (queryType) {
@ -52,9 +52,14 @@ export default {
case 'dataset': case 'dataset':
this.getDatasetRelationship(id) this.getDatasetRelationship(id)
break break
case 'panel': case 'panel': {
this.getPanelRelationship(id) let targetId = id
if (current.nodeData?.source) {
targetId = current.nodeData.source
}
this.getPanelRelationship(targetId)
break break
}
default: default:
break break
} }
@ -485,4 +490,4 @@ export default {
} }
} }
} }
</script> </script>

View File

@ -230,7 +230,8 @@ export default {
return { return {
queryType: this.formInline.queryType, queryType: this.formInline.queryType,
num: this.formInline.dataSourceName, num: this.formInline.dataSourceName,
label: this.nodeData.name label: this.nodeData.name,
nodeData: this.nodeData
} }
}, },
queryTypeTitle() { queryTypeTitle() {
@ -305,9 +306,14 @@ export default {
case 'dataset': case 'dataset':
this.getDatasetRelationship(id) this.getDatasetRelationship(id)
break break
case 'panel': case 'panel': {
this.getPanelRelationship(id) let targetId = id
if (this.nodeData.source) {
targetId = this.nodeData.source
}
this.getPanelRelationship(targetId)
break break
}
default: default:
break break
} }
@ -632,7 +638,7 @@ export default {
visibility: visible; visibility: visible;
} }
.relation-popover { .relation-popover {
max-height: 80%; max-height: 70%;
overflow-y: scroll; overflow-y: scroll;
} }
</style> </style>