Mercurial > gemma
comparison client/src/components/systemconfiguration/PDFTemplates.vue @ 2738:add2d47c2567
client: tables: implemented simple default sorting
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 19 Mar 2019 18:59:40 +0100 |
parents | 4bcb26542767 |
children | 615b0a9b8098 |
comparison
equal
deleted
inserted
replaced
2737:4a5c0e7cb75b | 2738:add2d47c2567 |
---|---|
12 </div> | 12 </div> |
13 <div class="mt-1 border-bottom pb-4"> | 13 <div class="mt-1 border-bottom pb-4"> |
14 <UITableHeader | 14 <UITableHeader |
15 :columns="[ | 15 :columns="[ |
16 { id: 'name', title: 'Name', class: 'col-4' }, | 16 { id: 'name', title: 'Name', class: 'col-4' }, |
17 { id: 'date', title: 'Date', class: 'col-4' }, | 17 { id: 'time', title: 'Date', class: 'col-4' }, |
18 { id: 'country', title: 'Country', class: 'col-2' } | 18 { id: 'country', title: 'Country', class: 'col-2' } |
19 ]" | 19 ]" |
20 :sortable="false" | |
21 /> | 20 /> |
22 <UITableBody :data="templates" v-slot="{ item: template }"> | 21 <UITableBody |
22 :data="templates | sortTable(sortColumn, sortDirection)" | |
23 v-slot="{ item: template }" | |
24 > | |
23 <div class="py-1 col-4">{{ template.name }}</div> | 25 <div class="py-1 col-4">{{ template.name }}</div> |
24 <div class="py-1 col-4">{{ template.time }}</div> | 26 <div class="py-1 col-4">{{ template.time }}</div> |
25 <div class="py-1 col-2" v-if="template.country"> | 27 <div class="py-1 col-2" v-if="template.country"> |
26 {{ template.country }} | 28 {{ template.country }} |
27 </div> | 29 </div> |
76 * Author(s): | 78 * Author(s): |
77 * Markus Kottländer <markus@intevation.de> | 79 * Markus Kottländer <markus@intevation.de> |
78 * Fadi Abbud <fadi.abbud@intevation.de> | 80 * Fadi Abbud <fadi.abbud@intevation.de> |
79 */ | 81 */ |
80 import { HTTP } from "@/lib/http"; | 82 import { HTTP } from "@/lib/http"; |
81 import { displayError, displayInfo } from "@/lib/errors.js"; | 83 import { displayError, displayInfo } from "@/lib/errors"; |
84 import { sortTable } from "@/lib/mixins"; | |
82 | 85 |
83 export default { | 86 export default { |
84 name: "pdftemplates", | 87 name: "pdftemplates", |
88 mixins: [sortTable], | |
85 data() { | 89 data() { |
86 return { | 90 return { |
87 templates: [], | 91 templates: [], |
88 uploading: false | 92 uploading: false |
89 }; | 93 }; |