File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Vol.Vue3版本/src/components/basic/ViewGrid
开发版dev/Vue.NetCore/Vol.Vue3版本/src/components/basic/ViewGrid Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,12 @@ export default {
2121 }
2222 this . getCacheViewColumn ( ) ;
2323 } ,
24+ getViewCacheKey ( ) {
25+ return 'custom:column' + this . table . name ;
26+ } ,
2427 getCacheViewColumn ( ) {
2528 try {
26- let columns = localStorage . getItem ( 'custom:column' ) ;
29+ let columns = localStorage . getItem ( this . getViewCacheKey ( ) ) ;
2730 if ( ! columns ) return ;
2831 columns = JSON . parse ( columns ) ;
2932 let sortTableColumns = [ ] ;
@@ -133,7 +136,7 @@ export default {
133136 this . sortViewColumns ( sortColumns ) ;
134137 }
135138 try {
136- localStorage . setItem ( 'custom:column' , JSON . stringify ( this . viewColumns ) ) ;
139+ localStorage . setItem ( this . getViewCacheKey ( ) , JSON . stringify ( this . viewColumns ) ) ;
137140 } catch ( error ) {
138141 console . log ( '获取自定义列异常:' + error . message ) ;
139142 }
Original file line number Diff line number Diff line change @@ -21,9 +21,12 @@ export default {
2121 }
2222 this . getCacheViewColumn ( ) ;
2323 } ,
24+ getViewCacheKey ( ) {
25+ return 'custom:column' + this . table . name ;
26+ } ,
2427 getCacheViewColumn ( ) {
2528 try {
26- let columns = localStorage . getItem ( 'custom:column' ) ;
29+ let columns = localStorage . getItem ( this . getViewCacheKey ( ) ) ;
2730 if ( ! columns ) return ;
2831 columns = JSON . parse ( columns ) ;
2932 let sortTableColumns = [ ] ;
@@ -133,7 +136,7 @@ export default {
133136 this . sortViewColumns ( sortColumns ) ;
134137 }
135138 try {
136- localStorage . setItem ( 'custom:column' , JSON . stringify ( this . viewColumns ) ) ;
139+ localStorage . setItem ( this . getViewCacheKey ( ) , JSON . stringify ( this . viewColumns ) ) ;
137140 } catch ( error ) {
138141 console . log ( '获取自定义列异常:' + error . message ) ;
139142 }
You can’t perform that action at this time.
0 commit comments