reordered for custom views
This commit is contained in:
73
src/views/lists/userlist.vue
Normal file
73
src/views/lists/userlist.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div class="Userlist">
|
||||
<h1>Userlist</h1>
|
||||
<scroll-table :columns="columns" :new-rows="newRows" :has-more="hasMore" :loading="loading" :handler="more" orderBy="id" :orderDesc="true"></scroll-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ScrollTable from '../../components/scroll-table.vue';
|
||||
|
||||
export default {
|
||||
name: "Userlist",
|
||||
components: {
|
||||
ScrollTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
columns: [
|
||||
{
|
||||
heading: 'ID',
|
||||
prop: 'ID',
|
||||
orderBy: 'id'
|
||||
},
|
||||
{
|
||||
heading: 'Benutzername',
|
||||
prop: 'Username',
|
||||
orderBy: 'username'
|
||||
},
|
||||
{
|
||||
heading: 'Reseller',
|
||||
prop: 'Reseller.Username'
|
||||
},
|
||||
{
|
||||
heading: 'Render',
|
||||
render(row) {
|
||||
return 'ID:' + row.ID;
|
||||
}
|
||||
}
|
||||
],
|
||||
newRows: [ ],
|
||||
hasMore: true,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
more(offset, limit, orderBy, orderDesc, search) {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('apiRequest', {
|
||||
endpoint: 'users',
|
||||
params: {
|
||||
start: offset,
|
||||
length: limit,
|
||||
orderBy,
|
||||
orderDesc,
|
||||
search
|
||||
}
|
||||
})
|
||||
.then(rows => {
|
||||
this.hasMore = (rows.length >= limit);
|
||||
this.newRows = rows;
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(error => {
|
||||
this.loading = false;
|
||||
this.hasMore = false;
|
||||
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user