From 04221a915d740bfef444c9ab34d79964f8630cdc Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 월, 20 12월 2021 18:00:00 +0900
Subject: [PATCH] Merge branch 'master' of http://192.168.0.25:9001/r/owl-kisa

---
 src/main/webapp/scripts/app/issue/issueDetail.controller.js |   70 ++++++++++++++++++++++++++++++++---
 1 files changed, 64 insertions(+), 6 deletions(-)

diff --git a/src/main/webapp/scripts/app/issue/issueDetail.controller.js b/src/main/webapp/scripts/app/issue/issueDetail.controller.js
index ad81f3a..9d13d75 100644
--- a/src/main/webapp/scripts/app/issue/issueDetail.controller.js
+++ b/src/main/webapp/scripts/app/issue/issueDetail.controller.js
@@ -55,7 +55,7 @@
                 //  �씠�뒋 紐⑸줉 而⑦듃濡ㅻ윭 vm, fn �긽�냽 以�
                 $scope.vm.viewer = {};      // �쁽�옱 �씠�뒋
                 $scope.vm.images = [];  //  泥⑤��맂 �뙆�씪 以� �씠誘몄� �뙆�씪
-                $scope.vm.activeTab = "ALL";    //  �솢�룞 �궡�뿭 �꺆
+                $scope.vm.activeTab = "RECODE";    //  �솢�룞 �궡�뿭 �꺆
                 //  �씠�뒋 �긽�깭 蹂�寃� �몴�떆 �뿬遺�
                 $scope.vm.editor = {
                     issueStatus : false
@@ -236,7 +236,7 @@
                 }
 
                 function getDownIssueListCallBack(result) {
-                    $scope.vm.autoCompletePage.issue.totalPage = result.data.page.totalPage;
+                    $scope.vm.autoCompletePageDown.issue.totalPage = result.data.page.totalPage;
                 }
 
                 //  �뀒�씠釉붿쓽 �뿰愿� �씠�뒋 而щ읆�쓣 留뚮뱾�뼱以��떎.
@@ -244,7 +244,6 @@
 
                     //  �뿰愿� �씠�뒋 而щ읆
                     switch(Rel_issueTableConfig.key) {
-
                         // �뿰愿� �씠�뒋 援щ텇
                         case "RELATION_ISSUE_TYPE" :
                             $scope.vm.relTableConfigs.push($tableProvider.config()
@@ -896,6 +895,9 @@
                                         issueRelationVo.relationIssueTypeName = $scope.vm.relationIssueTypes[issueRelationVo.relationIssueType].name;
                                         $scope.vm.form.issues.push(issueRelationVo.issueRelation);
                                     });
+                                    result.data.data.issueRelationVos.sort(function (a, b) {   //理쒓렐蹂�寃쎌씪 �궡由쇱감�닚
+                                        return a.modifyDate > b.modifyDate ? -1 : a.modifyDate < b.modifyDate ? 1 : 0;
+                                    });
                                 }
 
                                 // �븯�쐞 �씠�뒋 諛섎ぉ臾�
@@ -904,6 +906,9 @@
                                         //$scope.vm.form.issuesDown.push(issueDownVo.issueDown);
                                         $scope.vm.form.issuesDown.push(issueDownVo);
                                         $scope.vm.form.issuesDownStatus.push(issueDownVo.issueStatusVo.issueStatusType);
+                                    });
+                                    result.data.data.issueDownVos.sort(function (a, b) {   //理쒓렐蹂�寃쎌씪 �궡由쇱감�닚
+                                        return a.modifyDate > b.modifyDate ? -1 : a.modifyDate < b.modifyDate ? 1 : 0;
                                     });
                                 }
                                 $scope.vm.viewer.issueRelationVos = result.data.data.issueRelationVos;
@@ -995,8 +1000,61 @@
 
                 //  �솢�룞 �씠�젰 留뚮뱾湲�
                 function makeActiveHistory() {
-                    $scope.vm.viewer.activeHistory = $scope.vm.viewer.issueCommentVos.concat($scope.vm.viewer.issueHistoryVos);
-                    $scope.vm.viewer.activeHistory.sort(function (a, b) {
+                    $scope.vm.viewer.activeParentHistory = "";
+                    $scope.vm.viewer.activeHistory = "";
+                    if ($scope.vm.viewer.issueDownVos != null && $scope.vm.viewer.issueDownVos.length > 0) {
+                        $scope.vm.viewer.activeDownHistory = ""; //�븯�쐞�씠�뒋 �엳�뒪�넗由щ쭔
+                        $scope.vm.viewer.downComment = ""; //�븯�쐞�씠�뒋 �뙎湲�留�
+                        $scope.vm.viewer.activeDownAllHistory = ""; //�븯�쐞�씠�뒋 �엳�뒪�넗由�+�뙎湲�
+                        var downTitle = "";
+                        var oriDownHistory = [];
+                        var oriDownCommentHistory = [];
+
+                        // �븯�쐞�씠�뒋 �엳�뒪�넗由�
+                        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 i=0; i<oriDownHistory.length; i++){
+                            if ($scope.vm.viewer.activeDownHistory === "") {
+                                $scope.vm.viewer.activeDownHistory = oriDownHistory[i];
+                            } else {
+                                $scope.vm.viewer.activeDownHistory = $scope.vm.viewer.activeDownHistory.concat(oriDownHistory[i]);
+                            }
+                        }
+
+                        for (var i=0; i<$scope.vm.viewer.activeDownHistory.length; i++){
+                            downTitle = "<div class='dot' style='margin-bottom: -8px'>*�븯�쐞�씠�뒋 : "+$scope.vm.viewer.activeDownHistory[i].title+"</div>";
+                            $scope.vm.viewer.activeDownHistory[i].desc = downTitle + $scope.vm.viewer.activeDownHistory[i].description;
+                        }
+                        $scope.vm.viewer.activeDownHistory.sort(function (a, b) {   //�궡由쇱감�닚
+                            return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
+                        });
+
+                        // �븯�쐞�씠�뒋 �뙎湲� �엳�뒪�넗由�
+                       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.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);
+
+                    }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) {   //�궡由쇱감�닚
+                        return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
+                    });
+                    $scope.vm.viewer.activeHistory.sort(function (a, b) {   //�궡由쇱감�닚
                         return a.registerDate > b.registerDate ? -1 : a.registerDate < b.registerDate ? 1 : 0;
                     });
                 }
@@ -1050,7 +1108,6 @@
                                         $timeout(function () {
                                             SweetAlert.success($filter("translate")("common.deleteSucceeded"), result.data.message.message); // �궘�젣 �꽦怨�
                                         }, 100);
-
                                         $scope.fn.getCommentList();
                                     }
                                     else {
@@ -1073,6 +1130,7 @@
 
                         if (result.data.message.status === "success") {
                             $scope.vm.viewer.issueCommentVos = result.data.data;
+                            $scope.fn.updateActiveHistory();
                         }
                         else {
                             SweetAlert.swal({

--
Gitblit v1.8.0