File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ import { getAPI } from '@/api'
5252import { genericCompare } from ' @/utils/sort.js'
5353import ListView from ' @/components/view/ListView'
5454
55+ const EVENTS_TAB_COLUMNS_KEY = ' events_tab_columns'
56+
5557export default {
5658 name: ' EventsTab' ,
5759 components: {
@@ -98,8 +100,7 @@ export default {
98100 }
99101 },
100102 created () {
101- this .selectedColumnKeys = this .columnKeys
102- this .updateSelectedColumns (' description' )
103+ this .setDefaultColumns ()
103104 this .pageSize = this .pageSizeOptions [0 ] * 1
104105 this .fetchData ()
105106 },
@@ -111,6 +112,15 @@ export default {
111112 }
112113 },
113114 methods: {
115+ setDefaultColumns () {
116+ const savedColumns = this .$localStorage .get (EVENTS_TAB_COLUMNS_KEY )
117+ if (savedColumns && Array .isArray (savedColumns) && savedColumns .length > 0 ) {
118+ this .selectedColumnKeys = savedColumns
119+ } else {
120+ this .selectedColumnKeys = this .columnKeys .filter (x => x !== ' description' )
121+ }
122+ this .updateColumns ()
123+ },
114124 fetchData () {
115125 this .fetchEvents ()
116126 },
@@ -145,6 +155,7 @@ export default {
145155 } else {
146156 this .selectedColumnKeys .push (key)
147157 }
158+ this .$localStorage .set (EVENTS_TAB_COLUMNS_KEY , this .selectedColumnKeys )
148159 this .updateColumns ()
149160 },
150161 updateColumns () {
You can’t perform that action at this time.
0 commit comments