OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 3052936fed9166521b0557a36df83eb11a5e51ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
 * Created by wisestone on 2018-05-08.
 */
'use strict';
 
define([
        'app'
    ],
    function (app) {
        app.controller('issueStatusAddController', ['$scope', '$rootScope', '$log', '$resourceProvider', 'User', '$uibModalInstance', 'IssueStatus', 'SweetAlert', '$filter',
            function ($scope, $rootScope, $log, $resourceProvider, User, $uibModalInstance, IssueStatus, SweetAlert, $filter) {
 
                $scope.fn = {
                    cancel : cancel,    //  팝업 창 닫기
                    formSubmit : formSubmit,    //  폼 전송
                    formCheck : formCheck   //  폼 체크
                };
 
                $scope.vm = {
                    form : {
                        name : "",  //  이슈 상태 명
                        issueStatusType : "OPEN",    //  이슈 상태 유형
                        color : "#febd35"  //  색상
                    }
                };
 
                function formCheck(formInvalid) {
                    if (formInvalid) {
                        return true;
                    }
 
                    return false;
                }
 
                function formSubmit() {
                    $rootScope.spinner = true;
 
                    $scope.vm.form.name = $rootScope.preventXss($scope.vm.form.name);
 
                    IssueStatus.add($resourceProvider.getContent(
                        $scope.vm.form,
                        $resourceProvider.getPageContent(0, 10))).then(function (result) {
 
                        if (result.data.message.status === "success") {
                            $scope.fn.cancel();
                            //  목록 화면 갱신
                            $rootScope.$broadcast("getIssueStatusList", {});
                        }
                        else {
                            SweetAlert.error($filter("translate")("managementStatus.failedToCreateIssueStatus"), result.data.message.message); //"이슈 상태 생성 실패"
                        }
 
                        $rootScope.spinner = false;
                    });
                }
 
                function cancel() {
                    $rootScope.$broadcast("closeLayer");    //  팝업이 열리고 나서 js-multi, js-single 등에서 body 이벤트가 날아가는 현상 수정
                    $uibModalInstance.dismiss('cancel');
                    $(document).unbind("keydown");  //  단축키 이벤트 제거
                }
            }]);
    });