|
@@ -2934,10 +2934,26 @@
|
|
|
|
|
|
//行业
|
|
//行业
|
|
function getIndustries() {
|
|
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;
|
|
return industryArr;
|
|
}
|
|
}
|