fix(接口测试): 修复接口测试接口分享文档多数据页面卡死

This commit is contained in:
xinxin.wu 2024-10-30 14:05:28 +08:00 committed by Craftsman
parent 99821d98be
commit c45b1307c6
1 changed files with 11 additions and 11 deletions

View File

@ -186,7 +186,7 @@
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
import useAppStore from '@/store/modules/app';
import { characterLimit, filterTree, mapTree, TreeNode } from '@/utils';
import { characterLimit, mapTree, TreeNode } from '@/utils';
import { getLocalStorage } from '@/utils/local-storage';
import { hasAnyPermission } from '@/utils/permission';
@ -453,16 +453,16 @@
orgId: appStore.currentOrgId,
shareId: props.docShareId,
});
res = mapTree<ModuleTreeNode>(res, (node) => ({
...node,
count: modulesCount.value[node.id] || 0,
draggable: node.id !== 'root' && !(props.readOnly || props.isModal),
disabled: props.readOnly || props.isModal ? node.id === selectedKeys.value[0] : false,
hideMoreAction: node.id === 'root' || !!props.docShareId,
}));
// count0 MODULE
res = filterTree(res, (node) => !(node.count === 0 && node.type === 'MODULE'));
res = mapTree<ModuleTreeNode>(res, (node) => {
const mappedNode = {
...node,
count: modulesCount.value[node.id] || 0,
draggable: false,
disabled: false,
hideMoreAction: true,
};
return modulesCount.value[node.id] === 0 && node.type === 'MODULE' ? null : mappedNode;
});
return res;
}