feat(测试跟踪): 测试计划报告增加功能用例的id跳转

--story=1011884 --user=宋天阳
测试计划报告功能用例增加所属模块展示区分同名用例
https://www.tapd.cn/55049933/s/1368780
This commit is contained in:
song-tianyang 2023-05-05 14:50:51 +08:00 committed by fit2-zhao
parent c38955b4c9
commit c266e9522a
1 changed files with 97 additions and 71 deletions

View File

@ -1,66 +1,80 @@
<template>
<div class="container">
<el-table
row-key="id"
:data="testCases">
<el-table-column
prop="num"
:label="$t('commons.id')"
show-overflow-tooltip>
<template v-slot:default="{row}">
{{row.isCustomNum ? row.customNum : row.num }}
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="priority"
column-key="priority"
:label="$t('test_track.case.priority')">
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority"/>
</template>
</el-table-column>
<div class="container">
<el-table row-key="id" :data="testCases">
<el-table-column
prop="num"
:label="$t('commons.id')"
show-overflow-tooltip
>
<template v-slot:default="{ row }">
<span v-if="isTemplate || isShare">
{{ row.isCustomNum ? row.customNum : row.num }}
</span>
<el-link
v-else
type="primary"
@click="redirectFunctionCaseEditPage(row.caseId)"
>
{{ row.isCustomNum ? row.customNum : row.num }}
</el-link>
</template>
</el-table-column>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="priority"
column-key="priority"
:label="$t('test_track.case.priority')"
>
<template v-slot:default="scope">
<priority-table-item :value="scope.row.priority" ref="priority" />
</template>
</el-table-column>
<el-table-column
prop="projectName"
:label="$t('test_track.case.project_name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="projectName"
:label="$t('test_track.case.project_name')"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="executorName"
:label="$t('test_track.plan_view.executor')">
</el-table-column>
<el-table-column
prop="executorName"
:label="$t('test_track.plan_view.executor')"
>
</el-table-column>
<el-table-column
prop="maintainerName"
:label="$t('test_track.plan.plan_principal')">
</el-table-column>
<el-table-column
prop="maintainerName"
:label="$t('test_track.plan.plan_principal')"
>
</el-table-column>
<el-table-column
prop="status"
column-key="status"
:label="$t('test_track.plan_view.execute_result')">
<template v-slot:default="scope">
<status-table-item :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column
prop="updateTime"
:label="$t('commons.update_time')"
show-overflow-tooltip>
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | datetimeFormat }}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-table-column
prop="status"
column-key="status"
:label="$t('test_track.plan_view.execute_result')"
>
<template v-slot:default="scope">
<status-table-item :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
prop="updateTime"
:label="$t('commons.update_time')"
show-overflow-tooltip
>
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | datetimeFormat }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
@ -71,7 +85,12 @@ import StatusTableItem from "../../../../../../common/tableItems/planview/Status
export default {
name: "FunctionalCases",
components: {StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem},
components: {
StatusTableItem,
MethodTableItem,
TypeTableItem,
PriorityTableItem,
},
props: {
planId: String,
isTemplate: Boolean,
@ -85,13 +104,13 @@ export default {
type: Array,
default() {
return [];
}
}
},
},
},
data() {
return {
testCases: []
}
testCases: [],
};
},
mounted() {
this.getFunctionalTestCase();
@ -99,18 +118,18 @@ export default {
watch: {
testCases() {
if (this.testCases) {
this.$emit('setSize', this.testCases.length);
this.$emit("setSize", this.testCases.length);
}
},
allTestCase() {
this.getFunctionalTestCase();
}
},
},
methods: {
getFunctionalTestCase() {
this.testCases = [];
if (this.filterStatus) {
this.allTestCase.forEach(item => {
this.allTestCase.forEach((item) => {
if (item.status === this.filterStatus) {
this.testCases.push(item);
}
@ -118,11 +137,18 @@ export default {
} else {
this.testCases = this.allTestCase;
}
}
}
}
},
redirectFunctionCaseEditPage(caseId) {
let home = this.$router.resolve({
name: "testCaseEdit",
params: {
caseId: caseId,
},
});
window.open(home.href, "_blank");
},
},
};
</script>
<style scoped>
</style>
<style scoped></style>