remove console log from items list and fix showing items label
This commit is contained in:
parent
bddcb9bf31
commit
f48abe01dd
|
@ -46,8 +46,8 @@
|
|||
<div class="table-footer">
|
||||
<div class="shown-items">
|
||||
{{
|
||||
$i18n.get('info_showing_items') +
|
||||
(itemsPerPage*(page - 1) + 1) +
|
||||
$i18n.get('info_showing_items') +
|
||||
getFirstItem() +
|
||||
$i18n.get('info_to') +
|
||||
getLastItemNumber() +
|
||||
$i18n.get('info_of') + totalItems + '.'
|
||||
|
@ -100,6 +100,11 @@ export default {
|
|||
isLoading: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
page( value ){
|
||||
this.page = ( value > 0 ) ? value : 1;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
ItemsList,
|
||||
FiltersItemsList
|
||||
|
@ -185,6 +190,12 @@ export default {
|
|||
let last = (Number(this.itemsPerPage*(this.page - 1)) + Number(this.itemsPerPage));
|
||||
|
||||
return last > this.totalItems ? this.totalItems : last;
|
||||
},
|
||||
getFirstItem(){
|
||||
if( this.totalItems == 0 )
|
||||
return 0;
|
||||
|
||||
return ( this.itemsPerPage * ( this.page - 1 ) + 1)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -99,12 +99,14 @@
|
|||
getValuesPlainText( field_id ){
|
||||
return axios.get( '/collection/' + this.collection + '/fields/' + field_id + '?fetch=all_field_values')
|
||||
.then( res => {
|
||||
for (let metadata of res.data) {
|
||||
let index = this.options.findIndex(itemMetadata => itemMetadata.value === metadata.mvalue);
|
||||
if( index < 0 ){
|
||||
this.options.push({ label: metadata.mvalue, value: metadata.mvalue })
|
||||
}
|
||||
if( res.data ){
|
||||
for (let metadata of res.data) {
|
||||
let index = this.options.findIndex(itemMetadata => itemMetadata.value === metadata.mvalue);
|
||||
if( index < 0 ){
|
||||
this.options.push({ label: metadata.mvalue, value: metadata.mvalue })
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
Loading…
Reference in New Issue