From fb08399e35f7b90c9c5ef9781af10569be85f9ca Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 월, 14 2월 2022 16:08:44 +0900 Subject: [PATCH] - 사용자정의필드 기본값 입력시 모든 오류 메세지가 표시되는 문제 해결 --- src/main/webapp/scripts/app/customField/customFieldAdd.controller.js | 42 +++++++++++++++++++++++++++++++----------- 1 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/main/webapp/scripts/app/customField/customFieldAdd.controller.js b/src/main/webapp/scripts/app/customField/customFieldAdd.controller.js index 4edbe60..b1ce6f2 100644 --- a/src/main/webapp/scripts/app/customField/customFieldAdd.controller.js +++ b/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 = { @@ -24,8 +24,20 @@ name : "", // �궗�슜�옄 �젙�쓽 �븘�뱶 紐� customFieldType : "INPUT", // �궗�슜�옄 �젙�쓽 �븘�뱶 �쑀�삎 defaultValue : "", // 湲곕낯 媛� + defaultNumValue : "", // 湲곕낯 媛� + defaultDateValue : "", // 湲곕낯 媛� + defaultIpValue : "", // 湲곕낯 媛� + defaultEmailValue : "", // 湲곕낯 媛� + defaultTelValue : "", // 湲곕낯 媛� + defaultSiteValue : "", // 湲곕낯 媛� options : [], // �샃�뀡 - optionText : "" // �샃�뀡 媛� + optionText : "", // �샃�뀡 媛� + numberType : "", + ipAddress : "", + email : "", + site : "", + tel : "", + requiredData : false } }; @@ -36,13 +48,20 @@ // �븘�뱶 �쑀�삎�쓣 蹂�寃� �뻽�쓣 �븣 臾몄옄�뿴 �븘�뱶�씪 寃쎌슦�뿉�뒗 �샃�뀡 媛믪쓣 珥덇린�솕�빐以��떎. 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 = ""; + $scope.vm.form.defaultNumValue = ""; + $scope.vm.form.defaultDateValue = ""; + $scope.vm.form.defaultIpValue = ""; + $scope.vm.form.defaultEmailValue = ""; + $scope.vm.form.defaultTelValue = ""; + $scope.vm.form.defaultSiteValue = ""; } + // Select �샃�뀡 媛� 異붽��븯湲� function addOption() { @@ -69,7 +88,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 +101,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 +113,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 +129,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) { -- Gitblit v1.8.0