Account and user search now working, same as before will be a bit buggy if you want to navigate through paginate tabs with an unfiltered list with text in the input field, if that's a big problem we can rethink it :)

This commit is contained in:
Phoenix
2019-09-16 16:09:31 +01:00
parent bc81cbb6e2
commit 256eb48d36
3 changed files with 35 additions and 20 deletions

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<div class="filter-container">
<input v-model="substring" placeholder="Search Accounts" class="filter-item">
<el-input v-model="substring" placeholder="Search Users" class="filter-item" style="width: 200px;" @keyup.enter.native="handleFilter" />
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
Search
</el-button>
@@ -112,6 +112,13 @@ export default {
this.getFullList()
},
methods: {
getList() {
if (this.substring === '') {
this.getFullList()
} else {
this.getSubstring()
}
},
getFullList() {
this.listLoading = true
fetchList(this.listQuery).then(response => {
@@ -128,14 +135,6 @@ export default {
this.total = response.data.total
})
},
getList() {
console.log(this.listQuery)
if (this.substring === '') {
this.getFullList()
} else {
this.getSubstring()
}
},
handleFilter() {
this.listQuery.page = 1
this.getList()