fix(测试计划): 测试计划详情-关联用例-点击id跳转

--bug=1042722 --user=吕梦园
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001042722
This commit is contained in:
teukkk 2024-06-20 16:14:14 +08:00 committed by Craftsman
parent d71ce02d4c
commit e15209f5a8
4 changed files with 53 additions and 9 deletions

View File

@ -11,7 +11,7 @@
@filter-change="getModuleCount" @filter-change="getModuleCount"
> >
<template #num="{ record }"> <template #num="{ record }">
<MsButton type="text">{{ record.num }}</MsButton> <MsButton type="text" @click="toDetail(record)">{{ record.num }}</MsButton>
</template> </template>
<template #lastReportStatus="{ record }"> <template #lastReportStatus="{ record }">
<ExecutionStatus <ExecutionStatus
@ -57,19 +57,21 @@
import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue'; import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue';
import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue'; import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue';
import { useI18n } from '@/hooks/useI18n'; import useOpenNewPage from '@/hooks/useOpenNewPage';
import { characterLimit } from '@/utils'; import { characterLimit } from '@/utils';
import { ApiCaseDetail } from '@/models/apiTest/management';
import type { TableQueryParams } from '@/models/common'; import type { TableQueryParams } from '@/models/common';
import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum'; import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum';
import { CaseLinkEnum } from '@/enums/caseEnum'; import { CaseLinkEnum } from '@/enums/caseEnum';
import { ReportEnum, ReportStatus } from '@/enums/reportEnum'; import { ReportEnum, ReportStatus } from '@/enums/reportEnum';
import { ApiTestRouteEnum } from '@/enums/routeEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum'; import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { getPublicLinkCaseListMap } from './utils/page'; import { getPublicLinkCaseListMap } from './utils/page';
import { casePriorityOptions } from '@/views/api-test/components/config'; import { casePriorityOptions } from '@/views/api-test/components/config';
const { t } = useI18n(); const { openNewPage } = useOpenNewPage();
const props = defineProps<{ const props = defineProps<{
associationType: string; // | | associationType: string; // | |
@ -330,6 +332,14 @@
}; };
} }
//
function toDetail(record: ApiCaseDetail) {
openNewPage(ApiTestRouteEnum.API_TEST_MANAGEMENT, {
cId: record.id,
pId: record.projectId,
});
}
defineExpose({ defineExpose({
getApiCaseSaveParams, getApiCaseSaveParams,
loadCaseList, loadCaseList,

View File

@ -12,7 +12,7 @@
@filter-change="getModuleCount" @filter-change="getModuleCount"
> >
<template #num="{ record }"> <template #num="{ record }">
<MsButton type="text">{{ record.num }}</MsButton> <MsButton type="text" @click="toDetail(record)">{{ record.num }}</MsButton>
</template> </template>
<template #[FilterSlotNameEnum.API_TEST_API_REQUEST_METHODS]="{ filterContent }"> <template #[FilterSlotNameEnum.API_TEST_API_REQUEST_METHODS]="{ filterContent }">
<apiMethodName :method="filterContent.value" /> <apiMethodName :method="filterContent.value" />
@ -39,18 +39,23 @@
import apiMethodName from '@/views/api-test/components/apiMethodName.vue'; import apiMethodName from '@/views/api-test/components/apiMethodName.vue';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useOpenNewPage from '@/hooks/useOpenNewPage';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import { ApiDefinitionDetail } from '@/models/apiTest/management';
import type { TableQueryParams } from '@/models/common'; import type { TableQueryParams } from '@/models/common';
import { RequestMethods } from '@/enums/apiEnum'; import { RequestMethods } from '@/enums/apiEnum';
import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum'; import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum';
import { CaseLinkEnum } from '@/enums/caseEnum'; import { CaseLinkEnum } from '@/enums/caseEnum';
import { ApiTestRouteEnum } from '@/enums/routeEnum';
import { FilterRemoteMethodsEnum, FilterSlotNameEnum } from '@/enums/tableFilterEnum'; import { FilterRemoteMethodsEnum, FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { getPublicLinkCaseListMap } from './utils/page'; import { getPublicLinkCaseListMap } from './utils/page';
const { t } = useI18n(); const { t } = useI18n();
const { openNewPage } = useOpenNewPage();
const appStore = useAppStore(); const appStore = useAppStore();
const props = defineProps<{ const props = defineProps<{
associationType: string; // | | associationType: string; // | |
activeModule: string; activeModule: string;
@ -276,6 +281,14 @@
}; };
} }
//
function toDetail(record: ApiDefinitionDetail) {
openNewPage(ApiTestRouteEnum.API_TEST_MANAGEMENT, {
dId: record.id,
pId: record.projectId,
});
}
defineExpose({ defineExpose({
getApiSaveParams, getApiSaveParams,
loadApiList, loadApiList,

View File

@ -11,7 +11,7 @@
@filter-change="getModuleCount" @filter-change="getModuleCount"
> >
<template #num="{ record }"> <template #num="{ record }">
<MsButton type="text">{{ record.num }}</MsButton> <MsButton type="text" @click="toDetail(record)">{{ record.num }}</MsButton>
</template> </template>
<template #reviewStatus="{ record }"> <template #reviewStatus="{ record }">
<MsIcon <MsIcon
@ -51,18 +51,20 @@
import CaseLevel from '@/components/business/ms-case-associate/caseLevel.vue'; import CaseLevel from '@/components/business/ms-case-associate/caseLevel.vue';
import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue'; import ExecuteResult from '@/components/business/ms-case-associate/executeResult.vue';
import { useI18n } from '@/hooks/useI18n'; import useOpenNewPage from '@/hooks/useOpenNewPage';
import type { CaseManagementTable } from '@/models/caseManagement/featureCase';
import type { TableQueryParams } from '@/models/common'; import type { TableQueryParams } from '@/models/common';
import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum'; import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum';
import { CaseLinkEnum } from '@/enums/caseEnum'; import { CaseLinkEnum } from '@/enums/caseEnum';
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum'; import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { getPublicLinkCaseListMap } from './utils/page'; import { getPublicLinkCaseListMap } from './utils/page';
import { casePriorityOptions } from '@/views/api-test/components/config'; import { casePriorityOptions } from '@/views/api-test/components/config';
import { executionResultMap, statusIconMap } from '@/views/case-management/caseManagementFeature/components/utils'; import { executionResultMap, statusIconMap } from '@/views/case-management/caseManagementFeature/components/utils';
const { t } = useI18n(); const { openNewPage } = useOpenNewPage();
const props = defineProps<{ const props = defineProps<{
associationType: string; // | | associationType: string; // | |
@ -271,7 +273,6 @@
const tableRef = ref<InstanceType<typeof MsBaseTable>>(); const tableRef = ref<InstanceType<typeof MsBaseTable>>();
function getFunctionalSaveParams() { function getFunctionalSaveParams() {
console.log(111);
const { excludeKeys, selectedKeys, selectorStatus } = propsRes.value; const { excludeKeys, selectedKeys, selectorStatus } = propsRes.value;
const tableParams = getTableParams(); const tableParams = getTableParams();
return { return {
@ -282,6 +283,14 @@
}; };
} }
//
function toDetail(record: CaseManagementTable) {
openNewPage(CaseManagementRouteEnum.CASE_MANAGEMENT_CASE, {
id: record.id,
pId: record.projectId,
});
}
watch( watch(
() => props.currentProject, () => props.currentProject,
() => { () => {

View File

@ -11,7 +11,7 @@
@filter-change="getModuleCount" @filter-change="getModuleCount"
> >
<template #num="{ record }"> <template #num="{ record }">
<MsButton type="text">{{ record.num }}</MsButton> <MsButton type="text" @click="toDetail(record)">{{ record.num }}</MsButton>
</template> </template>
<template #[FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL]="{ filterContent }"> <template #[FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL]="{ filterContent }">
<CaseLevel :case-level="filterContent.value" /> <CaseLevel :case-level="filterContent.value" />
@ -48,18 +48,22 @@
import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue'; import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useOpenNewPage from '@/hooks/useOpenNewPage';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import { ApiCaseDetail } from '@/models/apiTest/management';
import type { TableQueryParams } from '@/models/common'; import type { TableQueryParams } from '@/models/common';
import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum'; import { CasePageApiTypeEnum } from '@/enums/associateCaseEnum';
import { CaseLinkEnum } from '@/enums/caseEnum'; import { CaseLinkEnum } from '@/enums/caseEnum';
import { ReportEnum, ReportStatus } from '@/enums/reportEnum'; import { ReportEnum, ReportStatus } from '@/enums/reportEnum';
import { ApiTestRouteEnum } from '@/enums/routeEnum';
import { FilterRemoteMethodsEnum, FilterSlotNameEnum } from '@/enums/tableFilterEnum'; import { FilterRemoteMethodsEnum, FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { getPublicLinkCaseListMap } from './utils/page'; import { getPublicLinkCaseListMap } from './utils/page';
import { casePriorityOptions } from '@/views/api-test/components/config'; import { casePriorityOptions } from '@/views/api-test/components/config';
const { t } = useI18n(); const { t } = useI18n();
const { openNewPage } = useOpenNewPage();
const props = defineProps<{ const props = defineProps<{
associationType: string; // | | associationType: string; // | |
@ -275,6 +279,14 @@
}; };
} }
//
function toDetail(record: ApiCaseDetail) {
openNewPage(ApiTestRouteEnum.API_TEST_SCENARIO, {
id: record.id,
pId: record.projectId,
});
}
onMounted(() => { onMounted(() => {
loadScenarioList(); loadScenarioList();
}); });