1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(function(){
angular.module("app.collect")
.controller("collectCtrl",["$rootScope","$scope","$state","ToolService","$timeout",collectCtrl]);
function collectCtrl($rootScope,$scope,$state,ToolService,$timeout){
var meauTree = {
"dataview":["custommenu"],
"action":["eventstats","funnel","retention","intelligentpath"],
"user":["usergroup"],
"event":["event","profile"],
"tool":["logtool","report"]
};
$scope.menustatus = {
dataview:true,
action:true,
user:false,
event:false,
tool:false
}
$scope.getSubMenu = function(menu){
$scope.menustatus[menu] = !$scope.menustatus[menu];
}
$rootScope.$watch("pagePath",function(n){
if(angular.isDefined(n)){
var idx = n.indexOf("Detail");
if(idx>-1){
n = n.substring(0,n);
}
$scope.menuCurFlag = "";
for(var k in meauTree){
var ms = meauTree[k];
if(ms.indexOf(n)>-1){
$scope.menuCurFlag = k;
$scope.menustatus[k] = true;
break;
}
}
}
});
}
})();