OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-01-07 ad7e60c5d5a090160c6b9be63c02a75a6c369b91
src/main/webapp/scripts/app/ispField/ispFieldAdd.controller.js
@@ -13,8 +13,7 @@
                $scope.fn = {
                    cancel : cancel,    //  팝업 창 닫기
                    formSubmit : formSubmit,    //  폼 전송
                    formCheck : formCheck,   //  폼 체크
                    autoHyphenPhone : autoHyphenPhone // 연락처 입력시 하이픈 자동 입력
                    formCheck : formCheck   //  폼 체크
                };
                $scope.vm = {
@@ -37,60 +36,9 @@
                    return false;
                }
                //  연락처 입력시 하이픈 자동 입력
                function autoHyphenPhone() {
                    let phone = $scope.vm.form.tel
                    let seoul = $scope.vm.form.tel
                    // 핸드폰 및 지방 지역번호 조건
                    phone.replace(/^[0-9]/g, '');
                    // 서울 지역번호 조건
                    seoul.replace(/^[0-9]/g, '');
                    var tmp = '';
                    if (phone.length < 4) {
                        return phone;
                    } else if (phone.length < 7) {
                        tmp += phone.substr(0, 3);
                        tmp += '-';
                        tmp += phone.substr(3);
                        $scope.vm.form.tel = tmp;
                    } else if (seoul.substring(0, 2) === "02" && seoul.length === 9) {    // 서울 지역번호 조건
                        tmp += seoul.substring(0, 2);
                        tmp += '-';
                        tmp += seoul.substring(2, 5);
                        tmp += '-';
                        tmp += seoul.substr(5);
                        $scope.vm.form.tel = tmp;
                    } else if (seoul.substring(0, 2) === "02" && seoul.length === 10) {   // 서울 지역번호 조건
                        tmp += seoul.substring(0, 2);
                        tmp += '-';
                        tmp += seoul.substring(2, 6);
                        tmp += '-';
                        tmp += seoul.substr(6);
                        $scope.vm.form.tel = tmp;
                    } else if (phone.length < 11) {     // 핸드폰 및 지방 지역번호 조건
                        tmp += phone.substr(0, 3);
                        tmp += '-';
                        tmp += phone.substr(3, 3);
                        tmp += '-';
                        tmp += phone.substr(6);
                        $scope.vm.form.tel = tmp;
                    } else {                           // 핸드폰 및 지방 지역번호 조건
                        tmp += phone.substr(0, 3);
                        tmp += '-';
                        tmp += phone.substr(3, 4);
                        tmp += '-';
                        tmp += phone.substr(7);
                        $scope.vm.form.tel = tmp;
                    }
                    return phone;
                }
                //  폼 전송
                function formSubmit(condition) {
                    $rootScope.spinner = true;
                    $scope.vm.form.tel = $scope.vm.form.tel.replace(/\-/g,'');  // 전화번호를 보낼땐 하이픈을 제거해서 DB에 저장
                    var content = {
                        code : $rootScope.preventXss($scope.vm.form.code),  //코드