|
@@ -52,6 +52,7 @@ $(function () {
|
|
|
if (item.indexOf('secondId') > -1) {
|
|
|
let secondIds = item.split('=')
|
|
|
dataList.secondId = decodeURIComponent(secondIds[1])
|
|
|
+ menuInit(theData,secondIds[1])
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
@@ -69,6 +70,7 @@ $(function () {
|
|
|
if (newHash.indexOf('secondId') > -1) {
|
|
|
let secondIds = newHash.split('=')
|
|
|
dataList.secondId = decodeURIComponent(secondIds[1])
|
|
|
+ menuInit(theData,secondIds[1])
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -83,10 +85,10 @@ $(function () {
|
|
|
}
|
|
|
}
|
|
|
//跳转渲染菜单
|
|
|
- function menuInit(data,id=''){
|
|
|
- var theArrs = '',htmls='';
|
|
|
- htmls+='<div class="objList">'
|
|
|
- let thisdata=data,m,n;
|
|
|
+ function menuInit(data,id='',state){
|
|
|
+ var theArrs = '',htmls='',htmlSec='';
|
|
|
+ htmls+='<div class="objList">';
|
|
|
+ let thisdata=data,m,n,l;
|
|
|
thisdata.unshift({
|
|
|
module: '',
|
|
|
name: '不限',
|
|
@@ -104,12 +106,27 @@ $(function () {
|
|
|
m=index;n=ind;
|
|
|
htmls+='<span class="active" data-id='+atem.topLevelId+'>'+atem.topLevel+'</span>'
|
|
|
return;
|
|
|
+ }else{
|
|
|
+ atem.children&&(atem.children).map((otem,nub)=>{
|
|
|
+ if(otem.id==id){
|
|
|
+ m=index;n=ind,l=nub;
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
htmls+='<span data-id="'+atem.topLevelId+'">'+atem.topLevel+'</span>'
|
|
|
})
|
|
|
}
|
|
|
htmls+='</div>'
|
|
|
})
|
|
|
+ if(l>=0){
|
|
|
+ let listSec = thisdata[m].list[n].children;
|
|
|
+ listSec.map(ttm=>{
|
|
|
+ htmlSec+=`<li data-id=${ttm.id}>${ttm.name}</li>`
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ l=0;
|
|
|
+ htmlSec='<li data-id="" class="active">不限</li>';
|
|
|
+ }
|
|
|
htmls+='</div>';
|
|
|
if(!id){
|
|
|
$('.industryList').append(htmls);
|
|
@@ -118,14 +135,14 @@ $(function () {
|
|
|
$('.objList div').eq(0).addClass('active');
|
|
|
$('.objList div').eq(0).find('span').addClass('active');
|
|
|
$('.productionType ol').html(`<li data-id='' class="active">不限</li>`);
|
|
|
- $('.productionType ol li').eq(0).addClass = "active";
|
|
|
}else{
|
|
|
$('.industryList').append(htmls);
|
|
|
$('.industryList ul').html(theArrs);
|
|
|
$('.industryList ul li').eq(m).addClass('active');
|
|
|
$('.objList>div').eq(m).addClass('active');
|
|
|
- $('.productionType ol').html(`<li data-id='' class="active">不限</li>`);
|
|
|
- $('.productionType ol li').eq(0).addClass = "active";
|
|
|
+ $('.objList>div').eq(m).find('span').eq(n).addClass('active');
|
|
|
+ $('.productionType ol').html(htmlSec);
|
|
|
+ $('.productionType ol li').eq(l).addClass('active');
|
|
|
}
|
|
|
onSelect(thisdata);
|
|
|
}
|
|
@@ -183,13 +200,14 @@ $(function () {
|
|
|
<div class="txts">
|
|
|
<h5>${thisdata.name}</h5>
|
|
|
</div>
|
|
|
- <div class="hr"></div>
|
|
|
- <div class="btnTxt">
|
|
|
- <p>${thisdata.introduce!=null?introd:'暂无介绍'}</p>
|
|
|
- </div>
|
|
|
+
|
|
|
</div>
|
|
|
</a>
|
|
|
</li>`);
|
|
|
+ /* <div class="hr"></div>
|
|
|
+ <div class="btnTxt">
|
|
|
+ <p>${thisdata.introduce!=null?introd:'暂无介绍'}</p>
|
|
|
+ </div> */
|
|
|
};
|
|
|
};
|
|
|
$('.loading').hide().stop(true,true);
|
|
@@ -342,19 +360,23 @@ $(function () {
|
|
|
<span>${txt}</span>
|
|
|
`)
|
|
|
loadDate();
|
|
|
- $('.productionType ol li').on('click', function () {
|
|
|
- dataList.name = '';
|
|
|
- dataList.topId = $('.industryList ul li.active').attr('data-id');
|
|
|
- $(this).addClass('active').siblings().removeClass('active');
|
|
|
- dataList.secondId = $(this).attr('data-id');
|
|
|
- if (!dataList.secondId) return;
|
|
|
- let txt = $(this).text();
|
|
|
- $('.onSelect .next').css('display', 'block').html(`
|
|
|
- <span>${txt}</span>
|
|
|
- `)
|
|
|
- loadDate();
|
|
|
- })
|
|
|
+ secSelect();
|
|
|
});
|
|
|
+ secSelect();
|
|
|
+ }
|
|
|
+ function secSelect(){
|
|
|
+ $('.productionType ol li').on('click', function () {
|
|
|
+ dataList.name = '';
|
|
|
+ dataList.topId = $('.industryList ul li.active').attr('data-id');
|
|
|
+ $(this).addClass('active').siblings().removeClass('active');
|
|
|
+ dataList.secondId = $(this).attr('data-id');
|
|
|
+ if (!dataList.secondId) return;
|
|
|
+ let txt = $(this).text();
|
|
|
+ $('.onSelect .next').css('display', 'block').html(`
|
|
|
+ <span>${txt}</span>
|
|
|
+ `)
|
|
|
+ loadDate();
|
|
|
+ })
|
|
|
}
|
|
|
//搜索
|
|
|
function search() {
|