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',
controller: 'partnerModuleNewCtrl',
resolve: {
moduleall: function () {
return $scope.modules;
},
module: function () {
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.nameEditable = !module.module_name;
$scope.module.initialize = true;
$scope.save = function () {
var hasOne =0;
$scope.errmsg = null;
$http.put('/sys/permissionPartner/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;
})
}
};
}]);

Loading…
Cancel
Save