feat(项目管理): 增加测试计划跳转
This commit is contained in:
parent
7d3e2a9f53
commit
73f0404d90
|
@ -198,6 +198,7 @@
|
||||||
BugManagementRouteEnum,
|
BugManagementRouteEnum,
|
||||||
CaseManagementRouteEnum,
|
CaseManagementRouteEnum,
|
||||||
ProjectManagementRouteEnum,
|
ProjectManagementRouteEnum,
|
||||||
|
TestPlanRouteEnum,
|
||||||
} from '@/enums/routeEnum';
|
} from '@/enums/routeEnum';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -211,7 +212,7 @@
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openNewPage } = useOpenNewPage();
|
const { openNewPage, openNewPageWidthSingleParam } = useOpenNewPage();
|
||||||
|
|
||||||
const innerVisible = useVModel(props, 'visible', emit);
|
const innerVisible = useVModel(props, 'visible', emit);
|
||||||
const projectId = ref<string>(appStore.currentProjectId);
|
const projectId = ref<string>(appStore.currentProjectId);
|
||||||
|
@ -365,6 +366,12 @@
|
||||||
count = module.name;
|
count = module.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (type === 'TEST_PLAN_MANAGEMENT') {
|
||||||
|
const module = options.value.find((item) => item.id === 'TEST_PLAN');
|
||||||
|
if (module) {
|
||||||
|
count = module.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
const number = parseInt(count, 10);
|
const number = parseInt(count, 10);
|
||||||
if (number > 99) {
|
if (number > 99) {
|
||||||
return '+99';
|
return '+99';
|
||||||
|
@ -380,6 +387,7 @@
|
||||||
[MessageResourceType.CASE_REVIEW_TASK]: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_DETAIL,
|
[MessageResourceType.CASE_REVIEW_TASK]: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_DETAIL,
|
||||||
[MessageResourceType.API_DEFINITION_TASK]: ApiTestRouteEnum.API_TEST_MANAGEMENT,
|
[MessageResourceType.API_DEFINITION_TASK]: ApiTestRouteEnum.API_TEST_MANAGEMENT,
|
||||||
[MessageResourceType.API_SCENARIO_TASK]: ApiTestRouteEnum.API_TEST_SCENARIO,
|
[MessageResourceType.API_SCENARIO_TASK]: ApiTestRouteEnum.API_TEST_SCENARIO,
|
||||||
|
[MessageResourceType.TEST_PLAN_TASK]: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 点击名称跳转
|
// 点击名称跳转
|
||||||
|
@ -399,8 +407,13 @@
|
||||||
routeQuery.dId = item.resourceId;
|
routeQuery.dId = item.resourceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const route = resourceTypeRouteMap[item.resourceType];
|
const route = resourceTypeRouteMap[item.resourceType];
|
||||||
openNewPage(route, routeQuery);
|
if (item.resourceType === MessageResourceType.FUNCTIONAL_CASE_TASK) {
|
||||||
|
openNewPageWidthSingleParam(route, 'edit', routeQuery);
|
||||||
|
} else {
|
||||||
|
openNewPage(route, routeQuery);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全部标记为已读
|
// 全部标记为已读
|
||||||
|
|
|
@ -26,7 +26,27 @@ export default function useOpenNewPage() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openNewPageWidthSingleParam(
|
||||||
|
name: RouteRecordName | undefined,
|
||||||
|
param: string,
|
||||||
|
query: Record<string, any> = {}
|
||||||
|
) {
|
||||||
|
const pId = query.pId || appStore.currentProjectId;
|
||||||
|
if (pId) {
|
||||||
|
// 如果传入参数指定了项目 id,则使用传入的项目 id
|
||||||
|
delete query.pId;
|
||||||
|
}
|
||||||
|
const queryParams = new URLSearchParams(query).toString();
|
||||||
|
window.open(
|
||||||
|
`${window.location.origin}#${router.resolve({ name }).fullPath}/${param}?orgId=${
|
||||||
|
appStore.currentOrgId
|
||||||
|
}&pId=${pId}&${queryParams}`,
|
||||||
|
'_blank'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
openNewPage,
|
openNewPage,
|
||||||
|
openNewPageWidthSingleParam,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue