索隆 vor 6 Jahren
Ursprung
Commit
91c5cdd5a2
1 geänderte Dateien mit 7 neuen und 9 gelöschten Zeilen
  1. 7 9
      js/function.js

+ 7 - 9
js/function.js

@@ -42,29 +42,27 @@ function loginout(){
42
 
42
 
43
 function getMenu(){
43
 function getMenu(){
44
 	var openIndex = 0, data = {data:[{"name":"预测管理","parent_id":"0","url":"prediction.html"},{"name":"用户管理","parent_id":"0","url":"management.html"},{"name":"火钻管理","parent_id":"0","url":"pierer.html"}]};
44
 	var openIndex = 0, data = {data:[{"name":"预测管理","parent_id":"0","url":"prediction.html"},{"name":"用户管理","parent_id":"0","url":"management.html"},{"name":"火钻管理","parent_id":"0","url":"pierer.html"}]};
45
-	$("#menu").html($.Template7.renderTpl("menu_template",data));
46
-	$("#menu>li:eq("+openIndex+")>ul.contentTxt").removeClass("contentTxt");
47
 	/*ajax({url:"api/?a=public&act=menu",data:{},callBack:function(res){
45
 	/*ajax({url:"api/?a=public&act=menu",data:{},callBack:function(res){
48
-		if(res.code == 1){
49
-			$.each(res.data,function(index, items){
46
+		if(res.code == 1){*/
47
+			$.each(data,function(index, items){
50
 				if(getPageName(items.url)){
48
 				if(getPageName(items.url)){
51
 					openIndex = index;
49
 					openIndex = index;
52
-					res.data[index]['parentIndex'] = true;
50
+					data[index]['parentIndex'] = true;
53
 				}
51
 				}
54
 				if(items.list.length > 0){
52
 				if(items.list.length > 0){
55
 					$.each(items.list,function(i, item){
53
 					$.each(items.list,function(i, item){
56
 						if(getPageName(item.url)){
54
 						if(getPageName(item.url)){
57
 							openIndex = index;
55
 							openIndex = index;
58
-							res.data[index]['parentIndex'] = true;
59
-							res.data[index]['list'][i]['subIndex'] = true;
56
+							data[index]['parentIndex'] = true;
57
+							data[index]['list'][i]['subIndex'] = true;
60
 						}
58
 						}
61
 					});
59
 					});
62
 				}else
60
 				}else
63
-					delete res.data[index]['list'];
61
+					delete data[index]['list'];
64
 			});
62
 			});
65
 			$("#menu").html($.Template7.renderTpl("menu_template",res));
63
 			$("#menu").html($.Template7.renderTpl("menu_template",res));
66
 			$("#menu>li:eq("+openIndex+")>ul.contentTxt").removeClass("contentTxt");
64
 			$("#menu>li:eq("+openIndex+")>ul.contentTxt").removeClass("contentTxt");
67
-		}
65
+		/*}
68
 	},load:false});*/
66
 	},load:false});*/
69
 }
67
 }
70
 
68