fix: 不同数据源同名的表无法做关联(无法选中)

This commit is contained in:
dataeaseShu 2024-01-09 10:34:38 +08:00
parent 33a68c46f4
commit 2b95be6022
2 changed files with 5 additions and 5 deletions

View File

@ -95,8 +95,8 @@ const dfsNodeList = computed(() => {
})
const dfsNodeNameList = (list, arr) => {
return list.forEach(ele => {
arr.push(ele.tableName)
list.forEach(ele => {
arr.push(`${ele.tableName}${ele.datasourceId}`)
if (ele.children?.length) {
dfsNodeNameList(ele.children, arr)
}

View File

@ -634,7 +634,7 @@ const tabChange = val => {
const addComplete = () => {
state.nodeNameList = [...datasetDrag.value.nodeNameList]
if (!state.nodeNameList) {
if (!state.nodeNameList?.length) {
columns.value = []
tableData.value = []
}
@ -1280,14 +1280,14 @@ const getDsIconName = data => {
<div
:class="[
{
'not-allow': state.nodeNameList.includes(ele.tableName)
'not-allow': state.nodeNameList.includes(`${ele.tableName}${dataSource}`)
}
]"
class="list-item_primary"
:title="ele.name"
@dragstart="$event => dragstart($event, ele)"
@dragend="maskShow = false"
:draggable="!state.nodeNameList.includes(ele.tableName)"
:draggable="!state.nodeNameList.includes(`${ele.tableName}${dataSource}`)"
@click="setActiveName(ele)"
>
<el-icon class="icon-color">