提交 468491bf 编写于 作者: S shiziyuan9527

测试报告下拉列表路由跳转

上级 145b4785
......@@ -5,7 +5,7 @@
{{$t('load_test.recent')}}
</div>
<el-menu-item :key="p.id" v-for="p in recentReports"
:index="'/report/' + p.id" :route="{name:'report', params:{projectId:p.id, projectName:p.name}}">
:index="'/reportView/' + p.id" :route="{path: '/reportView/' + p.id}">
{{ p.name }}
</el-menu-item>
</el-menu>
......
......@@ -32,7 +32,7 @@
</el-row>
<el-divider></el-divider>
<el-tabs v-model="active" type="border-card" :stretch="true">
<el-tab-pane :label="$t('report.test_overview')">
<ms-report-test-overview />
......@@ -91,6 +91,17 @@
this.reportId = this.$route.path.split('/')[2];
this.initBreadcrumb();
},
watch: {
'$route'(to) {
let reportId = to.path.split('/')[2]; // find testId
this.$get("report/test/pro/info/" + reportId, response => {
let data = response.data;
this.reportName = data.name;
this.testName = data.testName;
this.projectName = data.projectName;
});
}
}
}
</script>
......
......@@ -119,16 +119,9 @@ const router = new VueRouter({
},
{
path: "/reportView/:reportId",
name: "ReportView",
name: "reportView",
components: {
content: ReportView
},
props: {
content: (route) => {
return {
...route.params
}
}
}
},
]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册