|
|
@@ -90,20 +90,31 @@ export default {
|
|
|
tableData: []
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ '$route'(to, from) {
|
|
|
+ this.handleRouteParams()
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- console.log(this.currentPage)
|
|
|
+ // console.log(this.currentPage)
|
|
|
this.getFilters()
|
|
|
},
|
|
|
methods: {
|
|
|
// 页码变动
|
|
|
changePagination(page) {
|
|
|
- this.getTableData()
|
|
|
+ // console.log(this.certID, page)
|
|
|
+ this.$router.replace({
|
|
|
+ // path: `/main/dev_check`,
|
|
|
+ query: { page, cert_id: this.certID }
|
|
|
+ })
|
|
|
},
|
|
|
// 筛选框变动
|
|
|
changeSelect(id) {
|
|
|
- this.currentPage = 1
|
|
|
this.certID = id
|
|
|
- this.getTableData()
|
|
|
+ this.$router.replace({
|
|
|
+ // path: `/main/dev_check`,
|
|
|
+ query: { page: this.currentPage, cert_id: id }
|
|
|
+ })
|
|
|
},
|
|
|
// 获取筛选
|
|
|
async getFilters() {
|
|
|
@@ -115,7 +126,12 @@ export default {
|
|
|
})
|
|
|
this.statuses = data.cert_type_list || []
|
|
|
this.selected = this.statuses[0].name
|
|
|
-
|
|
|
+ this.handleRouteParams()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 路由钩子触发获取路由携带query, 首次进入也算一次
|
|
|
+ */
|
|
|
+ handleRouteParams() {
|
|
|
this.currentPage = Number(this.$route.query.page)
|
|
|
this.certID = this.$route.query.cert_id
|
|
|
this.getTableData()
|
|
|
@@ -153,11 +169,10 @@ export default {
|
|
|
async getTableData() {
|
|
|
this.tableData = []
|
|
|
let page = this.currentPage
|
|
|
- console.log(this.currentPage)
|
|
|
let cert_id = this.certID
|
|
|
let body = { page, cert_id }
|
|
|
let res = await this.$post("/api/admin/audit/getList", body)
|
|
|
- console.log(body)
|
|
|
+ // console.log(body)
|
|
|
let data = res.data
|
|
|
env = data.current_env
|
|
|
this.tableData = this.formatTableData(res.data.list)
|