feat(接口测试): 点击api/case引用关系的ID跳转到场景详情

--bug=1039577 --user=吕梦园
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001039577
This commit is contained in:
teukkk 2024-04-17 17:12:40 +08:00 committed by 刘瑞斌
parent 1527cf6890
commit 69fc71c3d3
2 changed files with 24 additions and 18 deletions

View File

@ -9,16 +9,14 @@
@press-enter="loadQuoteList"
/>
<ms-base-table v-bind="propsRes" no-disable v-on="propsEvent">
<template #id="{ record }">
<MsButton type="text" @click="gotoResource(record)">{{ record.id }}</MsButton>
<template #num="{ record }">
<MsButton type="text" @click="toScenario(record.id)">{{ record.num }}</MsButton>
</template>
</ms-base-table>
</div>
</template>
<script setup lang="ts">
// import { useRouter } from 'vue-router';
import MsButton from '@/components/pure/ms-button/index.vue';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import { MsTableColumn } from '@/components/pure/ms-table/type';
@ -26,15 +24,16 @@
import { getDefinitionReference } from '@/api/modules/api-test/management';
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
import useOpenNewPage from '@/hooks/useOpenNewPage';
import { RouteEnum } from '@/enums/routeEnum';
const props = defineProps<{
sourceId: string | number;
}>();
// const router = useRouter();
const appStore = useAppStore();
const { t } = useI18n();
const { openNewPage } = useOpenNewPage();
const keyword = ref('');
const quoteLocaleMap = {
@ -99,13 +98,10 @@
loadList();
}
function gotoResource(record: any) {
// router.push({
// name: 'apiTestManagementApiPreview',
// query: {
// id: record.id,
// },
// });
function toScenario(id: string) {
openNewPage(RouteEnum.API_TEST_SCENARIO, {
id,
});
}
onBeforeMount(() => {

View File

@ -13,8 +13,8 @@
</div>
<ms-base-table v-bind="propsRes" no-disable v-on="propsEvent">
<template #id="{ record }">
<MsButton type="text">{{ record.id }}</MsButton>
<template #num="{ record }">
<MsButton type="text" @click="toScenario(record.id)">{{ record.num }}</MsButton>
</template>
</ms-base-table>
</div>
@ -28,12 +28,16 @@
import { getApiCaseDependency } from '@/api/modules/api-test/management';
import { useI18n } from '@/hooks/useI18n';
import useOpenNewPage from '@/hooks/useOpenNewPage';
import { RouteEnum } from '@/enums/routeEnum';
const props = defineProps<{
sourceId: string | number;
}>();
const { t } = useI18n();
const { openNewPage } = useOpenNewPage();
const keyword = ref('');
const quoteLocaleMap = {
@ -112,6 +116,12 @@
loadList();
}
function toScenario(id: string) {
openNewPage(RouteEnum.API_TEST_SCENARIO, {
id,
});
}
onBeforeMount(() => {
loadQuoteList();
});
@ -125,9 +135,9 @@
}
.history-table-before {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
align-items: center;
padding-bottom: 16px;
flex-direction: row;
}
</style>