Explorar o código

调整记住树结构展开收起代码,原写法min加密后错误

MaiXinRong %!s(int64=4) %!d(string=hai) anos
pai
achega
51967e75ad
Modificáronse 1 ficheiros con 5 adicións e 10 borrados
  1. 5 10
      app/public/js/path_tree.js

+ 5 - 10
app/public/js/path_tree.js

@@ -266,7 +266,7 @@ const createNewPathTree = function (type, setting) {
             const self = this;
             // 无索引
             this.datas = [];
-            // 以key为索引
+            // 以key为索引indexedDB
             this.items = {};
             // 以排序为索引
             this.nodes = [];
@@ -276,15 +276,10 @@ const createNewPathTree = function (type, setting) {
             this.setting = setting;
 
             if (this.setting.markFoldKey) {
-                const markStr = getLocalCache(this.setting.markFoldKey);
-                const markData = markStr ? markStr.split('|') : ['', ''];
-                try {
-                    this.markFold = markData[0] === this.setting.markFoldSubKey
-                        ? (markData[1] ? markData[1].split(',').map(x => { return parseInt(x) }) : [])
-                        : [];
-                } catch {
-                    this.markFold = [];
-                }
+                 const markStr = getLocalCache(this.setting.markFoldKey);
+                 const markData = markStr ? markStr.split('|') : ['', ''];
+                 this.markFold = markData[0] === this.setting.markFoldSubKey && markData[1]
+                     ? _.map(markData[1].split(','), _.toInteger) : [];
             }
             // if (this.setting.treeCacheKey) {
             //     localforage.getItem(this.setting.treeCacheKey).then(function (v) {