| | |
| | | 'angular' |
| | | ], |
| | | function (app, angular) { |
| | | app.controller('workflowAddController', ['$scope', '$rootScope', '$log', '$resourceProvider', 'User', '$uibModalInstance', 'Workflow', 'SweetAlert', 'IssueStatus', '$filter', |
| | | app.controller('workflowAddController', ['$scope', '$rootScope', '$log', '$resourceProvider', 'User', '$uibModalInstance', 'Workflow', 'SweetAlert', 'IssueStatus', '$filter', '$injector','$controller', |
| | | function ($scope, $rootScope, $log, $resourceProvider, User, $uibModalInstance, Workflow, SweetAlert, IssueStatus, $filter) { |
| | | |
| | | $scope.fn = { |
| | | cancel : cancel, // 팝업 창 닫기 |
| | | formSubmit : formSubmit, // 폼 전송 |
| | | formCheck : formCheck, // 폼 체크 |
| | | getDepartments : getDepartments // 부서 목록 가져오기 |
| | | }; |
| | | |
| | | $scope.vm = { |
| | | form : { |
| | | name : "", // 워크플로우 명 |
| | | issueStatusVos : [] // 다이어그램에서 만들어진 이슈 상태 모음 |
| | | issueStatusVos : [], // 다이어그램에서 만들어진 이슈 상태 모음 |
| | | WorkflowDepartmentVos : [ |
| | | { |
| | | departmentVo : null |
| | | } |
| | | ] |
| | | }, |
| | | issueStatusVos : [], // 다이어그램 에디터에서 이 값을 감지하면서 조회가 시작된다. |
| | | step : "01", |
| | |
| | | firstStatusExist : true, // 워크플로우에 상태 속성 '대기'인 상태가 존재하는지 체크한다. |
| | | middleStatusExist : true, // 워크플로우에 상태 속성 '진행'인 상태가 존재하는지 체크한다. |
| | | lastStatusExist : true, // 워크플로우에 상태 속성 '종료'인 상태가 존재하는지 체크한다. |
| | | departments : [] // 부서 목록 |
| | | }; |
| | | |
| | | |
| | | |
| | | // 폼 체크 |
| | | function formCheck(formInvalid) { |
| | |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // 부서 목록 가져오기 |
| | | function getDepartments() { |
| | | var content = { |
| | | // 추후 변경을 위함 |
| | | }; |
| | | |
| | | Workflow.findDepartments($resourceProvider.getContent( |
| | | content, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.departments = result.data.data; |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("managementWorkflow.failedToSelectWorkspaceFullDepartmentList"), result.data.message.message); // 부서 목록 조회 실패 |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | // 폼 전송 |
| | |
| | | $uibModalInstance.dismiss('cancel'); |
| | | $(document).unbind("keydown"); // 단축키 이벤트 제거 |
| | | } |
| | | |
| | | $scope.fn.getDepartments(); |
| | | }]); |
| | | }); |