| | |
| | | ], |
| | | function (app, angular) { |
| | | app.controller('workspaceDepartmentConfigController', ['$scope', '$rootScope', '$log', '$resourceProvider', 'SweetAlert', '$uibModal', '$q', '$state', '$tableProvider', 'Payment', 'Workspace', |
| | | 'UserWorkspace', '$filter', |
| | | function ($scope, $rootScope, $log, $resourceProvider, SweetAlert, $uibModal, $q, $state, $tableProvider, Payment, Workspace, UserWorkspace, $filter) { |
| | | 'UserWorkspace', '$filter', '$timeout', |
| | | function ($scope, $rootScope, $log, $resourceProvider, SweetAlert, $uibModal, $q, $state, $tableProvider, Payment, Workspace, UserWorkspace, $filter, $timeout) { |
| | | |
| | | |
| | | /* $scope.fn 상속 중 */ |
| | |
| | | $scope.fn.makeTableConfigs = makeTableConfigs; // 부서 관리 목록 테이블 설정 |
| | | $scope.fn.initSearchDepartment = initSearchDepartment; // 검색 조건 초기화 |
| | | $scope.fn.departmentAdd = departmentAdd; // 부서 추가 |
| | | $scope.fn.removes = removes; // 부서 삭제 |
| | | |
| | | /* $scope.vm 상속 중 */ |
| | | $scope.vm.search = { |
| | |
| | | |
| | | // 테이블 이벤트 |
| | | $scope.vm.tableEvent2 = { |
| | | modifyDepartment : modifyDepartment //부서명 변경 |
| | | departmentModify : departmentModify, //부서명 변경 |
| | | modifyDepartmentCount : modifyDepartmentCount //부서 팀원 변경 |
| | | }; |
| | | |
| | | // 부서 관리 리스트 불러오기 |
| | |
| | | |
| | | // 검색 조건 초기화 |
| | | function initSearchDepartment() { |
| | | $scope.vm.search.departmentName = ""; |
| | | $scope.fn.getDepartmentList(0); |
| | | } |
| | | |
| | |
| | | .setHName("manageDepartment.departmentCount") |
| | | .setHWidth("width-120-p") |
| | | .setDAlign("text-center") |
| | | .setDName("departmentCount")); |
| | | .setDName("departmentCount") |
| | | .setDType("renderer") |
| | | .setDRenderer("DEPARTMENT_COUNT")); |
| | | } |
| | | |
| | | // 부서 관리 목록 조회 |
| | |
| | | } |
| | | |
| | | var conditions = { |
| | | name : $scope.vm.search.departmentName //부서명 |
| | | departmentName : $scope.vm.search.departmentName //부서명 |
| | | }; |
| | | |
| | | //테이블 리스트 데이터 컨트롤러 요청 |
| | |
| | | }); |
| | | } |
| | | |
| | | // 부서명 수정 |
| | | function modifyDepartment(id) { |
| | | // 부서 수정 |
| | | function departmentModify(id) { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/workspace/workspaceDepartmentModify.html', |
| | | size : "md", |
| | |
| | | }); |
| | | } |
| | | |
| | | // 부서 인원 수정 |
| | | function modifyDepartmentCount(id) { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/workspace/workspaceDepartmentCountModify.html', |
| | | size : "md", |
| | | controller : 'departmentCountModifyController', |
| | | backdrop : 'static', |
| | | resolve : { |
| | | parameter : function () { |
| | | return { |
| | | id : id |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 사용자 정의 필드 삭제 팝업 |
| | | function removes() { |
| | | var removeIds = []; |
| | | |
| | | angular.forEach($scope.vm.responseData.data, function (data) { |
| | | if (data.checked) { |
| | | removeIds.push(data.id); |
| | | } |
| | | }); |
| | | |
| | | if (removeIds.length < 1) { |
| | | SweetAlert.swal({ |
| | | title : $filter("translate")("common.checkPurgingTargets"), // 삭제 대상 확인 |
| | | text : $filter("translate")("common.selectDestinationDeletion"), // 삭제 대상을 선택하세요. |
| | | type : "warning" |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 삭제 알림 |
| | | SweetAlert.swal({ |
| | | title : $filter("translate")("customField.deleteUserDefinedFields"), // "사용자 정의 필드 삭제" |
| | | text : $filter("translate")("customField.wantToDeleteSelectUserDefinedFields"), // "선택한 사용자 정의 필드를 삭제하겠습니까? 삭제된 사용자 정의 필드는 복구할 수 없습니다." |
| | | type : "warning", |
| | | showCancelButton : true, |
| | | confirmButtonColor : "#DD6B55", |
| | | confirmButtonText : $filter("translate")("common.delete"), // 삭제 |
| | | cancelButtonText : $filter("translate")("common.cancel"), // 취소 |
| | | closeOnConfirm : false, |
| | | closeOnCancel : true |
| | | }, |
| | | function (isConfirm) { |
| | | SweetAlert.close(); |
| | | |
| | | if (isConfirm) { |
| | | $rootScope.spinner = true; |
| | | |
| | | UserWorkspace.departmentRemove($resourceProvider.getContent( |
| | | { removeIds : removeIds }, |
| | | $resourceProvider.getPageContent(0, 0))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $timeout(function () { |
| | | SweetAlert.success($filter("translate")("common.deleteSucceeded"), result.data.message.message); // 삭제 성공 |
| | | }, 100); |
| | | |
| | | $scope.fn.getDepartmentList(0); |
| | | } |
| | | else { |
| | | $timeout(function () { |
| | | SweetAlert.error($filter("translate")("common.deleteFailed"), result.data.message.message); // 삭제 실패 |
| | | }, 100); |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | $scope.fn.makeTableConfigs(); |
| | | $scope.fn.getDepartmentList(); |
| | | |