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(); await getDefaultFields();
</script> </script>

View File

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

View File

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

View File

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