mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 22:24:23 +08:00
Add entries and selected entries in paging [SCI-10317] (#7276)
This commit is contained in:
parent
f400e2f6d9
commit
8300c2c3c3
2 changed files with 20 additions and 7 deletions
|
@ -67,13 +67,6 @@
|
|||
@toolbar:action="emitAction" />
|
||||
</div>
|
||||
<div v-if="scrollMode == 'pages'" class="flex items-center py-4" :class="{'opacity-0': initializing }">
|
||||
<div class="mr-auto">
|
||||
<Pagination
|
||||
:totalPage="totalPage"
|
||||
:currentPage="page"
|
||||
@setPage="setPage"
|
||||
></Pagination>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
{{ i18n.t('datatable.show') }}
|
||||
<div class="w-36">
|
||||
|
@ -83,6 +76,21 @@
|
|||
@change="setPerPage"
|
||||
></SelectDropdown>
|
||||
</div>
|
||||
<div>
|
||||
<span v-if="selectedRows.length">
|
||||
{{ i18n.t('datatable.entries.selected', { total: totalEntries, selected: selectedRows.length }) }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ i18n.t('datatable.entries.total', { total: totalEntries, selected: selectedRows.length }) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ml-auto">
|
||||
<Pagination
|
||||
:totalPage="totalPage"
|
||||
:currentPage="page"
|
||||
@setPage="setPage"
|
||||
></Pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -167,6 +175,7 @@ export default {
|
|||
page: 1,
|
||||
order: null,
|
||||
totalPage: 0,
|
||||
totalEntries: null,
|
||||
selectedRows: [],
|
||||
keepSelection: false,
|
||||
searchValue: '',
|
||||
|
@ -436,6 +445,7 @@ export default {
|
|||
this.handleInfiniteScroll(response);
|
||||
}
|
||||
this.totalPage = response.data.meta.total_pages;
|
||||
this.totalEntries = response.data.meta.total_count;
|
||||
this.$emit('tableReloaded');
|
||||
this.dataLoading = false;
|
||||
this.restoreSelection();
|
||||
|
|
|
@ -3839,6 +3839,9 @@ en:
|
|||
# This section contains general words that can be used in any parts of
|
||||
# application.
|
||||
datatable:
|
||||
entries:
|
||||
total: "%{total} entries"
|
||||
selected: "%{selected} of %{total} selected"
|
||||
show: 'Show:'
|
||||
rows: 'rows'
|
||||
tiny_mce:
|
||||
|
|
Loading…
Add table
Reference in a new issue