浏览代码

树结构过滤,预处理调整

MaiXinRong 1 年之前
父节点
当前提交
2ad8c3c8a6
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      app/lib/rpt_data_analysis.js

+ 4 - 2
app/lib/rpt_data_analysis.js

@@ -1805,7 +1805,9 @@ const treeFilter = {
     },
     _checkPath(matchPath, full_path) {
         for (const mp of matchPath) {
-            if (full_path.indexOf(mp) === 0) return true;
+            if (full_path.indexOf(mp.match + '-') === 0) return true;
+            if (mp.type === 'all' && full_path === mp.match) return true;
+
         }
         return false;
     },
@@ -1824,7 +1826,7 @@ const treeFilter = {
             if (this._checkPath(matchPath, d.full_path)) continue;
 
             if (valueCheck.checkData(ctx, d, options.condition)) {
-                matchPath.push(d.full_path + (options.subType === 'posterity' ? '-' : ''));
+                matchPath.push({ match: d.full_path, type: options.subType });
             }
         }
         data[options.table] = fData.filter(x => {