From a4557fcc4c2a374c9bfac18a156a948ce09b63c8 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Thu, 12 Mar 2026 10:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E8=A1=A8=E9=A2=84=E5=A1=AB=E5=85=85?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=A7=A3=E5=86=B3=E5=AD=90=E8=A1=A8=E8=A2=AB?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=A1=B5=E5=B5=8C=E5=A5=97=E6=97=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E4=B8=8D=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/formControlPropertiNew.vue | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) 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 = {}