From 7afaa4251315ae2f04a6080a6d6d8ab06fa4ccaa Mon Sep 17 00:00:00 2001 From: baiqi Date: Thu, 23 May 2024 11:54:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=20=20csv/mock=20=E5=8A=9F=E8=83=BD=20bug=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/business/ms-tree/index.vue | 10 ++++--- .../components/pure/ms-detail-card/index.vue | 14 +++++----- .../views/api-test/components/paramTable.vue | 26 +++++++++---------- .../management/mock/mockDetailDrawer.vue | 9 ++++--- .../management/mock/mockMatchRuleForm.vue | 12 +++++++++ .../components/management/mock/mockTable.vue | 23 +++++++++++++--- .../components/common/csvParamsTable.vue | 3 ++- .../components/common/quoteCsvDrawer.vue | 2 +- .../api-test/scenario/components/config.ts | 2 +- .../src/views/api-test/scenario/index.vue | 6 ++--- 10 files changed, 70 insertions(+), 37 deletions(-) diff --git a/frontend/src/components/business/ms-tree/index.vue b/frontend/src/components/business/ms-tree/index.vue index 0dc7c8eab1..8461e800fc 100644 --- a/frontend/src/components/business/ms-tree/index.vue +++ b/frontend/src/components/business/ms-tree/index.vue @@ -27,7 +27,7 @@ class="cursor-pointer" @click.stop="handleExpand(_props)" > - +
@@ -98,6 +98,7 @@ import type { ActionsItem } from '@/components/pure/ms-table-more-action/types'; import useContainerShadow from '@/hooks/useContainerShadow'; + import { mapTree } from '@/utils'; import type { MsTreeExpandedData, MsTreeFieldNames, MsTreeNodeData, MsTreeSelectedData } from './types'; import { VirtualListProps } from '@arco-design/web-vue/es/_components/virtual-list-v2/interface'; @@ -190,12 +191,17 @@ overHeight: 32, containerClassName: 'ms-tree-container', }); + const filterTreeData = ref([]); // 初始化时全量的树数据或在非搜索情况下更新后的全量树数据 function init(isFirstInit = false) { nextTick(() => { if (isFirstInit) { if (props.defaultExpandAll) { treeRef.value?.expandAll(true); + filterTreeData.value = mapTree(filterTreeData.value, (node) => { + node.expanded = true; + return node; + }); } if (!isInitListener.value && treeRef.value) { setContainer( @@ -240,8 +246,6 @@ return search(data.value); } - const filterTreeData = ref([]); // 初始化时全量的树数据或在非搜索情况下更新后的全量树数据 - // 防抖搜索 const updateDebouncedSearch = debounce(() => { if (props.keyword) { diff --git a/frontend/src/components/pure/ms-detail-card/index.vue b/frontend/src/components/pure/ms-detail-card/index.vue index b8217c8079..bdd12e7389 100644 --- a/frontend/src/components/pure/ms-detail-card/index.vue +++ b/frontend/src/components/pure/ms-detail-card/index.vue @@ -1,15 +1,15 @@