fix(测试跟踪): 修复7天失败用例跳转不显示查询结果的问题

--bug=1021144 --user=宋天阳 【测试跟踪】首页-过去7天测试计划失败用例TOP 10-接口用例跳转页面数据不对
https://www.tapd.cn/55049933/s/1319160
This commit is contained in:
song-tianyang 2022-12-24 21:29:48 +08:00 committed by 建国
parent a4e4996e9f
commit 61ff11d8d4
1 changed files with 64 additions and 35 deletions

View File

@ -1,20 +1,20 @@
<template> <template>
<div style="background-color:#F5F6F7; overflow: auto"> <div style="background-color: #f5f6f7; overflow: auto">
<ms-container> <ms-container>
<ms-main-container style="padding: 0px"> <ms-main-container style="padding: 0px">
<div class="track-home-layout"> <div class="track-home-layout">
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="12"> <el-col :span="12">
<case-count-card @redirectPage="redirectPage"/> <case-count-card @redirectPage="redirectPage" />
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<relevance-case-card @redirectPage="redirectPage"/> <relevance-case-card @redirectPage="redirectPage" />
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="16" style="margin-top: 16px"> <el-row :gutter="16" style="margin-top: 16px">
<el-col :span="12"> <el-col :span="12">
<bug-count-card @redirectPage="redirectPage"/> <bug-count-card @redirectPage="redirectPage" />
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<case-maintenance /> <case-maintenance />
@ -22,20 +22,26 @@
</el-row> </el-row>
<el-row style="margin-top: 16px"> <el-row style="margin-top: 16px">
<el-col style="height: 369px; background-color: #FFFFFF;"> <el-col style="height: 369px; background-color: #ffffff">
<ms-failure-test-case-list :select-function-case="true" @redirectPage="redirectPage"/> <ms-failure-test-case-list
:select-function-case="true"
@redirectPage="redirectPage"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 16px"> <el-row style="margin-top: 16px">
<el-col style="height: 369px; background-color: #FFFFFF;"> <el-col style="height: 369px; background-color: #ffffff">
<review-list/> <review-list />
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 16px"> <el-row style="margin-top: 16px">
<el-col style="height: 369px; background-color: #FFFFFF;"> <el-col style="height: 369px; background-color: #ffffff">
<ms-running-task-list :call-from="'track_home'" @redirectPage="redirectPage"/> <ms-running-task-list
:call-from="'track_home'"
@redirectPage="redirectPage"
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -45,7 +51,6 @@
</template> </template>
<script> <script>
import MsMainContainer from "metersphere-frontend/src/components/MsMainContainer"; import MsMainContainer from "metersphere-frontend/src/components/MsMainContainer";
import MsContainer from "metersphere-frontend/src/components/MsContainer"; import MsContainer from "metersphere-frontend/src/components/MsContainer";
import CaseCountCard from "./components/CaseCountCard"; import CaseCountCard from "./components/CaseCountCard";
@ -54,10 +59,10 @@ import CaseMaintenance from "./components/CaseMaintenance";
import BugCountCard from "./components/BugCountCard"; import BugCountCard from "./components/BugCountCard";
import ReviewList from "./components/ReviewList"; import ReviewList from "./components/ReviewList";
import MsRunningTaskList from "./components/RunningTaskList"; import MsRunningTaskList from "./components/RunningTaskList";
import {getUUID} from "metersphere-frontend/src/utils"; import { getUUID } from "metersphere-frontend/src/utils";
import MsFailureTestCaseList from "@/business/home/components/FailureTestCaseList"; import MsFailureTestCaseList from "@/business/home/components/FailureTestCaseList";
require('echarts/lib/component/legend'); require("echarts/lib/component/legend");
export default { export default {
name: "TrackHome", name: "TrackHome",
components: { components: {
@ -72,8 +77,7 @@ export default {
MsRunningTaskList, MsRunningTaskList,
}, },
data() { data() {
return { return {};
}
}, },
methods: { methods: {
redirectPage(page, dataType, selectType, title) { redirectPage(page, dataType, selectType, title) {
@ -81,31 +85,56 @@ export default {
//UUID //UUID
let uuid = getUUID(); let uuid = getUUID();
let home; let home;
let defaultVersion = "default";
switch (page) { switch (page) {
case "testCase": case "testCase":
home = this.$router.resolve({ home = this.$router.resolve({
name: 'testCaseRedirect', name: "testCaseRedirect",
params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType} params: {
}) redirectID: uuid,
dataType: dataType,
dataSelectRange: selectType,
},
});
break; break;
case "testPlanEdit": case "testPlanEdit":
home = this.$router.resolve('/track/plan/view/' + selectType) home = this.$router.resolve("/track/plan/view/" + selectType);
break; break;
case "scenarioWithQuery": case "scenarioWithQuery":
home = this.$router.resolve('/api/automation/' + uuid + "/" + dataType + "/" + selectType); home = this.$router.resolve(
"/api/automation/" +
defaultVersion +
"/" +
uuid +
"/" +
dataType +
"/" +
selectType
);
break; break;
case "api": case "api":
home = this.$router.resolve('/api/definition/' + uuid + "/" + dataType + "/" + selectType); home = this.$router.resolve(
"/api/definition/" +
defaultVersion +
"/" +
uuid +
"/" +
dataType +
"/" +
selectType
);
break; break;
case "issue": case "issue":
home = this.$router.resolve('/track/issue/' + uuid + "/" + dataType + "/" + selectType); home = this.$router.resolve(
"/track/issue/" + uuid + "/" + dataType + "/" + selectType
);
} }
if (home) { if (home) {
window.open(home.href, '_blank'); window.open(home.href, "_blank");
} }
} },
} },
} };
</script> </script>
<style scoped> <style scoped>
@ -145,10 +174,10 @@ export default {
.track-home-layout :deep(.main-info-card) { .track-home-layout :deep(.main-info-card) {
height: 208px; height: 208px;
width: 100%; width: 100%;
color: #646A73; color: #646a73;
background-color: #FFFFFF; background-color: #ffffff;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #DEE0E3; border: 1px solid #dee0e3;
border-radius: 4px; border-radius: 4px;
} }
@ -161,7 +190,7 @@ export default {
line-height: 22px; line-height: 22px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #646A73; color: #646a73;
} }
.track-home-layout :deep(.addition-info-text) { .track-home-layout :deep(.addition-info-text) {
@ -180,13 +209,13 @@ export default {
.track-home-layout :deep(.home-table-cell) { .track-home-layout :deep(.home-table-cell) {
height: 40px; height: 40px;
background-color: #F5F6F7; background-color: #f5f6f7;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
border: 1px solid rgba(31, 35, 41, 0.15); border: 1px solid rgba(31, 35, 41, 0.15);
border-right-width: 0; border-right-width: 0;
border-left-width: 0; border-left-width: 0;
color: #646A73; color: #646a73;
line-height: 22px; line-height: 22px;
} }
@ -195,7 +224,7 @@ export default {
} }
.track-home-layout :deep(.table-title) { .track-home-layout :deep(.table-title) {
color: #1F2329; color: #1f2329;
font-weight: 500; font-weight: 500;
font-size: 18px; font-size: 18px;
line-height: 26px; line-height: 26px;
@ -207,10 +236,10 @@ export default {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
line-height: 22px; line-height: 22px;
color: #1F2329; color: #1f2329;
} }
.track-home-layout :deep(.el-table__body tr:hover ) { .track-home-layout :deep(.el-table__body tr:hover) {
cursor: pointer; cursor: pointer;
} }