fix(数据源): 没有数据源,点击创建数据集,页面卡住,控制台报错 #16831

This commit is contained in:
dataeaseShu
2025-08-28 14:38:54 +08:00
committed by dataeaseShu
parent c3a67f6781
commit bc189bf953

View File

@@ -1357,7 +1357,7 @@ const getSqlResultHeight = () => {
const getDatasource = (weight?: number) => {
getDatasourceList(weight).then(res => {
const _list = (res as unknown as DataSource[]) || []
if (_list && _list.length > 0 && _list[0].id === '0') {
if (_list && _list.length > 0 && _list[0].id === '0' && _list[0].children?.length) {
state.dataSourceList = dfsChild(_list[0].children)
} else {
state.dataSourceList = dfsChild(_list)