fix(测试计划): 修复测试计划首次关联接口用例选中问题&用例删除模块
This commit is contained in:
parent
8b04d9cb9a
commit
d98ebb6f13
|
@ -284,25 +284,16 @@
|
|||
const tableRef = ref<InstanceType<typeof MsBaseTable>>();
|
||||
|
||||
watch(
|
||||
() => props.showType,
|
||||
(val) => {
|
||||
if (val === 'API_CASE') {
|
||||
resetSelector();
|
||||
resetFilterParams();
|
||||
loadCaseList();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => () => props.currentProject,
|
||||
[() => props.currentProject, () => props.protocols],
|
||||
() => {
|
||||
setPagination({
|
||||
current: 1,
|
||||
});
|
||||
resetSelector();
|
||||
resetFilterParams();
|
||||
loadCaseList();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
const innerSelectedIds = defineModel<string[]>('selectedIds', { required: true });
|
||||
|
@ -352,6 +343,10 @@
|
|||
propsRes.value
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
loadCaseList();
|
||||
});
|
||||
|
||||
watch(
|
||||
[() => props.moduleTree, () => props.modulesCount],
|
||||
(val) => {
|
||||
|
|
|
@ -214,11 +214,11 @@
|
|||
return {
|
||||
keyword: props.keyword,
|
||||
projectId: props.currentProject,
|
||||
protocols: props.protocols,
|
||||
moduleIds: props.activeModule === 'all' || !props.activeModule ? [] : [props.activeModule, ...props.offspringIds],
|
||||
excludeIds: [...excludeKeys],
|
||||
filter: propsRes.value.filter,
|
||||
...props.extraTableParams,
|
||||
protocols: props.protocols || [],
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -248,13 +248,16 @@
|
|||
}
|
||||
|
||||
watch(
|
||||
() => [() => props.currentProject, () => props.protocols],
|
||||
[() => props.currentProject, () => props.protocols],
|
||||
() => {
|
||||
setPagination({
|
||||
current: 1,
|
||||
});
|
||||
resetFilterParams();
|
||||
loadApiList();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -270,17 +273,6 @@
|
|||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.showType,
|
||||
(val) => {
|
||||
if (val === 'API') {
|
||||
resetSelector();
|
||||
resetFilterParams();
|
||||
loadApiList();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.activeModule,
|
||||
(val) => {
|
||||
|
@ -317,6 +309,10 @@
|
|||
propsRes.value
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
loadApiList();
|
||||
});
|
||||
|
||||
watch(
|
||||
[() => props.moduleTree, () => props.modulesCount],
|
||||
(val) => {
|
||||
|
|
|
@ -197,6 +197,8 @@
|
|||
};
|
||||
});
|
||||
allCount.value = props.modulesCount.all || 0;
|
||||
|
||||
emit('init', caseTree.value, selectedProtocols.value);
|
||||
}
|
||||
/**
|
||||
* 初始化模块树
|
||||
|
@ -218,8 +220,6 @@
|
|||
if (setDefault) {
|
||||
setActiveFolder('all');
|
||||
}
|
||||
|
||||
emit('init', caseTree.value, selectedProtocols.value);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
|
|
@ -636,9 +636,6 @@
|
|||
function initModuleTree(tree: ModuleTreeNode[], _protocols?: string[]) {
|
||||
moduleTree.value = tree;
|
||||
selectedProtocols.value = _protocols || [];
|
||||
if (props.associatedType === CaseLinkEnum.API) {
|
||||
loadCaseList();
|
||||
}
|
||||
}
|
||||
|
||||
const apiSetTree = ref<ModuleTreeNode[]>();
|
||||
|
|
|
@ -1019,6 +1019,13 @@ export const pathMap: PathMapItem[] = [
|
|||
permission: [],
|
||||
level: MENU_LEVEL[2],
|
||||
children: [
|
||||
{
|
||||
key: 'TEST_PLAN_MODULE', // 测试计划-模块
|
||||
locale: 'testPlan.testPlanGroup.module',
|
||||
route: RouteEnum.TEST_PLAN,
|
||||
permission: [],
|
||||
level: MENU_LEVEL[2],
|
||||
},
|
||||
{
|
||||
key: 'TEST_PLAN_PLAN', // 测试计划-计划
|
||||
locale: 'menu.testPlanShort',
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
import useModal from '@/hooks/useModal';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
||||
import { mapTree, traverseTree } from '@/utils';
|
||||
import { characterLimit, mapTree, traverseTree } from '@/utils';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import type { CreateOrUpdateModule, UpdateModule } from '@/models/caseManagement/featureCase';
|
||||
|
@ -217,7 +217,7 @@
|
|||
const deleteHandler = (node: MsTreeNodeData) => {
|
||||
openModal({
|
||||
type: 'error',
|
||||
title: t('caseManagement.featureCase.moduleDeleteTipTitle', { name: node.name }),
|
||||
title: t('caseManagement.featureCase.moduleDeleteTipTitle', { name: characterLimit(node.name) }),
|
||||
content: t('caseManagement.featureCase.deleteCaseTipContent'),
|
||||
okText: t('caseManagement.featureCase.deleteConfirm'),
|
||||
okButtonProps: {
|
||||
|
|
Loading…
Reference in New Issue