330330 :pageSize =" pageSize"
331331 :total =" itemCount"
332332 :showTotal =" total => `${$t('label.showing')} ${Math.min(total, 1+((page-1)*pageSize))}-${Math.min(page*pageSize, total)} ${$t('label.of')} ${total} ${$t('label.items')}`"
333- :pageSizeOptions =" device === 'desktop' ? ['20', '50', '100', '200'] : ['10', '20', '50', '100', '200'] "
333+ :pageSizeOptions =" pageSizeOptions "
334334 @change =" changePage"
335335 @showSizeChange =" changePageSize"
336336 showSizeChanger
@@ -392,7 +392,7 @@ export default {
392392 items: [],
393393 itemCount: 0 ,
394394 page: 1 ,
395- pageSize: 10 ,
395+ pageSize: this . $store . getters . defaultListViewPageSize ,
396396 resource: {},
397397 selectedRowKeys: [],
398398 currentAction: {},
@@ -431,9 +431,6 @@ export default {
431431 this .execAction (action, isGroupAction)
432432 })
433433
434- if (this .device === ' desktop' ) {
435- this .pageSize = 20
436- }
437434 this .currentPath = this .$route .fullPath
438435 this .fetchData ()
439436 if (' projectid' in this .$route .query ) {
@@ -456,7 +453,6 @@ export default {
456453 this .pageSize = Number (to .query .pagesize )
457454 } else {
458455 this .page = 1
459- this .pageSize = (this .device === ' desktop' ? 20 : 10 )
460456 }
461457 this .itemCount = 0
462458 this .fetchData ()
@@ -474,6 +470,17 @@ export default {
474470 this .fetchData ()
475471 }
476472 },
473+ computed: {
474+ pageSizeOptions () {
475+ var sizes = [20 , 50 , 100 , 200 , this .$store .getters .defaultListViewPageSize ]
476+ if (this .device !== ' desktop' ) {
477+ sizes .unshift (10 )
478+ }
479+ return [... new Set (sizes)].sort (function (a , b ) {
480+ return a - b
481+ }).map (String )
482+ }
483+ },
477484 methods: {
478485 switchProject (projectId ) {
479486 if (! projectId || ! projectId .length || projectId .length !== 36 ) {
0 commit comments