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;
$http.put('/sys/permissionPartner/modules/' + $scope.module.module_name + '.end', $scope.module).then(function () { angular.forEach(moduleall,function (data) {
$scope.$close(); if ($scope.module.module_name == data.module_name) {
}, function (resp) { commonDialog.alert({title: 'Error', content: "Module Has Exists", type: 'error'})
$scope.errmsg = resp.data.message; 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