提交 1ab4b75e 编写于 作者: C Captain.B

项目的点击事件

上级 a77ba70a
......@@ -18,6 +18,9 @@
<if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId}
</if>
<if test="request.projectId != null">
AND project.id = #{request.projectId}
</if>
</where>
<if test="request.recent">
order by load_test.update_time desc
......
......@@ -18,7 +18,7 @@
<template slot="title">测试</template>
<ms-recent-test-plan/>
<el-divider/>
<el-menu-item index="/allTest">
<el-menu-item index="/allTest/all">
<font-awesome-icon :icon="['fa', 'list-ul']"/>
<span style="padding-left: 5px;">所有测试</span>
</el-menu-item>
......
<template>
<el-menu>
<el-menu router menu-trigger="click" :default-active="$route.path">
<div class="recent-text">
<i class="el-icon-time"/>
{{$t('project.recent')}}
</div>
<el-menu-item :key="recentProject.id" v-for="recentProject in recentProjects" @click="goTest(recentProject)">
{{ recentProject.name }}
<el-menu-item :key="p.id" v-for="p in recentProjects"
:index="'/allTest/' + p.id" :route="{name:'allTest', params:{projectId:p.id, projectName:p.name}}">
{{ p.name }}
</el-menu-item>
</el-menu>
</template>
......@@ -18,12 +20,7 @@
this.recentProjects = response.data;
});
},
methods: {
goTest(project) {
window.console.log(project);
// this.$router.push({path: '/allTest', params: {projectId: project.id, projectName: project.name}});
}
},
methods: {},
data() {
return {
recentProjects: [],
......
......@@ -85,11 +85,11 @@ const router = new VueRouter({
}
},
{
path: "/allTest",
path: "/allTest/:projectId",
name: "allTest",
components: {
content: AllTestPlan
},
props: true,
},
{
path: "/project",
......
......@@ -80,16 +80,13 @@
<script>
export default {
props: {
projectId: String,
projectName: String
},
data() {
return {
result: {},
queryPath: "/testplan/list",
deletePath: "/testplan/delete",
condition: "",
projectId: null,
tableData: [],
multipleSelection: [],
currentPage: 1,
......@@ -98,20 +95,32 @@
loading: false,
}
},
watch: {
'$route'(to, from) {
window.console.log(to, from);
this.projectId = to.params.projectId;
this.initTableData();
}
},
created: function () {
this.projectId = this.$route.params.projectId;
this.initTableData();
},
methods: {
initTableData() {
let param = {
name: this.condition
name: this.condition,
};
if (this.projectId !== 'all') {
param.projectId = this.projectId;
}
this.result = this.$post(this.buildPagePath(this.queryPath), param, response => {
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
})
});
},
search() {
this.initTableData();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册