fix(接口测试): 修复接口测试场景切换项目未清空已选择引用或复制

This commit is contained in:
xinxin.wu 2024-10-22 18:45:02 +08:00 committed by 刘瑞斌
parent eed331d1a4
commit b4a40f26a7
1 changed files with 7 additions and 6 deletions

View File

@ -223,12 +223,6 @@
} }
); );
function resetModule() {
nextTick(() => {
moduleTreeRef.value?.init(activeKey.value);
});
}
function handleModuleSelect(ids: (string | number)[], node: MsTreeNodeData) { function handleModuleSelect(ids: (string | number)[], node: MsTreeNodeData) {
activeModule.value = node; activeModule.value = node;
moduleIds.value = ids; moduleIds.value = ids;
@ -470,6 +464,7 @@
handleCancel(); handleCancel();
} }
// //
function clearSelected() { function clearSelected() {
apiUseTreeSelection.clearSelector(); apiUseTreeSelection.clearSelector();
@ -477,6 +472,12 @@
scenarioUseTreeSelection.clearSelector(); scenarioUseTreeSelection.clearSelector();
} }
function resetModule() {
clearSelected();
nextTick(() => {
moduleTreeRef.value?.init(activeKey.value);
});
}
onBeforeMount(async () => { onBeforeMount(async () => {
await initProtocolList(); await initProtocolList();
const localProtocol = getLocalStorage<string>(ProtocolKeyEnum.API_SCENARIO_IMPORT_PROTOCOL); const localProtocol = getLocalStorage<string>(ProtocolKeyEnum.API_SCENARIO_IMPORT_PROTOCOL);