From 12e19e0b8bc5e728169dad54c132e7ccd41973a4 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 월, 14 3월 2022 12:55:35 +0900 Subject: [PATCH] Merge branch 'master' of http://192.168.0.28:9001/r/owl-kisa --- src/main/webapp/scripts/app/issue/issueDetail.controller.js | 390 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 323 insertions(+), 67 deletions(-) diff --git a/src/main/webapp/scripts/app/issue/issueDetail.controller.js b/src/main/webapp/scripts/app/issue/issueDetail.controller.js index 865d992..962075f 100644 --- a/src/main/webapp/scripts/app/issue/issueDetail.controller.js +++ b/src/main/webapp/scripts/app/issue/issueDetail.controller.js @@ -51,9 +51,14 @@ $scope.fn.containsPartner = containsPartner; $scope.fn.onActivate = onActivate; $scope.fn.issueBack = issueBack; + $scope.fn.goParentIssue = goParentIssue; $scope.fn.removeRelationIssue = removeRelationIssue; $scope.fn.removeDownIssue = removeDownIssue; + $scope.fn.changeDetailPageRowCount = changeDetailPageRowCount; // �럹�씠吏� 蹂�寃� $scope.fn.sendCommonMail = sendCommonMail; + $scope.fn.getSubPageContent = getSubPageContent; + + $scope.vm.hideCompleteIssue = true; // �씠�뒋 紐⑸줉 而⑦듃濡ㅻ윭 vm, fn �긽�냽 以� $scope.vm.viewer = {}; // �쁽�옱 �씠�뒋 @@ -90,6 +95,16 @@ issueHostingVos : [] }; + $scope.vm.responseData = { + data : [] + }; + + $scope.vm.subPage = { + selectedRelPage : 0, + selectedRelPageRowCount : String(10), + selectedDownPage : 0, + selectedDownPageRowCount : String(10) + }; $scope.vm.issueNameDown = ""; // �꽑�깮�맂 �븯�쐞 �씪媛� �씠由� $scope.vm.autoCompletePageDown = { @@ -101,6 +116,7 @@ $scope.vm.issueName = ""; // �꽑�깮�맂 �뿰愿� �씪媛� �씠由� $scope.vm.issueId = ""; // + $scope.vm.parentIssueId = ""; $scope.vm.issueTypeId = ""; $scope.vm.autoCompletePage = { issue : { @@ -108,6 +124,9 @@ totalPage : 0 }, }; + + $scope.vm.inheritPartners = ""; + $scope.vm.downTotalCount = ""; $scope.vm.relResponseData = []; $scope.vm.relTableConfigs = []; @@ -133,7 +152,7 @@ $scope.fn.onActivate(); } - // �긽�쐞 �씠�뒋 �겢由��떆 �긽�쐞 �씠�뒋濡� �씠�룞 + // �뮘濡쒓�湲� 踰꾪듉 function issueBack() { var index = $scope.$parent.vm.issueIds.length -2; if (index > -1) { @@ -143,16 +162,29 @@ } } + // �긽�쐞 �씠�뒋 �겢由��떆 �긽�쐞 �씠�뒋濡� �씠�룞 + function goParentIssue() { + var parentIssueId = $scope.vm.parentIssueId; + $scope.$parent.tableEvent.changeDetailView(parentIssueId, true); + //�븯�쐞�씠�뒋-> �긽�쐞�씠�뒋 -> �뿰愿��씠�뒋�뿉�꽌 �뮘濡쒓�湲� 踰꾪듉 �겢由� �떆 �븯�쐞�씠�뒋濡� �씠�룞�릺�뒗 臾몄젣濡� 留덉�留� 諛곗뿴媛� �젣嫄� + $scope.$parent.vm.issueIds.pop(); + } + + // �럹�씠吏� 蹂�寃� + function changeDetailPageRowCount() { + $scope.fn.getIssueDetail(0,0); + } + function onActivate() { window.scroll(0,240); } angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); - // �씠�뒋 紐⑸줉 �뜲�씠�꽣 媛깆떊 - $scope.$on("getIssueList", function () { - $scope.fn.getIssueDetail(); - }); + // �씠�뒋 紐⑸줉 �뜲�씠�꽣 媛깆떊 + /*$scope.$on("getIssueList", function () { + $scope.fn.getIssueDetail(0,0); + });*/ // �븯�쐞 �씠�뒋 �궘�젣 function removeDownIssue() { @@ -214,7 +246,7 @@ $resourceProvider.getPageContent(0, 10))).then(function (result) { if (result.data.message.status === "success") { - $scope.fn.getIssueDetail(); + $scope.fn.getIssueDetail(0,0); } else { SweetAlert.error($filter("translate")("issue.failedToIssueDeleteIssueDown"), result.data.message.message); // "�뿰愿��씪媛� �궘�젣 �떎�뙣" @@ -263,7 +295,7 @@ // �궘�젣 �븣由� SweetAlert.swal({ title : $filter("translate")("issue.relationIssueRemove"), // �뿰愿� �씠�뒋 �궘�젣 - text : $filter("translate")("issue.wantToDeleteSelectIssue"), + text : $filter("translate")("issue.wantToDeleteSelectRelIssueInList"), type : "warning", showCancelButton : true, confirmButtonColor : "#DD6B55", @@ -287,7 +319,7 @@ $resourceProvider.getPageContent(0, 10))).then(function (result) { if (result.data.message.status === "success") { - $scope.fn.getIssueDetail(); + $scope.fn.getIssueDetail(0,0); } else { SweetAlert.error($filter("translate")("issue.failedToIssueDeleteIssueRelation"), result.data.message.message); // "�뿰愿��씪媛� �궘�젣 �떎�뙣" @@ -387,6 +419,33 @@ .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") .setDName("modifyDate")); + break; + case "REL_COMPANY" : // �뾽泥� + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.company") + .setDName("companyName") + .setDType("renderer") + .setHWidth("bold " + issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_USE_COMPANY")); + break; + case "REL_ISP" : // ISP + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.isp") + .setDName("ispName") + .setDType("renderer") + .setHWidth("bold " + issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_USE_ISP")); + break; + case "REL_HOSTING" : // HOSTING + $scope.vm.relTableConfigs.push($tableProvider.config() + .setHName("common.hosting") + .setDName("hostingName") + .setDType("renderer") + .setHWidth("bold " + issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("REL_USE_HOSTING")); break; } @@ -488,6 +547,33 @@ .setHWidth("bold " + issueTableConfig.width) .setDAlign("text-center") .setDName("modifyDate")); + break; + case "DOWN_COMPANY" : // �뾽泥� + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.company") + .setDName("companyName") + .setDType("renderer") + .setHWidth("bold " + issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_USE_COMPANY")); + break; + case "DOWN_ISP" : // ISP + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.isp") + .setDName("ispName") + .setDType("renderer") + .setHWidth("bold " + issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_USE_ISP")); + break; + case "DOWN_HOSTING" : // HOSTING + $scope.vm.downTableConfigs.push($tableProvider.config() + .setHName("common.hosting") + .setDName("hostingName") + .setDType("renderer") + .setHWidth("bold " + issueTableConfig.width) + .setDAlign("text-center") + .setDRenderer("DOWN_USE_HOSTING")); break; } @@ -602,7 +688,7 @@ $scope.vm.issueRelTableConfigs = []; $scope.vm.issueRelTableConfigs = JSON.parse(issueTableConfigs); $scope.vm.issueRelTableConfigs.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; }); $scope.vm.relTableConfigs = []; @@ -658,7 +744,7 @@ $scope.vm.issueDownTableConfigs = []; $scope.vm.issueDownTableConfigs = JSON.parse(issueTableConfigs); $scope.vm.issueDownTableConfigs.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; }); $scope.vm.downTableConfigs = []; /* $scope.vm.downTableConfigs.push($downProvider.config() @@ -713,7 +799,7 @@ $resourceProvider.getPageContent(0, 10))).then(function (result) { if (result.data.message.status === "success") { - $scope.fn.getIssueDetail(); + $scope.fn.getIssueDetail(0,0); } else { SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueRelation"), result.data.message.message); // "�뿰愿��씪媛� �깮�꽦 �떎�뙣" @@ -729,28 +815,50 @@ return; } - var ids = []; - if ($scope.vm.form.issuesDown[0].id != null) { - ids.push($scope.vm.form.issuesDown[0].id); + let inheritYn = false; + if ($scope.vm.inheritPartners) { + SweetAlert.swal({ + title : $filter("translate")("issue.addDownIssue"), // �븯�쐞 �씠�뒋 異붽� + text : $filter("translate")("issue.wantToInheritPartnersOfParentIssue"), // �긽�쐞�씠�뒋�쓽 �뙆�듃�꼫 �젙蹂�(�뾽泥�/ISP/�샇�뒪�똿)瑜� �쟻�슜�떆�궎寃좎뒿�땲源�? + type : "warning", + showCancelButton : true, + confirmButtonColor : "#DD6B55", + confirmButtonText : $filter("translate")("common.ok"), // �꽕 + cancelButtonText : $filter("translate")("common.no"), // �븘�땲�삤 + closeOnConfirm : false, + closeOnCancel : false + }, + function (isConfirm) { + if (isConfirm) { + inheritYn = true; + } + + var ids = []; + if ($scope.vm.form.issuesDown[0].id != null) { + ids.push($scope.vm.form.issuesDown[0].id); + } + + var contents = { + issueId : $rootScope.currentDetailIssueId, + ids : ids, + parentIssueId : $rootScope.currentDetailIssueId, + inheritYn : inheritYn + }; + + Issue.modifyParentIssue($resourceProvider.getContent( + contents, + $resourceProvider.getPageContent(0, 10))).then(function (result) { + + if (result.data.message.status === "success") { + SweetAlert.close(); + $scope.fn.getIssueDetail(0,0); + } + else { + SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueDown"), result.data.message.message); // "�븯�쐞�씠�뒋 �깮�꽦 �떎�뙣" + } + }); + }); } - - var contents = { - issueId : $rootScope.currentDetailIssueId, - ids : ids, - parentIssueId : $rootScope.currentDetailIssueId - }; - - Issue.modifyParentIssue($resourceProvider.getContent( - contents, - $resourceProvider.getPageContent(0, 10))).then(function (result) { - - if (result.data.message.status === "success") { - $scope.fn.getIssueDetail(); - } - else { - SweetAlert.error($filter("translate")("issue.failedToIssueAddIssueDown"), result.data.message.message); // "�뿰愿��씪媛� �깮�꽦 �떎�뙣" - } - }); } // �씠�뒋紐낆쓣 �겢由��븯硫� �씠�뒋 �긽�꽭 �젙蹂대�� 議고쉶�븳�떎. @@ -764,14 +872,14 @@ // $scope.vm.viewer.id = args["id"]; // $scope.fn.getIssueDetail(); // }); - + // �씠硫붿씪 蹂대궦�썑 �긽�꽭�솕硫� 媛깆떊 // $rootScope.$on("getIssueDetail", function (event, args) { // $scope.fn.getIssueDetail(); // }); $scope.$on("getIssueDetail", function (event, args) { - $scope.fn.getIssueDetail(); + $scope.fn.getIssueDetail(0,0); }); $scope.$watch(function() { @@ -779,11 +887,11 @@ }, function() { if ($rootScope.currentDetailIssueId != null) { $scope.vm.viewer.id = $rootScope.currentDetailIssueId; - $scope.fn.getIssueDetail(); + $scope.fn.getIssueDetail(0,0); } }, true); - // 珥덇린�솕 �빐�빞�븷 �븷紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎. + // 珥덇린�솕 �빐�빞�븷 �빆紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎. function initReload() { $scope.vm.editor.issueStatus = false; $scope.vm.issueForm.issueStatusList = []; @@ -899,7 +1007,6 @@ parameter : function () { return { issueTypeId : $scope.vm.viewer.issueTypeVo.id - }; } } @@ -967,26 +1074,85 @@ return result; } + function getSubPageContent(relPage, relPageSize, downPage, downPageSize) { + return { + relPage: relPage, + relPageSize: relPageSize, + downPage: downPage, + downPageSize: downPageSize + }; + } // �씠�뒋 �긽�꽭 �젙蹂� 議고쉶 - function getIssueDetail() { + function getIssueDetail(selectedRelPage, selectedDownPage) { $rootScope.spinner = true; - // 珥덇린�솕 �빐�빞�븷 �븷紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎. + if (selectedRelPage < 0) { + selectedRelPage = 0; + } + if (selectedDownPage < 0) { + selectedDownPage = 0; + } + // �쁽�옱 �럹�씠吏� �젙蹂� + var currentRelPage = 0; + var currentDownPage = 0; + + // 荑좏궎�뿉 �꽑�깮�븳 �럹�씠吏� �젙蹂닿� �뾾�쑝硫� 湲곕낯 �럹�씠吏� �젙蹂� 0 �쓣 ���옣 + if (angular.isUndefined(selectedRelPage) || selectedRelPage === "") { + currentRelPage = $scope.vm.page.selectedRelPage; + } + else { + currentRelPage = selectedRelPage; + } + + if (angular.isUndefined(selectedDownPage) || selectedDownPage === "") { + currentDownPage = $scope.vm.page.selectedDownPage; + } + else { + currentDownPage = selectedDownPage; + } + + // 珥덇린�솕 �빐�빞�븷 �빆紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎. $scope.fn.initReload(); // $scope.fn.getRelTableConfigs(); // $scope.fn.getDownTableConfigs(); - Issue.detail($resourceProvider.getContent( - {id : $scope.vm.viewer.id, deep : "02"}, - $resourceProvider.getPageContent(0, 1))).then(function (result) { + + var pageContent = $scope.fn.getSubPageContent(currentRelPage, $scope.vm.subPage.selectedRelPageRowCount + , currentDownPage, $scope.vm.subPage.selectedDownPageRowCount); + + var content = $resourceProvider.getContent( + { + id : $scope.vm.viewer.id + , issueTypeId : (function () { + var id = ""; + if ($rootScope.allIssueList) { + id = -1; + } else { + id = $rootScope.getCurrentIssueTypeId(); + } + return id; + })() + , deep : "02", pageContent + , hideCompleteIssue : $scope.vm.hideCompleteIssue + }, null); + + Issue.detail(content).then(function (result) { if (result.data.message.status === "success") { if (angular.isDefined(result.data.data)) { + + $scope.vm.subPage.selectedRelPage = currentRelPage + 1; + $scope.vm.subPage.selectedDownPage = currentDownPage + 1; + $scope.vm.responseData = result.data.data; $scope.vm.viewer = angular.copy(result.data.data); // �씠�뒋 �씠誘몄� 誘몃━ 蹂닿린 留뚮뱾湲� $scope.fn.makePreviewImages(result.data.data.attachedFileVos); // �솢�룞 �씠�젰 留뚮뱾湲� $scope.fn.makeActiveHistory(); + + if ($rootScope.isDefined($scope.vm.viewer.parentIssueVo)) { + $scope.vm.parentIssueId = $scope.vm.viewer.parentIssueVo.id; + } $scope.vm.viewer.startDate = result.data.data.startDate == null ? "common.unspecified" : result.data.data.startDate; // 誘몄��젙 $scope.vm.viewer.completeDate = result.data.data.completeDate == null ? "common.unspecified" : result.data.data.completeDate; // 誘몄��젙 @@ -1036,8 +1202,11 @@ $scope.vm.viewer.issueDownVos = result.data.data.issueDownVos; if ($rootScope.workProject.id > -1 && result.data.data.projectVo !== null) { - $rootScope.changeLastProject(result.data.data.projectVo.id); + $rootScope.changeLastProject(result.data.data.projectVo.id, false, false); } + + $scope.vm.inheritPartners = result.data.data.issueTypeVo.inheritPartners; + $scope.vm.downTotalCount = result.data.data.downTotalCount; } } else { @@ -1121,21 +1290,69 @@ // �솢�룞 �씠�젰 留뚮뱾湲� function makeActiveHistory() { - $scope.vm.viewer.activeParentHistory = ""; - $scope.vm.viewer.activeHistory = ""; + $scope.vm.viewer.activeParentHistory = []; + $scope.vm.viewer.activeHistory = []; + $scope.vm.viewer.activeParentMailHistory = []; + $scope.vm.viewer.activeAllMailAndReplyHistory = []; //�긽�쐞+�븯�쐞 硫붿씪,�뙎湲� �엳�뒪�넗由� + var oriMailHistory = []; + var oriCommentHistory = []; + + if ($scope.vm.viewer.issueHistoryVos != null && $scope.vm.viewer.issueHistoryVos.length > 0) { + // �긽�쐞�씠�뒋 硫붿씪 �엳�뒪�넗由� + for (var i=0; i<$scope.vm.viewer.issueHistoryVos.length; i++) { + if ($scope.vm.viewer.issueHistoryVos[i].issueHistoryType === "SEND") { + oriMailHistory.push($scope.vm.viewer.issueHistoryVos[i]); + } + } + //$scope.vm.viewer.activeParentMailHistory = angular.copy(oriMailHistory); + } + + // �긽�쐞�씠�뒋 �뙎湲� �엳�뒪�넗由� + if ($scope.vm.viewer.issueCommentVos != null && $scope.vm.viewer.issueCommentVos.length > 0) { + for (var i=0; i<$scope.vm.viewer.issueCommentVos.length; i++) { + oriCommentHistory.push($scope.vm.viewer.issueCommentVos[i]); + } + } + + $scope.vm.viewer.activeAllMailAndReplyHistory = oriMailHistory.concat(oriCommentHistory); + + // �븯�쐞�씠�뒋 �엳�뒪�넗由� if ($scope.vm.viewer.issueDownVos != null && $scope.vm.viewer.issueDownVos.length > 0) { - $scope.vm.viewer.activeDownHistory = ""; //�븯�쐞�씠�뒋 �엳�뒪�넗由щ쭔 - $scope.vm.viewer.downComment = ""; //�븯�쐞�씠�뒋 �뙎湲�留� - $scope.vm.viewer.activeDownAllHistory = ""; //�븯�쐞�씠�뒋 �엳�뒪�넗由�+�뙎湲� + $scope.vm.viewer.activeDownHistory = []; //�븯�쐞�씠�뒋 �엳�뒪�넗由щ쭔 + $scope.vm.viewer.downComment = []; //�븯�쐞�씠�뒋 �뙎湲�留� + $scope.vm.viewer.activeDownAllHistory = []; //�븯�쐞�씠�뒋 �엳�뒪�넗由�+�뙎湲� + $scope.vm.viewer.activeDownMailAndReplyHistory = []; //�븯�쐞 硫붿씪+�뙎湲� �엳�뒪�넗由� var downTitle = ""; var oriDownHistory = []; var oriDownCommentHistory = []; + var oriDownMailHistory = []; // �븯�쐞�씠�뒋 �엳�뒪�넗由� for (var i=0; i<$scope.vm.viewer.issueDownVos.length; i++){ oriDownHistory.push($scope.vm.viewer.issueDownVos[i].issueHistoryVos); - oriDownCommentHistory.push($scope.vm.viewer.issueDownVos[i].issueCommentVos); + + // �븯�쐞�씠�뒋 硫붿씪 湲곕줉 + for (var j=0; j<$scope.vm.viewer.issueDownVos[i].issueHistoryVos.length; j++) { + if($scope.vm.viewer.issueDownVos[i].issueHistoryVos[j].issueHistoryType === "SEND") { + oriDownMailHistory.push($scope.vm.viewer.issueDownVos[i].issueHistoryVos[j]); + } + } + // �븯�쐞�씠�뒋 �뙎湲� 湲곕줉 + for (var k=0; k<$scope.vm.viewer.issueDownVos[i].issueCommentVos.length; k++) { + oriDownCommentHistory.push($scope.vm.viewer.issueDownVos[i].issueCommentVos[k]); + } } + // �븯�쐞�씠�뒋 硫붿씪+�뙎湲� ���옣 + $scope.vm.viewer.activeDownMailAndReplyHistory = oriDownCommentHistory.concat(oriDownMailHistory); + for (var i=0; i<$scope.vm.viewer.activeDownMailAndReplyHistory.length; i++){ + downTitle = "<div class='dot' style='margin-bottom: -8px'>*�븯�쐞�씠�뒋 : "+$scope.vm.viewer.activeDownMailAndReplyHistory[i].title+"</div>"; + $scope.vm.viewer.activeDownMailAndReplyHistory[i].desc = downTitle + $scope.vm.viewer.activeDownMailAndReplyHistory[i].description; + } + + $scope.vm.viewer.activeDownMailAndReplyHistory.sort(function (a, b) { //"MAIL_AND_REPLY_DOWN" �궡由쇱감�닚 + return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0; + }); + for (var i=0; i<oriDownHistory.length; i++){ if ($scope.vm.viewer.activeDownHistory === "") { $scope.vm.viewer.activeDownHistory = oriDownHistory[i]; @@ -1153,29 +1370,41 @@ }); // �븯�쐞�씠�뒋 �뙎湲� �엳�뒪�넗由� - for (var i=0; i<oriDownCommentHistory.length; i++) { + for (var i=0; i<oriDownCommentHistory.length; i++) { if ($scope.vm.viewer.downComment === "") { $scope.vm.viewer.downComment = oriDownCommentHistory[i]; } else { $scope.vm.viewer.downComment = $scope.vm.viewer.downComment.concat(oriDownCommentHistory[i]); } - } - $scope.vm.viewer.issueDownVos.sort(function (a, b) { //�궡由쇱감�닚 - return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0; - }); + } + $scope.vm.viewer.issueDownVos.sort(function (a, b) { //�궡由쇱감�닚 + return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0; + }); - $scope.vm.viewer.activeDownAllHistory = $scope.vm.viewer.downComment.concat($scope.vm.viewer.activeDownHistory); - $scope.vm.viewer.activeParentHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos); - $scope.vm.viewer.activeHistory = $scope.vm.viewer.activeParentHistory.concat($scope.vm.viewer.activeDownAllHistory); + $scope.vm.viewer.activeDownAllHistory = $scope.vm.viewer.downComment.concat($scope.vm.viewer.activeDownHistory); + + $scope.vm.viewer.activeDownAllHistory.sort(function (a, b) { //"RECODE_DOWN" �궡由쇱감�닚 + return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0; + }); + + $scope.vm.viewer.activeParentHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos); + $scope.vm.viewer.activeHistory = $scope.vm.viewer.activeParentHistory.concat($scope.vm.viewer.activeDownAllHistory); + $scope.vm.viewer.activeAllMailAndReplyHistory = $scope.vm.viewer.activeAllMailAndReplyHistory.concat($scope.vm.viewer.activeDownMailAndReplyHistory); }else { $scope.vm.viewer.activeParentHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos); $scope.vm.viewer.activeHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos); } - $scope.vm.viewer.activeParentHistory.sort(function (a, b) { //�궡由쇱감�닚 + + $scope.vm.viewer.activeHistory.sort(function (a, b) { //"ALL" �궡由쇱감�닚 return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0; }); - $scope.vm.viewer.activeHistory.sort(function (a, b) { //�궡由쇱감�닚 + + $scope.vm.viewer.activeParentHistory.sort(function (a, b) { //"RECODE" �궡由쇱감�닚 + return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0; + }); + + $scope.vm.viewer.activeAllMailAndReplyHistory.sort(function (a, b) { //"MAIL_AND_REPLY" �궡由쇱감�닚 return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0; }); } @@ -1325,16 +1554,43 @@ } function getParametersAll() { - var params = $scope.fn.getParameters(null, $scope.vm.viewer.issueCompanyVos); - params = $scope.fn.getParameters(params, $scope.vm.viewer.issueIspVos); - params = $scope.fn.getParameters(params, $scope.vm.viewer.issueHostingVos); - - if (params != null && params.length > 0) { - for (let i = 0; i < params.length; i++) { - params[i].id = i; + var params = []; + if ($scope.vm.viewer.issueCompanyVos != null && $scope.vm.viewer.issueCompanyVos.length > 0) { + var issueCompany = $scope.fn.getParameters(params, $scope.vm.viewer.issueCompanyVos); + if (issueCompany != null && issueCompany.length > 0) { + angular.forEach(issueCompany, function (data) { + params.push(data); + }); } } - return params; + if ($scope.vm.viewer.issueIspVos != null && $scope.vm.viewer.issueIspVos.length > 0) { + var issueIsp = $scope.fn.getParameters(params, $scope.vm.viewer.issueIspVos) + if (issueIsp != null && issueIsp.length > 0) { + angular.forEach(issueIsp, function (data) { + params.push(data); + }); + } + } + if ($scope.vm.viewer.issueHostingVos != null && $scope.vm.viewer.issueHostingVos.length > 0) { + var issueHosting = $scope.fn.getParameters(params, $scope.vm.viewer.issueHostingVos); + if (issueHosting != null && issueHosting.length > 0) { + angular.forEach(issueHosting, function (data) { + params.push(data); + }); + } + } + + if (params != null && params.length > 0) { + var filterData = params.filter(function(item, idx){ + return params.findIndex(function(item2, idx2){ + return item.email === item2.email + }) == idx; + }); + for (let i = 0; i < filterData.length; i++) { + filterData[i].id = i; + } + } + return filterData; } function getParameters(sourceArr, partnerVos) { -- Gitblit v1.8.0