OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2021-12-21 13df3419f367b1448a844120840459a17df02f3a
src/main/webapp/scripts/app/issue/issueAddTableConfig.controller.js
@@ -8,8 +8,8 @@
        'angular'
    ],
    function (app, angular) {
        app.controller('issueAddTableConfigController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', 'SweetAlert', '$timeout', 'IssueTableConfig', 'CustomField', '$q', '$filter',
            function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, SweetAlert, $timeout, IssueTableConfig, CustomField, $q, $filter) {
        app.controller('issueAddTableConfigController', ['$scope', '$rootScope', '$log', '$resourceProvider', '$uibModalInstance', 'SweetAlert', '$timeout', 'IssueTableConfig', 'IssueTypeCustomField', '$q', '$filter', 'parameter',
            function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, SweetAlert, $timeout, IssueTableConfig, IssueTypeCustomField, $q, $filter, parameter) {
                //  함수 모음
                $scope.fn = {
@@ -17,53 +17,74 @@
                    formSubmit : formSubmit,    //  폼 전송
                    formCheck : formCheck,  //  폼 체크
                    getCustomFields : getCustomFields,   //  사용자 정의 필드 목록을 가져온다.
                    getIssueTableConfigs : getIssueTableConfigs //  이슈 목록 테이블 설정 정보를 가져온다.
                    getIssueAddTableConfigs : getIssueAddTableConfigs //  이슈 목록 테이블 설정 정보를 가져온다.
                };
                //  변수 모음
                $scope.vm = {
                    issueTableConfigs : [{
                        name : $filter("translate")("common.importance"), // 우선순위
                        name : $filter("translate")("issue.issueTitle"), // 이슈 제목
                        key : "ISSUE_TITLE",
                        width : "width-140-p",
                        position : 0,
                        display : true,
                        checkboxShow : false
                    }, {
                        name : $filter("translate")("common.priority"), // 우선순위
                        key : "PRIORITY",
                        width : "width-80-p",
                        position : 1,
                        display : true
                        display : true,
                        checkboxShow : true
                    }, {
                        name : $filter("translate")("common.importance"), // 중요도
                        key : "SEVERITY",
                        width : "width-80-p",
                        position : 2,
                        display : true
                        display : true,
                        checkboxShow : true
                    }, {
                        name : $filter("translate")("issue.issueType"), // 이슈 타입
                        key : "ISSUE_TYPE",
                        width : "width-140-p",
                        position : 3,
                        display : true
                        display : true,
                        checkboxShow : true
                    }, {
                        name : $filter("translate")("common.assigneeTeam"), // 담당부서
                        key : "ASSIGNEE_TEAM",
                        width : "width-100-p",
                        position : 4,
                        display : true
                        display : true,
                        checkboxShow : true
                    }, {
                        name : $filter("translate")("common.countDownIssue"), // 하위이슈 카운트
                        key : "COUNT_DOWN_ISSUE",
                        width : "width-100-p",
                        position : 5,
                        display : false,
                        checkboxShow : true
                    }, {
                        name : $filter("translate")("common.register"), // 등록자
                        key : "REGISTER",
                        width : "width-100-p",
                        position : 5,
                        display : true
                        position : 6,
                        display : false,
                        checkboxShow : true
                    }, {
                        name : $filter("translate")("common.period"), // 기간
                        key : "PERIOD",
                        width : "width-140-p",
                        position : 6,
                        display : true
                        position : 7,
                        display : false,
                        checkboxShow : true
                    }, {
                        name : $filter("translate")("common.lastChangeDate"), // 최근 변경일
                        key : "MODIFY_DATE",
                        width : "width-100-p",
                        position : 7,
                        display : true
                        position : 8,
                        display : false,
                        checkboxShow : true
                    }, {
                    }]
                };
@@ -83,6 +104,7 @@
                    $rootScope.spinner = true;
                    var content = {
                        issueTypeId : $rootScope.getCurrentIssueTypeId(),
                        issueTableConfigs : JSON.stringify($scope.vm.issueTableConfigs)
                    };
@@ -93,9 +115,9 @@
                            SweetAlert.success($filter("translate")("issue.completedSavingIssueTable"), $filter("translate")("issue.saveIssueTableSettingsInformation")); // "이슈 테이블 설정 저장 완료", "이슈 테이블 설정 정보가 저장되었습니다."
                            //  변경된 이슈 테이블 정보를 이슈 목록 테이블에 갱신한다.
                            $rootScope.$broadcast("getIssueTableConfigs", {});
                            swal.close();
                            $scope.fn.cancel();
                            $rootScope.$broadcast("getIssueTableConfigs", {});
                        }
                        else {
                            SweetAlert.error($filter("translate")("issue.failedToSaveIssueTableSetting"), result.data.message.message); // 이슈 테이블 설정 저장 실패
@@ -117,7 +139,7 @@
                function getCustomFields() {
                    var deferred = $q.defer();
                    CustomField.find($resourceProvider.getContent({},
                    IssueTypeCustomField.findByIssueType($resourceProvider.getContent({issueTypeId : $rootScope.getCurrentIssueTypeId()},
                        $resourceProvider.getPageContent(0, 1000))).then(function (result) {
                        if (result.data.message.status !== "success") {
                            SweetAlert.error($filter("translate")("issue.failedToUserDefinedFieldListLookup"), result.data.message.message); // 사용자 정의 필드 목록 조회 실패
@@ -129,15 +151,27 @@
                    return deferred.promise;
                }
                var content = {
                    delValue : $scope.vm.issueTableConfigs.splice(9,1),
                    issueTableConfigs : JSON.stringify($scope.vm.issueTableConfigs),
                    issueTypeId : $rootScope.getCurrentIssueTypeId()
                };
                //  이슈 목록 테이블 설정 정보를 가져온다.
                function getIssueTableConfigs() {
                function getIssueAddTableConfigs() {
                    var deferred = $q.defer();
                    IssueTableConfig.detail($resourceProvider.getContent({},
                    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); // 이슈 테이블 컬럼 조회 실패
                        }
                        // for (var i = 0; i < result.data.name; i++) {
                        //     if (result.data.name === '') {
                        //         result.splice(i,1);
                        //         i--;
                        //     }
                        // }
                        deferred.resolve(result.data.data);
                    });
@@ -147,13 +181,14 @@
                //  사용자 정의 필드를 조회한 후 표시할 이슈 테이블 컬럼을 준비한다.
                $scope.fn.getCustomFields().then(function (result) {
                    var count = 7;
                    var count = 8;
                    angular.forEach(result, function (customField) {
                        $scope.vm.issueTableConfigs.push({
                            name : customField.name,
                            key : "CUSTOM_FIELD_" + customField.id,
                            width : "width-100-p",
                            display : false,
                            checkboxShow : true,
                            position : count
                        });
@@ -161,7 +196,7 @@
                    });
                    //  이슈 목록 테이블 설정 정보를 가져온다.
                    $scope.fn.getIssueTableConfigs().then(function (issueTableConfigs) {
                    $scope.fn.getIssueAddTableConfigs().then(function (issueTableConfigs) {
                        if ($rootScope.isDefined(issueTableConfigs)) {
                            $rootScope.spinner = true;