diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index e5e3a84..9bb9f25 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -5632,17 +5632,21 @@ function preFillDialogDetermine(){ preFillDialogFlag.value = false } -const asfsCurrentTable = computed(()=>{ +/* const asfsCurrentTable = computed(()=>{ let currentTable = [] let count = 0 let result = [] xTree.value.forEach((element:any) => { - + console.log(getAfterLastColon(element.value)) + console.log(controlData.value.name) if(getAfterLastColon(element.value) == controlData.value.name){ currentTable.push(element) count++ } + console.log("1111111111111111111111") }); + console.log("asfsCurrentTable(((((((((((((((((((((((())))))))))))))))))))))))") + console.log(count) if(count>0){ result = currentTable[0].children }else{ @@ -5650,7 +5654,31 @@ const asfsCurrentTable = computed(()=>{ } return result -}) +}) */ + + +const asfsCurrentTable = computed(() => { + const matchingNodes: any[] = []; + + // 递归遍历函数 + function traverse(nodes: any[]) { + for (const node of nodes) { + // 检查当前节点是否匹配 + if (getAfterLastColon(node.value) === controlData.value.name) { + matchingNodes.push(node); + } + // 继续遍历子节点 + if (node.children && node.children.length > 0) { + traverse(node.children); + } + } + } + + traverse(xTree.value); + + // 返回第一个匹配节点的 children,若无匹配则返回空数组 + return matchingNodes.length > 0 ? matchingNodes[0].children || [] : []; +}); const asfPropsData = computed(()=>{ let result = {}