From 398a4927e195755bd6a46be99337efd8dacc3dc2 Mon Sep 17 00:00:00 2001
From: 박지현 <jhpark@maprex.co.kr>
Date: 월, 07 3월 2022 18:08:13 +0900
Subject: [PATCH] Merge branch 'master' of http://maprex.iptime.org:9001/r/owl-kisa

---
 src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js |   50 +++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js b/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js
index 021f8d3..de4a45f 100644
--- a/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js
+++ b/src/main/webapp/scripts/app/companyField/companyFieldModify.controller.js
@@ -41,6 +41,8 @@
                         tel : "",  //�쟾�솕踰덊샇
                         email : "",  //�씠硫붿씪
                         url : "", // url
+                        ipStart : "", //ip�떆�옉二쇱냼
+                        ipEnd : "", //ip醫낅즺二쇱냼
                         memo : "",  //硫붾え(鍮꾧퀬)
                         companyTypeId : "",
                         companyType : "", //湲곗뾽援щ텇
@@ -115,7 +117,16 @@
                 }
 
                 // �뾽泥� 移댄뀒怨좊━ autocomplete page �뾽�뜲�씠�듃
-                function getParentSectorListCallBack(result) {
+                function getParentSectorListCallBack(result, value) {
+                    if (value === "") {
+                        $scope.vm.form.parentSectorId = "";
+                        if ($rootScope.isDefined($scope.vm.form.parentSectors) && $rootScope.isDefined($scope.vm.form.parentSectors[0])) {
+                            $scope.vm.form.parentSectors[0].id = "";
+                        }
+                        $scope.vm.form.childSectorId = "";
+                        $scope.vm.form.childSector = "";
+                        $scope.vm.form.childSectors = [];
+                    }
                     $scope.vm.autoCompletePage.parentSector.totalPage = result.data.page.totalPage;
                 }
 
@@ -144,42 +155,47 @@
                 }
 
                 $scope.$on("ispFieldEvent", function (event, result) {
-                    if ($rootScope.isDefined(result[0])) {
+                    if ($rootScope.isDefined(result) && $rootScope.isDefined(result[0])) {
                         $scope.vm.form.ispId = result[0].id;
                     }
                 });
 
                 $scope.$on("hostingFieldEvent", function (event, result) {
-                    if ($rootScope.isDefined(result[0])) {
+                    if ($rootScope.isDefined(result) && $rootScope.isDefined(result[0])) {
                         $scope.vm.form.hostingId = result[0].id;
                     }
                 });
 
                 $scope.$on("companyTypeEvent", function (event, result) {
-                    if ($rootScope.isDefined(result[0])) {
+                    if ($rootScope.isDefined(result) && $rootScope.isDefined(result[0])) {
                         $scope.vm.form.companyTypeId = result[0].id;
                     }
                 });
                 $scope.$on("parentSectorEvent", function (event, result) {
-                    if ($rootScope.isDefined(result[0])) {
+                    if ($rootScope.isDefined(result) && $rootScope.isDefined(result[0])) {
                         $scope.vm.form.parentSectorId = result[0].id;
+                    }  else {
+                        $scope.vm.form.parentSectorId = "";
+                        if ($rootScope.isDefined($scope.vm.form.parentSectors) && $rootScope.isDefined($scope.vm.form.parentSectors[0])) {
+                            $scope.vm.form.parentSectors[0].id = "";
+                        }
                     }
                     $scope.vm.form.childSectorId = "";
                     $scope.vm.form.childSector = "";
                     $scope.vm.form.childSectors = [];
                 });
                 $scope.$on("childSectorEvent", function (event, result) {
-                    if ($rootScope.isDefined(result[0])) {
+                    if ($rootScope.isDefined(result) && $rootScope.isDefined(result[0])) {
                         $scope.vm.form.childSectorId = result[0].id;
                     }
                 });
                 $scope.$on("regionEvent", function (event, result) {
-                    if ($rootScope.isDefined(result[0])) {
+                    if ($rootScope.isDefined(result) && $rootScope.isDefined(result[0])) {
                         $scope.vm.form.regionId = result[0].id;
                     }
                 });
                 $scope.$on("statusEvent", function (event, result) {
-                    if ($rootScope.isDefined(result[0])) {
+                    if ($rootScope.isDefined(result) && $rootScope.isDefined(result[0])) {
                         $scope.vm.form.statusId = result[0].id;
                     }
                 });
@@ -194,7 +210,7 @@
                         name : $rootScope.preventXss($scope.vm.form.name),
                         ispId : (function () {  // ISP �븘�씠�뵒
                             var ispId = null;
-                            if ($scope.vm.form.ispName !== "" && $scope.vm.form.ispId !== null && $scope.vm.form.ispId !== null) {
+                            if ($scope.vm.form.ispName !== "" && $scope.vm.form.ispId !== null && $scope.vm.form.ispId !== -1) {
                                 ispId = $scope.vm.form.ispId;
                             }else if ($scope.vm.form.issueIspFields != null && $scope.vm.form.issueIspFields.length > 0) {
                                 ispId = $scope.vm.form.issueIspFields[0].id;
@@ -245,8 +261,18 @@
                             }
                             return emailList;
                         })(),
-                        url : $rootScope.preventXss($scope.vm.form.url), // url
-                        memo : $rootScope.preventXss($scope.vm.form.memo),
+                        url : (function () {
+                            //  紐⑤뱺 怨듬갚 �젣嫄�
+                            var regex = / /gi;
+                            let url = $scope.vm.form.url;
+                            if ($rootScope.isDefined(url) && url.indexOf(" ") !== -1) {
+                                url = url.replace(regex, "");
+                            }
+                            return url;
+                        })(),
+                        ipStart : $scope.vm.form.ipStart, // ip�떆�옉二쇱냼
+                        ipEnd : $scope.vm.form.ipEnd, // ip醫낅즺二쇱냼
+                        memo : $scope.vm.form.memo,
                         companyTypeId : (function () {
                             var companyTypeId = null;
                             if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) {
@@ -428,6 +454,8 @@
                                 }
 
                                 $scope.vm.form.url = result.data.content.url;
+                                $scope.vm.form.ipStart = result.data.content.ipStart;
+                                $scope.vm.form.ipEnd = result.data.content.ipEnd;
                                 $scope.vm.form.memo = result.data.content.memo;
                                 $scope.vm.form.companyTypeId = result.data.content.companyTypeId;
                                 $scope.vm.form.companyType = result.data.content.companyTypeName;

--
Gitblit v1.8.0