Forráskód Böngészése

测试压缩后js bug

ellisran 1 éve
szülő
commit
e34a398365
1 módosított fájl, 10 hozzáadás és 10 törlés
  1. 10 10
      app/public/js/tender_showhide.js

+ 10 - 10
app/public/js/tender_showhide.js

@@ -9,7 +9,7 @@
  */
 let hideList = [];
 // const tTree = typeof tenderTree !== 'undefined' ? tenderTree : typeof tenderTree2 !== 'undefined' ? tenderTree2 : [];
-const tTree = tenderTree;
+// const tTree = tenderTree;
 let returnItem;
 const findTenderTreeNode = function(sortId, tree) {
     tree.forEach((item) => {
@@ -55,7 +55,7 @@ function recursiveExpand(nodes, parent, checkFun) {
 }
 function expandByCustom(checkFun) {
     hideList = [];
-    recursiveExpand(tTree, null, checkFun);
+    recursiveExpand(tenderTree, null, checkFun);
 }
 
 function expandByLevel(level) {
@@ -66,7 +66,7 @@ function expandByLevel(level) {
 }
 
 // 根据标段类别设置排序
-function sortTenderTree(teTree = tTree) {
+function sortTenderTree(teTree = tenderTree) {
     for (const tender of teTree) {
         if (tender.sort) {
             // 当前层排序
@@ -98,7 +98,7 @@ function localHideList(wap = false) {
             hideList = JSON.parse(userTenderHideList);
             for (const h of hideList) {
                 const cid = h.sort_id;
-                const node = findTenderTreeNode(parseInt(cid), tTree);
+                const node = findTenderTreeNode(parseInt(cid), tenderTree);
                 $('.c-body tr td span[cid="' + cid + '"]').children('i').removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
                 $('.c-body tr td span[cid="' + cid + '"]').attr('title', '展开');
                 doTrStatus(returnItem, 'hide');
@@ -174,7 +174,7 @@ $(document).ready(() => {
             $(this).children('i').removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
             $(this).attr('title', '展开');
             const cid = $(this).attr('cid');
-            const node = findTenderTreeNode(parseInt(cid), tTree);
+            const node = findTenderTreeNode(parseInt(cid), tenderTree);
             doTrStatus(returnItem, 'hide');
             hideList.push({sort_id: cid});
             setLocalCache(uphlname, JSON.stringify(hideList));
@@ -182,7 +182,7 @@ $(document).ready(() => {
             $(this).children('i').removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
             $(this).attr('title', '收起');
             const cid = $(this).attr('cid');
-            const node = findTenderTreeNode(parseInt(cid), tTree);
+            const node = findTenderTreeNode(parseInt(cid), tenderTree);
             doTrStatus(returnItem, 'show');
             const index = hideList.findIndex(function(item) {
                 return parseInt(item.sort_id) === parseInt(cid);
@@ -200,10 +200,10 @@ $(document).ready(() => {
         if (item === 'open') {
             setLocalCache(uphlname, JSON.stringify(hideList));
         }
-        for (const tree of tTree) {
+        for (const tree of tenderTree) {
             if (tree && tree.sort_id !== undefined) {
                 const cid = tree.sort_id;
-                const node = findTenderTreeNode(parseInt(cid), tTree);
+                const node = findTenderTreeNode(parseInt(cid), tenderTree);
                 if (item === 'open') {
                     $('.c-body tr td span[cid="' + cid + '"]').children('i').removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
                     $('.c-body tr td span[cid="' + cid + '"]').attr('title', '收起');
@@ -223,12 +223,12 @@ $(document).ready(() => {
         levels: [
             {
                 type: 'sort', count: 5, visible_count: function () {
-                    return tTree.map(getChildrenLevel).reduce((x, y) => { return Math.max(x, y); }, 0) - 1;
+                    return tenderTree.map(getChildrenLevel).reduce((x, y) => { return Math.max(x, y); }, 0) - 1;
                 }
             },
             {
                 type: 'last', title: '最底层', visible: function () {
-                    const count = tTree.map(getChildrenLevel).reduce((x, y) => { return Math.max(x, y); }, 0) - 1;
+                    const count = tenderTree.map(getChildrenLevel).reduce((x, y) => { return Math.max(x, y); }, 0) - 1;
                     return count > 0;
                 }
             },