From d5d694bc42eadfe36ae99988ab6ebb22769a32e3 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 목, 10 3월 2022 13:10:28 +0900 Subject: [PATCH] - 상위이슈와 그 이슈의 하위이슈를 같이 삭제 할 경우 오류 수정 - 이슈리스트 기본값 '상위이슈만 보기'로 수정 --- src/main/webapp/scripts/app/issue/issueList.controller.js | 726 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 609 insertions(+), 117 deletions(-) diff --git a/src/main/webapp/scripts/app/issue/issueList.controller.js b/src/main/webapp/scripts/app/issue/issueList.controller.js index a0df35a..22929e2 100644 --- a/src/main/webapp/scripts/app/issue/issueList.controller.js +++ b/src/main/webapp/scripts/app/issue/issueList.controller.js @@ -8,9 +8,9 @@ '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) { // �븿�닔 @@ -20,14 +20,18 @@ changePageRowCount : changePageRowCount, // �럹�씠吏� 蹂�寃� makeTableConfigs : makeTableConfigs, // �뀒�씠釉� �꽕�젙 setTableColumn : setTableColumn, // �뀒�씠釉붿쓽 而щ읆�쓣 留뚮뱾�뼱以��떎. + setTreeColumn : setTreeColumn, add : add, // �씠�뒋 �깮�꽦 modify : modify, // �씠�뒋 �닔�젙 + addRelationIssueForm : addRelationIssueForm, // �뿰愿� �씠�뒋 異붽� + addDownIssueForm : addDownIssueForm, // �븯�쐞 �씠�뒋 異붽� modifyMultiIssueStatus : modifyMultiIssueStatus, // �씠�뒋 �떎以� �긽�깭 蹂�寃� removes : removes, // �씠�뒋 �궘�젣 addIssueTableConfig : addIssueTableConfig, // �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 listView : listView, // 紐⑸줉 �솕硫댁쑝濡� 蹂�寃� importExcel : importExcel, // �뿊�� import 湲곕뒫 �뙘�뾽 �샇異� getIssueTypes : getIssueTypes, // �씠�뒋 �쑀�삎 紐⑸줉�쓣 媛��졇�삩�떎. + getUsePartner : getUsePartner, // �씠�뒋 �쑀�삎 蹂� �궗�슜�븯�뒗 �뙆�듃�꼫 紐⑸줉�쓣 媛��졇�삩�떎. getPriorities : getPriorities, // �슦�꽑�닚�쐞 紐⑸줉�쓣 媛��졇�삩�떎. getSeverities : getSeverities, // 以묒슂�룄 紐⑸줉�쓣 媛��졇�삩�떎. getIssueStatuses : getIssueStatuses, // �씠�뒋 �긽�깭 紐⑸줉�쓣 媛��졇�삩�떎. @@ -36,20 +40,28 @@ getVmSearchObject : getVmSearchObject, // ���옣�븳 寃��깋 議곌굔�쓣 媛��졇���꽌 vm �뿉 �뀑�똿�븳�떎. makeSearchConditions : makeSearchConditions, // 寃��깋 議곌굔�쓣 留뚮뱺�떎. getIssueTableConfigs : getIssueTableConfigs, // �궗�슜�옄 �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 媛믪쓣 媛��졇���꽌 �쟻�슜�븳�떎. - startExecute : startExecute // 而⑦듃濡� 濡쒕뵫�떆 泥섏쓬�쑝濡� �떆�옉�릺�뒗 �븿�닔 + startExecute : startExecute, // 而⑦듃濡� 濡쒕뵫�떆 泥섏쓬�쑝濡� �떆�옉�릺�뒗 �븿�닔 + getResponseData : getResponseData, // 而⑦듃濡� 濡쒕뵫�떆 泥섏쓬�쑝濡� �떆�옉�릺�뒗 �븿�닔 + onClickListMode : onClickListMode, // 由ъ뒪�듃 紐⑤뱶 蹂�寃쎌떆 �떎�뻾�릺�뒗 �븿�닔 + setDefaultTableConfig : setDefaultTableConfig // 湲곕낯 �뀒�씠釉� �꽕�젙 �꽭�똿 }; // 蹂��닔 $scope.vm = { + projectId : "", issueTypeId : "", + partnerVos : "", search : { + keyWord : "", // 寃��깋 title : "", // �젣紐� description : "", // �궡�슜 combinationIssueNumber : "", // �씠�뒋 踰덊샇 + issueNumber : "", projectType : "BTS_PROJECT", // �봽濡쒖젥�듃 �쑀�삎 registerDateRange : "", // �벑濡앹씪 湲곌컙 寃��깋 startDateRange : "", // �떆�옉�씪 湲곌컙 寃��깋 completeDateRange : "", // �셿猷뚯씪 湲곌컙 寃��깋 + dateRange : "", // 湲곌컙 寃��깋 severityIds : [], // 以묒슂�룄 寃��깋 priorityIds : [], // �슦�꽑�닚�쐞 寃��깋 issueStatusIds : [], // �씠�뒋 �긽�깭 寃��깋 @@ -61,7 +73,9 @@ selectedPage : 0, selectedPageRowCount : String(10) }, + tableConfigs : [], // �뀒�씠釉� �뀑�똿 �젙蹂� + treeConfigs : [], // �듃由� �뀑�똿 �젙蹂� responseData : { data : [] }, @@ -71,6 +85,7 @@ projects : [], // �봽濡쒖젥�듃 issueStatuses : [], // �씠�뒋 �긽�깭 issueTypes : [], // �씠�뒋 �쑀�삎 + partners : [], // �씠�뒋 �쑀�삎 priorities : [], // �슦�꽑 �닚�쐞 severities : [], // 以묒슂�룄 users : [], // �떞�떦�옄 @@ -78,7 +93,12 @@ registers : [], // �벑濡앹옄 customFields : [], // �궗�슜�옄 �젙�쓽 �븘�뱶 issueTableConfigs : [], // �씠�뒋 �뀒�씠釉� �꽕�젙 - parentIssueId : "" + issueTreeConfigs : [], // �씠�뒋 �뀒�씠釉� �꽕�젙 + parentIssueId : "", + hideCompleteIssue : false, + hideDownIssue : "1", //�씠�뒋紐⑸줉�뿉�꽌 �쟾泥댁씠�뒋蹂닿린 :0 �긽�쐞�씠�뒋留뚮낫湲�: 1 �븯�쐞�씠�뒋留뚮낫湲�:1 + listMode : 0, // 紐⑸줉 紐⑤뱶 0:湲곕낯 由ъ뒪�듃 1:�듃由ш뎄議� 由ъ뒪�듃 + allIssue : false }; // �뀒�씠釉� �씠踰ㅽ듃 @@ -88,17 +108,34 @@ 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.fn.startExecute(); }); + $scope.$on("changedIssueListMenu", function (event, args) { + $scope.vm.search.keyWord = ""; + $rootScope.isMainSearch = false; + //$scope.fn.getPageList($scope.vm.page.selectedPage - 1); + }); + // 寃��깋 議곌굔�쓣 湲곗뼲�븳�떎. - �쟻�슜 蹂대쪟 + // 寃��깋 議곌굔�쓣 湲곗뼲�빐�꽌 �씠�뒋 �긽�꽭 �럹�씠吏�濡� �씠�룞 function makeVmSearchObject() { var content = { conditions : JSON.stringify({ @@ -124,7 +161,7 @@ } // �꽌踰꾩뿉 ���옣�븳 �씠�뒋 寃��깋 議곌굔�쓣 媛��졇�삩�떎. - function getVmSearchObject() { + function getVmSearchObject(keyWord = null, allIssue = false) { IssueSearch.detail($resourceProvider.getContent({}, $resourceProvider.getPageContent(0, 0))).then(function (result) { @@ -133,14 +170,14 @@ var issueListSearchObject = JSON.parse(result.data.data); // �씠�뒋 踰덊샇留� �쟻�슜�븳�떎. - �궘�젣�떆 泥섎━諛⑸쾿�븣臾몄뿉 �떎瑜� �냽�꽦�� �쟻�슜 蹂대쪟 $scope.vm.search = issueListSearchObject.search; - $scope.vm.users = issueListSearchObject.users; - $scope.vm.departments = issueListSearchObject.departments; - $scope.vm.projects = issueListSearchObject.projects; - $scope.vm.registers = issueListSearchObject.registers; + // $scope.vm.users = issueListSearchObject.users; + // $scope.vm.departments = issueListSearchObject.departments; + // $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 { @@ -148,9 +185,10 @@ } }); } + $scope.vm.issueIds = []; // �긽�꽭 �솕硫댁쑝濡� 蹂�寃쏀븳�떎. - function changeDetailView(id) { + function changeDetailView(id, isBack = false) { $scope.vm.tableConfigs = []; $scope.vm.detailView = true; @@ -161,16 +199,22 @@ // �뀒�씠釉붿쓣 �떎�떆 洹몃┫�닔 �엳寃� �뜲�씠�꽣 諛붿씤�뵫�쓣 �떎�떆�븳�떎. 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; // �씠�뒋 �긽�꽭 �솕硫� �슂泥� - $rootScope.$broadcast("getIssueDetail", { - id : id - }); + // $scope.$broadcast("getIssueDetail", { + // id : id + // }); } + // 紐⑸줉 �솕硫댁쑝濡� 蹂�寃쏀븳�떎. function listView() { + $scope.vm.issueIds = []; $scope.vm.detailView = false; // �씠�뒋 �뀒�씠釉� �꽕�젙 $scope.fn.makeTableConfigs(); @@ -178,11 +222,13 @@ $scope.vm.responseData.data = angular.copy(temp); // 留덉�留됱쑝濡� 蹂닿퀬�엳�뜕 �씠�뒋 id瑜� 珥덇린�솕�븳�떎. $rootScope.currentDetailIssueId = null; + $scope.$broadcast("getIssueList", {id: $rootScope.currentDetailIssueId}); } // �씠�뒋 �뀒�씠釉� �꽕�젙 function makeTableConfigs() { $scope.vm.tableConfigs = []; + $scope.vm.treeConfigs = []; $scope.vm.tableConfigs.push($tableProvider.config() .setDType("checkbox") @@ -190,29 +236,97 @@ .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; } - }); + } } } @@ -221,10 +335,20 @@ // �씪諛� 而щ읆 switch(issueTableConfig.key) { + case "ISSUE_TITLE" : // �씠�뒋 �젣紐� + $scope.vm.tableConfigs.push($tableProvider.config() + .setHName("issue.issueTitle") + .setDName("title") + .setDType("renderer") + .setHWidth("bold " + issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("ISSUE_TITLE")); + break; + case "PRIORITY" : // �슦�꽑�닚�쐞 $scope.vm.tableConfigs.push($tableProvider.config() .setHName("common.priority") - .setDName("priorityName") + .setDName("priorityId") .setDType("renderer") .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") @@ -233,22 +357,25 @@ 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") @@ -257,6 +384,7 @@ case "REGISTER" : // �벑濡앹옄 $scope.vm.tableConfigs.push($tableProvider.config() .setHName("common.register") + .setDName("registerId") .setDType("renderer") .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") @@ -277,6 +405,43 @@ .setDAlign("text-center") .setDName("modifyDate")); break; + 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; } // �궗�슜�옄 �젙�쓽 �븘�뱶 而щ읆 @@ -289,6 +454,7 @@ $scope.vm.tableConfigs.push($tableProvider.config() .setHName(customField.name) .setDType("renderer") + .setDName("useValue"+count) .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") .setColumnHint(customField) @@ -317,8 +483,11 @@ // �씠�뒋 寃��깋 議곌굔�쓣 留뚮뱺�떎. 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 : "", @@ -327,12 +496,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; })(), @@ -348,9 +523,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; })(), @@ -443,15 +620,45 @@ 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; @@ -463,38 +670,104 @@ currentPage = selectedPage; } - // 硫붾돱�뿉�꽌 �꽑�깮�맂 �씠�뒋 �쑀�삎�쓣 湲곕낯�쑝濡� 異붽� - if ($rootScope.issueTypeMenu != null) { - // $scope.vm.pageTitle = $rootScope.issueTypeMenu.name; - $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.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.issueTypeId = result.data.data[0].issueTypeId; $scope.vm.page.selectedPage = currentPage + 1; $scope.vm.responseData = result.data; - if (detail) { + + 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; + + if (detail) { + changeDetailView(result.data.data[0].id); + } + } else { + // 媛믪씠 �뾾�쓣�븣 媛믪쓣 �꽔�뼱二쇰젮怨� �븯�뒗 �쓽�룄 + // $scope.vm.responseData = result.data; + result.data = $scope.vm.responseData; + } + } + else { + SweetAlert.error($filter("translate")("issue.failedIssueLookup"), result.data.message.message); // �씠�뒋 議고쉶 �떎�뙣 + } + $rootScope.spinner = false; // �봽濡쒓렇�옒�뒪 諛� + + }); + } + + function getResponseData() { + return $scope.data; + } + + // �씠硫붿씪 �봽濡쒖젥�듃 寃쎈줈濡� �씠�룞 �썑 �긽�꽭 吏꾩엯�떆 議고쉶 + function getDetailList(projectKey, number) { + var conditions = { + projectKey : projectKey, + combinationIssueNumber : number + }; + + Issue.find($resourceProvider.getContent(conditions, + $resourceProvider.getPageContent(0, 1))).then(function (result) { + + if (result.data.message.status === "success") { + if (result.data.data != null && result.data.data.length > 0) { + $scope.vm.projectKey = result.data.data[0].projectKey; + $scope.vm.issueNumber = result.data.data[0].issueNumber; + $scope.vm.responseData = result.data; + changeDetailView(result.data.data[0].id); } } @@ -550,6 +823,7 @@ angular.forEach($scope.vm.responseData.data, function (data) { if (data.checked) { issueIds.push(data.id); + $scope.vm.projectId = data.projectId; } }); @@ -566,7 +840,8 @@ resolve : { parameter : function () { return { - issueIds : issueIds + issueIds : issueIds, + projectId : $scope.vm.projectId }; } } @@ -574,7 +849,7 @@ } // �씠�뒋 �닔�젙 �뙘�뾽 �샇異� - function modify(id) { + function modify(id, downTotalCount) { $uibModal.open({ templateUrl : 'views/issue/issueModify.html', size : "lg", @@ -583,7 +858,47 @@ resolve : { parameter : function () { return { - id : id + id : id, + issueTypeId : $scope.vm.viewer.issueTypeVo.id, + inheritPartners : $scope.vm.viewer.issueTypeVo.inheritPartners, + usePartner : $scope.vm.viewer.usePartnerVos, + downTotalCount : downTotalCount + }; + } + } + }); + } + + function addRelationIssueForm(id, project, issueTypeId) { + $uibModal.open({ + templateUrl : 'views/issue/issueAddRelation.html', + size : "lg", + controller : 'issueAddRelationController', + backdrop : 'static', + resolve : { + 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 }; } } @@ -594,6 +909,7 @@ function removes() { var removeIds = []; var removePermission = true; + var downIssueIds = false; angular.forEach($scope.vm.responseData.data, function (data) { if (data.checked && data.modifyPermissionCheck) { @@ -602,6 +918,10 @@ if (data.checked && !data.modifyPermissionCheck) { removePermission = false; + } + + if (data.downIssueAllCount > 0){ + downIssueIds = true; } }); @@ -624,25 +944,23 @@ 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) { @@ -650,9 +968,7 @@ $timeout(function () { SweetAlert.success($filter("translate")("common.deleteSucceeded"), result.data.message.message); // �궘�젣 �꽦怨� }, 100); - $scope.fn.listView(); - $scope.fn.getPageList(0); } else { @@ -660,11 +976,96 @@ 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; + }); + } + }); + } } // �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 @@ -677,7 +1078,8 @@ resolve : { parameter : function () { return { - issueTypeId : $scope.vm.issueTypeId + issueTypeId : $scope.vm.issueTypeId, + allIssue : $scope.vm.allIssue }; } } @@ -726,6 +1128,29 @@ } else { SweetAlert.swal($filter("translate")("issue.failedToIssueTypeListLookup"), result.data.message.message, "error"); // �씠�뒋 �쑀�삎 紐⑸줉 議고쉶 �떎�뙣 + } + + deferred.resolve(result.data.data); + }); + + return deferred.promise; + } + + // �씠�뒋�쑀�삎 蹂� �뙆�듃�꼫 紐⑸줉 + function getUsePartner() { + var deferred = $q.defer(); + $scope.vm.partners = []; + + Issue.findPartners($resourceProvider.getContent({issueTypeId : $rootScope.getCurrentIssueTypeId()}, + $resourceProvider.getPageContent(0, 1))).then(function (result) { + if (result.data.message.status === "success") { + angular.forEach(result.data.data, function (partner) { + $scope.vm.partners.push(partner); + }); + //$scope.vm.partnerVos = result.data.data; + } + else { + SweetAlert.swal($filter("translate")("issue.failedToPartnerListLookup"), result.data.message.message, "error"); // �뙆�듃�꼫 紐⑸줉 議고쉶 �떎�뙣 } deferred.resolve(result.data.data); @@ -796,6 +1221,12 @@ angular.forEach(result.data.data, function (customField) { switch (customField.customFieldType) { case "INPUT" : + case "NUMBER" : + case "DATETIME" : + case "IP_ADDRESS" : + case "EMAIL" : + case "SITE" : + case "TEL" : customField.useValues = ""; break; @@ -803,8 +1234,8 @@ case "SINGLE_SELECT" : customField.useValues = []; break; - } + } $scope.vm.customFields.push(customField); }); } @@ -819,10 +1250,23 @@ } // �궗�슜�옄 �씠�뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 媛믪쓣 媛��졇���꽌 �쟻�슜�븳�떎. + function getIssueTableConfigs() { var deferred = $q.defer(); - IssueTableConfig.detail($resourceProvider.getContent({}, + 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); // �씠�뒋 �뀒�씠釉� 而щ읆 議고쉶 �떎�뙣 @@ -834,22 +1278,88 @@ 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 }); - $rootScope.previousGetParams = null; - return; + // $rootScope.$broadcast("makeIssueSearch", { projectKey : params.projectKey, issueNumber : params.issueNumber }); + if (params.keyWord != null) { + paramKeyWord = params.keyWord; + }else { + getDetailList(params.projectKey, params.issueNumber); + return; + } + // $rootScope.issueTypeId = $rootScope.issueTypeMenu.id; } + + 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){ @@ -864,48 +1374,30 @@ // �씠�뒋 �뀒�씠釉� �꽕�젙 �젙蹂대�� ���옣 �븳�떎. $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")("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(); } // �씠�뒋 �뀒�씠釉� �꽕�젙 $scope.fn.makeTableConfigs(); - // �꽌踰꾩뿉 ���옣�븳 �씠�뒋 寃��깋 議곌굔�쓣 媛��졇���꽌 �씠�뒋 紐⑸줉 寃��깋�쓣 吏꾪뻾�븳�떎. - $scope.fn.getVmSearchObject(); }); + // �꽌踰꾩뿉 ���옣�븳 �씠�뒋 寃��깋 議곌굔�쓣 媛��졇���꽌 �씠�뒋 紐⑸줉 寃��깋�쓣 吏꾪뻾�븳�떎. + $scope.fn.getVmSearchObject(paramKeyWord, allIssue); }); } + // this.router.navigate(['path/to']) + // .then(() => { + // window.location.reload(); + // }); + + $scope.fn.startExecute(); } + ]); } ); -- Gitblit v1.8.0