Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2020-12-24 14:15:17 +08:00
commit 9253d25b5d
3 changed files with 44 additions and 11 deletions

View File

@ -10,7 +10,7 @@
@dataChange="changePlan"/>
</template>
<template v-slot:menu>
<el-menu active-text-color="#6d317c" :default-active="activeIndex"
<el-menu v-if="isMenuShow" active-text-color="#6d317c" :default-active="activeIndex"
class="el-menu-demo header-menu" mode="horizontal" @select="handleSelect">
<el-menu-item index="functional">功能测试用例</el-menu-item>
<el-menu-item index="api">接口测试用例</el-menu-item>
@ -21,6 +21,9 @@
<test-plan-functional v-if="activeIndex === 'functional'" :plan-id="planId"/>
<test-plan-api v-if="activeIndex === 'api'" :plan-id="planId"/>
<test-case-statistics-report-view :test-plan="currentPlan" v-if="activeIndex === 'report'"/>
<test-report-template-list @openReport="openReport" ref="testReportTemplateList"/>
</div>
</template>
@ -38,10 +41,12 @@
import TestPlanFunctional from "./comonents/functional/TestPlanFunctional";
import TestPlanApi from "./comonents/api/TestPlanApi";
import TestCaseStatisticsReportView from "./comonents/report/statistics/TestCaseStatisticsReportView";
import TestReportTemplateList from "./comonents/TestReportTemplateList";
export default {
name: "TestPlanView",
components: {
TestReportTemplateList,
TestCaseStatisticsReportView,
TestPlanApi,
TestPlanFunctional,
@ -52,7 +57,8 @@
return {
testPlans: [],
currentPlan: {},
activeIndex: "functional"
activeIndex: "functional",
isMenuShow: true
}
},
computed: {
@ -62,6 +68,7 @@
},
watch: {
'$route.params.planId'() {
this.activeIndex = "functional";
this.getTestPlans();
}
},
@ -85,8 +92,23 @@
},
handleSelect(key) {
this.activeIndex = key;
if (key === 'report' && !this.currentPlan.reportId) {
this.$refs.testReportTemplateList.open(this.planId);
}
},
openTemplateReport() {
this.$refs.testReportTemplateList.open(this.planId);
},
openReport(planId, id) {
this.currentPlan.reportId = id;
},
reloadMenu() {
this.isMenuShow = false;
this.$nextTick(() => {
this.isMenuShow = true;
});
}
}
},
}
</script>

View File

@ -2,6 +2,7 @@
<el-dialog :title="$t('test_track.plan_view.select_template')"
:visible.sync="templateVisible"
class="report-template-list"
width="50%">
<el-main>
@ -59,4 +60,7 @@
display: none;
}
.report-template-list {
text-align: left;
}
</style>

View File

@ -1,16 +1,15 @@
<template>
<div v-loading="result.loading">
<div v-loading="result.loading" :class="{'text-align': !reportId}">
<el-button v-if="!reportId" class="create-button" :disabled="!isTestManagerOrTestUser" plain size="mini" @click="openTemplateReport">
{{$t('test_track.plan_view.create_report')}}
</el-button>
<el-row type="flex" class="head-bar">
<el-col :span="12">
</el-col>
<el-col v-if="!reportId" :span="11" class="head-right">
<el-button :disabled="!isTestManagerOrTestUser" plain size="mini" @click="openTemplateReport">
{{$t('test_track.plan_view.create_report')}}
</el-button>
</el-col>
<el-col v-else :span="11" class="head-right">
<el-col v-if="reportId" :span="11" class="head-right">
<el-button :disabled="!isTestManagerOrTestUser" plain size="mini" @click="handleSave">
{{$t('commons.save')}}
</el-button>
@ -255,6 +254,14 @@
width: 80px;
}
.text-align {
text-align: center;
}
.create-button {
margin: 20px auto;
}
.head-bar {
position: fixed;
right: 10px;