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

This commit is contained in:
xinxin.wu 2024-10-25 17:51:13 +08:00 committed by 刘瑞斌
parent fd263b3755
commit c3b5e598bd

View File

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