增加测试平台功能,系统设置,支持多个角色,分配菜单
This commit is contained in:
106
src/components/TestPlatform/Plan/PlanList.vue
Normal file
106
src/components/TestPlatform/Plan/PlanList.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<div class="page-wrap">
|
||||
<page-section title="测试计划">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" size="small" @click="goBuilder()">新建计划</el-button>
|
||||
</template>
|
||||
<el-form :inline="true" :model="queryForm" size="small" @submit.native.prevent>
|
||||
<el-form-item label="项目ID">
|
||||
<el-input v-model="projectId" style="width: 120px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="queryForm.keyword" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="queryForm.status" clearable>
|
||||
<el-option label="草稿" :value="0"></el-option>
|
||||
<el-option label="进行中" :value="1"></el-option>
|
||||
<el-option label="已完成" :value="2"></el-option>
|
||||
<el-option label="已归档" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="fetchList">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableData" border style="margin-top: 16px;">
|
||||
<el-table-column prop="name" label="计划名称" min-width="180"></el-table-column>
|
||||
<el-table-column prop="version" label="版本" width="120"></el-table-column>
|
||||
<el-table-column prop="owner_id" label="负责人" width="120"></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100"></el-table-column>
|
||||
<el-table-column label="操作" width="260">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="goExecute(scope.row)">执行</el-button>
|
||||
<el-button type="text" @click="goProgress(scope.row)">进度</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="margin-top: 16px; text-align: right;">
|
||||
<el-pagination
|
||||
:current-page="pageNo"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</page-section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PageSection from '@/components/TestPlatform/common/PageSection'
|
||||
import { getPlanList } from '@/api/planApi'
|
||||
|
||||
export default {
|
||||
name: 'PlanList',
|
||||
components: { PageSection },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
projectId: this.$route.query.projectId || 1,
|
||||
queryForm: {
|
||||
keyword: '',
|
||||
status: ''
|
||||
},
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
getPlanList(this.projectId, this.queryForm).then(res => {
|
||||
const data = (res && res.data) || res || {}
|
||||
this.tableData = data.items || data.list || []
|
||||
}).catch(() => {
|
||||
this.tableData = []
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
goBuilder() {
|
||||
this.$router.push({ path: '/test-platform/plans/builder', query: { projectId: this.projectId } })
|
||||
},
|
||||
goExecute(row) {
|
||||
this.$router.push({ path: '/test-platform/plans/execute', query: { projectId: this.projectId, planId: row.id } })
|
||||
},
|
||||
goProgress(row) {
|
||||
this.$router.push({ path: '/test-platform/plans/progress', query: { projectId: this.projectId, planId: row.id } })
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-wrap {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user