From 612b5a21417f3c8dcaed84c1c0691dc883088f61 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 금, 18 2월 2022 18:04:14 +0900 Subject: [PATCH] 이슈 컬럼 정렬 진행 --- src/main/webapp/scripts/app/issue/issueList.controller.js | 112 ++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 73 insertions(+), 39 deletions(-) diff --git a/src/main/webapp/scripts/app/issue/issueList.controller.js b/src/main/webapp/scripts/app/issue/issueList.controller.js index 8f38e3d..03f3cc1 100644 --- a/src/main/webapp/scripts/app/issue/issueList.controller.js +++ b/src/main/webapp/scripts/app/issue/issueList.controller.js @@ -61,6 +61,7 @@ registerDateRange : "", // �벑濡앹씪 湲곌컙 寃��깋 startDateRange : "", // �떆�옉�씪 湲곌컙 寃��깋 completeDateRange : "", // �셿猷뚯씪 湲곌컙 寃��깋 + dateRange : "", // 湲곌컙 寃��깋 severityIds : [], // 以묒슂�룄 寃��깋 priorityIds : [], // �슦�꽑�닚�쐞 寃��깋 issueStatusIds : [], // �씠�뒋 �긽�깭 寃��깋 @@ -97,6 +98,7 @@ hideCompleteIssue : false, hideDownIssue : true, listMode : 0, // 紐⑸줉 紐⑤뱶 0:湲곕낯 由ъ뒪�듃 1:�듃由ш뎄議� 由ъ뒪�듃 + allIssue : false }; // �뀒�씠釉� �씠踰ㅽ듃 @@ -159,7 +161,7 @@ } // �꽌踰꾩뿉 ���옣�븳 �씠�뒋 寃��깋 議곌굔�쓣 媛��졇�삩�떎. - function getVmSearchObject(keyWord = null) { + function getVmSearchObject(keyWord = null, allIssue = false) { IssueSearch.detail($resourceProvider.getContent({}, $resourceProvider.getPageContent(0, 0))).then(function (result) { @@ -173,9 +175,9 @@ // $scope.vm.projects = issueListSearchObject.projects; // $scope.vm.registers = issueListSearchObject.registers; - $scope.fn.getPageList(0, true, keyWord); + $scope.fn.getPageList(0, true, keyWord, allIssue); } else { - $scope.fn.getPageList(0, false, keyWord); + $scope.fn.getPageList(0, false, keyWord, allIssue); } } else { @@ -336,7 +338,7 @@ case "ISSUE_TITLE" : // �씠�뒋 �젣紐� $scope.vm.tableConfigs.push($tableProvider.config() .setHName("issue.issueTitle") - .setDName("issueNumber") /* todo �씠嫄� ���씠��濡� 蹂�寃쏀빐�빞�븯�뒗�뜲*/ + .setDName("title") .setDType("renderer") .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") @@ -373,7 +375,7 @@ case "ASSIGNEE_TEAM" : // �떞�떦遺��꽌 $scope.vm.tableConfigs.push($tableProvider.config() .setHName("common.assigneeTeam") - .setDName("departmentName") /* todo 泥댄겕*/ + .setDName("departmentName") .setDType("renderer") .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") @@ -391,7 +393,6 @@ case "PERIOD" : // 湲곌컙 $scope.vm.tableConfigs.push($tableProvider.config() .setHName("common.period") - .setDName("startDate") .setDType("renderer") .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") @@ -445,20 +446,22 @@ // �궗�슜�옄 �젙�쓽 �븘�뱶 而щ읆 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" + [count]) /* todo 泥댄겕*/ + .setDName("useValue"+cnt) /* todo 泥댄겕*/ .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") .setColumnHint(customField) .setDRenderer("ISSUE_CUSTOM_FIELD_VALUE_VIEW")); - break; } } } @@ -482,6 +485,7 @@ // �씠�뒋 寃��깋 議곌굔�쓣 留뚮뱺�떎. function makeSearchConditions() { var conditions = { + allIssue : $scope.vm.allIssue, keyWord : $scope.vm.search.keyWord, title : $scope.vm.search.title, description : $scope.vm.search.description, @@ -494,15 +498,18 @@ 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; })(), @@ -518,9 +525,11 @@ 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; })(), @@ -613,6 +622,10 @@ 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; @@ -623,16 +636,20 @@ } // �씠�뒋 紐⑸줉�쓣 議고쉶�븳�떎. - function getPageList(selectedPage, detail = false, keyWord = null) { + 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}); } @@ -657,10 +674,10 @@ // 寃��깋 湲곕낯媛� �꽭�똿 $scope.vm.search.issueTypeIds = []; $scope.vm.projects = []; - if (keyWord == null || keyWord === '') { + if (!$scope.vm.allIssue && keyWord == null || keyWord === '') { // 硫붾돱�뿉�꽌 �꽑�깮�맂 �씠�뒋 �쑀�삎�쓣 湲곕낯�쑝濡� 異붽� if ($rootScope.issueTypeMenu != null) { - //$scope.vm.pageTitle = $rootScope.issueTypeMenu.name; + $scope.vm.pageTitle = $rootScope.issueTypeMenu.name; $scope.vm.search.issueTypeIds.push({ fieldKey: $rootScope.issueTypeMenu.id, @@ -691,6 +708,9 @@ $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++) { @@ -711,8 +731,6 @@ $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); @@ -832,7 +850,7 @@ } // �씠�뒋 �닔�젙 �뙘�뾽 �샇異� - function modify(id) { + function modify(id, downTotalCount) { $uibModal.open({ templateUrl : 'views/issue/issueModify.html', size : "lg", @@ -842,13 +860,16 @@ 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", @@ -858,13 +879,15 @@ parameter : function () { return { id : id, + project : project, + issueTypeId : issueTypeId }; } } }); } - function addDownIssueForm(id) { + function addDownIssueForm(id, project, issueTypeId) { $uibModal.open({ templateUrl : 'views/issue/issueAddDown.html', size : "lg", @@ -874,6 +897,8 @@ parameter : function () { return { id : id, + project : project, + issueTypeId : issueTypeId }; } } @@ -1053,7 +1078,8 @@ resolve : { parameter : function () { return { - issueTypeId : $scope.vm.issueTypeId + issueTypeId : $scope.vm.issueTypeId, + allIssue : $scope.vm.allIssue }; } } @@ -1228,20 +1254,26 @@ function getIssueTableConfigs() { var deferred = $q.defer(); - if ($rootScope.issueTypeMenu != null){ - var content = { - issueTypeId : $rootScope.getCurrentIssueTypeId() + var content = { + issueTypeId : (function () { + var id = ""; + if ($rootScope.allIssueList) { + id = -1; + } else { + id = $rootScope.getCurrentIssueTypeId(); + } + 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); // �씠�뒋 �뀒�씠釉� 而щ읆 議고쉶 �떎�뙣 } - 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); - }); - } + deferred.resolve(result.data.data); + }); return deferred.promise; } @@ -1320,6 +1352,8 @@ // $rootScope.issueTypeId = $rootScope.issueTypeMenu.id; } + var allIssue = $rootScope.allIssueList; + var promises = { getIssueTypes : $scope.fn.getIssueTypes(), getPriorities : $scope.fn.getPriorities(), @@ -1340,7 +1374,7 @@ // �씠�뒋 �뀒�씠釉� �꽕�젙 �젙蹂대�� ���옣 �븳�떎. $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 { @@ -1349,9 +1383,9 @@ // �씠�뒋 �뀒�씠釉� �꽕�젙 $scope.fn.makeTableConfigs(); - // �꽌踰꾩뿉 ���옣�븳 �씠�뒋 寃��깋 議곌굔�쓣 媛��졇���꽌 �씠�뒋 紐⑸줉 寃��깋�쓣 吏꾪뻾�븳�떎. - $scope.fn.getVmSearchObject(paramKeyWord); }); + // �꽌踰꾩뿉 ���옣�븳 �씠�뒋 寃��깋 議곌굔�쓣 媛��졇���꽌 �씠�뒋 紐⑸줉 寃��깋�쓣 吏꾪뻾�븳�떎. + $scope.fn.getVmSearchObject(paramKeyWord, allIssue); }); } -- Gitblit v1.8.0