|
|
|
@ -39,21 +39,21 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/payemnt_config.html',
|
|
|
|
|
controller: 'paymentConfigCtrl'
|
|
|
|
|
})*/
|
|
|
|
|
.state('sysconfig.partnerPermission', {
|
|
|
|
|
url: '/partnerPermission',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/partnerPermission_config.html',
|
|
|
|
|
controller: 'partnerPermissionConfigRootCtrl'
|
|
|
|
|
}).state('sysconfig.partnerPermission.functions', {
|
|
|
|
|
.state('sysconfig.permissionPartner', {
|
|
|
|
|
url: '/permissionPartner',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_config.html',
|
|
|
|
|
controller: 'permissionPartnerConfigRootCtrl'
|
|
|
|
|
}).state('sysconfig.permissionPartner.functions', {
|
|
|
|
|
url: '/partnerFunctions',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/partnerPermission_functions.html',
|
|
|
|
|
controller: 'partnerPermissionFuncCtrl'
|
|
|
|
|
}).state('sysconfig.partnerPermission.modules', {
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_functions.html',
|
|
|
|
|
controller: 'permissionPartnerFuncCtrl'
|
|
|
|
|
}).state('sysconfig.permissionPartner.modules', {
|
|
|
|
|
url: '/partnerModules',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/partnerPermission_modules.html',
|
|
|
|
|
controller: 'partnerPermissionModuleCtrl',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_modules.html',
|
|
|
|
|
controller: 'permissionPartnerModuleCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
modules: ['$http', function ($http) {
|
|
|
|
|
return $http.get('/sys/partnerPermission/modules')
|
|
|
|
|
return $http.get('/sys/permissionPartner/modules')
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -326,18 +326,18 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}]);*/
|
|
|
|
|
app.controller('partnerPermissionConfigRootCtrl', ['$scope', '$http', '$uibModal', function ($scope, $http, $uibModal) {
|
|
|
|
|
app.controller('permissionPartnerConfigRootCtrl', ['$scope', '$http', '$uibModal', function ($scope, $http, $uibModal) {
|
|
|
|
|
$scope.authorizeRole = function (roleMask) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/PartnerPermission_authorize_dialog.html',
|
|
|
|
|
controller: 'partnerPermissionAuthorizeDialogCtrl',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_authorize_dialog.html',
|
|
|
|
|
controller: 'permissionPartnerAuthorizeDialogCtrl',
|
|
|
|
|
size: 'lg',
|
|
|
|
|
resolve: {
|
|
|
|
|
authorized: ['$http', function ($http) {
|
|
|
|
|
return $http.get('/sys/partnerPermission/roles/' + roleMask + '/functions');
|
|
|
|
|
return $http.get('/sys/permissionPartner/roles/' + roleMask + '/functions');
|
|
|
|
|
}],
|
|
|
|
|
modules: ['$http', function ($http) {
|
|
|
|
|
return $http.get('/sys/partnerPermission/functions');
|
|
|
|
|
return $http.get('/sys/permissionPartner/functions');
|
|
|
|
|
}],
|
|
|
|
|
role: function () {
|
|
|
|
|
return roleMask
|
|
|
|
@ -346,13 +346,13 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerPermissionAuthorizeDialogCtrl', ['$scope', '$http', 'authorized', 'modules', 'role',
|
|
|
|
|
app.controller('permissionPartnerAuthorizeDialogCtrl', ['$scope', '$http', 'authorized', 'modules', 'role',
|
|
|
|
|
function ($scope, $http, authorized, modules, role) {
|
|
|
|
|
$scope.authorized = authorized.data;
|
|
|
|
|
$scope.modules = modules.data;
|
|
|
|
|
$scope.submitAuthorize = function () {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
$http.put('/sys/partnerPermission/roles/' + role + '/functions', $scope.authorized).then(function () {
|
|
|
|
|
$http.put('/sys/permissionPartner/roles/' + role + '/functions', $scope.authorized).then(function () {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
@ -368,17 +368,17 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
);
|
|
|
|
|
app.controller('partnerPermissionFuncCtrl', ['$scope', '$http', '$state', '$uibModal', 'commonDialog',
|
|
|
|
|
app.controller('permissionPartnerFuncCtrl', ['$scope', '$http', '$state', '$uibModal', 'commonDialog',
|
|
|
|
|
function ($scope, $http, $state, $uibModal, commonDialog) {
|
|
|
|
|
$scope.loadFunctions = function () {
|
|
|
|
|
$http.get('/sys/partnerPermission/functions').then(function (functions) {
|
|
|
|
|
$http.get('/sys/permissionPartner/functions').then(function (functions) {
|
|
|
|
|
$scope.modFunctions = functions.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.loadFunctions();
|
|
|
|
|
|
|
|
|
|
$scope.loadModules = function () {
|
|
|
|
|
$http.get('/sys/partnerPermission/modules').then(function (modules) {
|
|
|
|
|
$http.get('/sys/permissionPartner/modules').then(function (modules) {
|
|
|
|
|
$scope.modules = modules.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
@ -387,21 +387,21 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.syncFunctions = function () {
|
|
|
|
|
$http.post('/sys/partnerPermission/synchronize').then(function () {
|
|
|
|
|
$http.post('/sys/permissionPartner/synchronize').then(function () {
|
|
|
|
|
$scope.loadFunctions();
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.moveFunction = function (func) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/partnerPermission_choose_module.html',
|
|
|
|
|
controller: 'partnerPermissionChooseModuleDialogCtrl',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_choose_module.html',
|
|
|
|
|
controller: 'permissionPartnerChooseModuleDialogCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
modules: function () {
|
|
|
|
|
return $scope.modules;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).result.then(function (modName) {
|
|
|
|
|
$http.put('/sys/partnerPermission/functions/' + func.func_id + '/modules', {module_name: modName}).then(function () {
|
|
|
|
|
$http.put('/sys/permissionPartner/functions/' + func.func_id + '/modules', {module_name: modName}).then(function () {
|
|
|
|
|
$scope.loadFunctions();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
|
|
|
@ -411,7 +411,7 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
$scope.editFunctionInfo = function (func) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/PartnerFunc_info_edit.html',
|
|
|
|
|
controller: 'partnerPermissionFuncEditDialogCtrl',
|
|
|
|
|
controller: 'permissionPartnerFuncEditDialogCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
func: function () {
|
|
|
|
|
return angular.copy(func);
|
|
|
|
@ -423,31 +423,34 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
);
|
|
|
|
|
app.controller('partnerPermissionChooseModuleDialogCtrl', ['$scope', '$http', 'modules', function ($scope, $http, modules) {
|
|
|
|
|
app.controller('permissionPartnerChooseModuleDialogCtrl', ['$scope', '$http', 'modules', function ($scope, $http, modules) {
|
|
|
|
|
$scope.modules = modules;
|
|
|
|
|
$scope.chooseModule = function (mod) {
|
|
|
|
|
$scope.$close(mod.module_name);
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerPermissionFuncEditDialogCtrl', ['$scope', '$http', 'func', function ($scope, $http, func) {
|
|
|
|
|
app.controller('permissionPartnerFuncEditDialogCtrl', ['$scope', '$http', 'func', function ($scope, $http, func) {
|
|
|
|
|
$scope.func = func;
|
|
|
|
|
$scope.modifyFunction = function () {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
$http.put('/sys/partnerPermission/functions/' + func.func_id + '.end', $scope.func).then(function () {
|
|
|
|
|
$http.put('/sys/permissionPartner/functions/' + func.func_id + '.end', $scope.func).then(function () {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerPermissionModuleCtrl', ['$scope', '$http', '$state', '$uibModal', 'commonDialog', 'modules',
|
|
|
|
|
app.controller('permissionPartnerModuleCtrl', ['$scope', '$http', '$state', '$uibModal', 'commonDialog', 'modules',
|
|
|
|
|
function ($scope, $http, $state, $uibModal, commonDialog, modules) {
|
|
|
|
|
$scope.modules = modules.data;
|
|
|
|
|
$scope.newPartnerModule = function () {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/PartnerPermission_module_dialog.html',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_module_dialog.html',
|
|
|
|
|
controller: 'partnerModuleNewCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
moduleall: function () {
|
|
|
|
|
return $scope.modules;
|
|
|
|
|
},
|
|
|
|
|
module: function () {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
@ -458,7 +461,7 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
};
|
|
|
|
|
$scope.editPartnerModule = function (mod) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/PartnerPermission_module_dialog.html',
|
|
|
|
|
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_module_dialog.html',
|
|
|
|
|
controller: 'partnerModuleEditCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
module: function () {
|
|
|
|
@ -475,7 +478,7 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
title: 'Warning',
|
|
|
|
|
content: 'You are deleting an exists module. Confirm?'
|
|
|
|
|
}).then(function () {
|
|
|
|
|
$http.delete('/sys/partnerPermission/modules/' + mod.module_name + '.end').then(function () {
|
|
|
|
|
$http.delete('/sys/permissionPartner/modules/' + mod.module_name + '.end').then(function () {
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
|
|
|
@ -487,46 +490,41 @@ define(['angular', 'uiRouter'], function (angular) {
|
|
|
|
|
app.controller('partnerModuleEditCtrl', ['$scope', '$http', 'module', function ($scope, $http, module) {
|
|
|
|
|
$scope.module = angular.copy(module);
|
|
|
|
|
$scope.nameEditable = !module.module_name;
|
|
|
|
|
$http.get('/sys/partnerPermission/modules/'+ $scope.module.module_id + '.num').then(function (num) {
|
|
|
|
|
$scope.module.initialize = num.data.bool;
|
|
|
|
|
})
|
|
|
|
|
$scope.save = function () {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
$http.put('/sys/partnerPermission/modules/' + $scope.module.module_name + '.end', $scope.module).then(function () {
|
|
|
|
|
$http.put('/sys/permissionPartner/modules/' + $scope.module.module_name + '.end', $scope.module).then(function () {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerModuleNewCtrl', ['$scope', '$http', 'module', function ($scope, $http, module) {
|
|
|
|
|
app.controller('partnerModuleNewCtrl', ['$scope', '$http', 'module','moduleall','commonDialog', function ($scope, $http, module,moduleall,commonDialog) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.module = angular.copy(module);
|
|
|
|
|
$scope.nameEditable = !module.module_name;
|
|
|
|
|
$scope.module.initialize = false;
|
|
|
|
|
$scope.module.initialize = true;
|
|
|
|
|
$scope.save = function () {
|
|
|
|
|
var hasOne =0;
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
$http.put('/sys/partnerPermission/modules/' + $scope.module.module_name + '.end', $scope.module).then(function () {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
|
angular.forEach(moduleall,function (data) {
|
|
|
|
|
if ($scope.module.module_name == data.module_name) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: "Module Has Exists", type: 'error'})
|
|
|
|
|
hasOne=1
|
|
|
|
|
return hasOne;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (hasOne != 1) {
|
|
|
|
|
$http.put('/sys/permissionPartner/modules/' + $scope.module.module_name + '.end', $scope.module).then(function () {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return app;
|
|
|
|
|
});
|