Commit 0118f774 by yangfangfang

js埋点

parent ec849f08
......@@ -51,8 +51,8 @@ module.exports = function(grunt) {
connect: {
proxies: [{
context: ['/api'],
host: 'localhost',
//host: '192.168.2.9',
// host: 'localhost',
host: '192.168.2.37',
port: 8091,
https: false,
xforward: true,
......@@ -152,7 +152,7 @@ module.exports = function(grunt) {
}
}
},
useminPrepare: {
html: ["<%= yeoman.app %>/index.html","<%= yeoman.app %>/login.html","<%= yeoman.app %>/activation.html","<%= yeoman.app %>/failure.html","<%= yeoman.app %>/forget.html","<%= yeoman.app %>/register.html","<%= yeoman.app %>/success.html","<%= yeoman.app %>/resetpwd.html","<%= yeoman.app %>/olduser.html","<%= yeoman.app %>/demo.html","<%= yeoman.app %>/home.html","<%= yeoman.app %>/main.html"],
options: {
......@@ -217,13 +217,13 @@ module.exports = function(grunt) {
"template/**/*.jpg",
"*.ico"
]
},
},
{
expand: true,
cwd: ".tmp/images",
dest: "<%= yeoman.dist %>/images",
src: ["generated/*"]
},
},
{
expand: true,
cwd: "",
......@@ -327,7 +327,7 @@ module.exports = function(grunt) {
else{
dd.setDate(m-i);
}
arr.unshift(this.date(dd,'YYYY-MM-DD'));
}
return arr;
......@@ -388,6 +388,6 @@ module.exports = function(grunt) {
});
grunt.registerTask("build", ["clean:dist", "useminPrepare", "concurrent:dist", "copy:dist", "concat", "cssmin", "uglify", "usemin"]);
return grunt.registerTask("default", ["build"]);
};
......@@ -89,8 +89,8 @@
</div>
<div class="rightHeader clearfix">
<div class="mainMenu" ng-class="{'mainShow':hasMenuFlag || isall}">
<div ng-class="{'active':mainMenu=='behavior'}" ng-click="showSubMenus('behavior')" ng-if="showMenuFlag.behavior || isall">行为分析</div>
<!-- <div ng-class="{'active':mainMenu=='export'}" ng-click="showSubMenus('export')" ng-if="showMenuFlag.export || isall">数据导出</div> -->
<div ng-class="{'active':mainMenu=='behavior'}" ng-click="showSubMenus('behavior')">行为分析</div>
<div ng-class="{'active':mainMenu=='export'}" ng-click="showSubMenus('export')">数据导出</div>
<div ng-class="{'active':mainMenu=='management'}" ng-click="showSubMenus('management')">管理中心</div>
</div>
......@@ -236,5 +236,7 @@
</div>
<div class="helpTipWrap winTips" id="winTC"></div>
</div>
<div class="alphaDiv" ng-if="ioAlert && byflow && ioPercentRel <= 0.2 && behaviorAuth && !flowRestrict" style="z-index: 997"></div>
<div class="alphaDiv" ng-if="ioDateAlert && pastLong <= 30 && behaviorAuth && !flowRestrict" style="z-index: 997"></div>
</body>
</html>
......@@ -5,33 +5,33 @@
function httpService($http,$q,UtilService){
var service = {};
service.loginTimeout = function(data) {
if(data!=null && data.code && data.code == -1002){
service.logOutCookie();
}
};
service.noLogin = function(url){
if(angular.isUndefined(url) || url.indexOf('login')==-1){
var loginuserId = UtilService.getCookie("ryioUid");
if(UtilService.isNullStr(loginuserId)){
service.logOutCookie();
}
}
};
service.logOutCookie = function(){
UtilService.setCookie("ryioUid","");
// UtilService.setCookie("ryioUname",'');
window.localStorage.setItem("ryioUauth","");
UtilService.setCookie("ryioToken","");
UtilService.setCookie("ryioIsSuper","");
window.location.href="/login.html";
};
if(data!=null && data.code && data.code == -1002){
service.logOutCookie();
}
};
service.noLogin = function(url){
if(angular.isUndefined(url) || url.indexOf('login')==-1){
var loginuserId = UtilService.getCookie("ryioUid");
if(UtilService.isNullStr(loginuserId)){
service.logOutCookie();
}
}
};
service.logOutCookie = function(){
UtilService.setCookie("ryioUid","");
// UtilService.setCookie("ryioUname",'');
window.localStorage.setItem("ryioUauth","");
UtilService.setCookie("ryioToken","");
UtilService.setCookie("ryioIsSuper","");
window.location.href="/login.html";
};
service.getInfo = function(url,params,noLogin){
if(!noLogin){
service.noLogin(url);
}
var defered = $q.defer();
var condition = "";
for(var k in params){
condition += "&" + k +"=" + params[k];
......@@ -62,7 +62,7 @@
service.getInfoByUrl = function(url){
service.noLogin();
var defered = $q.defer();
var hp = $http.get(url)
.success(function(data){
......@@ -79,7 +79,7 @@
service.getReportData = function(report,param){
service.noLogin();
var defered = $q.defer();
var params = UtilService.cloneJSON(param);
var appid = params.appid;
delete params.appid;
......@@ -128,7 +128,7 @@
else{
defered.resolve(data.content || data);
}
})
.error(function(data){
service.loginTimeout(data);
......@@ -139,13 +139,14 @@
service.postInfoByUrl = function(url,params){
service.noLogin();
var defered = $q.defer();
if(url.indexOf("?")==-1){
url += "?r=" + Math.random();
}else{
url += "&r=" + Math.random();
}
url += "?r=" + Math.random();
}
else{
url += "&r=" + Math.random();
}
var hp = $http.post(url,params)
.success(function(data){
defered.resolve(data.content || data);
......@@ -191,7 +192,7 @@
}else{
url += "&r=" + Math.random();
}
var hp = $http.delete("/api/"+url)
.success(function(data,status){
service.loginTimeout(data);
......@@ -225,7 +226,7 @@
defered.resolve({code:1});
}
headers = headers();
var filename = headers['filename'];
var contentType = headers['content-type'];
var linkElement = document.createElement('a');
......@@ -235,7 +236,7 @@
linkElement.setAttribute('href', url);
linkElement.setAttribute("download", decodeURIComponent(filename));
var clickEvent = new MouseEvent("click", {
"view": window,
"bubbles": true,
......@@ -246,10 +247,10 @@
// console.log(ex);
}
}).error(function (data) {
});
return defered.promise;
}
return service;
}
})();
\ No newline at end of file
})();
......@@ -193,6 +193,9 @@
//loading加载
service.showLoading = function(){
document.getElementById("sysLoad").style.display = "block";
setTimeout(function(){
service.hideLoading();
},60*100);
}
service.hideLoading = function(){
document.getElementById("sysLoad").style.display = "none";
......@@ -394,7 +397,95 @@
return JSON.parse(u);
}
}
//菜单报送数据
service.getMenuSubmitData = function(submenu){
if($rootScope.pagePath=="userinfo")return;
if(!rootmenu[$rootScope.mainMenu])return;
var cmids = service.getCMidInfo();
var company = service.getUser().company;
if(UtilService.isNullStr(company)){
company = "";
}
var appkey = "",appcategory = "",appname = "";
if($rootScope.appInstance){
appkey = $rootScope.appInstance.appkey;
appcategory = $rootScope.appInstance.appGenreName;
appname = $rootScope.appInstance.name;
}
if(!submenu || submenu==''){submenu = menu[$rootScope.pagePath];}
var params = {
appid: UtilService.getTKAppkey(),
who:UtilService.getCookie("ryioUname"),
what:"pageview",
context:{
rootmenu:rootmenu[$rootScope.mainMenu], //菜单分类
menu:menu[$rootScope.pagePath], //当前菜单
submenu:submenu, //子菜单-看单
sessionid:UtilService.getCookie("JSESSIONID"),
user_appkey:appkey, //所选APP的id,
appcategory:appcategory,//应用类型 中文名
appname:appname, //应用名称
rolename:service.getRoleName(),
company:company,
"_cid":cmids.cid,
"_campaignid":cmids.campaignid,
"_apptype":"wap",
email:UtilService.getCookie("ryioUname"),
_deviceid:UtilService.randDeviceId(), //设备ID
operatesystem: UtilService.operatorSystem(),//操作系统 _ryos
browser: UtilService.getBrowser() //浏览器类型
}
};
$.post(UtilService.getLogRoot()+"/receive/tkio/event",JSON.stringify(params));
}
//功能报送数据
service.getOperSubmitData = function(opername){
var appkey = "",appcategory = "",appname = "";
if($rootScope.appInstance){
appkey = $rootScope.appInstance.appkey;
appcategory = $rootScope.appInstance.appGenreName;
appname = $rootScope.appInstance.name;
}
var cmids = service.getCMidInfo();
var company = service.getUser().company;
if(UtilService.isNullStr(company)){
company = "";
}
var params = {
appid:UtilService.getTKAppkey(),
who:UtilService.getCookie("ryioUname"),
what:"operation",
context:{
menu:menu[$rootScope.pagePath], //菜单分类
opername:opername, //操作名字
email:UtilService.getCookie("ryioUname"),
user_appkey:appkey, //所选APP的id,
appcategory:appcategory,//应用类型 中文名
appname:appname, //应用名称
rolename:service.getRoleName(),
company:company,
"_cid":cmids.cid,
"_campaignid":cmids.campaignid,
"_apptype":"wap",
_deviceid:UtilService.randDeviceId(), //设备ID
operatesystem: UtilService.operatorSystem(),//操作系统 _ryos
browser: UtilService.getBrowser() //浏览器类型
}
};
$.post(UtilService.getLogRoot()+"/receive/tkio/event",JSON.stringify(params));
}
return service;
}
})();
......@@ -83,30 +83,6 @@
$scope.$on('f5Applist',function(e,msg){
$scope.queryApp(msg);
});
$scope.hasSubMenus = function(){
$scope.showMenuFlag = {};
var menus = $rootScope.curRoleAuth.roleAuthDetailList;
var first = "";
for(var i=0;i<menus.length;i++){
if($scope.showMenuFlag.admonitor && $scope.showMenuFlag.behavior && $scope.showMenuFlag.export){
break;
}
if(menus[i].parentAuth=='admonitor' || menus[i].parentAuth == 'campaignmanager'){
$scope.showMenuFlag.admonitor = true;
}else if(menus[i].parentAuth=='behavior' || menus[i].parentAuth == 'eventmanage'){
$scope.showMenuFlag.behavior = true;
}else if(menus[i].parentAuth=='export'){
$scope.showMenuFlag.export = true;
}
}
if($rootScope.mainMenu == 'export' && !$scope.showMenuFlag.export){
$rootScope.mainMenu = "";
}else if($rootScope.mainMenu == 'behavior' && !$scope.showMenuFlag.behavior){
$rootScope.mainMenu = "";
}else if($rootScope.mainMenu == 'admonitor' && !$scope.showMenuFlag.admonitor){
$rootScope.mainMenu = "";
}
}
$rootScope.webHideMenus = [];
$scope.$on("appid",function(e,msg){
......@@ -268,7 +244,6 @@
return false;
}
if($rootScope.isSuper || $rootScope.isManage || $rootScope.isAppManage){
$scope.campaigninfoGroup = true;
return true;
}else{
if($rootScope.curRoleAuth){
......@@ -392,6 +367,18 @@
}
}
$rootScope.menuSubmitData = function(submenu){
ToolService.getMenuSubmitData(submenu);
}
$rootScope.operSubmitData = function(opername){
ToolService.getOperSubmitData(opername);
}
$rootScope.$watch("thirdtab",function(n){
if(angular.isDefined(n)){
ToolService.getMenuSubmitData(n);
}
});
$scope.pwdPlacehold = "仅支持数字,大小写字母,且至少包含其中2种,长度限制为6-18位";
}
})();
......@@ -64,8 +64,7 @@
var speMenus = ["userinfo","product","nopower","expiration"];
$rootScope.mainMenus ={
behavior:["custommenu","eventstats","retention","funnel","usergroup","profile","event","activityevent","custommenuDetail","intelligentpath"],
// dataexport:["logtool","report"],
dataexport:["report"],
dataexport:["logtool","report"],
manage:["app","auth"]
};
$rootScope.$on('$stateChangeStart', function(event,next,o,current){
......@@ -145,6 +144,13 @@
}
$rootScope.pagePath = nextMenu;
//看单的子菜单已经报送
if(nextMenu == 'custommenu' && next.url.indexOf(":pageid")>-1){}
else{
if( ['nopower','expiration'].indexOf(nextMenu) == -1 ){
ToolService.getMenuSubmitData(submenuDir[submenu]);
}
}
}
if(!$rootScope.limitInfo){
$timeout(function(){
......
......@@ -820,12 +820,6 @@
},100);
}
}
//有导出权限
$rootScope.$watch("limitInfo",function(n){
if(angular.isDefined(n)){
$scope.iscanExport = $rootScope.showMenu('export') && $rootScope.limitInfo.platformExport==true;
}
});
$scope.exportData = function(){
var nowdate = new Date().getTime();
......@@ -881,12 +875,7 @@
});
}
//有导出权限
$rootScope.$watch("limitInfo",function(n){
if(angular.isDefined(n)){
$scope.iscanExport = $rootScope.showMenu('export') && $rootScope.limitInfo.platformExport==true;
}
});
}
}
}
......
......@@ -445,6 +445,9 @@
ToolService.showTips(txtTips);
$scope.lookMyMenu(flag);
$scope.$emit("f5CtmMenus",{});
if($scope.winFlag!=2){
$rootScope.operSubmitData("新建");
}
}
},function(data){
......@@ -487,6 +490,7 @@
ToolService.showTips('添加成功');
$scope.query(data);
$scope.currentMenu.templates.push(data);
$rootScope.operSubmitData("看单里面创建表单");
}
});
......@@ -556,6 +560,7 @@
else{
$scope.lookMyMenu();
$scope.$emit("f5CtmMenus",{});
$rootScope.operSubmitData("删除");
}
});
}
......
......@@ -476,6 +476,7 @@
ToolService.showTips("删除成功");
$scope.queryInfoByApp(1);
ToolService.hideLoading();
$rootScope.operSubmitData("删除");
});
}
......@@ -1071,6 +1072,7 @@
}
else{
$scope.queryInfoByApp(1);
$rootScope.operSubmitData("删除");
if($scope.isShowCache){
localStorage.removeItem($scope.appid);
}
......
......@@ -153,6 +153,7 @@
ToolService.showTips("删除成功");
$scope.queryInfoByApp(3,$scope.delDefine.id);
ToolService.hideLoading();
$rootScope.operSubmitData("删除");
});
}
$scope.closeAddWin = function(){
......@@ -492,6 +493,9 @@
ToolService.hideLoading();
ToolService.showTips(txtTips);
$scope.queryInfoByApp(1,$scope.currentFunnel.id)
if(!$scope.currentFunnel.id){
$rootScope.operSubmitData("新建");
}
});
}
......
......@@ -107,6 +107,7 @@
ToolService.showTips("删除成功");
$scope.queryInfoByApp(1);
ToolService.hideLoading();
$rootScope.operSubmitData("删除");
});
}
......@@ -567,6 +568,7 @@
}
else{
$scope.queryInfoByApp(1);
$rootScope.operSubmitData("新建");
if($scope.isShowCache){
localStorage.removeItem("path_"+$scope.appid);
}
......
......@@ -65,7 +65,7 @@
$scope.winID = info.id;
ToolService.showAlp();
}else{
$rootScope.operSubmitData("下载");
}
});
}
......
......@@ -28,6 +28,7 @@
$scope.delstatus = false;
ToolService.showTips("删除成功")
$scope.$emit("f5Applist",true);
$rootScope.operSubmitData("删除");
});
}
$timeout(function(){
......@@ -56,6 +57,7 @@
ToolService.hideLoading();
ToolService.showTips(tipmsg)
$scope.$emit("f5Applist",true);
$rootScope.operSubmitData(tipmsg.slice(0,2));
});
}
......@@ -110,6 +112,7 @@
});
}
$scope.downloadsdk = function(){
$rootScope.operSubmitData("查看并下载SDK");
}
$scope.$on("appGenre",function(e,msg){
$scope.showGame = msg.info.categoryid == gameTypeId;
......@@ -302,6 +305,7 @@
$scope.appkey = data.appkey;
ToolService.hideLoading();
$scope.stepflag = 2;
$rootScope.operSubmitData("新建");
}
});
}
......@@ -377,6 +381,7 @@
devList.push({id:item.deviceId,name:item.deviceId});
});
$scope.deviceList = devList;
$rootScope.operSubmitData("下一步");
ToolService.hideLoading();
});
}
......
......@@ -52,6 +52,7 @@
userPM.then(function(data){
ToolService.hideLoading();
ToolService.showTips("启用成功");
$rootScope.operSubmitData("启用");
$scope.query();
});
}
......@@ -61,6 +62,7 @@
userPM.then(function(data){
ToolService.hideLoading();
ToolService.showTips("停用成功");
$rootScope.operSubmitData("停用");
$scope.query();
});
}
......@@ -354,6 +356,9 @@
ToolService.hideLoading();
ToolService.showTips(txtTips);
$scope.cancel();
if(!infoId){
$rootScope.operSubmitData("新建");
}
}
},function(data){
if(data.code == -6001){
......
......@@ -161,6 +161,7 @@
ToolService.hideLoading();
ToolService.showTips("停用成功")
$rootScope.operSubmitData("停用");
$scope.query(true);
});
}
......@@ -171,6 +172,7 @@
ToolService.hideLoading();
ToolService.showTips("启用成功")
$scope.query(true);
$rootScope.operSubmitData("启用");
});
}
......@@ -1006,6 +1008,9 @@
ToolService.hideLoading();
ToolService.showTips(txtTips);
$scope.cancel();
if(!infoId){
$rootScope.operSubmitData("新建");
}
});
}
......
......@@ -35,6 +35,7 @@
$scope.delstatus = false;
ToolService.showTips("删除成功");
$scope.query();
$rootScope.operSubmitData("删除");
});
}
......@@ -487,6 +488,9 @@
ToolService.hideLoading();
ToolService.showTips(txtTips);
$scope.cancel();
if(!infoId){
$rootScope.operSubmitData("新建");
}
});
}
......
<div class="eptWrap" ng-click="exportData()" ng-style="style1" ng-hide="iscanExport">
<div class="eptWrap" ng-click="exportData()" ng-style="style1">
<span class="eptOut"></span>
</div>
......@@ -39,10 +39,10 @@
</div>
</ul>
<ul class="sidebarNav" ng-if="mainMenu=='export'">
<!-- <li ng-class="{'active':pagePath=='logtool'}" ng-click="goPage('collect.logtool')" ng-if="showMenu('logtool')">
<li ng-class="{'active':pagePath=='logtool'}" ng-click="goPage('collect.logtool')" ng-if="showMenu('logtool')">
<i class="iconfont icon-logtool"></i>
<a>日志流</a>
</li> -->
</li>
<li ng-class="{'active':pagePath=='report'}" ng-click="goPage('collect.report')" ng-if="showMenu('report')">
<i class="iconfont icon-report"></i>
<a>下载报表</a>
......@@ -135,7 +135,7 @@
</li>
</ul>
<ul class="sidebarNav" ng-if="mainMenu=='export'">
<!-- <li ng-class="{'active':pagePath=='logtool'}" ng-click="goPage('collect.logtool')" ng-if="showMenu('logtool')" ng-mouseenter="hoverMenu='日志流'" ng-mouseleave="hoverMenu=''" >
<li ng-class="{'active':pagePath=='logtool'}" ng-click="goPage('collect.logtool')" ng-if="showMenu('logtool')" ng-mouseenter="hoverMenu='日志流'" ng-mouseleave="hoverMenu=''" >
<i class="iconfont icon-logtool"></i>
<div class="outDiv" ng-if="hoverMenu=='日志流'">
<span class="arrIcon"></span>
......@@ -143,7 +143,7 @@
<li ng-class="{'active':pagePath=='logtool'}"><a>日志流</a></li>
</ul>
</div>
</li> -->
</li>
<li ng-class="{'active':pagePath=='report'}" ng-click="goPage('collect.report')" ng-if="showMenu('report')" ng-mouseenter="hoverMenu='下载报表'" ng-mouseleave="hoverMenu=''" >
<i class="iconfont icon-report"></i>
<div class="outDiv" ng-if="hoverMenu=='下载报表'">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment