From a227dd7df7f84a5cfb7218042a6f844991dcfb96 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 수, 09 2월 2022 14:53:41 +0900 Subject: [PATCH] - isp, 호스팅 엑셀 import 기능 추가 --- src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js b/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js index aaae690..6b9b468 100644 --- a/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js +++ b/src/main/webapp/scripts/app/companyField/companyFieldAdd.controller.js @@ -140,15 +140,21 @@ } $scope.$on("ispFieldEvent", function (event, result) { - $scope.vm.form.ispId = result[0].id; + if ($rootScope.isDefined(result[0])) { + $scope.vm.form.ispId = result[0].id; + } }); $scope.$on("hostingFieldEvent", function (event, result) { - $scope.vm.form.hostingId = result[0].id; + if ($rootScope.isDefined(result[0])) { + $scope.vm.form.hostingId = result[0].id; + } }); $scope.$on("companyTypeEvent", function (event, result) { - $scope.vm.form.companyTypeId = result[0].id; + if ($rootScope.isDefined(result[0])) { + $scope.vm.form.companyTypeId = result[0].id; + } }); $scope.$on("parentSectorEvent", function (event, result) { if ($rootScope.isDefined(result[0])) { @@ -159,13 +165,19 @@ $scope.vm.form.childSectors = []; }); $scope.$on("childSectorEvent", function (event, result) { - $scope.vm.form.childSectorId = result[0].id; + if ($rootScope.isDefined(result[0])) { + $scope.vm.form.childSectorId = result[0].id; + } }); $scope.$on("regionEvent", function (event, result) { - $scope.vm.form.regionId = result[0].id; + if ($rootScope.isDefined(result[0])) { + $scope.vm.form.regionId = result[0].id; + } }); $scope.$on("statusEvent", function (event, result) { - $scope.vm.form.statusId = result[0].id; + if ($rootScope.isDefined(result[0])) { + $scope.vm.form.statusId = result[0].id; + } }); // �뤌 �쟾�넚 @@ -175,14 +187,14 @@ var content = { name : $rootScope.preventXss($scope.vm.form.name), // �뾽泥대챸 ispId : (function () { // ISP �븘�씠�뵒 - var ispId = -1; + var ispId = null; if ($scope.vm.form.issueIspFields != null) { ispId = $scope.vm.form.ispId; } return ispId; })(), hostingId : (function () { // Hosting �븘�씠�뵒 - var hostingId = -1; + var hostingId = null; if ($scope.vm.form.issueHostingFields != null) { hostingId = $scope.vm.form.hostingId; } @@ -226,35 +238,35 @@ url : $scope.vm.form.url, // url memo : $scope.vm.form.memo, //鍮꾧퀬 companyTypeId : (function () { - var companyTypeId = -1; + var companyTypeId = null; if ($scope.vm.form.companyTypes != null && $scope.vm.form.companyTypes.length > 0) { companyTypeId = $scope.vm.form.companyTypes[0].id; } return companyTypeId; })(), parentSectorId : (function () { - var parentSectorId = -1; + var parentSectorId = null; if ($scope.vm.form.parentSectors != null && $scope.vm.form.parentSectors.length > 0) { parentSectorId = $scope.vm.form.parentSectors[0].id; } return parentSectorId; })(), childSectorId : (function () { - var childSectorId = -1; + var childSectorId = null; if ($scope.vm.form.childSectors != null && $scope.vm.form.childSectors.length > 0) { childSectorId = $scope.vm.form.childSectors[0].id; } return childSectorId; })(), regionId : (function () { - var regionId = -1; + var regionId = null; if ($scope.vm.form.regions != null && $scope.vm.form.regions.length > 0) { regionId = $scope.vm.form.regions[0].id; } return regionId; })(), statusId : (function () { - var statusId = -1; + var statusId = null; if ($scope.vm.form.statuses != null && $scope.vm.form.statuses.length > 0) { statusId = $scope.vm.form.statuses[0].id; } else if ($scope.vm.form.status !== ""){ -- Gitblit v1.8.0