| | |
| | | '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, // 이슈 수정 |
| | | addRelationIssueForm : addRelationIssueForm, // 연관 이슈 추가 |
| | | addDownIssueForm : addDownIssueForm, // 하위 이슈 추가 |
| | | modifyMultiIssueStatus : modifyMultiIssueStatus, // 이슈 다중 상태 변경 |
| | | removes : removes, // 이슈 삭제 |
| | | addIssueTableConfig : addIssueTableConfig, // 이슈 목록 테이블 설정 |
| | |
| | | makeSearchConditions : makeSearchConditions, // 검색 조건을 만든다. |
| | | getIssueTableConfigs : getIssueTableConfigs, // 사용자 이슈 목록 테이블 설정 값을 가져와서 적용한다. |
| | | startExecute : startExecute, // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | getResponseData : getResponseData // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | getResponseData : getResponseData, // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | onClickListMode : onClickListMode, // 리스트 모드 변경시 실행되는 함수 |
| | | setDefaultTableConfig : setDefaultTableConfig // 기본 테이블 설정 세팅 |
| | | }; |
| | | |
| | | // 변수 |
| | | $scope.vm = { |
| | | projectId : "", |
| | | issueTypeId : "", |
| | | partnerVos : "", |
| | | search : { |
| | | keyWord : "", // 전체 검색 |
| | | keyWord : "", // 검색 |
| | | title : "", // 제목 |
| | | description : "", // 내용 |
| | | combinationIssueNumber : "", // 이슈 번호 |
| | | issueNumber : "", |
| | | projectType : "BTS_PROJECT", // 프로젝트 유형 |
| | | registerDateRange : "", // 등록일 기간 검색 |
| | | startDateRange : "", // 시작일 기간 검색 |
| | | completeDateRange : "", // 완료일 기간 검색 |
| | | dateRange : "", // 기간 검색 |
| | | severityIds : [], // 중요도 검색 |
| | | priorityIds : [], // 우선순위 검색 |
| | | issueStatusIds : [], // 이슈 상태 검색 |
| | |
| | | selectedPage : 0, |
| | | selectedPageRowCount : String(10) |
| | | }, |
| | | |
| | | tableConfigs : [], // 테이블 셋팅 정보 |
| | | treeConfigs : [], // 트리 셋팅 정보 |
| | | responseData : { |
| | | data : [] |
| | | }, |
| | |
| | | registers : [], // 등록자 |
| | | customFields : [], // 사용자 정의 필드 |
| | | issueTableConfigs : [], // 이슈 테이블 설정 |
| | | parentIssueId : "" |
| | | issueTreeConfigs : [], // 이슈 테이블 설정 |
| | | parentIssueId : "", |
| | | hideCompleteIssue : false, |
| | | hideDownIssue : true, |
| | | listMode : 0, // 목록 모드 0:기본 리스트 1:트리구조 리스트 |
| | | allIssue : false |
| | | }; |
| | | |
| | | // 테이블 이벤트 |
| | |
| | | |
| | | angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | |
| | | // 이슈목록 새로고침 목록 갱신 |
| | | $scope.$on("findIssueListOK", function (event, args) { |
| | | if (args != null) { |
| | | $scope.fn.startExecute(); |
| | | } |
| | | }); |
| | | |
| | | // 이슈 목록 데이터 갱신 |
| | | $scope.$on("getIssueList", function () { |
| | | $scope.fn.getPageList($scope.vm.page.selectedPage - 1); |
| | | }); |
| | | |
| | | // 이슈 목록 새로고침 |
| | | $rootScope.$on("getIssueList", function (event, args) {}) |
| | | |
| | | // 이슈 테이블 설정 정보 갱신 |
| | | $scope.$on("getIssueTableConfigs", function () { |
| | |
| | | }); |
| | | |
| | | $scope.$on("changedIssueListMenu", function (event, args) { |
| | | $scope.fn.getPageList($scope.vm.page.selectedPage - 1); |
| | | $scope.vm.search.keyWord = ""; |
| | | $rootScope.isMainSearch = false; |
| | | //$scope.fn.getPageList($scope.vm.page.selectedPage - 1); |
| | | }); |
| | | |
| | | // 검색 조건을 기억한다. - 적용 보류 |
| | |
| | | } |
| | | |
| | | // 서버에 저장한 이슈 검색 조건을 가져온다. |
| | | function getVmSearchObject() { |
| | | function getVmSearchObject(keyWord = null, allIssue = false) { |
| | | |
| | | IssueSearch.detail($resourceProvider.getContent({}, $resourceProvider.getPageContent(0, 0))).then(function (result) { |
| | | |
| | |
| | | // $scope.vm.projects = issueListSearchObject.projects; |
| | | // $scope.vm.registers = issueListSearchObject.registers; |
| | | |
| | | $scope.fn.getPageList(0, true); |
| | | $scope.fn.getPageList(0, true, keyWord, allIssue); |
| | | } else { |
| | | $scope.fn.getPageList(0); |
| | | $scope.fn.getPageList(0, false, keyWord, allIssue); |
| | | } |
| | | } |
| | | else { |
| | |
| | | } |
| | | }); |
| | | } |
| | | $scope.vm.issueIds = []; |
| | | |
| | | // 상세 화면으로 변경한다. |
| | | function changeDetailView(id) { |
| | | function changeDetailView(id, isBack = false) { |
| | | $scope.vm.tableConfigs = []; |
| | | $scope.vm.detailView = true; |
| | | |
| | |
| | | // 테이블을 다시 그릴수 있게 데이터 바인딩을 다시한다. |
| | | var temp = angular.copy($scope.vm.responseData.data); |
| | | $scope.vm.responseData.data = angular.copy(temp); |
| | | |
| | | if (!isBack) { |
| | | $scope.vm.issueIds.push(id); |
| | | } |
| | | // 현재 상세화면으로 보려고하는 이슈 id를 기억한다. |
| | | $rootScope.currentDetailIssueId = id; |
| | | // 이슈 상세 화면 요청 |
| | |
| | | |
| | | // 목록 화면으로 변경한다. |
| | | function listView() { |
| | | $scope.vm.issueIds = []; |
| | | $scope.vm.detailView = false; |
| | | // 이슈 테이블 설정 |
| | | $scope.fn.makeTableConfigs(); |
| | |
| | | // 이슈 테이블 설정 |
| | | function makeTableConfigs() { |
| | | $scope.vm.tableConfigs = []; |
| | | $scope.vm.treeConfigs = []; |
| | | |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setDType("checkbox") |
| | |
| | | if (issueTableConfig.display) { |
| | | // 테이블의 컬럼을 만들어준다. |
| | | $scope.fn.setTableColumn(issueTableConfig); |
| | | $scope.fn.setTreeColumn(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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 테이블의 컬럼을 만들어준다. |
| | |
| | | case "ISSUE_TITLE" : // 이슈 제목 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("issue.issueTitle") |
| | | .setDName("title") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | |
| | | case "PRIORITY" : // 우선순위 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.priority") |
| | | .setDName("priorityName") |
| | | .setDName("priorityId") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | |
| | | case "SEVERITY" : // 중요도 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.importance") |
| | | .setDName("severityName") |
| | | .setDName("severityId") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setDRenderer("COMMON_SEVERITY")); |
| | | break; |
| | | case "ISSUE_TYPE" : // 이슈 타입 |
| | | case "ISSUE_TYPE" : // 이슈 유형 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("issue.issueType") |
| | | .setDName("issueTypeId") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setDName("issueTypeName")); |
| | | .setDRenderer("COMMON_ISSUE_TYPE")); |
| | | break; |
| | | case "ASSIGNEE_TEAM" : // 담당부서 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.assigneeTeam") |
| | | .setDName("departmentName") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | |
| | | case "REGISTER" : // 등록자 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.register") |
| | | .setDName("registerId") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | |
| | | case "COUNT_DOWN_ISSUE" : // 하위 이슈 개수 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.countDownIssue") |
| | | .setDName("downIssueCount") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setColumnTooltip("미완료 하위이슈/전체 하위이슈") |
| | | .setDRenderer("DOWN_ISSUE_COUNT")); |
| | | break; |
| | | case "COMPANY" : // 업체 |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.company") |
| | | .setDName("companyName") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setDRenderer("USE_COMPANY")); |
| | | break; |
| | | case "ISP" : // ISP |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.isp") |
| | | .setDName("ispName") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setDRenderer("USE_ISP")); |
| | | break; |
| | | case "HOSTING" : // HOSTING |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("common.hosting") |
| | | .setDName("hostingName") |
| | | .setDType("renderer") |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setDRenderer("USE_HOSTING")); |
| | | break; |
| | | } |
| | | |
| | | // 사용자 정의 필드 컬럼 |
| | | if (issueTableConfig.key.indexOf("CUSTOM_FIELD_") !== -1) { |
| | | let cnt = -1; |
| | | |
| | | // 만약 이슈 테이블 컬럼명이 표시되지 않으면 이쪽이 문제 |
| | | for (var count in $scope.vm.customFields) { |
| | | var customField = $scope.vm.customFields[count]; |
| | | |
| | | if (customField.id === Number(issueTableConfig.key.substring(13))) { |
| | | cnt ++; |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName(customField.name) |
| | | .setDType("renderer") |
| | | .setDName("useValue"+cnt) /* todo 체크*/ |
| | | .setHWidth("bold " + issueTableConfig.width) |
| | | .setDAlign("text-center") |
| | | .setColumnHint(customField) |
| | | .setDRenderer("ISSUE_CUSTOM_FIELD_VALUE_VIEW")); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | // 이슈 검색 조건을 만든다. |
| | | function makeSearchConditions() { |
| | | var conditions = { |
| | | allIssue : $scope.vm.allIssue, |
| | | keyWord : $scope.vm.search.keyWord, |
| | | title : $scope.vm.search.title, |
| | | description : $scope.vm.search.description, |
| | | issueNumber : $scope.vm.search.issueNumber, |
| | | projectType : $scope.vm.search.projectType, |
| | | combinationIssueNumber : $scope.vm.search.combinationIssueNumber.trim(), |
| | | beginRegisterDate : "", |
| | |
| | | endStartDate : "", |
| | | beginCompleteDate : "", |
| | | endCompleteDate : "", |
| | | dateRange: "", |
| | | hideCompleteIssue: $scope.vm.hideCompleteIssue, |
| | | hideDownIssue : $scope.vm.hideDownIssue, |
| | | isTree : $scope.vm.listMode === 1, |
| | | projectIds : (function () { |
| | | var projectIds = []; |
| | | |
| | | angular.forEach($scope.vm.projects, function (project) { |
| | | projectIds.push(project.id); |
| | | }); |
| | | if (!$scope.vm.allIssue) { //전체 키워드 검색이 아닐 경우에만 프로젝트ID push |
| | | angular.forEach($scope.vm.projects, function (project) { |
| | | projectIds.push(project.id); |
| | | }); |
| | | } |
| | | |
| | | return projectIds; |
| | | })(), |
| | |
| | | issueTypeIds : (function () { |
| | | var issueTypeIds = []; |
| | | |
| | | angular.forEach($scope.vm.search.issueTypeIds, function (issueTypeId) { |
| | | issueTypeIds.push(issueTypeId.fieldKey); |
| | | }); |
| | | if (!$scope.vm.allIssue) { //전체 키워드 검색이 아닐 경우에만 이슈유형ID push |
| | | angular.forEach($scope.vm.search.issueTypeIds, function (issueTypeId) { |
| | | issueTypeIds.push(issueTypeId.fieldKey); |
| | | }); |
| | | } |
| | | |
| | | return issueTypeIds; |
| | | })(), |
| | |
| | | conditions.beginCompleteDate = completeDateRange[0].trim(); |
| | | conditions.endCompleteDate = completeDateRange[1].trim(); |
| | | } |
| | | // 기간 |
| | | if ($rootScope.isDefined($scope.vm.search.dateRange)) { |
| | | conditions.dateRange = $scope.vm.search.dateRange.trim(); |
| | | } |
| | | |
| | | return conditions; |
| | | |
| | | } |
| | | |
| | | function getTreeList() { |
| | | |
| | | } |
| | | |
| | | // 이슈 목록을 조회한다. |
| | | function getPageList(selectedPage, detail = false) { |
| | | function getPageList(selectedPage, detail = false, keyWord = null, allIssue = false) { |
| | | $rootScope.spinner = true; // 프로그래스 바 |
| | | if (selectedPage < 0) { |
| | | selectedPage = 0; |
| | | } |
| | | if (allIssue) { |
| | | $scope.vm.allIssue = true; |
| | | $rootScope.$broadcast("getAllIssuePageList"); |
| | | } |
| | | |
| | | if (keyWord != null) { |
| | | $scope.vm.search.keyWord = keyWord; |
| | | $rootScope.isMainSearch = true; |
| | | $scope.vm.allIssue = true; |
| | | $rootScope.$broadcast("getPageListKeyWord", {keyWord: $scope.vm.search.keyWord}); |
| | | } |
| | | |
| | | if ($scope.vm.hideCompleteIssue) { |
| | | $scope.vm.hideCompleteIssue = true; |
| | | } |
| | | |
| | | if ($scope.vm.hideDownIssue) { |
| | | $scope.vm.hideDownIssue = 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.vm.search.issueTypeIds = []; |
| | | $scope.vm.projects = []; |
| | | if (!$scope.vm.allIssue && keyWord == null || keyWord === '') { |
| | | // 메뉴에서 선택된 이슈 유형을 기본으로 추가 |
| | | if ($rootScope.issueTypeMenu != null) { |
| | | $scope.vm.pageTitle = $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.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); |
| | | } |
| | | } |
| | | //$scope.vm.searchAll.keyWord = ""; |
| | | } |
| | | |
| | | // 이슈 검색 조건을 만든다. |
| | | var conditions = $scope.fn.makeSearchConditions(); |
| | | |
| | | if ($rootScope.previousGetParams != null) |
| | | $rootScope.previousGetParams = null; |
| | | |
| | | Issue.find($resourceProvider.getContent(conditions, |
| | | $resourceProvider.getPageContent(currentPage, $scope.vm.page.selectedPageRowCount))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.page.selectedPage = currentPage + 1; |
| | | $scope.vm.responseData = result.data; |
| | | |
| | | if (result.data.data != null && result.data.data.length > 0) { |
| | | //var resultSize = result.data.data.length; |
| | | for (var i = 0; i < result.data.data.length; i++) { |
| | | /*if (result.data.data[i].parentIssueId != null) {//하위이슈는 리스트에서 삭제 |
| | | result.data.data.splice(i, 1); |
| | | i--; |
| | | }else*/ |
| | | if ($scope.vm.search.issueTypeIds !== null && $scope.vm.search.issueTypeIds.length > 0 |
| | | && result.data.data[i].issueTypeId !== $scope.vm.search.issueTypeIds[0].fieldKey) { //이슈타입 체크 |
| | | result.data.data.splice(i, 1); |
| | | i--; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (result.data.data != null && result.data.data.length > 0) { |
| | | $scope.vm.issueTypeId = result.data.data[0].issueTypeId; |
| | | $scope.vm.projectKey = result.data.data[0].projectKey; |
| | | $scope.vm.issueNumber = result.data.data[0].issueNumber; |
| | | $scope.vm.projectName = result.data.data[0].projectName; |
| | | $scope.vm.page.selectedPage = currentPage + 1; |
| | | $scope.vm.responseData = result.data; |
| | | |
| | | if (detail) { |
| | | changeDetailView(result.data.data[0].id); |
| | | } |
| | | } else { |
| | | $scope.vm.responseData = result.data; |
| | | // 값이 없을때 값을 넣어주려고 하는 의도 |
| | | // $scope.vm.responseData = result.data; |
| | | result.data = $scope.vm.responseData; |
| | | } |
| | | |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueLookup"), result.data.message.message); // 이슈 조회 실패 |
| | | } |
| | | $rootScope.spinner = false; // 프로그래스 바 |
| | | |
| | | }); |
| | | } |
| | |
| | | angular.forEach($scope.vm.responseData.data, function (data) { |
| | | if (data.checked) { |
| | | issueIds.push(data.id); |
| | | $scope.vm.projectId = data.projectId; |
| | | } |
| | | }); |
| | | |
| | |
| | | resolve : { |
| | | parameter : function () { |
| | | return { |
| | | issueIds : issueIds |
| | | issueIds : issueIds, |
| | | projectId : $scope.vm.projectId |
| | | }; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // 이슈 수정 팝업 호출 |
| | | function modify(id) { |
| | | function modify(id, downTotalCount) { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/issue/issueModify.html', |
| | | size : "lg", |
| | |
| | | parameter : function () { |
| | | return { |
| | | id : id, |
| | | issueTypeId : $scope.vm.viewer.issueTypeVo.id, |
| | | inheritPartners : $scope.vm.viewer.issueTypeVo.inheritPartners, |
| | | downTotalCount : downTotalCount |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function addRelationIssueForm(id) { |
| | | function addRelationIssueForm(id, project, issueTypeId) { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/issue/issueAddRelation.html', |
| | | size : "lg", |
| | |
| | | parameter : function () { |
| | | return { |
| | | id : id, |
| | | project : project, |
| | | issueTypeId : issueTypeId |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function addDownIssueForm(id, project, issueTypeId) { |
| | | $uibModal.open({ |
| | | templateUrl : 'views/issue/issueAddDown.html', |
| | | size : "lg", |
| | | controller : 'issueAddDownController', |
| | | backdrop : 'static', |
| | | resolve : { |
| | | parameter : function () { |
| | | return { |
| | | id : id, |
| | | project : project, |
| | | issueTypeId : issueTypeId |
| | | }; |
| | | } |
| | | } |
| | |
| | | resolve : { |
| | | parameter : function () { |
| | | return { |
| | | issueTypeId : $scope.vm.issueTypeId |
| | | issueTypeId : $scope.vm.issueTypeId, |
| | | allIssue : $scope.vm.allIssue |
| | | }; |
| | | } |
| | | } |
| | |
| | | var deferred = $q.defer(); |
| | | $scope.vm.partners = []; |
| | | |
| | | Issue.findPartners($resourceProvider.getContent({}, |
| | | Issue.findPartners($resourceProvider.getContent({issueTypeId : $rootScope.getCurrentIssueTypeId()}, |
| | | $resourceProvider.getPageContent(0, 1))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.partnerVos = result.data.content; |
| | | angular.forEach(result.data.data, function (partner) { |
| | | $scope.vm.partners.push(partner); |
| | | }); |
| | | //$scope.vm.partnerVos = result.data.data; |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToPriorityListLookup"), result.data.message.message, "error"); // 우선순위 목록 조회 실패 |
| | | SweetAlert.swal($filter("translate")("issue.failedToPartnerListLookup"), result.data.message.message, "error"); // 파트너 목록 조회 실패 |
| | | } |
| | | |
| | | deferred.resolve(result.data.data); |
| | |
| | | break; |
| | | |
| | | } |
| | | |
| | | $scope.vm.customFields.push(customField); |
| | | }); |
| | | } |
| | |
| | | function getIssueTableConfigs() { |
| | | var deferred = $q.defer(); |
| | | |
| | | if ($rootScope.issueTypeMenu != null){ |
| | | var content = { |
| | | issueTypeId : $rootScope.issueTypeMenu.id |
| | | var content = { |
| | | issueTypeId : (function () { |
| | | var id = ""; |
| | | if ($rootScope.allIssueList) { |
| | | id = -1; |
| | | } else { |
| | | id = $rootScope.getCurrentIssueTypeId(); |
| | | } |
| | | |
| | | IssueTableConfig.detail($resourceProvider.getContent(content, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | if (result.data.message.status !== "success") { |
| | | SweetAlert.error($filter("translate")("issue.failedToIssueTableColumnLookup"), result.data.message.message); // 이슈 테이블 컬럼 조회 실패 |
| | | } |
| | | |
| | | deferred.resolve(result.data.data); |
| | | }); |
| | | return id; |
| | | })() |
| | | } |
| | | |
| | | IssueTableConfig.detail($resourceProvider.getContent(content, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | if (result.data.message.status !== "success") { |
| | | SweetAlert.error($filter("translate")("issue.failedToIssueTableColumnLookup"), result.data.message.message); // 이슈 테이블 컬럼 조회 실패 |
| | | } |
| | | |
| | | deferred.resolve(result.data.data); |
| | | }); |
| | | |
| | | 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() { |
| | | // 이슈 상세화면 이슈 이동 내역 저장 |
| | | $scope.vm.issueIds = []; |
| | | // 쿠키 읽기 |
| | | var paramKeyWord = null; |
| | | |
| | | var keyWord = $rootScope.getCookie("searchKeyword"); |
| | | if (keyWord != null && keyWord !== '') { |
| | | paramKeyWord = keyWord; |
| | | $rootScope.deleteCookie("searchKeyword"); |
| | | } |
| | | |
| | | // 파라미터 읽기 |
| | | var params = $rootScope.previousGetParams; |
| | | if ($rootScope.isDefined(params)) { |
| | | // $rootScope.$broadcast("makeIssueSearch", { projectKey : params.projectKey, issueNumber : params.issueNumber }); |
| | | getDetailList(params.projectKey, params.issueNumber); |
| | | $rootScope.previousGetParams = null; |
| | | if (params.keyWord != null) { |
| | | paramKeyWord = params.keyWord; |
| | | }else { |
| | | getDetailList(params.projectKey, params.issueNumber); |
| | | return; |
| | | } |
| | | // $rootScope.issueTypeId = $rootScope.issueTypeMenu.id; |
| | | return; |
| | | } |
| | | |
| | | var allIssue = $rootScope.allIssueList; |
| | | |
| | | var promises = { |
| | | getIssueTypes : $scope.fn.getIssueTypes(), |
| | | getPriorities : $scope.fn.getPriorities(), |
| | | getSeverities : $scope.fn.getSeverities(), |
| | | getIssueStatuses : $scope.fn.getIssueStatuses(), |
| | | getCustomFields : $scope.fn.getCustomFields() |
| | | getCustomFields : $scope.fn.getCustomFields(), |
| | | }; |
| | | |
| | | $q.all(promises).then(function (results){ |
| | |
| | | // 이슈 테이블 설정 정보를 저장 한다. |
| | | $scope.vm.issueTableConfigs = JSON.parse(issueTableConfigs); |
| | | $scope.vm.issueTableConfigs.sort(function (a, b) { |
| | | return a.position < b.position ? -1 : a.position > b.position ? 1: 0; |
| | | return parseInt(a.position) < parseInt(b.position) ? -1 : parseInt(a.position) > parseInt(b.position) ? 1 : 0; |
| | | }); |
| | | } |
| | | else { |
| | | // 최초 업무 공간에 들어왔을 경우 |
| | | $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 |
| | | }]; |
| | | $scope.fn.setDefaultTableConfig(); |
| | | } |
| | | |
| | | // 이슈 테이블 설정 |
| | | $scope.fn.makeTableConfigs(); |
| | | // 서버에 저장한 이슈 검색 조건을 가져와서 이슈 목록 검색을 진행한다. |
| | | $scope.fn.getVmSearchObject(); |
| | | }); |
| | | // 서버에 저장한 이슈 검색 조건을 가져와서 이슈 목록 검색을 진행한다. |
| | | $scope.fn.getVmSearchObject(paramKeyWord, allIssue); |
| | | }); |
| | | } |
| | | |
| | | // this.router.navigate(['path/to']) |
| | | // .then(() => { |
| | | // window.location.reload(); |
| | | // }); |
| | | |
| | | |
| | | $scope.fn.startExecute(); |
| | | } |
| | | |