From 662f2218903a868aad8ca0e6e5a7cd807b059d72 Mon Sep 17 00:00:00 2001 From: kaeery <3491123437@qq.com> Date: Fri, 28 Feb 2025 10:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8B=9B=E7=94=9F=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AB=AF=E3=80=91=20=E4=BC=98=E5=8C=96#=20?= =?UTF-8?q?=E5=AD=90=E8=B4=A6=E5=8F=B7=E7=AE=A1=E7=90=86=EF=BC=9A=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84=EF=BC=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=89=E4=B8=AD=E7=AC=AC=E4=B8=80=E5=B1=82=E8=8A=82?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/organization-tree.vue | 19 ++++++++----------- .../sub_account/modules/account-list.vue | 2 +- .../sub_account/modules/organization.vue | 10 +++++++++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/views/account_center/sub_account/components/organization/organization-tree.vue b/src/views/account_center/sub_account/components/organization/organization-tree.vue index 68f4386..028131c 100644 --- a/src/views/account_center/sub_account/components/organization/organization-tree.vue +++ b/src/views/account_center/sub_account/components/organization/organization-tree.vue @@ -81,17 +81,11 @@ watch(filterText, val => { const handleNodeClick = (data: Tree) => { parent?.setSelectedNode(data) } -// 默认设置选中节点 -watch( - () => props.currentNodeKey, - val => { - if (val) { - nextTick(() => { - treeRef.value?.setCurrentKey(val) - }) - } - } -) +const setCurrentKey = (val: any) => { + nextTick(() => { + treeRef.value?.setCurrentKey(val) + }) +} const handleCommand = (args: any[], data: Tree) => { const command = args[0] switch (command) { @@ -106,6 +100,9 @@ const handleCommand = (args: any[], data: Tree) => { break } } +defineExpose({ + setCurrentKey +})