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'
52
52
import { genericCompare } from ' @/utils/sort.js'
53
53
import ListView from ' @/components/view/ListView'
54
54
55
+ const EVENTS_TAB_COLUMNS_KEY = ' events_tab_columns'
56
+
55
57
export default {
56
58
name: ' EventsTab' ,
57
59
components: {
@@ -98,8 +100,7 @@ export default {
98
100
}
99
101
},
100
102
created () {
101
- this .selectedColumnKeys = this .columnKeys
102
- this .updateSelectedColumns (' description' )
103
+ this .setDefaultColumns ()
103
104
this .pageSize = this .pageSizeOptions [0 ] * 1
104
105
this .fetchData ()
105
106
},
@@ -111,6 +112,15 @@ export default {
111
112
}
112
113
},
113
114
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
+ },
114
124
fetchData () {
115
125
this .fetchEvents ()
116
126
},
@@ -145,6 +155,7 @@ export default {
145
155
} else {
146
156
this .selectedColumnKeys .push (key)
147
157
}
158
+ this .$localStorage .set (EVENTS_TAB_COLUMNS_KEY , this .selectedColumnKeys )
148
159
this .updateColumns ()
149
160
},
150
161
updateColumns () {
You can’t perform that action at this time.
0 commit comments