Ver Fonte

fix: 修复pc数据导出行业筛选传参

cuiyalong há 9 meses atrás
pai
commit
170974aafa
1 ficheiros alterados com 20 adições e 4 exclusões
  1. 20 4
      src/web/templates/pc/dataExport_sieve.html

+ 20 - 4
src/web/templates/pc/dataExport_sieve.html

@@ -2934,10 +2934,26 @@
 
     //行业
     function getIndustries() {
-        var industryArr = new Array();
-        ClassArr.arr.map(function (v) {
-            industryArr = industryArr.concat(v.split(","));
-            return v
+        // 数据源map
+        var industryOrigin = industrylist
+        // 数据源key的数组,用来判断是否选中了第一级
+        var industryLevel1Arr = Object.keys(industrylist)
+        var industryArr = [];
+        ClassArr.arr.forEach(function(key) {
+          if (industryLevel1Arr.indexOf(key) === -1) {
+            // 选中的二级
+            industryArr = industryArr.concat(key.split(","));
+          } else {
+            // 选中的一级
+            const childern = industrylist[key]
+            if (Array.isArray(childern) && childern.length > 0) {
+              childern.forEach(function(c) {
+                industryArr = industryArr.concat(key + '_' + c);
+              })
+            } else {
+              industryArr = industryArr.concat(key.split(","));
+            }
+          }
         })
         return industryArr;
     }