Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
scc-net
netvs
netvs-core
Commits
43bcc793
Commit
43bcc793
authored
Oct 15, 2021
by
gj4210
👽
Committed by
janis.streib
Dec 05, 2021
Browse files
UPD: Paginator & -List attribute naming
parent
f2b8ad25
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/Paginator.vue
View file @
43bcc793
<
template
>
<b-row
class=
"justify-content-md-center"
>
<b-col
:md=
"block ? null : 'auto'"
class=
"mb-0"
v-if=
"total
_r
ows > per
_p
age"
>
<b-pagination
:total-rows=
"total
_r
ows"
v-model=
"current_page_mutable"
:per-page=
"per
_p
age"
first-number
align=
"fill"
<b-col
:md=
"block ? null : 'auto'"
class=
"mb-0"
v-if=
"total
R
ows > per
P
age"
>
<b-pagination
:total-rows=
"total
R
ows"
v-model=
"current_page_mutable"
:per-page=
"per
P
age"
first-number
align=
"fill"
last-number
class=
"shadow"
>
</b-pagination>
</b-col>
<b-col
:md=
"block ? null : 'auto'"
class=
"mb-0 pb-3"
>
<b-input-group
class=
"shadow flex-nowrap"
>
<b-form-select
v-model=
"per_page_mutable"
:options=
"per
_p
age
_o
ptions"
/>
<b-form-select
v-model=
"per_page_mutable"
:options=
"per
P
age
O
ptions"
/>
<template
#append
>
<b-input-group-text>
von
{{
total
_r
ows
}}
</b-input-group-text>
<b-input-group-text>
von
{{
total
R
ows
}}
</b-input-group-text>
</
template
>
</b-input-group>
</b-col>
...
...
@@ -20,24 +20,24 @@
export
default
{
name
:
'
Paginator
'
,
props
:
{
current
_p
age
:
{
current
P
age
:
{
default
()
{
return
1
}
},
per
_p
age
:
{
per
P
age
:
{
default
()
{
return
25
}
},
total
_r
ows
:
total
R
ows
:
{
required
:
true
,
default
()
{
return
0
}
},
per
_p
age
_o
ptions
:
{
per
P
age
O
ptions
:
{
default
()
{
return
[
5
,
...
...
@@ -59,7 +59,7 @@ export default {
computed
:
{
current_page_mutable
:
{
get
()
{
return
this
.
current
_p
age
return
this
.
current
P
age
},
set
(
val
)
{
this
.
$emit
(
'
current-page
'
,
val
)
...
...
@@ -67,7 +67,7 @@ export default {
},
per_page_mutable
:
{
get
()
{
return
this
.
per
_p
age
return
this
.
per
P
age
},
set
(
val
)
{
this
.
$emit
(
'
per-page
'
,
val
)
...
...
frontend/src/components/PaginatorList.vue
View file @
43bcc793
<
template
>
<div
class=
"paginator"
>
<FilterInput
v-model=
"filterValue"
></FilterInput>
<Paginator
:current_page=
"current_page"
:per_page=
"items_per_page"
@
current-page=
"current_page = $event"
@
per-page=
"items_per_page = $event"
:total_rows=
"filtered_and_sorted_items.length"
:block=
"block"
<Paginator
currentPage=
"current_page"
perPage=
"items_per_page"
@
current-page=
"current_page = $event"
@
per-page=
"items_per_page = $event"
totalRows=
"filtered_and_sorted_items.length"
:block=
"block"
:per-page-options=
"itemsPerPageOptions"
v-if=
"filtered_and_sorted_items.length > 0"
/>
<div
class=
"pagination_container"
>
...
...
@@ -13,11 +14,12 @@
</div>
<div
v-if=
"!items || filtered_and_sorted_items.length === 0"
class=
"font-italic text-center my-3"
>
<span
class=
"font-italic"
>
{{
no
_i
tems
_t
ext
}}
</span><br/>
<span
class=
"font-italic"
>
{{
no
I
tems
T
ext
}}
</span><br/>
</div>
<Paginator
:current_page=
"current_page"
:per_page=
"items_per_page"
@
current-page=
"current_page = $event"
@
per-page=
"items_per_page = $event"
:total_rows=
"filtered_and_sorted_items.length"
:block=
"block"
<Paginator
currentPage=
"current_page"
perPage=
"items_per_page"
@
current-page=
"current_page = $event"
@
per-page=
"items_per_page = $event"
totalRows=
"filtered_and_sorted_items.length"
:block=
"block"
:per-page-options=
"itemsPerPageOptions"
v-if=
"filtered_and_sorted_items.length > 0"
/>
</div>
</
template
>
...
...
@@ -43,12 +45,12 @@ export default {
return
null
}
},
initial
_i
tems
_per_p
age
:
{
initial
I
tems
PerP
age
:
{
default
()
{
return
25
}
},
items
_per_p
age
_o
ptions
:
{
items
PerP
age
O
ptions
:
{
default
()
{
return
[
{
value
:
25
,
text
:
25
},
...
...
@@ -65,12 +67,12 @@ export default {
return
false
}
},
no
_i
tems
_t
ext
:
{
no
I
tems
T
ext
:
{
default
()
{
return
'
Keine Einträge vorhanden
'
}
},
filter
_f
unction
:
{
filter
F
unction
:
{
type
:
Function
,
default
()
{
return
function
(
item
,
term
)
{
...
...
@@ -88,7 +90,7 @@ export default {
}
}
},
sort
_f
unction
:
{
sort
F
unction
:
{
type
:
Function
,
default
()
{
return
null
...
...
@@ -97,8 +99,8 @@ export default {
},
computed
:
{
filtered_and_sorted_items
()
{
const
filtered_items
=
this
.
filterValue
===
''
?
this
.
items
:
this
.
items
.
filter
(
x
=>
this
.
filter
_f
unction
()(
x
,
this
.
filterValue
))
return
this
.
sort
_f
unction
?
filtered_items
.
sort
(
this
.
sort
_f
unction
)
:
filtered_items
const
filtered_items
=
this
.
filterValue
===
''
?
this
.
items
:
this
.
items
.
filter
(
x
=>
this
.
filter
F
unction
()(
x
,
this
.
filterValue
))
return
this
.
sort
F
unction
?
filtered_items
.
sort
(
this
.
sort
F
unction
)
:
filtered_items
},
sliced_items
()
{
if
(
this
.
items_per_page
===
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment