From 0e9a2d3cdad67b0c16d18bf349c14528f617aef0 Mon Sep 17 00:00:00 2001
From: wyu <kknd09321@nate.com>
Date: 월, 20 12월 2021 18:30:07 +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 |  118 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 91 insertions(+), 27 deletions(-)

diff --git a/src/main/webapp/scripts/app/issue/issueDetail.controller.js b/src/main/webapp/scripts/app/issue/issueDetail.controller.js
index 9d8b142..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
@@ -81,6 +81,7 @@
                 $scope.vm.form = {
                     issues : [], //�뿰愿� �씪媛�
                     issuesDown : [],  // �븯�쐞 �씪媛�
+                    issuesDownStatus : [], //�븯�쐞 �씠�뒋 �긽�깭
                     issueCompanyVos : [],
                     issueIspVos : [],
                     issueHostingVos : []
@@ -235,7 +236,7 @@
                 }
 
                 function getDownIssueListCallBack(result) {
-                    $scope.vm.autoCompletePage.issue.totalPage = result.data.page.totalPage;
+                    $scope.vm.autoCompletePageDown.issue.totalPage = result.data.page.totalPage;
                 }
 
                 //  �뀒�씠釉붿쓽 �뿰愿� �씠�뒋 而щ읆�쓣 留뚮뱾�뼱以��떎.
@@ -243,7 +244,6 @@
 
                     //  �뿰愿� �씠�뒋 而щ읆
                     switch(Rel_issueTableConfig.key) {
-
                         // �뿰愿� �씠�뒋 援щ텇
                         case "RELATION_ISSUE_TYPE" :
                             $scope.vm.relTableConfigs.push($tableProvider.config()
@@ -477,14 +477,16 @@
                         .setHWidth("width-60-p bold")
                         .setHSort(false)
                         .setDRenderer("ISSUE_DOWN_MOVE"))
-                    $scope.vm.downTableConfigs.push($tableProvider.config()
-                        .setHName("issue.relationIssueDelete")
-                        .setDType("renderer")
-                        .setDAlign("text-center")
-                        .setHWidth("width-20-p bold")
-                        .setDRenderer("ISSUE_DOWN_DELETE")
-                        .setHSort(false)
-                        .setDAlign("text-center"))
+                    if($scope.vm.viewer.modifyPermissionCheck){
+                        $scope.vm.downTableConfigs.push($tableProvider.config()
+                            .setHName("issue.relationIssueDelete")
+                            .setDType("renderer")
+                            .setDAlign("text-center")
+                            .setHWidth("width-20-p bold")
+                            .setDRenderer("ISSUE_DOWN_DELETE")
+                            .setHSort(false)
+                            .setDAlign("text-center"))
+                    }
 
                     angular.forEach($scope.vm.downTableConfigs, function (Down_issueTableConfig) {
                         //  �몴�떆 ���긽�씤 而щ읆留� �솕硫댁뿉 洹몃젮以��떎.
@@ -497,7 +499,10 @@
 
                 // �뿰愿� �씠�뒋 �뀒�씠釉� �꽕�젙
                 function setRelTableConfigs(issueTableConfigVo) {
-                    if (issueTableConfigVo == null) makeRelTableConfigs(); return;
+                    if (issueTableConfigVo == null) {
+                        makeRelTableConfigs();
+                        return;
+                    }
                     var issueTableConfigs = issueTableConfigVo.issueTableConfigs;
 
                     //  �뿰愿� �뒋 紐⑸줉 �뀒�씠釉� �꽕�젙 媛믪쓣 媛��졇���꽌 �쟻�슜�븳�떎.
@@ -642,15 +647,20 @@
                         }
                     });
                 }
-                // todo 紐⑤Ⅴ寃좊떎.....
+
                  // �씠�뒋紐낆쓣 �겢由��븯硫� �씠�뒋 �긽�꽭 �젙蹂대�� 議고쉶�븳�떎.
                  // $rootScope.$on("getIssueDetail", function (event, args) {
                  //     $scope.vm.viewer.id = args["id"];
                  //     $scope.fn.getIssueDetail();
                  // });
+
+                //  �씠�뒋紐낆쓣 �겢由��븯硫� �씠�뒋 �긽�꽭 �젙蹂대�� 議고쉶�븳�떎.
+                // $scope.$on("getIssueDetail", function (event, args) {
+                //     $scope.vm.viewer.id = args["id"];
+                //     $scope.fn.getIssueDetail();
+                // });
                 
                 // �씠硫붿씪 蹂대궦�썑 �긽�꽭�솕硫� 媛깆떊
-                // todo �씠嫄� 萸먯�...
                 //  $rootScope.$on("getIssueDetail", function (event, args) {
                 //      $scope.fn.getIssueDetail();
                 //  });
@@ -658,12 +668,6 @@
                 $scope.$on("getIssueDetail", function (event, args) {
                     $scope.fn.getIssueDetail();
                 });
-
-                //  �씠�뒋紐낆쓣 �겢由��븯硫� �씠�뒋 �긽�꽭 �젙蹂대�� 議고쉶�븳�떎.
-                // $scope.$on("getIssueDetail", function (event, args) {
-                //     $scope.vm.viewer.id = args["id"];
-                //     $scope.fn.getIssueDetail();
-                // });
 
                 $scope.$watch(function() {
                     return $rootScope.currentDetailIssueId;
@@ -673,8 +677,6 @@
                         $scope.fn.getIssueDetail();
                     }
                 }, true);
-
-
 
                 //  珥덇린�솕 �빐�빞�븷 �븷紐⑹쓣 吏��젙�븯�뿬 �떎瑜� �씠�뒋瑜� �겢由��븷 �븣 珥덇린�솕�빐以��떎.
                 function initReload() {
@@ -698,7 +700,8 @@
                             parameter : function () {
                                 return {
                                     issueIds : [$scope.vm.viewer.id],
-                                    projectId : $scope.vm.viewer.projectVo.id
+                                    projectId : $scope.vm.viewer.projectVo.id,
+                                    downIssuesStatus : $scope.vm.form.issuesDownStatus
                                 };
                             }
                         }
@@ -879,6 +882,7 @@
                                 $scope.vm.form.issues = [];
                                 $scope.vm.form.issues.push(result.data.data);
                                 $scope.vm.form.issuesDown = [];
+                                $scope.vm.form.issuesDownStatus = [];// �븯�쐞�씠�뒋 �긽�깭
                                 $scope.vm.form.issuesDown.push(result.data.data);
 
                                 var issueTableConfigVos = result.data.data.issueTableConfigVos;
@@ -891,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;
+                                    });
                                 }
 
                                 // �븯�쐞 �씠�뒋 諛섎ぉ臾�
@@ -898,7 +905,10 @@
                                     angular.forEach(result.data.data.issueDownVos, function (issueDownVo){
                                         //$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;
@@ -907,6 +917,7 @@
                                 if ($rootScope.workProject.id > -1 && result.data.data.projectVo !== null) {
                                     $rootScope.changeLastProject(result.data.data.projectVo.id);
                                 }
+
                             }
                         }
                         else {
@@ -989,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;
                     });
                 }
@@ -1044,7 +1108,6 @@
                                         $timeout(function () {
                                             SweetAlert.success($filter("translate")("common.deleteSucceeded"), result.data.message.message); // �궘�젣 �꽦怨�
                                         }, 100);
-
                                         $scope.fn.getCommentList();
                                     }
                                     else {
@@ -1067,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