| | |
| | | 'angular' |
| | | ], |
| | | function (app, angular) { |
| | | app.controller('issueListController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$tableProvider', '$state', '$uibModal', '$q', |
| | | app.controller('issueListController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$tableProvider', '$treeProvider', '$state', '$uibModal', '$q', |
| | | '$controller', '$injector', 'SweetAlert', 'Issue', 'IssueType', 'Priority', 'Severity', 'IssueStatus', 'CustomField', 'IssueSearch', 'IssueTableConfig', '$timeout', '$filter', |
| | | function ($scope, $rootScope, $log, $resourceProvider, $tableProvider, $state, $uibModal, $q, $controller, $injector, SweetAlert, Issue, IssueType, Priority, Severity, IssueStatus, CustomField, |
| | | function ($scope, $rootScope, $log, $resourceProvider, $tableProvider, $treeProvider, $state, $uibModal, $q, $controller, $injector, SweetAlert, Issue, IssueType, Priority, Severity, IssueStatus, CustomField, |
| | | IssueSearch, IssueTableConfig, $timeout, $filter) { |
| | | |
| | | // 함수 |
| | |
| | | changePageRowCount : changePageRowCount, // 페이지 변경 |
| | | makeTableConfigs : makeTableConfigs, // 테이블 설정 |
| | | setTableColumn : setTableColumn, // 테이블의 컬럼을 만들어준다. |
| | | setTreeColumn : setTreeColumn, |
| | | add : add, // 이슈 생성 |
| | | modify : modify, // 이슈 수정 |
| | | AddRelation : AddRelation, // 연관 이슈 추가 |
| | | addRelationIssueForm : addRelationIssueForm, // 연관 이슈 추가 |
| | | modifyMultiIssueStatus : modifyMultiIssueStatus, // 이슈 다중 상태 변경 |
| | | removes : removes, // 이슈 삭제 |
| | | addIssueTableConfig : addIssueTableConfig, // 이슈 목록 테이블 설정 |
| | |
| | | getVmSearchObject : getVmSearchObject, // 저장한 검색 조건을 가져와서 vm 에 셋팅한다. |
| | | makeSearchConditions : makeSearchConditions, // 검색 조건을 만든다. |
| | | getIssueTableConfigs : getIssueTableConfigs, // 사용자 이슈 목록 테이블 설정 값을 가져와서 적용한다. |
| | | startExecute : startExecute // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | startExecute : startExecute, // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | getResponseData : getResponseData, // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | onClickListMode : onClickListMode, // 리스트 모드 변경시 실행되는 함수 |
| | | setDefaultTableConfig : setDefaultTableConfig // 기본 테이블 설정 세팅 |
| | | }; |
| | | |
| | | // 변수 |
| | |
| | | selectedPageRowCount : String(10) |
| | | }, |
| | | tableConfigs : [], // 테이블 셋팅 정보 |
| | | treeConfigs : [], // 트리 셋팅 정보 |
| | | responseData : { |
| | | data : [] |
| | | }, |
| | |
| | | registers : [], // 등록자 |
| | | customFields : [], // 사용자 정의 필드 |
| | | issueTableConfigs : [], // 이슈 테이블 설정 |
| | | parentIssueId : "" |
| | | issueTreeConfigs : [], // 이슈 테이블 설정 |
| | | parentIssueId : "", |
| | | hideIssue : false, |
| | | listMode : 0, // 목록 모드 0:기본 리스트 1:트리구조 리스트 |
| | | }; |
| | | |
| | | // 테이블 이벤트 |
| | |
| | | |
| | | $scope.$on("changedIssueListMenu", function (event, args) { |
| | | $scope.fn.getPageList($scope.vm.page.selectedPage - 1); |
| | | }); |
| | | |
| | | // 상단 검색시 |
| | | $scope.$on("searchIssueList", function (event, args) { |
| | | $scope.vm.search.keyWord = args.keyWord; |
| | | $scope.fn.getPageList(0); |
| | | $rootScope.isMainSearch = false; |
| | | }); |
| | | |
| | | // 검색 조건을 기억한다. - 적용 보류 |
| | |
| | | // 이슈 테이블 설정 |
| | | function makeTableConfigs() { |
| | | $scope.vm.tableConfigs = []; |
| | | $scope.vm.treeConfigs = []; |
| | | |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setDType("checkbox") |
| | |
| | | .setDAlign("text-center")); |
| | | |
| | | // 상세형 일때때 |
| | | if ($scope.vm.detailView) { |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("issue.issueTitle") |
| | | .setDName("title") |
| | | .setDType("renderer") |
| | | .setHWidth("width-100 bold") |
| | | .setDRenderer("ISSUE_DETAIL_FLOATING")); |
| | | } |
| | | else { |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("issue.issueTitle") |
| | | .setDName("title") |
| | | .setDType("renderer") |
| | | .setHWidth("bold") |
| | | .setDRenderer("ISSUE_DETAIL_FLOATING")); |
| | | // if ($scope.vm.detailView) { |
| | | // $scope.vm.tableConfigs.push($tableProvider.config() |
| | | // .setHName("issue.issueTitle") |
| | | // .setDName("title") |
| | | // .setDType("renderer") |
| | | // .setHWidth("bold") |
| | | // .setDRenderer("ISSUE_DETAIL_FLOATING")); |
| | | // } |
| | | // else { |
| | | // $scope.vm.tableConfigs.push($tableProvider.config() |
| | | // .setHName("issue.issueTitle") |
| | | // .setDName("title") |
| | | // .setDType("renderer") |
| | | // .setHWidth("bold") |
| | | // .setDRenderer("ISSUE_DETAIL_FLOATING")); |
| | | // |
| | | // angular.forEach($scope.vm.issueTableConfigs, function (issueTableConfig) { |
| | | // // 표시 대상인 컬럼만 화면에 그려준다. |
| | | // if (issueTableConfig.display) { |
| | | // // 테이블의 컬럼을 만들어준다. |
| | | // $scope.fn.setTableColumn(issueTableConfig); |
| | | // } |
| | | // }); |
| | | // } |
| | | angular.forEach($scope.vm.issueTableConfigs, function (issueTableConfig) { |
| | | // 표시 대상인 컬럼만 화면에 그려준다. |
| | | if (issueTableConfig.display) { |
| | | // 테이블의 컬럼을 만들어준다. |
| | | $scope.fn.setTableColumn(issueTableConfig); |
| | | $scope.fn.setTreeColumn(issueTableConfig); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | angular.forEach($scope.vm.issueTableConfigs, function (issueTableConfig) { |
| | | // 표시 대상인 컬럼만 화면에 그려준다. |
| | | if (issueTableConfig.display) { |
| | | // 테이블의 컬럼을 만들어준다. |
| | | $scope.fn.setTableColumn(issueTableConfig); |
| | | // 트리 컬럼을 만들어준다. |
| | | function setTreeColumn(issueTableConfig) { |
| | | // 일반 컬럼 |
| | | switch(issueTableConfig.key) { |
| | | case "ISSUE_TITLE" : // 이슈 제목 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("title")); |
| | | break; |
| | | |
| | | case "PRIORITY" : // 우선순위 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("priorityName")); |
| | | break; |
| | | case "SEVERITY" : // 중요도 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("severityName")); |
| | | break; |
| | | case "ISSUE_TYPE" : // 이슈 타입 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("issueTypeName")); |
| | | break; |
| | | case "ASSIGNEE_TEAM" : // 담당부서 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("assigneeTeam")); |
| | | break; |
| | | case "REGISTER" : // 등록자 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("register")); |
| | | break; |
| | | case "PERIOD" : // 기간 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("period")); |
| | | break; |
| | | case "MODIFY_DATE" : // 최근 변경일 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("modifyDate")); |
| | | break; |
| | | case "COUNT_DOWN_ISSUE" : // 하위 이슈 개수 |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDName("countDownIssue")); |
| | | break; |
| | | } |
| | | |
| | | // 사용자 정의 필드 컬럼 |
| | | if (issueTableConfig.key.indexOf("CUSTOM_FIELD_") !== -1) { |
| | | // 만약 이슈 테이블 컬럼명이 표시되지 않으면 이쪽이 문제 |
| | | for (var count in $scope.vm.customFields) { |
| | | var customField = $scope.vm.customFields[count]; |
| | | |
| | | if (customField.id === Number(issueTableConfig.key.substring(13))) { |
| | | $scope.vm.treeConfigs.push($treeProvider.config() |
| | | .setDType("CUSTOM_FIELD") |
| | | .setDName(customField.id) |
| | | .setColumnHint(customField)); |
| | | break; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // 일반 컬럼 |
| | | switch(issueTableConfig.key) { |
| | | case "ISSUE_TITLE" : // 이슈 제목 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("issue.issueTitle") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setDRenderer("ISSUE_TITLE")); |
| | | break; |
| | | |
| | | case "PRIORITY" : // 우선순위 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.priority") |
| | |
| | | case "COUNT_DOWN_ISSUE" : // 하위 이슈 개수 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.countDownIssue") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setDName("downIssueCount")); |
| | | .setDRenderer("DOWN_ISSUE_COUNT")); |
| | | break; |
| | | } |
| | | |
| | |
| | | endStartDate : "", |
| | | beginCompleteDate : "", |
| | | endCompleteDate : "", |
| | | hideIssue : $scope.vm.hideIssue, |
| | | isTree : $scope.vm.listMode === 1, |
| | | projectIds : (function () { |
| | | var projectIds = []; |
| | | |
| | |
| | | return conditions; |
| | | } |
| | | |
| | | function getTreeList() { |
| | | |
| | | } |
| | | |
| | | // 이슈 목록을 조회한다. |
| | | function getPageList(selectedPage, detail = false) { |
| | | $rootScope.spinner = true; // 프로그래스 바 |
| | | if (selectedPage < 0) { |
| | | selectedPage = 0; |
| | | } |
| | | |
| | | if ($scope.vm.hideIssue) { |
| | | $scope.vm.hideIssue = true; |
| | | } |
| | | // 현재 페이지 정보 |
| | | var currentPage = 0; |
| | |
| | | currentPage = selectedPage; |
| | | } |
| | | |
| | | // 메뉴에서 선택된 이슈 유형을 기본으로 추가 |
| | | if ($rootScope.issueTypeMenu != null) { |
| | | // $scope.vm.pageTitle = $rootScope.issueTypeMenu.name; |
| | | $scope.vm.search.issueTypeIds = []; |
| | | $scope.vm.search.issueTypeIds.push({ |
| | | fieldKey : $rootScope.issueTypeMenu.id, |
| | | fieldValue : $rootScope.issueTypeMenu.name |
| | | }); |
| | | } |
| | | |
| | | // 검색 조건을 저장한다. |
| | | //$scope.fn.makeVmSearchObject(); |
| | | |
| | | |
| | | // 현재 선택된 프로젝트를 검색 기본으로 추가 |
| | | if ($rootScope.workProject != null && $rootScope.workProject.id > -1) { |
| | | var find = findProjectSearch($rootScope.workProject.id); |
| | | if (!find) { |
| | | $scope.vm.projects = []; |
| | | $scope.vm.projects.push($rootScope.workProject); |
| | | // 검색 기본값 세팅 |
| | | $scope.vm.search.issueTypeIds = []; |
| | | $scope.vm.projects = []; |
| | | if (!$rootScope.isMainSearch) { |
| | | // 메뉴에서 선택된 이슈 유형을 기본으로 추가 |
| | | if ($rootScope.issueTypeMenu != null) { |
| | | // $scope.vm.pageTitle = $rootScope.issueTypeMenu.name; |
| | | |
| | | $scope.vm.search.issueTypeIds.push({ |
| | | fieldKey: $rootScope.issueTypeMenu.id, |
| | | fieldValue: $rootScope.issueTypeMenu.name |
| | | }); |
| | | } |
| | | |
| | | // 검색 조건을 저장한다. |
| | | //$scope.fn.makeVmSearchObject(); |
| | | |
| | | // 현재 선택된 프로젝트를 검색 기본으로 추가 |
| | | if ($rootScope.workProject != null && $rootScope.workProject.id > -1) { |
| | | var find = findProjectSearch($rootScope.workProject.id); |
| | | if (!find) { |
| | | $scope.vm.projects.push($rootScope.workProject); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | changeDetailView(result.data.data[0].id); |
| | | } |
| | | } else { |
| | | $scope.vm.responseData = null; |
| | | $scope.vm.responseData = result.data; |
| | | } |
| | | |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueLookup"), result.data.message.message); // 이슈 조회 실패 |
| | | } |
| | | $rootScope.spinner = false; // 프로그래스 바 |
| | | |
| | | }); |
| | | } |
| | | |
| | | function getResponseData() { |
| | | return $scope.data; |
| | | } |
| | | |
| | | // 이메일 프로젝트 경로로 이동 후 상세 진입시 조회 |
| | |
| | | }); |
| | | } |
| | | |
| | | function AddRelation(id) { |
| | | function addRelationIssueForm(id) { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/issue/issueAddRelation.html', |
| | | size : "lg", |
| | |
| | | function removes() { |
| | | var removeIds = []; |
| | | var removePermission = true; |
| | | var downIssueIds = false; |
| | | |
| | | angular.forEach($scope.vm.responseData.data, function (data) { |
| | | if (data.checked && data.modifyPermissionCheck) { |
| | |
| | | |
| | | if (data.checked && !data.modifyPermissionCheck) { |
| | | removePermission = false; |
| | | } |
| | | |
| | | if (data.downIssueAllCount > 0){ |
| | | downIssueIds = true; |
| | | } |
| | | }); |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | // 삭제 알림 |
| | | SweetAlert.swal({ |
| | | title : $filter("translate")("issue.deleteIssue"), // 이슈 삭제 |
| | | text : $filter("translate")("issue.wantToDeleteSelectIssue"), // 선택한 이슈을 삭제하겠습니까? 삭제된 이슈은 복구할 수 없습니다. |
| | | if (downIssueIds) { |
| | | SweetAlert.swal({ |
| | | title : $filter("translate")("common.deleteIssue"), // 이슈 삭제 |
| | | text : $filter("translate")("issue.wantToDeleteSelectDownIssue"), // 하위 이슈가 존재 합니다. 선택한 이슈와 하위 이슈 모두 삭제하겠습니까? 삭제된 이슈는 복구할 수 없습니다. |
| | | type : "warning", |
| | | showCancelButton : true, |
| | | confirmButtonColor : "#DD6B55", |
| | | confirmButtonText : $filter("translate")("common.delete"), // 삭제 |
| | | cancelButtonText : $filter("translate")("common.cancel"), // 취소 |
| | | closeOnConfirm : false, |
| | | closeOnCancel : true |
| | | closeOnCancel : false |
| | | }, |
| | | function (isConfirm) { |
| | | SweetAlert.close(); |
| | | |
| | | if (isConfirm) { |
| | | if (isConfirm) { //이슈 + 하위 삭제 |
| | | $rootScope.spinner = true; |
| | | |
| | | Issue.remove($resourceProvider.getContent( |
| | | Issue.removeAllIssues($resourceProvider.getContent( |
| | | { removeIds : removeIds }, |
| | | $resourceProvider.getPageContent(0, 0))).then(function (result) { |
| | | |
| | |
| | | $timeout(function () { |
| | | SweetAlert.success($filter("translate")("common.deleteSucceeded"), result.data.message.message); // 삭제 성공 |
| | | }, 100); |
| | | |
| | | $scope.fn.listView(); |
| | | |
| | | $scope.fn.getPageList(0); |
| | | } |
| | | else { |
| | |
| | | SweetAlert.error($filter("translate")("common.deleteFailed"), result.data.message.message); // 삭제 실패 |
| | | }, 100); |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | |
| | | } else {// 선택 한 이슈만 삭제 |
| | | // 삭제 알림 |
| | | SweetAlert.swal({ |
| | | title : $filter("translate")("issue.deleteIssue"), // 이슈 삭제 |
| | | text : $filter("translate")("issue.wantToDeleteOnlySelectIssue"), // 선택한 이슈만 삭제하겠습니까? 삭제된 이슈은 복구할 수 없습니다. |
| | | 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; |
| | | |
| | | Issue.remove($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.listView(); |
| | | |
| | | $scope.fn.getPageList(0); |
| | | } |
| | | else { |
| | | $timeout(function () { |
| | | SweetAlert.error($filter("translate")("common.deleteFailed"), result.data.message.message); // 삭제 실패 |
| | | }, 100); |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | // 삭제 알림 |
| | | SweetAlert.swal({ |
| | | title : $filter("translate")("issue.deleteIssue"), // 이슈 삭제 |
| | | text : $filter("translate")("issue.wantToDeleteSelectIssue"), // 선택한 이슈을 삭제하겠습니까? 삭제된 이슈은 복구할 수 없습니다. |
| | | 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; |
| | | |
| | | Issue.remove($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.listView(); |
| | | |
| | | $scope.fn.getPageList(0); |
| | | } |
| | | else { |
| | | $timeout(function () { |
| | | SweetAlert.error($filter("translate")("common.deleteFailed"), result.data.message.message); // 삭제 실패 |
| | | }, 100); |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // 이슈 목록 테이블 설정 |
| | |
| | | return deferred.promise; |
| | | } |
| | | |
| | | // 리스트 모드 변경시 실행 |
| | | function onClickListMode(listMode) { |
| | | if ($scope.vm.listMode !== listMode) { |
| | | $scope.vm.listMode = listMode; |
| | | |
| | | if ($scope.vm.listMode === 0) { |
| | | $scope.fn.getPageList(0); |
| | | } else { |
| | | $scope.fn.getPageList(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | function setDefaultTableConfig() { |
| | | // 최초 업무 공간에 들어왔을 경우 |
| | | $scope.vm.issueTableConfigs = [{ |
| | | name : $filter("translate")("issue.issueTitle"), // 이슈 제목 |
| | | key : "ISSUE_TITLE", |
| | | width : "width-140-p", |
| | | position : 1, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("common.priority"), // 우선순위 |
| | | key : "PRIORITY", |
| | | width : "width-80-p", |
| | | position : 2, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("common.importance"), // 중요도 |
| | | key : "SEVERITY", |
| | | width : "width-80-p", |
| | | position : 3, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("issue.issueType"), // 이슈 타입 |
| | | key : "ISSUE_TYPE", |
| | | width : "width-140-p", |
| | | position : 4, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("common.assigneeTeam"), // 담당부서 |
| | | key : "ASSIGNEE_TEAM", |
| | | width : "width-140-p", |
| | | position : 5, |
| | | display : true |
| | | }]; |
| | | } |
| | | |
| | | // 최초 실행 |
| | | function startExecute() { |
| | | // 파라미터 읽기 |
| | |
| | | }); |
| | | } |
| | | else { |
| | | // 최초 업무 공간에 들어왔을 경우 |
| | | $scope.vm.issueTableConfigs = [{ |
| | | name : $filter("translate")("common.priority"), // 우선순위 |
| | | key : "PRIORITY", |
| | | width : "width-80-p", |
| | | position : 1, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("common.importance"), // 중요도 |
| | | key : "SEVERITY", |
| | | width : "width-80-p", |
| | | position : 2, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("issue.issueType"), // 이슈 타입 |
| | | key : "ISSUE_TYPE", |
| | | width : "width-140-p", |
| | | position : 3, |
| | | display : true |
| | | }, { |
| | | name : $filter("translate")("common.assigneeTeam"), // 담당부서 |
| | | key : "ASSIGNEE_TEAM", |
| | | width : "width-140-p", |
| | | position : 4, |
| | | display : true |
| | | }]; |
| | | $scope.fn.setDefaultTableConfig(); |
| | | } |
| | | |
| | | // 이슈 테이블 설정 |