fix(接口测试): 修复接口测试循环下子请求可展开bug

This commit is contained in:
xinxin.wu 2024-10-25 17:51:13 +08:00 committed by 刘瑞斌
parent fd263b3755
commit c3b5e598bd
1 changed files with 6 additions and 6 deletions

View File

@ -240,16 +240,16 @@
* 处理步骤展开折叠 * 处理步骤展开折叠
*/ */
function handleStepExpand(data: MsTreeExpandedData) { function handleStepExpand(data: MsTreeExpandedData) {
const realStep = findNodeByKey<ScenarioItemType>(steps.value, data.node?.stepId, 'stepId');
const isNotAllowExpand = const isNotAllowExpand =
data.node?.children && data.node?.children.length && showApiType.value.includes(data.node?.stepType); data.node?.children && data.node?.children.length && showApiType.value.includes(data.node?.stepType);
if (isNotAllowExpand && data.node && data.node.children) { if (isNotAllowExpand && data.node && data.node.children?.length) {
data.node.stepChildren = cloneDeep(data.node.children);
data.node.children = [];
} else {
const realStep = findNodeByKey<ScenarioItemType>(steps.value, data.node?.stepId, 'stepId');
if (realStep) { if (realStep) {
realStep.expanded = !realStep.expanded; realStep.stepChildren = cloneDeep(realStep.children);
realStep.children = [];
} }
} else if (realStep) {
realStep.expanded = !realStep.expanded;
} }
} }