| | |
| | | function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, UserWorkspace, parameter, SweetAlert, $filter) { |
| | | |
| | | $scope.fn = { |
| | | getDepartmentList : getDepartmentList, // 부서 관리 리스트 |
| | | detail : detail, // 상세 조회 |
| | | cancel : cancel, // 팝업 창 닫기 |
| | | formSubmit : formSubmit, // 폼 전송 |
| | | formCheck : formCheck, // 폼 체크 |
| | |
| | | id : parameter.id, |
| | | form : { |
| | | departmentName : "", |
| | | departmentEx : "" |
| | | departmentDescription : "" |
| | | } |
| | | }; |
| | | |
| | | // 부서 관리 목록 조회 |
| | | function getDepartmentList() { |
| | | |
| | | // 상세 정보 |
| | | function detail() { |
| | | var conditions = { |
| | | id : $scope.vm.id |
| | | }; |
| | | id : parameter.id |
| | | } |
| | | |
| | | //테이블 리스트 데이터 컨트롤러 요청 |
| | | UserWorkspace.departmentFind($resourceProvider.getContent(conditions, |
| | | $resourceProvider.getPageContent(0, 10))).then(function (result) { |
| | | UserWorkspace.departmentDetail($resourceProvider.getContent( |
| | | conditions, |
| | | $resourceProvider.getPageContent(0, 1))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.form.departmentName = result.data.data[0].departmentName; //departmentName 가져오기 |
| | | $scope.vm.form.departmentDescription = result.data.data[0].departmentDescription; //departmentEx 가져오기 |
| | | |
| | | if (angular.isDefined(result.data.data)) { |
| | | $scope.vm.form.departmentName = result.data.data.departmentName; |
| | | $scope.vm.form.departmentDescription = result.data.data.departmentDescription; |
| | | } |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("managementWorkspace.failedToSelectWorkspaceFullDepartmentList"), result.data.message.message); // "부서 관리 목록 조회 실패" |
| | | SweetAlert.swal($filter("translate")("customField.failedToDetailUserDefinedFields"), result.data.message.message, "error"); // "사용자 정의 필드 상세 정보 조회 실패" |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | // 폼 전송 |
| | | function formSubmit(condition) { |
| | | function formSubmit() { |
| | | $rootScope.spinner = true; |
| | | |
| | | var content = { |
| | | id : parameter.id, |
| | | title : $rootScope.preventXss($scope.vm.form.departmentName), |
| | | description : $rootScope.preventXss($scope.vm.form.departmentDescription) |
| | | departmentName : $rootScope.preventXss($scope.vm.form.departmentName), |
| | | departmentDescription : $rootScope.preventXss($scope.vm.form.departmentDescription) |
| | | }; |
| | | |
| | | UserWorkspace.modifyDepartment($resourceProvider.getContent(condition, |
| | | UserWorkspace.departmentModify($resourceProvider.getContent( |
| | | content, |
| | | $resourceProvider.getPageContent(0, 0))).then(function (result) { |
| | | |
| | |
| | | $(document).unbind("keydown"); // 단축키 이벤트 제거 |
| | | } |
| | | |
| | | $scope.fn.getDepartmentList(); |
| | | $scope.fn.detail(); |
| | | |
| | | }]); |
| | | }); |