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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(function(){
angular.module("app.collect")
.controller("collectCtrl",["$rootScope","$scope","$state","ToolService","$timeout",collectCtrl]);
function collectCtrl($rootScope,$scope,$state,ToolService,$timeout){
var meauTree = {
"analysis":["campaigninfo","channeleffect","attribute","effectevaluate","roi","keyword","packageinfo"],
"decisionsupport":["paymentinsight","potentialusergroup","device"],
"campaignmanager":["campaign","campgroup","datacb","onelink","sublink","subpackage"],
"export":["logexport","logdump","logtool","report","subcampaign"],
"eventmanage":["event","profile"]
};
$scope.getSubMenu = function(menu){
if(menu == 'custommenu'){
if($rootScope.isSuper && $scope.ctmMenuList.length == 0){
ToolService.showAlp();
$rootScope.tipCustom = true;
return false;
}
}
if($scope.subflag == menu && $state.current && $state.current.name!=menu){
$scope.subflag = "";
}else{
$scope.subflag = menu;
}
$rootScope.custID = "";
// $timeout(function(){
// $(".leftSidebar").perfectScrollbar("update");
// },100);
}
$scope.closeTip = function(){
$rootScope.tipCustom = false;
ToolService.hideAlp();
}
$scope.okCust = function(){
$scope.goPage('collect.custommenu');
$scope.closeTip();
}
$rootScope.$watch("pagePath",function(n){
if(angular.isDefined(n)){
$scope.subflag = "";
var idx = n.indexOf("Detail");
if(idx>-1){
n = n.substring(0,n);
}
for(var k in meauTree){
var ms = meauTree[k];
if(ms.indexOf(n)>-1){
$scope.subflag = k;
break;
}
}
if(n == 'custommenu'){
$scope.subflag = n;
}
}
});
// $(".leftSidebar").perfectScrollbar();
}
})();