Browse Source

Merge branch 'hotfix-842-wangcz'

Administrator 7 years ago
parent
commit
2594b5e0f3

+ 0 - 263
src/main/webapp/resources/js/sso/controllers/securitySetCtrl.js

@@ -162,186 +162,6 @@ define(['app/app'], function (app) {
 			})
 		}
 
-        $scope.pageParam = {};
-        $scope.tableParams = new ngTableParams({
-            page : 1, // show first page
-            count : 10 // count per page
-        }, {
-            total : 0,
-            getData : function($defer, params) {
-                var param = BaseService.parseParams(params.url());
-                param.enuu = $scope.userInfo.enterprise.uu;
-                if(!$scope.searchMthod) {
-                    Enterprise.getAllUsersByEnuu(param, function (page) {
-                        if (page) {
-                            $scope.pageParam.start = (page.number-1)*page.size+1;
-                            $scope.pageParam.end = $scope.pageParam.start + page.numberOfElements - 1;
-                            $scope.pageParam.all = page.totalElements;
-                            params.total(page.totalElements);
-                            $defer.resolve(page.content);
-                            $scope.users = page.content;
-                            $scope.reloadUserCheck(false);
-                        }
-                    },function (error) {
-                        toaster.pop('error', '获取企业人员信息失败',error.data);
-                    });
-                }
-                else {
-                    param.keyword = $scope.keyword;
-                    if (filterRolejs !== 1){
-                        param.roleId = filterRolejs;
-                    }
-                    Enterprise.findUsersByKeyword(param,function (page) {
-                        if (page) {
-                            $scope.pageParam.start = (page.number-1)*page.size+1;
-                            $scope.pageParam.end = $scope.pageParam.start + page.numberOfElements - 1;
-                            $scope.pageParam.all = page.totalElements;
-                            params.total(page.totalElements);
-                            $defer.resolve(page.content);
-                            $scope.users = page.content;
-                            $scope.reloadUserCheck(false);
-                        }
-                    },function (error) {
-                        toaster.pop('error', '获取企业人员信息失败',error.data);
-                    })
-                }
-            }
-        });
-
-        var filterRolejs = 1;
-        $scope.onSearch = function (keyword,filterRole) {
-            filterRolejs = 1;
-            if ((keyword != null && keyword != '') || filterRole !== 'all') {
-                if (filterRole === 'all'){
-                    filterRolejs = 1;
-                }else {
-                    filterRolejs = filterRole;
-                }
-                $scope.searchMthod = true;
-                $scope.keyword = keyword;
-            } else {
-                $scope.searchMthod = false;
-            }
-            $scope.tableParams.page(1);
-            $scope.tableParams.reload();
-        };
-        $scope.onKeyUpSearch = function (keyword, filterRole, event) {
-            if (event && event.keyCode == 13) {
-                $scope.onSearch(keyword, filterRole);
-            }
-        }
-
-        $scope.newUser = {};
-
-        //弹出添加用户模态框
-        $scope.addExistUser = function () {
-            $scope.adding = false;
-            $scope.setAddingUser(false);
-            $scope.newUser = {};
-            var modalInstance = $modal.open({
-                animation: true,
-                templateUrl: $rootScope.rootPath + '/static/view/vendor/forstore/addExistUser.html',
-                controller: 'AddExistUserCtrl'
-            });
-
-            modalInstance.result.then(function () {
-                $scope.userTelSuccess = false;
-                $scope.userTelError = false;
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-            }, function () {
-
-            });
-
-        };
-        /**
-         * 添加未注册用户
-         */
-        $scope.addUser = function () {
-            if (!$scope.userEmailSuccess || !$scope.userTelSuccess) {
-                toaster.pop('error', '请输入正确的信息后提交');
-                return;
-            }
-            $scope.adding = true;
-            $scope.loading = true;
-            Enterprise.saveUser({}, $scope.newUser, function () {
-                $scope.loading = false;
-                toaster.pop('success', '提示', '增加用户成功:' + $scope.newUser.userName);
-                $scope.setAddingUser(false);
-                $scope.newUser = {userSex: 'M'};
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-                $scope.adding = false;
-                // $scope.newUserForm.newUserTel.$setValidity('available', false);
-                // $scope.newUserForm.newUserEmail.$setValidity('available', false);
-                $scope.userTelSuccess = false;
-                $scope.userTelError = false;
-                $scope.userEmailSuccess = false;
-                $scope.userEmailError = false;
-            }, function (response) {
-                $scope.loading = false;
-                toaster.pop('error', '错误', response.data);
-            });
-        };
-
-        $scope.adding = false;
-        $scope.setAdding = function (status) {
-            $scope.adding = status;
-        }
-        /**
-         * 删除用户
-         */
-        $scope.removeUser = function (user) {
-
-            // if (confirm('确定删除用户(' + user.userName + ')吗?')) {
-            // }
-            Enterprise.removeUser({uu: user.userUU}, function () {
-                toaster.pop('success', '提示', '用户删除成功。');
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-                $scope.showDelUserFlag = false;
-            }, function (response) {
-                toaster.pop('error', '删除失败', response.data);
-            });
-        };
-        //用户删除确认框
-        $scope.showDelUserFlag = false;
-
-        $scope.setShowDelUserFlag = function (flag, user) {
-            $scope.showDelUserFlag = flag;
-            if (flag) {
-                $scope.delUser = user;
-            }
-        }
-        /***
-         * 全选
-         * */
-        $scope.isCheckAll = false;
-        $scope.doCheckAll = function () {
-            $scope.isCheckAll = !$scope.isCheckAll;
-            if ($scope.isCheckAll) {
-                $scope.reloadUserCheck(true);
-            } else {
-                $scope.reloadUserCheck(false);
-            }
-        }
-
-        $scope.checkUser = function (user) {
-            user.checked = !user.checked;
-            var allcheck = true
-            angular.forEach($scope.users, function (item) {
-                if (!item.checked) {
-                    allcheck = false;
-                }
-            });
-            $scope.isCheckAll = allcheck;
-        }
-
-        $scope.reloadUserCheck = function (flag) {
-            angular.forEach($scope.users, function (item) {
-                item.checked = flag;
-            });
-        }
         /**
          * 验证手机号是否可用
          */
@@ -572,18 +392,8 @@ define(['app/app'], function (app) {
             if (t === 'role' && $scope.rolesExcept) {
                 toaster.pop('error', '获取企业角色信息失败',$scope.rolesExcept);
             }
-            // if (t === 'auth') {
-            //     $scope.keyword = '';
-            //     $scope.onSearch($scope.keyword,'all');
-            // }
           };
 
-          /* 查询接口权限 */
-        // AccountRole.findAuthority({resUrl: encodeURIComponent('/account/role'), method: 'GET'}, function (data) {
-        //
-        // }, function (error) {
-        //
-        // })
 
           $scope.updatePassword = function () {
               AuthenticationService.redirectPassword();
@@ -637,79 +447,6 @@ define(['app/app'], function (app) {
                 break;
             }
         }
-        //角色控制
-        $scope.roles = {};
-        AccountResource.query({}, function (data) {
-            if (data && data.length > 0) {
-                data[0].$open = true;
-            }
-            $scope.resources = data;
-        });
-        var getData = function () {
-            AccountRole.findAll({}, function (data) {
-                var defaults = [], custom = [];
-                angular.forEach(data, function (d) {
-                    if (d.isdefault == 1)
-                        defaults.push(d);
-                    else
-                        custom.push(d);
-                });
-                $scope.roles = {defaults: defaults, custom: custom};
-            },function (error) {
-                $scope.rolesExcept = error.data;
-            });
-            AccountRole.getByExistRoleAndEnuu({}, function (data) {
-                var defaults = [], custom = [];
-                angular.forEach(data, function (d) {
-                    if (d.isdefault == 1)
-                        defaults.push(d);
-                    else
-                        custom.push(d);
-                });
-                $scope.existRoles = {defaults: defaults, custom: custom};
-            });
-        };
-        getData();
-        $scope.editRole = function (role) {
-            var modalInstance = $modal.open({
-                animation: true,
-                templateUrl: $rootScope.rootPath + '/static/view/vendor/modal/role_detail.html',
-                controller: 'RoleEditCtrl',
-                resolve: {
-                    role: function () {
-                        return role;
-                    }
-                }
-            });
-            modalInstance.result.then(function (added) {
-                added && getData();
-            });
-        };
-
-        $scope.editUserRole = function (user) {
-            var modalInstance = $modal.open({
-                animation: true,
-                templateUrl: $rootScope.rootPath + '/static/view/vendor/modal/edit_user_role.html',
-                controller: 'UserRoleEditCtrl',
-                resolve: {
-                    user: function () {
-                        return user;
-                    }
-                }
-            });
-        };
-
-        $scope.inSelect = false;
-        $scope.setInSelect = function (status) {
-            $scope.inSelect = status;
-        }
-        $(document).on("click", function () {
-            $scope.$apply(function () {
-                if (!$scope.inSelect) {
-                    $scope.setAdding(false);
-                }
-            })
-        })
     }]);
 
 

+ 0 - 28
src/main/webapp/resources/js/sso/controllers/ssoAddressCtrl.js

@@ -51,34 +51,6 @@ define(['app/app'], function (app) {
                     });
                 };
 
-                // $scope.checkPhone = function () {
-                // 	var keyCode = event.keyCode;
-                // 	if (!(keyCode == 46) && !(keyCode == 8)) {
-                // 		if (!(keyCode >= 48 && keyCode <= 57)) {
-                // 			event.returnValue = false;
-                // 		} 
-                // 	}
-                // };
-
-                // $scope.showEditFrame = false;
-                // //编辑地址
-                // $scope.modifyAddress = function (address) {
-                // 	//拼装下拉选择框
-                // 	var arr = address.area.split(',');
-                // 	address.province = arr[0];
-                // 	address.city = arr[1];
-                // 	address.district = arr[2];
-                // 	$scope.modifyObject = angular.copy(address);
-                // 	$scope.showEditFrame = true;
-                // 	$scope.isModify = true;
-                // };
-                // //新增地址
-                // $scope.addAddress = function () {
-                // 	$scope.modifyObject = {};
-                // 	$scope.showEditFrame = true;
-                // 	$scope.isModify = false;
-                // };
-
                 //删除地址
                 $scope.deleteAddress = function (address) {
                     $scope.deleteObject = angular.copy(address);