OWL ITS + 탐지시스템(인터넷 진흥원)
src/main/webapp/scripts/app/customField/customFieldAdd.controller.js
@@ -16,7 +16,7 @@
                    formCheck : formCheck,  //  폼 체크
                    addOption : addOption,   //  옵션 값 추가하기
                    removeOption : removeOption,    //  옵션 삭제
                    changeFieldType : changeFieldType   //  필드 유형 변경
                    changeFieldType : changeFieldType,   //  필드 유형 변경
                };
                $scope.vm = {
@@ -25,7 +25,13 @@
                        customFieldType : "INPUT",    //  사용자 정의 필드 유형
                        defaultValue : "",  //  기본 값
                        options : [],   //  옵션
                        optionText : ""  //  옵션 값
                        optionText : "",  //  옵션 값
                        numberType : "",
                        ipAdress : "",
                        email : "",
                        site : "",
                        tel : "",
                        requiredData : ""
                    }
                };
@@ -36,13 +42,14 @@
                //  필드 유형을 변경 했을 때 문자열 필드일 경우에는 옵션 값을 초기화해준다.
                function changeFieldType() {
                    if ($scope.vm.form.customFieldType === "INPUT") {
                        $scope.vm.form.options = [];
                        $scope.vm.form.optionText = "";
                    }
                    // if ($scope.vm.form.customFieldType === "INPUT") {
                    // $scope.vm.form.name = "";
                    $scope.vm.form.options = [];
                    $scope.vm.form.optionText = "";
                    $scope.vm.form.defaultValue = "";
                }
                //  Select 옵션 값 추가하기
                function addOption() {
@@ -69,7 +76,8 @@
                    if (!duplication) {
                        if (!$rootScope.isDefined($scope.vm.form.optionText)) {
                            $scope.vm.form.optionText = "";
                            SweetAlert.warning($filter("translate")("customField.emptyInputValue"), $filter("translate")("customField.emptyAddValue")); //  입력 값 확인 알림, 입력한 값이 없습니다.
                            SweetAlert.warning($filter("translate")("customField.emptyInputValue"),
                                $filter("translate")("customField.emptyAddValue")); //  입력 값 확인 알림, 입력한 값이 없습니다.
                            return;
                        }
                        $scope.vm.form.options.push($scope.vm.form.optionText);
@@ -81,7 +89,8 @@
                        }, 200);
                    }
                    else {
                        SweetAlert.warning($filter("translate")("customField.duplicateInputValue"), $filter("translate")("customField.alreadyAddedValue")); // "입력 값 중복 알림", "입력한 값이 이미 추가되어 있습니다."
                        SweetAlert.warning($filter("translate")("customField.duplicateInputValue"),
                            $filter("translate")("customField.alreadyAddedValue")); // "입력 값 중복 알림", "입력한 값이 이미 추가되어 있습니다."
                    }
                }
@@ -92,13 +101,12 @@
                    }
                    //  다중, 단일 선택일 경우에
                    if ($scope.vm.form.customFieldType !== "INPUT") {
                    if ($scope.vm.form.customFieldType === "MULTI_SELECT" || $scope.vm.form.customFieldType === "SINGLE_SELECT") {
                        //  옵션이 1개 이하일 경우에는 셀렉트 태그를 만들 수 없다.
                        if ($scope.vm.form.options.length < 1) {
                            return true;
                        }
                    }
                    return false;
                }
@@ -109,7 +117,7 @@
                    var content = angular.copy($scope.vm.form);
                    content.name = $rootScope.preventXss(content.name);
                    if ($scope.vm.form.customFieldType !== 'INPUT') {
                    if ($scope.vm.form.customFieldType === 'MULTI_SELECT'|| $scope.vm.form.customFieldType === "SINGLE_SELECT") {
                        var convertDefaultValues = "";
                        angular.forEach(content.defaultValue.split("#"), function (value) {