Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
externe Matthieu
Géocontrib Frontend
Commits
b452c845
"...git@git.neogeo.fr:ext_matthieu/geocontrib-frontend.git" did not exist on "b5c0c1936db58360ceefcaf8355798bbf5508823"
Commit
b452c845
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
remove pagination from map
parent
c88f5956
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/feature/FeatureListTable.vue
+53
-18
53 additions, 18 deletions
src/components/feature/FeatureListTable.vue
src/views/feature/Feature_list.vue
+27
-78
27 additions, 78 deletions
src/views/feature/Feature_list.vue
with
80 additions
and
96 deletions
src/components/feature/FeatureListTable.vue
+
53
−
18
View file @
b452c845
...
...
@@ -170,8 +170,8 @@
</tr>
</tbody>
</table>
<!-- v-if="
nbPage
s.length > 1" -->
<!--
<div
<!-- v-if="
pageNumber
s.length > 1" -->
<div
id=
"table-features_info"
class=
"dataTables_info"
role=
"status"
...
...
@@ -182,7 +182,7 @@
sur
{{
featuresCount
}}
éléments
</div>
<div
v-if=
"
nbPage
s.length > 1"
v-if=
"
pageNumber
s.length > 1"
id=
"table-features_paginate"
class=
"dataTables_paginate paging_simple_numbers"
>
...
...
@@ -200,7 +200,7 @@
>
<span>
<a
v-for=
"pageNumber in
nbPage
s"
v-for=
"pageNumber in
pageNumber
s"
:key=
"'page' + pageNumber"
@
click=
"toPage(pageNumber)"
:class=
"[
...
...
@@ -218,7 +218,7 @@
id=
"table-features_next"
:class=
"[
'paginate_button next',
{ disabled: pagination.currentPage ===
nbPage
s.length },
{ disabled: pagination.currentPage ===
pageNumber
s.length },
]"
aria-controls="table-features"
data-dt-idx="7"
...
...
@@ -226,7 +226,7 @@
@click="toNextPage"
>Suivant
</a
>
</div>
-->
</div>
</div>
</
template
>
...
...
@@ -236,11 +236,11 @@ import { mapState, mapGetters } from "vuex";
export
default
{
name
:
"
FeatureListTable
"
,
props
:
[
"
geojsonFeatures
"
,
"
checkedFeatures
"
,
"
featuresCount
"
],
props
:
[
"
geojsonFeatures
"
,
"
checkedFeatures
"
,
"
featuresCount
"
,
"
pagination
"
,
"
pageNumbers
"
],
data
()
{
return
{
/*
pagination: {
/*
pagination: {
currentPage: 1,
pagesize: 15,
start: 0,
...
...
@@ -305,13 +305,14 @@ export default {
return
sortedFeatures
;
},
/* nbPages() {
let N = Math.ceil(this.featuresCount / this.pagination.pagesize);
const arr = [...Array(N).keys()].map(function (x) {
++x;
return x;
/* pageNumbers() {
const totalPages = Math.ceil(
this.featuresCount / this.pagination.pagesize
);
return [...Array(totalPages).keys()].map((pageNumb) => {
++pageNumb;
return pageNumb;
});
return arr;
}, */
checked
:
{
...
...
@@ -322,12 +323,12 @@ export default {
this
.
$store
.
commit
(
"
feature/UPDATE_CHECKED_FEATURES
"
,
newChecked
);
},
},
/*
displayedPageEnd
()
{
return
this
.
featuresCount
<=
this
.
pagination
.
end
?
this
.
featuresCount
:
this
.
pagination
.
end
;
},
*/
},
},
methods
:
{
...
...
@@ -358,14 +359,48 @@ export default {
}
},
toPage
(
pageNumber
)
{
console
.
log
(
pageNumber
);
this
.
$emit
(
"
update:page
"
,
pageNumber
);
/*
const toAddOrRemove =
(pageNumber - this.pagination.currentPage) * this.pagination.pagesize;
this.pagination.start += toAddOrRemove;
this.pagination.end += toAddOrRemove;
this.pagination.currentPage = pageNumber;
this.updateFeatures(); */
},
toPreviousPage
()
{
this
.
$emit
(
"
update:page
"
,
"
previous
"
);
/* if (this.pagination.currentPage !== 1) {
if (this.pagination.start > 0) {
this.pagination.start -= this.pagination.pagesize;
this.pagination.end -= this.pagination.pagesize;
this.pagination.currentPage -= 1;
}
this.updateFeatures(this.previous);
} */
},
toNextPage
()
{
this
.
$emit
(
"
update:page
"
,
"
next
"
);
/* if (this.pagination.currentPage !== this.pageNumbers.length) {
if (this.pagination.end < this.featuresCount) {
this.pagination.start += this.pagination.pagesize;
this.pagination.end += this.pagination.pagesize;
this.pagination.currentPage += 1;
}
this.updateFeatures(this.next);
} */
},
},
};
</
script
>
<
style
scoped
>
/* datatables */
/*
.dataTables_wrapper {
.dataTables_wrapper
{
position
:
relative
;
clear
:
both
;
}
...
...
@@ -442,7 +477,7 @@ export default {
border
:
1px
solid
transparent
;
background
:
transparent
;
box-shadow
:
none
;
}
*/
}
i
.icon.sort
:not
(
.down
)
:not
(
.up
)
{
color
:
rgb
(
220
,
220
,
220
);
...
...
This diff is collapsed.
Click to expand it.
src/views/feature/Feature_list.vue
+
27
−
78
View file @
b452c845
...
...
@@ -141,75 +141,17 @@
<div
id=
"map"
ref=
"map"
></div>
<SidebarLayers
v-if=
"basemaps && map"
/>
</div>
<!--
v-on:update:page="changePage"
-->
<!--
|
-->
<FeatureListTable
v-show=
"!showMap"
v-on:update:page=
"handlePageChange"
:geojsonFeatures=
"geojsonFeatures"
:checkedFeatures.sync=
"checkedFeatures"
:featuresCount=
"featuresCount"
:pagination=
"pagination"
:pageNumbers=
"pageNumbers"
/>
<!-- PAGINATION START -->
<div
data-tab=
"list"
class=
"dataTables_wrapper no-footer"
>
<div
id=
"table-features_info"
class=
"dataTables_info"
role=
"status"
aria-live=
"polite"
>
Affichage de l'élément
{{
pagination
.
start
+
1
}}
à
{{
displayedPageEnd
}}
sur
{{
featuresCount
}}
éléments
</div>
<div
v-if=
"nbPages.length > 1"
id=
"table-features_paginate"
class=
"dataTables_paginate paging_simple_numbers"
>
<a
@
click=
"toPreviousPage"
id=
"table-features_previous"
:class=
"[
'paginate_button previous',
{ disabled: pagination.currentPage === 1 },
]"
aria-controls="table-features"
data-dt-idx="0"
tabindex="0"
>Précédent
</a
>
<span>
<a
v-for=
"pageNumber in nbPages"
:key=
"'page' + pageNumber"
@
click=
"toPage(pageNumber)"
:class=
"[
'paginate_button',
{ current: pageNumber === pagination.currentPage },
]"
aria-controls="table-features"
data-dt-idx="1"
tabindex="0"
>
{{
pageNumber
}}
</a
>
</span>
<!-- // TODO :
<span
v-if=
"nbPages > 4"
class=
"ellipsis"
>
...
</span>
-->
<a
id=
"table-features_next"
:class=
"[
'paginate_button next',
{ disabled: pagination.currentPage === nbPages.length },
]"
aria-controls="table-features"
data-dt-idx="7"
tabindex="0"
@click="toNextPage"
>Suivant
</a
>
</div>
</div>
<!-- PAGINATION END -->
<!-- MODAL ALL DELETE FEATURE TYPE -->
<div
v-if=
"modalAllDeleteOpen"
...
...
@@ -342,20 +284,26 @@ export default {
);
},
nbPages
()
{
let
N
=
Math
.
ceil
(
this
.
featuresCount
/
this
.
pagination
.
pagesize
);
const
arr
=
[...
Array
(
N
).
keys
()].
map
(
function
(
x
)
{
++
x
;
return
x
;
pageNumbers
()
{
const
totalPages
=
Math
.
ceil
(
this
.
featuresCount
/
this
.
pagination
.
pagesize
);
return
[...
Array
(
totalPages
).
keys
()].
map
((
pageNumb
)
=>
{
++
pageNumb
;
return
pageNumb
;
});
return
arr
;
},
displayedPageEnd
()
{
/* displayedPageNumbers() {
return this.pageNumbers;
//return [...this.pageNumbers].splice(0, 4);
}, */
/* displayedPageEnd() {
return this.featuresCount <= this.pagination.end
? this.featuresCount
: this.pagination.end;
},
},
*/
},
methods
:
{
...
...
@@ -453,19 +401,20 @@ export default {
},
1000
);
},
/* changePage(page) {
handlePageChange
(
page
)
{
console
.
log
(
"
handlePageChange
"
,
page
,
typeof
page
)
if
(
page
===
"
next
"
)
{
this.
updateFeatures(this.next
);
this
.
toNextPage
(
);
}
else
if
(
page
===
"
previous
"
)
{
this.
updateFeatures(this.p
revious);
} else if (typeof page ===
N
umber) {
this
.
toP
revious
Page
(
);
}
else
if
(
typeof
page
===
"
n
umber
"
)
{
//* update limit and offset
this.
updateFeatures(
);
this
.
toPage
(
page
);
}
},
*/
},
toPage
(
pageNumber
)
{
console
.
log
(
pageNumber
);
console
.
log
(
"
toPage
"
,
pageNumber
);
const
toAddOrRemove
=
(
pageNumber
-
this
.
pagination
.
currentPage
)
*
this
.
pagination
.
pagesize
;
this
.
pagination
.
start
+=
toAddOrRemove
;
...
...
@@ -486,7 +435,7 @@ export default {
},
toNextPage
()
{
if
(
this
.
pagination
.
currentPage
!==
this
.
nbPage
s
.
length
)
{
if
(
this
.
pagination
.
currentPage
!==
this
.
pageNumber
s
.
length
)
{
if
(
this
.
pagination
.
end
<
this
.
featuresCount
)
{
this
.
pagination
.
start
+=
this
.
pagination
.
pagesize
;
this
.
pagination
.
end
+=
this
.
pagination
.
pagesize
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment