fix(测试计划): 测试计划详情-修复规划视图下展开全部icon还显示的缺陷&查询测试集传全部协议

--bug=1042759 --user=吕梦园
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001042759
This commit is contained in:
teukkk 2024-06-21 14:00:06 +08:00 committed by Craftsman
parent 1a22efd8f0
commit 0c9fbb643a
6 changed files with 55 additions and 19 deletions

View File

@ -166,6 +166,10 @@
selectedProtocols.value = allProtocolList.value.filter((item) => protocols.includes(item as string));
}
});
defineExpose({
allProtocolList,
});
</script>
<style lang="less" scoped>

View File

@ -154,6 +154,7 @@
moduleTree: ModuleTreeNode[];
canEdit: boolean;
selectedProtocols: string[];
allProtocolList: string[];
treeType: 'MODULE' | 'COLLECTION';
}>();
@ -359,8 +360,9 @@
const selectModules = await getModuleIds();
const commonParams = {
testPlanId: props.planId,
protocols: props.selectedProtocols,
...(props.treeType === 'COLLECTION' ? { collectionId: collectionId.value } : { moduleIds: selectModules }),
...(props.treeType === 'COLLECTION'
? { protocols: props.allProtocolList, collectionId: collectionId.value }
: { protocols: props.selectedProtocols, moduleIds: selectModules }),
};
if (isBatch) {
return {

View File

@ -12,6 +12,7 @@
:max-length="255"
/>
<TreeFolderAll
ref="treeFolderAllRef"
v-model:isExpandAll="isExpandAll"
v-model:selectedProtocols="selectedProtocols"
:not-show-operation="props.treeType === 'COLLECTION'"
@ -91,10 +92,25 @@
buffer: 15, // 10 padding
};
});
const treeFolderAllRef = ref<InstanceType<typeof TreeFolderAll>>();
const allProtocolList = computed(() => treeFolderAllRef.value?.allProtocolList);
const activeFolder = ref<string>('all');
const allCount = ref(0);
const isExpandAll = ref<boolean | undefined>(false);
const isExpandAll = ref<boolean | undefined>(undefined);
function setIsExpandAll() {
if (props.treeType === 'COLLECTION') {
isExpandAll.value = undefined;
} else {
isExpandAll.value = false;
}
}
watch(
() => props.treeType,
() => {
setIsExpandAll();
}
);
function setActiveFolder(id: string) {
activeFolder.value = id;
@ -157,8 +173,13 @@
initModules();
}
onBeforeMount(() => {
setIsExpandAll();
});
defineExpose({
initModules,
setActiveFolder,
allProtocolList,
});
</script>

View File

@ -24,6 +24,7 @@
:module-tree="moduleTree"
:can-edit="props.canEdit"
:selected-protocols="selectedProtocols"
:all-protocol-list="allProtocolList"
@get-module-count="getModuleCount"
@refresh="emit('refresh')"
@init-modules="initModules"
@ -109,6 +110,8 @@
});
}
const allProtocolList = computed(() => caseTreeRef.value?.allProtocolList ?? []);
defineExpose({
getCaseTableList,
});

View File

@ -89,16 +89,18 @@
const activeFolder = ref<string>('all');
const allCount = ref(0);
const isExpandAll = ref<boolean | undefined>(false);
const isExpandAll = ref<boolean | undefined>(undefined);
function setIsExpandAll() {
if (props.treeType === 'COLLECTION') {
isExpandAll.value = undefined;
} else {
isExpandAll.value = false;
}
}
watch(
() => props.treeType,
(val) => {
if (val === 'COLLECTION') {
isExpandAll.value = undefined;
} else {
isExpandAll.value = false;
}
() => {
setIsExpandAll();
}
);
@ -144,6 +146,7 @@
}
onBeforeMount(() => {
setIsExpandAll();
initModules();
});

View File

@ -89,16 +89,18 @@
const activeFolder = ref<string>('all');
const allCount = ref(0);
const isExpandAll = ref<boolean | undefined>(false);
const isExpandAll = ref<boolean | undefined>(undefined);
function setIsExpandAll() {
if (props.treeType === 'COLLECTION') {
isExpandAll.value = undefined;
} else {
isExpandAll.value = false;
}
}
watch(
() => props.treeType,
(val) => {
if (val === 'COLLECTION') {
isExpandAll.value = undefined;
} else {
isExpandAll.value = false;
}
() => {
setIsExpandAll();
}
);
@ -149,6 +151,7 @@
}
onBeforeMount(() => {
setIsExpandAll();
initModules();
});