|
|
@ -6,57 +6,58 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
|
|
|
|
var app = angular.module('managerMainAppv2', ['ngSanitize', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ngFileUpload']);
|
|
|
|
var app = angular.module('managerMainAppv2', ['ngSanitize', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ngFileUpload']);
|
|
|
|
app.config(['$urlRouterProvider', '$httpProvider', function ($urlRouterProvider, $httpProvider) {
|
|
|
|
app.config(['$urlRouterProvider', '$httpProvider', function ($urlRouterProvider, $httpProvider) {
|
|
|
|
|
|
|
|
|
|
|
|
window.getRoleMenulist = function (role) {
|
|
|
|
window.getRoleMenulist = function (role) {
|
|
|
|
var roleMenu = [];
|
|
|
|
var roleMenu = [];
|
|
|
|
|
|
|
|
|
|
|
|
if ((role & 1) >0){
|
|
|
|
if ((role & 1) > 0) {
|
|
|
|
roleMenu.push({'value':'administrator','module':'系统配置'});
|
|
|
|
roleMenu.push({'value': 'administrator', 'module': '系统配置'});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 2) >0){
|
|
|
|
if ((role & 2) > 0) {
|
|
|
|
roleMenu.push({'value':'compliance','module':'合规中心'});
|
|
|
|
roleMenu.push({'value': 'compliance', 'module': '合规中心'});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 4) >0){
|
|
|
|
if ((role & 4) > 0) {
|
|
|
|
roleMenu.push({'value':'bduser','module':"销售中心"});
|
|
|
|
roleMenu.push({'value': 'bduser', 'module': "销售中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 8) >0){
|
|
|
|
if ((role & 8) > 0) {
|
|
|
|
roleMenu.push({'value':'accountant','module':"财务中心"});
|
|
|
|
roleMenu.push({'value': 'accountant', 'module': "财务中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 64) >0){
|
|
|
|
if ((role & 64) > 0) {
|
|
|
|
roleMenu.push({'value':'director','module':"领导决策"});
|
|
|
|
roleMenu.push({'value': 'director', 'module': "领导决策"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 128) >0){
|
|
|
|
if ((role & 128) > 0) {
|
|
|
|
roleMenu.push({'value':'sitemanager','module':"营销中心"});
|
|
|
|
roleMenu.push({'value': 'sitemanager', 'module': "营销中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 256) >0){
|
|
|
|
if ((role & 256) > 0) {
|
|
|
|
roleMenu.push({'value':'developer','module':"开发中心"});
|
|
|
|
roleMenu.push({'value': 'developer', 'module': "开发中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 1024) >0){
|
|
|
|
if ((role & 1024) > 0) {
|
|
|
|
roleMenu.push({'value':'riskmanager','module':"风控中心"});
|
|
|
|
roleMenu.push({'value': 'riskmanager', 'module': "风控中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 2048) >0){
|
|
|
|
if ((role & 2048) > 0) {
|
|
|
|
roleMenu.push({'value':'guest','module':"访客中心"});
|
|
|
|
roleMenu.push({'value': 'guest', 'module': "访客中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 4096) >0){
|
|
|
|
if ((role & 4096) > 0) {
|
|
|
|
roleMenu.push({'value':'orgmanager','module':"代理商中心"});
|
|
|
|
roleMenu.push({'value': 'orgmanager', 'module': "代理商中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((role & 8192) >0){
|
|
|
|
if ((role & 8192) > 0) {
|
|
|
|
roleMenu.push({'value':'salesmanager','module':"销管中心"});
|
|
|
|
roleMenu.push({'value': 'salesmanager', 'module': "销管中心"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return roleMenu;
|
|
|
|
return roleMenu;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (getRoleMenulist(window.currentUser.role).length>1) {
|
|
|
|
if (getRoleMenulist(window.currentUser.role).length > 1) {
|
|
|
|
sessionStorage.setItem('roleNum','N');
|
|
|
|
sessionStorage.setItem('roleNum', 'N');
|
|
|
|
$urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/home');
|
|
|
|
$urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/home');
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
sessionStorage.setItem('roleNum','1');
|
|
|
|
sessionStorage.setItem('roleNum', '1');
|
|
|
|
sessionStorage.setItem('role',getRoleMenulist(window.currentUser.role)[0].value);
|
|
|
|
var roleTemplValue = "guest";
|
|
|
|
|
|
|
|
if (getRoleMenulist(window.currentUser.role)[0]) {
|
|
|
|
|
|
|
|
roleTemplValue = getRoleMenulist(window.currentUser.role)[0].value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sessionStorage.setItem('role', roleTemplValue);
|
|
|
|
$urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/menu');
|
|
|
|
$urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/menu');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$httpProvider.defaults.headers.get) {
|
|
|
|
if (!$httpProvider.defaults.headers.get) {
|
|
|
|
$httpProvider.defaults.headers.get = {};
|
|
|
|
$httpProvider.defaults.headers.get = {};
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -64,45 +65,45 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
|
|
|
|
$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache';
|
|
|
|
$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache';
|
|
|
|
$httpProvider.defaults.headers.get['Pragma'] = 'no-cache';
|
|
|
|
$httpProvider.defaults.headers.get['Pragma'] = 'no-cache';
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
app.controller('managerIndexCtrl', ['$scope', '$state','$rootScope', '$http', '$log', '$timeout', '$interval', '$uibModal', '$filter', 'myLoginLogView', 'commonDialog',
|
|
|
|
app.controller('managerIndexCtrl', ['$scope', '$state', '$rootScope', '$http', '$log', '$timeout', '$interval', '$uibModal', '$filter', 'myLoginLogView', 'commonDialog',
|
|
|
|
function ($scope, $state,$rootScope, $http, $log, $timeout, $interval, $uibModal, $filter, myLoginLogView, commonDialog) {
|
|
|
|
function ($scope, $state, $rootScope, $http, $log, $timeout, $interval, $uibModal, $filter, myLoginLogView, commonDialog) {
|
|
|
|
$scope.rolelist = window.getRoleMenulist(window.currentUser.role);
|
|
|
|
$scope.rolelist = window.getRoleMenulist(window.currentUser.role);
|
|
|
|
$scope.roleNow = getroleNow();
|
|
|
|
$scope.roleNow = getroleNow();
|
|
|
|
$scope.roleName = sessionStorage.getItem('role');
|
|
|
|
$scope.roleName = sessionStorage.getItem('role');
|
|
|
|
$scope.changeRole = function (index) {
|
|
|
|
$scope.changeRole = function (index) {
|
|
|
|
sessionStorage.setItem('role',index);
|
|
|
|
sessionStorage.setItem('role', index);
|
|
|
|
$scope.roleNow = getroleNow();
|
|
|
|
$scope.roleNow = getroleNow();
|
|
|
|
$state.go('listMenu',null,{
|
|
|
|
$state.go('listMenu', null, {
|
|
|
|
reload:true
|
|
|
|
reload: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (sessionStorage.getItem('roleNum') =='N'){
|
|
|
|
if (sessionStorage.getItem('roleNum') == 'N') {
|
|
|
|
if (window.location.hash == "" || window.location.hash == "#/home") {
|
|
|
|
if (window.location.hash == "" || window.location.hash == "#/home") {
|
|
|
|
$scope.headerDisplay = false;
|
|
|
|
$scope.headerDisplay = false;
|
|
|
|
$scope.copyright = false;
|
|
|
|
$scope.copyright = false;
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
$scope.headerDisplay = true;
|
|
|
|
|
|
|
|
$scope.copyright = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
$scope.headerDisplay = true;
|
|
|
|
$scope.headerDisplay = true;
|
|
|
|
$scope.copyright = true;
|
|
|
|
$scope.copyright = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$scope.headerCopyDisplay = function () {
|
|
|
|
} else {
|
|
|
|
if (sessionStorage.getItem('role')=='guest'){
|
|
|
|
$scope.headerDisplay = true;
|
|
|
|
|
|
|
|
$scope.copyright = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.headerCopyDisplay = function () {
|
|
|
|
|
|
|
|
if (sessionStorage.getItem('role') == 'guest') {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$state.go('home');
|
|
|
|
$state.go('home');
|
|
|
|
$scope.headerDisplay = false;
|
|
|
|
$scope.headerDisplay = false;
|
|
|
|
$scope.copyright = false;
|
|
|
|
$scope.copyright = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$scope.headerShow = function (role) {
|
|
|
|
$scope.headerShow = function (role) {
|
|
|
|
$scope.headerDisplay = true;
|
|
|
|
$scope.headerDisplay = true;
|
|
|
|
$scope.copyright = true;
|
|
|
|
$scope.copyright = true;
|
|
|
|
sessionStorage.setItem('role',role);
|
|
|
|
sessionStorage.setItem('role', role);
|
|
|
|
$scope.roleNow = getroleNow();
|
|
|
|
$scope.roleNow = getroleNow();
|
|
|
|
$scope.roleName = sessionStorage.getItem('role');
|
|
|
|
$scope.roleName = sessionStorage.getItem('role');
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -199,7 +200,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// $scope.getManagerTodoNotices();
|
|
|
|
// $scope.getManagerTodoNotices();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var connected;
|
|
|
|
var connected;
|
|
|
@ -313,7 +314,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scope.customerService = function () {
|
|
|
|
$scope.customerService = function () {
|
|
|
|
$http.put('/sys/openim/check').then(function (resp) {
|
|
|
|
$http.put('/sys/openim/check').then(function (resp) {
|
|
|
|
window.open('/service_client.html?key='+resp.data.appkey+'&p='+resp.data.password+'&uid='+resp.data.user_id,'_blank');
|
|
|
|
window.open('/service_client.html?key=' + resp.data.appkey + '&p=' + resp.data.password + '&uid=' + resp.data.user_id, '_blank');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|