From 2cec4309b598ceda5ddde410753f3eb8fe5d1048 Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Fri, 6 Jul 2018 17:11:19 +0800 Subject: [PATCH] fix : develop_client_permission --- .../ui/static/config/sysconfigs/sysconfigs.js | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main/ui/static/config/sysconfigs/sysconfigs.js b/src/main/ui/static/config/sysconfigs/sysconfigs.js index 89c1c053d..a653673d8 100644 --- a/src/main/ui/static/config/sysconfigs/sysconfigs.js +++ b/src/main/ui/static/config/sysconfigs/sysconfigs.js @@ -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; + }) + } }; }]);