fix : develop_client_permission

master
luoyang14z7 6 years ago
parent 9e5e07daef
commit 2cec4309b5

@ -448,6 +448,9 @@ define(['angular', 'uiRouter'], function (angular) {
templateUrl: '/static/config/sysconfigs/templates/permissionPartner_module_dialog.html', templateUrl: '/static/config/sysconfigs/templates/permissionPartner_module_dialog.html',
controller: 'partnerModuleNewCtrl', controller: 'partnerModuleNewCtrl',
resolve: { resolve: {
moduleall: function () {
return $scope.modules;
},
module: function () { module: function () {
return {}; return {};
} }
@ -496,17 +499,31 @@ define(['angular', 'uiRouter'], function (angular) {
}) })
}; };
}]); }]);
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.module = angular.copy(module);
$scope.nameEditable = !module.module_name; $scope.nameEditable = !module.module_name;
$scope.module.initialize = true; $scope.module.initialize = true;
$scope.save = function () { $scope.save = function () {
var hasOne =0;
$scope.errmsg = null; $scope.errmsg = null;
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 () { $http.put('/sys/permissionPartner/modules/' + $scope.module.module_name + '.end', $scope.module).then(function () {
$scope.$close(); $scope.$close();
}, function (resp) { }, function (resp) {
$scope.errmsg = resp.data.message; $scope.errmsg = resp.data.message;
}) })
}
}; };
}]); }]);

Loading…
Cancel
Save