|
|
@@ -1,17 +1,22 @@
|
|
|
<template>
|
|
|
<div id="dev_check">
|
|
|
- <!-- <el-select v-model="selected" @change="changeSelect" placeholder="筛选">
|
|
|
- <el-option v-for="(item, index) of statuses" :key="index" :label="item.name" :value="item.id">
|
|
|
- <span>{{item.name}}</span>
|
|
|
- </el-option>
|
|
|
- </el-select> -->
|
|
|
<div class="filter-box">
|
|
|
<el-form :inline="true" :model="filterForm" class="filter-form" :label-position="labelPosition">
|
|
|
<el-form-item label="类型">
|
|
|
+ <el-radio-group v-model="filterForm.cert_id" size="mini">
|
|
|
+ <el-radio-button :label="0">全部</el-radio-button>
|
|
|
+ <el-radio-button v-for="itm in types" :label="itm.id" :key="itm.id">{{itm.name}}</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态">
|
|
|
<el-radio-group v-model="filterForm.status" size="mini">
|
|
|
- <el-radio-button v-for="itm in statuses" :label="itm.name" :key="itm.id">{{itm.name}}</el-radio-button>
|
|
|
+ <el-radio-button :label="0">全部</el-radio-button>
|
|
|
+ <el-radio-button v-for="itm in statues" :label="itm.id" :key="itm.id">{{itm.name}}</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="searchList()" size="small">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="table">
|
|
|
@@ -101,14 +106,15 @@ let env = "test";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 筛选类型
|
|
|
+ types: [],
|
|
|
// 筛选状态
|
|
|
- statuses: [],
|
|
|
- selected: "",
|
|
|
+ statues: [],
|
|
|
// 数据总条目
|
|
|
totalCount: 0,
|
|
|
currentPage: 1,
|
|
|
currentPageSize: 20,
|
|
|
- certID: "",
|
|
|
+ // certID: "",
|
|
|
// 列表头显示内容
|
|
|
tableHeaders,
|
|
|
// 列表头字段
|
|
|
@@ -133,34 +139,39 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 页码变动
|
|
|
- changePagination(page) {
|
|
|
- // console.log(this.certID, page)
|
|
|
- this.$router.replace({
|
|
|
- // path: `/main/dev_check`,
|
|
|
- query: { page, cert_id: this.certID }
|
|
|
- });
|
|
|
+ // changePagination(page) {
|
|
|
+ // // console.log(this.certID, page)
|
|
|
+ // this.$router.replace({
|
|
|
+ // // path: `/main/dev_check`,
|
|
|
+ // query: { page, cert_id: this.certID }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ changePagination(val) {
|
|
|
+ this.page = val;
|
|
|
+ this.getTableData();
|
|
|
},
|
|
|
changePageSize(pageSize) {
|
|
|
this.currentPageSize = pageSize;
|
|
|
},
|
|
|
// 筛选框变动
|
|
|
- changeSelect(id) {
|
|
|
- this.certID = id;
|
|
|
- this.$router.replace({
|
|
|
- // path: `/main/dev_check`,
|
|
|
- query: { page: this.currentPage, cert_id: id }
|
|
|
- });
|
|
|
+ // changeSelect(id) {
|
|
|
+ // this.certID = id;
|
|
|
+ // this.$router.replace({
|
|
|
+ // // path: `/main/dev_check`,
|
|
|
+ // query: { page: this.currentPage, cert_id: id }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ searchList() {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.getTableData();
|
|
|
},
|
|
|
// 获取筛选
|
|
|
async getFilters() {
|
|
|
const res = await this.$post("/api/admin/cert/getEnum");
|
|
|
const data = res.data;
|
|
|
- data.cert_type_list.unshift({
|
|
|
- id: 0,
|
|
|
- name: "全部"
|
|
|
- });
|
|
|
- this.statuses = data.cert_type_list || [];
|
|
|
- this.selected = this.statuses[0].name;
|
|
|
+
|
|
|
+ this.types = data.cert_type_list || [];
|
|
|
+ this.statues = data.audit_status_list || [];
|
|
|
this.handleRouteParams();
|
|
|
},
|
|
|
/**
|
|
|
@@ -168,12 +179,14 @@ export default {
|
|
|
*/
|
|
|
handleRouteParams() {
|
|
|
this.currentPage = Number(this.$route.query.page);
|
|
|
- this.certID = this.$route.query.cert_id;
|
|
|
- for (var i = 0; i < this.statuses.length; i++) {
|
|
|
- if (this.certID == this.statuses[i].id) {
|
|
|
- this.selected = this.statuses[i].name;
|
|
|
- }
|
|
|
+ if (typeof(this.$route.query.cert_id) != 'undefined') {
|
|
|
+ this.filterForm.cert_id = this.$route.query.cert_id;
|
|
|
}
|
|
|
+ // for (var i = 0; i < this.types.length; i++) {
|
|
|
+ // if (this.certID == this.types[i].id) {
|
|
|
+ // this.filterForm.cert_id = this.types[i].id;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.getTableData();
|
|
|
},
|
|
|
clickCtrl(item, index) {
|
|
|
@@ -212,9 +225,11 @@ export default {
|
|
|
this.tableData = [];
|
|
|
let page = this.currentPage;
|
|
|
let page_size = this.currentPageSize;
|
|
|
- let cert_id = Number(this.certID);
|
|
|
- let body = { page, page_size, cert_id };
|
|
|
- let res = await this.$post("/api/admin/audit/getList", body);
|
|
|
+ let cert_id = this.filterForm.cert_id;
|
|
|
+ let status = this.filterForm.status;
|
|
|
+ // let body = { page, page_size, cert_id };
|
|
|
+ let params = { page, page_size, cert_id, status };
|
|
|
+ let res = await this.$post("/api/admin/audit/getList", params);
|
|
|
let data = res.data;
|
|
|
env = data.current_env;
|
|
|
this.tableData = this.formatTableData(res.data.list);
|
|
|
@@ -234,10 +249,11 @@ export default {
|
|
|
height: auto;
|
|
|
}
|
|
|
.page {
|
|
|
- margin-top: 15px;
|
|
|
+}
|
|
|
+.el-form-item{
|
|
|
+ margin-bottom: 0;
|
|
|
}
|
|
|
.filter-box{
|
|
|
margin-top: 10px;
|
|
|
- margin-bottom: 15px;
|
|
|
}
|
|
|
</style>
|