function createChnlTree() { var chnlList=[ { url:'https://www.nanan.gov.cn/wsbs/ztfw/bmfwdt/', desc:'便民服务地图', chnlid:'59544', defaultItems:{ "地籍图查询":{ desc:'地籍图查询', chnlid:'64156', jsonData: 404 Not Found

404 Not Found


nginx
}, "地图数据_社保":{ desc:'地图数据_社保', chnlid:'55813', jsonData: 404 Not Found

404 Not Found


nginx
}, "地图数据_住房":{ desc:'地图数据_住房', chnlid:'55840', jsonData: 404 Not Found

404 Not Found


nginx
}, "地图数据_交通":{ desc:'地图数据_交通', chnlid:'55871', jsonData: 404 Not Found

404 Not Found


nginx
} }, fieldItems:[ { url:'https://www.nanan.gov.cn/wsbs/ztfw/bmfwdt/dtsj_2/', desc:'地图数据_就业创业', chnlid:'55927', isActive:false }, { url:'https://www.nanan.gov.cn/wsbs/ztfw/bmfwdt/dtsj_3/', desc:'地图数据_社会救助', chnlid:'55959', isActive:false }, { url:'https://www.nanan.gov.cn/wsbs/ztfw/bmfwdt/dtsj_4/', desc:'地图数据_婚姻生育', chnlid:'55981', isActive:false }, { url:'https://www.nanan.gov.cn/wsbs/ztfw/bmfwdt/dt_1/', desc:'地图数据_医疗健康', chnlid:'56015', isActive:false } ] }, ] return chnlList; } avalon.define("field",function($scope){ $scope.defaultItems={}; //头部领域主题简称 $scope.chnldesc=""; $scope.fieldItems=[]; //办事服务数据集 $scope.serviceItems=[]; //专题入口数据集 $scope.subjectItems=[]; //图解数据集 $scope.diagramItems=[]; //政策数据集 $scope.policyItems=[]; //常见问题集 $scope.requestionItems=[]; //检索词 $scope.searchWord=_searchTag; $scope.innerPageBgClassObj={ "社保":"sb_bg", "住房":"zf_bg", "交通":"jt_bg", "教育":"jyly_bg", "就业创业":"jycy_bg", "社会救助与福利":"shjz_bg", "婚姻生育":"hysy_bg", "医疗健康":"yljk_bg", "企业开办":"qykb_bg" }; //innerPageBgClassName $scope.innerPageBgClassName=""; //默认领域对象用于完成互动知识库检索 $scope.defaultNthemeObj={ _key:'', _value:'' }; $scope.getCurrChnlTree=function(){ var _channelItems=createChnlTree(); for (var index1 =0; index1 < _channelItems.length;index1++) { var element1 = _channelItems [index1]; if(location.href.indexOf(element1.url)!=-1){ $scope.chnldesc=element1.desc; $scope.innerPageBgClassName=$scope.innerPageBgClassObj[$scope.chnldesc]; for (var index2 = 0; index2 < element1.fieldItems.length; index2++) { var element2 = element1.fieldItems[index2]; if(location.href.indexOf(element2.url)!=-1){ element2.isActive=true; break; } } $scope.defaultItems = JSON.parse(JSON.stringify(element1.defaultItems)); $scope.fieldItems = JSON.parse(JSON.stringify(element1.fieldItems)); break; } } } $scope.filterList=function(_list,_key){ var _arr_var1=[]; if(!_key) return []; var _list_Var1=JSON.parse(JSON.stringify(_list)); avalon.each(_list_Var1,function(i,o){ if(o.docKeyWord&&o.docKeyWord.indexOf(_key)!=-1){ _arr_var1.push(o); } }) return _arr_var1; } //获取办事服务数据集 $scope.dealServiceData=function(){ if($scope.defaultItems['办事服务']){ $scope.serviceItems=$scope.filterList($scope.defaultItems['办事服务']['jsonData'],$scope.searchWord); } } //获取专题入口数据集 $scope.dealSubjectData=function(){ if($scope.defaultItems['专题入口']){ $scope.subjectItems=$scope.filterList($scope.defaultItems['专题入口']['jsonData'],$scope.searchWord); } } //获取图解数据集 $scope.dealDiagramData=function(){ if($scope.defaultItems['图解']){ $scope.diagramItems=$scope.filterList($scope.defaultItems['图解']['jsonData'],$scope.searchWord); } } //获取政策数据集 $scope.dealPolicyData=function(){ if($scope.defaultItems['政策文件']){ $scope.policyItems=$scope.filterList($scope.defaultItems['政策文件']['jsonData'],$scope.searchWord); } } //获取常见问题数据集 $scope.dealRuestionData=function(){ if($scope.defaultItems['常见问题']){ var _list_temp=[]; var _reqList=$scope.defaultItems['常见问题']['jsonData']; var _maxLen=_reqList.length>=5 ? 5:_reqList.length; for (var index = 0; index < _maxLen; index++) { var element = _reqList[index]; _list_temp.push(element); } $scope.requestionItems=_list_temp; } } $scope.dealData=function(){ $scope.dealServiceData(); $scope.dealSubjectData(); $scope.dealDiagramData(); $scope.dealPolicyData(); $scope.dealRuestionData(); } $scope.getCurrChnlTree(); $scope.dealData(); })