fix(测试计划): 修复测试计划关联用例全选异常

This commit is contained in:
xinxin.wu 2024-10-21 15:13:03 +08:00 committed by Craftsman
parent 74dba73597
commit c268465059
2 changed files with 10 additions and 6 deletions

View File

@ -179,7 +179,6 @@
}; };
const res = await getModuleTreeFunc(props.getModulesApiType, props.activeTab, getModuleParams); const res = await getModuleTreeFunc(props.getModulesApiType, props.activeTab, getModuleParams);
caseTree.value = calculateTreeCount(res, props.modulesCount); caseTree.value = calculateTreeCount(res, props.modulesCount);
allCount.value = props.modulesCount.all || 0; allCount.value = props.modulesCount.all || 0;
emit('init', caseTree.value, selectedProtocols.value); emit('init', caseTree.value, selectedProtocols.value);
@ -212,9 +211,12 @@
*/ */
watch( watch(
() => props.modulesCount, () => props.modulesCount,
() => { (val) => {
allCount.value = props.modulesCount.all || 0; if (val) {
caseTree.value = calculateTreeCount(caseTree.value, props.modulesCount); caseTree.value = calculateTreeCount(caseTree.value, props.modulesCount);
allCount.value = val.all || 0;
emit('init', caseTree.value, selectedProtocols.value);
}
}, },
{ {
deep: true, deep: true,

View File

@ -463,9 +463,11 @@
watch( watch(
() => moduleTree.value, () => moduleTree.value,
(val) => { (val) => {
if (val) {
if (val) { if (val) {
selectedModuleProps.value.modulesTree = val; selectedModuleProps.value.modulesTree = val;
} }
}
}, },
{ {
immediate: true, immediate: true,
@ -613,7 +615,7 @@
...params, ...params,
moduleIds: [], moduleIds: [],
filter: {}, filter: {},
keyword: keyword.value, keyword: '',
...props.extraModuleCountParams, ...props.extraModuleCountParams,
protocols: associationType.value === CaseLinkEnum.API ? selectedProtocols.value : undefined, protocols: associationType.value === CaseLinkEnum.API ? selectedProtocols.value : undefined,
} }