Kaynağa Gözat

columns缓存接口代码恢复

zhangqing 1 yıl önce
ebeveyn
işleme
a1c8f94739
1 değiştirilmiş dosya ile 15 ekleme ve 15 silme
  1. 15 15
      src/mixins/tableColumnsMixin.js

+ 15 - 15
src/mixins/tableColumnsMixin.js

@@ -3,34 +3,34 @@ import request from '@/utils/request';
 export default {
   data() {
     return {
-      // newColumns: []
+      newColumns: []
     };
   },
   created() {
     //从服务器获取缓存列表配置
-    // this.getTabColumns();
+    this.getTabColumns();
     // 创建防抖函数并绑定this
-    // this.debouncedHandleColumnChange = this.debounce(
-    //   this.handleColumnChangeImpl,
-    //   1000
-    // );
+    this.debouncedHandleColumnChange = this.debounce(
+      this.handleColumnChangeImpl,
+      1000
+    );
   },
   methods: {
     // 实际的列变更处理逻辑
     handleColumnChangeImpl() {
-      // try {
-      //   const list = this.getStorage(this.cacheKeyUrl + 'Cols');
-      //   if (list) {
-      //     this.saveColumns(list);
-      //   }
-      // } catch (error) {
-      //   console.error('处理列配置出错:', error);
-      // }
+      try {
+        const list = this.getStorage(this.cacheKeyUrl + 'Cols');
+        if (list) {
+          this.saveColumns(list);
+        }
+      } catch (error) {
+        console.error('处理列配置出错:', error);
+      }
     },
 
     // 列表变化回调
     handleColumnChange() {
-      // this.debouncedHandleColumnChange();
+      this.debouncedHandleColumnChange();
     },
 
     // 获取table-column配置