fix(用例管理): 调整表参数移动模块后报错

This commit is contained in:
xinxin.wu 2024-03-16 21:25:45 +08:00 committed by Craftsman
parent 056a972a71
commit adcab0961c
4 changed files with 36 additions and 15 deletions

View File

@ -1563,6 +1563,10 @@
}
}
);
defineExpose({
emitTableParams,
});
await getDefaultFields();
</script>

View File

@ -113,7 +113,7 @@
modulesCount?: Record<string, number>; //
}>();
const emits = defineEmits(['update:selectedKeys', 'caseNodeSelect', 'init']);
const emits = defineEmits(['update:selectedKeys', 'caseNodeSelect', 'init', 'dragUpdate']);
const currentProjectId = computed(() => appStore.currentProjectId);
@ -273,7 +273,8 @@
console.log(error);
} finally {
loading.value = false;
initModules();
// initModules();
emits('dragUpdate');
}
}

View File

@ -228,11 +228,20 @@
}
}
watchEffect(() => {
if (props.platformInfo.demand_platform_config) {
initColumn();
watch(
() => props.platformInfo.demand_platform_config,
(val) => {
if (val) {
initColumn();
}
}
});
);
// watchEffect(() => {
// if (props.platformInfo.demand_platform_config) {
// }
// });
watch(
() => innerLinkDemandVisible.value,

View File

@ -66,6 +66,7 @@
:modules-count="modulesCount"
@case-node-select="caseNodeSelect"
@init="setRootModules"
@drag-update="dragUpdate"
></FeatureCaseTree>
<div class="b-0 absolute w-[88%]">
<a-divider class="!my-0 !mb-2" />
@ -83,6 +84,7 @@
<template #second>
<div class="p-[24px]">
<CaseTable
ref="caseTableRef"
:active-folder="activeFolder"
:offspring-ids="offspringIds"
:active-folder-type="activeCaseType"
@ -233,6 +235,14 @@
}
};
/**
* 设置根模块名称列表
* @param names 根模块名称列表
*/
function setRootModules(names: string[]) {
rootModulesName.value = names;
}
//
const tableFilterParams = ref<TableQueryParams>({
moduleIds: [],
@ -256,15 +266,6 @@
tableFilterParams.value = { ...params };
}
/**
* 设置根模块名称列表
* @param names 根模块名称列表
*/
function setRootModules(names: string[]) {
initModulesCount({ ...tableFilterParams.value });
rootModulesName.value = names;
}
//
function caseDetail() {
router.push({
@ -385,6 +386,12 @@
importLoading.value = false;
}
}
const caseTableRef = ref();
function dragUpdate() {
caseTableRef.value.emitTableParams();
}
</script>
<style scoped lang="less">