OWL ITS + 탐지시스템(인터넷 진흥원)
src/main/webapp/scripts/app/customField/customFieldAdd.controller.js
@@ -24,13 +24,20 @@
                        name : "",  //  사용자 정의 필드 명
                        customFieldType : "INPUT",    //  사용자 정의 필드 유형
                        defaultValue : "",  //  기본 값
                        defaultNumValue : "",  //  기본 값
                        defaultDateValue : "",  //  기본 값
                        defaultIpValue : "",  //  기본 값
                        defaultEmailValue : "",  //  기본 값
                        defaultTelValue : "",  //  기본 값
                        defaultSiteValue : "",  //  기본 값
                        options : [],   //  옵션
                        optionText : "",  //  옵션 값
                        numberType : "",
                        ipAdress : "",
                        ipAddress : "",
                        email : "",
                        site : "",
                        tel : ""
                        tel : "",
                        requiredData : false
                    }
                };
@@ -42,11 +49,17 @@
                //  필드 유형을 변경 했을 때 문자열 필드일 경우에는 옵션 값을 초기화해준다.
                function changeFieldType() {
                    // if ($scope.vm.form.customFieldType === "INPUT") {
                    $scope.vm.form.name = "";
                    // $scope.vm.form.name = "";
                    $scope.vm.form.options = [];
                    $scope.vm.form.optionText = "";
                    $scope.vm.form.defaultValue = "";
                    $scope.vm.form.defaultNumValue = "";
                    $scope.vm.form.defaultDateValue = "";
                    $scope.vm.form.defaultIpValue = "";
                    $scope.vm.form.defaultEmailValue = "";
                    $scope.vm.form.defaultTelValue = "";
                    $scope.vm.form.defaultSiteValue = "";
                }
@@ -93,55 +106,6 @@
                    }
                }
                // function chkPhoneType(type) {
                //     var input = $scope.vm.form.tel
                //
                //     //focus out인 경우
                //     //input type을 text로 바꾸고 '-'추가
                //     if(type == 'blur'){
                //         $scope.vm.form.tel;
                //         var phone = chkItemPhone(input);
                //     }
                //
                //     //focus인 경우
                //     //input type을 number로 바꾸고 '-' 제거
                //     if(type == 'focus'){
                //         var phone = input.replace( /-/gi, '');
                //         $scope.vm.form.tel('type', 'number');
                //     }
                //
                //     $scope.vm.form.tel(phone);
                // }
                //
                // function chkItemPhone(temp) {
                //     var number = temp.replace(/[^0-9]/g, "");
                //     var phone = "";
                //
                //     if (number.length < 9) {
                //         return number;
                //     } else if (number.length < 10) {
                //         phone += number.substr(0, 2);
                //         phone += "-";
                //         phone += number.substr(2, 3);
                //         phone += "-";
                //         phone += number.substr(5);
                //     } else if (number.length < 11) {
                //         phone += number.substr(0, 3);
                //         phone += "-";
                //         phone += number.substr(3, 3);
                //         phone += "-";
                //         phone += number.substr(6);
                //     } else {
                //         phone += number.substr(0, 3);
                //         phone += "-";
                //         phone += number.substr(3, 4);
                //         phone += "-";
                //         phone += number.substr(7);
                //     }
                //
                //     return phone;
                // }
                //  폼 체크
                function formCheck(formInvalid) {
                    if (formInvalid) {
@@ -155,7 +119,6 @@
                            return true;
                        }
                    }
                    return false;
                }
@@ -166,7 +129,6 @@
                    var content = angular.copy($scope.vm.form);
                    content.name = $rootScope.preventXss(content.name);
                    if ($scope.vm.form.customFieldType === 'MULTI_SELECT'|| $scope.vm.form.customFieldType === "SINGLE_SELECT") {
                        var convertDefaultValues = "";
@@ -176,7 +138,7 @@
                            }
                        });
                        //content.defaultValue = convertDefaultValues;
                        content.defaultValue = convertDefaultValues;
                    }
                    CustomField.add($resourceProvider.getContent(