Merge pull request #9293 from dataease/pr@dev-v2_st

fix(数据集): 修复使用自定义 SQL 创建数据集,SQL编辑器关闭后,没有获取并加载字段的问题
This commit is contained in:
dataeaseShu 2024-04-24 10:59:03 +08:00 committed by GitHub
commit 676c231d92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,7 +221,22 @@ const closeSqlNode = () => {
!state.nodeList[0].children?.length &&
changeSqlId.value.length === 1
) {
editUnion.value = true
currentNode.value = state.nodeList[0]
const { datasourceId, id, info, tableName } = currentNode.value
getTableField({
datasourceId,
id,
info,
tableName,
type: 'sql'
}).then(res => {
nodeField.value = res as unknown as Field[]
nodeField.value.forEach(ele => {
ele.checked = true
})
state.nodeList[0].currentDsFields = cloneDeep(res)
editUnion.value = true
})
changeSqlId.value = []
}
if (state.visualNode?.confirm) {