- api로 이슈 추가 시 사용자정의필드 타입으로 체크 => 정규식표현검사로 체크로 변경
| | |
| | | List<CompanyField> findByIspId(@Param("isp_id") Long id); |
| | | |
| | | List<CompanyField> findByHostingId(@Param("hosting_id") Long id); |
| | | |
| | | List<CompanyField> findByIdNot(@Param("id") Long id); |
| | | } |
| | |
| | | // 업체명 중복 체크 |
| | | this.verifyTitle(companyFieldForm.getName(), null); |
| | | |
| | | if (companyFieldForm.getIpStart() != null && companyFieldForm.getIpEnd() != null) { |
| | | // 아이피 유효성 체크 |
| | | this.verifyIp(companyFieldForm.getIpStart(), companyFieldForm.getIpEnd(), null); |
| | | } |
| | | |
| | | if (companyFieldForm.getUrl() != null) { |
| | | // url 유효성 체크 |
| | | this.verifyUrl(companyFieldForm.getUrl(), null); |
| | | } |
| | | |
| | | if (companyFieldForm.getIpStarts() != null && companyFieldForm.getIpStarts().size() > 0 |
| | | && companyFieldForm.getIpEnds() != null && companyFieldForm.getIpEnds().size() > 0) { |
| | | |
| | | for (int i=0; i<companyFieldForm.getIpStarts().size(); i++) { |
| | | // 아이피 유효성 체크 |
| | | this.verifyIp(companyFieldForm.getIpStarts().get(i), companyFieldForm.getIpEnds().get(i), null); |
| | | } |
| | | |
| | | String startIps = companyFieldForm.getIpStarts().toString(); |
| | | // 대괄호 제거 |
| | | startIps = this.removeSquare(startIps); |
| | | companyFieldForm.setIpStart(startIps.trim()); |
| | | |
| | | String endIps = companyFieldForm.getIpEnds().toString(); |
| | | // 대괄호 제거 |
| | | endIps = this.removeSquare(endIps); |
| | | companyFieldForm.setIpEnd(endIps.trim()); |
| | | } |
| | | |
| | | if (companyFieldForm.getTelList() != null && companyFieldForm.getTelList().size() > 0) { |
| | | String tels = companyFieldForm.getTelList().toString(); |
| | | if (tels.contains("[")) { |
| | | tels = tels.substring(1, tels.indexOf("]")); |
| | | } |
| | | // 대괄호 제거 |
| | | tels = this.removeSquare(tels); |
| | | companyFieldForm.setTel(tels.trim()); |
| | | } |
| | | if (companyFieldForm.getEmailList() != null && companyFieldForm.getEmailList().size() > 0) { |
| | | String emails = companyFieldForm.getEmailList().toString(); |
| | | String email = ""; |
| | | if (emails.contains("[")) { |
| | | email = emails.substring(1, emails.indexOf("]")); |
| | | } |
| | | companyFieldForm.setEmail(email.trim()); |
| | | // 대괄호 제거 |
| | | emails = this.removeSquare(emails); |
| | | companyFieldForm.setEmail(emails.trim()); |
| | | } |
| | | |
| | | CompanyField companyField = ConvertUtil.copyProperties(companyFieldForm, CompanyField.class); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 대괄호([]) 제거 함수 |
| | | * @param str String |
| | | * @return str |
| | | */ |
| | | private String removeSquare(String str) { |
| | | if (str.contains("[")) { |
| | | str = str.substring(1, str.indexOf("]")); |
| | | } |
| | | |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * IP 유효성 체크 |
| | | * @param ip String |
| | | * @param ip2 String |
| | | * @param id Long |
| | | */ |
| | | private void verifyIp(String ip, String ip2, Long id) { |
| | | if (!StringUtils.isEmpty(ip)) { |
| | |
| | | condition.setIpEnd(String.valueOf(ipEnd)); |
| | | if (id != null) { |
| | | condition.setId(id); |
| | | companyFields = this.companyFieldMapper.findByIpsAndIdNot(condition); |
| | | companyFields = this.companyFieldRepository.findByIdNot(condition.getId()); |
| | | } else { |
| | | companyFields = this.companyFieldMapper.findByIps(condition); |
| | | companyFields = this.companyFieldRepository.findAll(); |
| | | } |
| | | |
| | | // IP대역대 중복 체크 |
| | | if (companyFields != null && companyFields.size() > 0) { |
| | | this.ipOverlapChk(companyFields, ipStart, ipEnd); |
| | | |
| | | /*if (companyFields != null && companyFields.size() > 0) { |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.COMPANY_EXIST_IP)); |
| | | }*/ |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ip 대역대 중복 체크 |
| | | * @param companyFields List<CompanyField> |
| | | */ |
| | | private void ipOverlapChk(List<CompanyField> companyFields, long ipStart, long ipEnd) { |
| | | String[] ipStartArr = null; |
| | | String[] ipEndArr = null; |
| | | List<String> startIpList = Lists.newArrayList(); |
| | | List<String> endIpList = Lists.newArrayList(); |
| | | String startIp = ""; |
| | | String endIp = ""; |
| | | List<Long> startIps = Lists.newArrayList(); |
| | | List<Long> endIps = Lists.newArrayList(); |
| | | |
| | | if (companyFields.size() > 0) { |
| | | for (CompanyField companyField : companyFields) { |
| | | if(companyField.getIpStart() != null && companyField.getIpEnd() != null) { |
| | | startIp = companyField.getIpStart(); |
| | | if (startIp.contains(" ")) { |
| | | startIp = startIp.replace(" ",""); |
| | | } |
| | | if (startIp.contains(",")) { |
| | | ipStartArr = startIp.split(","); |
| | | startIpList.addAll(Arrays.asList(ipStartArr)); |
| | | } else { |
| | | startIpList.add(startIp.trim()); |
| | | } |
| | | |
| | | endIp = companyField.getIpEnd(); |
| | | if (endIp.contains(" ")) { |
| | | endIp = endIp.replace(" ",""); |
| | | } |
| | | if (endIp.contains(",")) { |
| | | ipEndArr = endIp.split(","); |
| | | endIpList.addAll(Arrays.asList(ipEndArr)); |
| | | } else { |
| | | endIpList.add(endIp.trim()); |
| | | } |
| | | } |
| | | } |
| | | if (startIpList.size() > 0) { |
| | | for (String ipS : startIpList) { |
| | | long start = ConvertUtil.ipToLong(ipS); |
| | | startIps.add(start); |
| | | } |
| | | for (String ipE : endIpList) { |
| | | long end = ConvertUtil.ipToLong(ipE); |
| | | endIps.add(end); |
| | | } |
| | | } |
| | | |
| | | for (int i=0; i<startIps.size(); i++) { |
| | | if (startIps.get(i) >= ipStart && startIps.get(i) <= ipEnd || endIps.get(i) >= ipStart && endIps.get(i) <= ipEnd |
| | | || ipStart >= startIps.get(i) && ipStart <= endIps.get(i) || ipEnd >= startIps.get(i) && ipEnd <= endIps.get(i)) { |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.COMPANY_EXIST_IP)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // 업체명 유효성 체크 |
| | | this.verifyTitle(companyFieldForm.getName(), companyFieldForm.getId()); |
| | | |
| | | if (companyFieldForm.getIpStart() != null && companyFieldForm.getIpEnd() != null) { |
| | | // 아이피 유효성 체크 |
| | | this.verifyIp(companyFieldForm.getIpStart(), companyFieldForm.getIpEnd(), companyFieldForm.getId()); |
| | | } |
| | | |
| | | if (companyFieldForm.getUrl() != null) { |
| | | // url 유효성 체크 |
| | | this.verifyUrl(companyFieldForm.getUrl(), companyFieldForm.getId()); |
| | | } |
| | | |
| | | if (companyFieldForm.getIpStarts() != null && companyFieldForm.getIpStarts().size() > 0 |
| | | && companyFieldForm.getIpEnds() != null && companyFieldForm.getIpEnds().size() > 0) { |
| | | |
| | | for (int i=0; i<companyFieldForm.getIpStarts().size(); i++) { |
| | | // 아이피 유효성 체크 |
| | | this.verifyIp(companyFieldForm.getIpStarts().get(i), companyFieldForm.getIpEnds().get(i), companyFieldForm.getId()); |
| | | } |
| | | |
| | | String startIps = companyFieldForm.getIpStarts().toString(); |
| | | // 대괄호 제거 |
| | | startIps = this.removeSquare(startIps); |
| | | companyFieldForm.setIpStart(startIps.trim()); |
| | | |
| | | String endIps = companyFieldForm.getIpEnds().toString(); |
| | | // 대괄호 제거 |
| | | endIps = this.removeSquare(endIps); |
| | | companyFieldForm.setIpEnd(endIps.trim()); |
| | | } |
| | | |
| | | if (companyFieldForm.getTelList() != null && companyFieldForm.getTelList().size() > 0) { |
| | | String tels = companyFieldForm.getTelList().toString(); |
| | | if (tels.contains("[")) { |
| | | tels = tels.substring(1, tels.indexOf("]")); |
| | | } |
| | | // 대괄호 제거 |
| | | tels = this.removeSquare(tels); |
| | | companyFieldForm.setTel(tels.trim()); |
| | | } |
| | | if (companyFieldForm.getEmailList() != null && companyFieldForm.getEmailList().size() > 0) { |
| | | String emails = companyFieldForm.getEmailList().toString(); |
| | | if (emails.contains("[")) { |
| | | emails = emails.substring(1, emails.indexOf("]")); |
| | | } |
| | | // 대괄호 제거 |
| | | emails = this.removeSquare(emails); |
| | | companyFieldForm.setEmail(emails.trim()); |
| | | } |
| | | |
| | |
| | | |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | private long ip; |
| | | private String ipStart; |
| | | private String ipEnd; |
| | | private List<String> ipStarts = new ArrayList<>(); |
| | | private List<String> ipEnds = new ArrayList<>(); |
| | | private String memo; |
| | | private Long ispId; |
| | | private Long hostingId; |
| | |
| | | this.ipEnd = ipEnd; |
| | | } |
| | | |
| | | public List<String> getIpStarts() { |
| | | return ipStarts; |
| | | } |
| | | |
| | | public void setIpStarts(List<String> ipStarts) { |
| | | this.ipStarts = ipStarts; |
| | | } |
| | | |
| | | public List<String> getIpEnds() { |
| | | return ipEnds; |
| | | } |
| | | |
| | | public void setIpEnds(List<String> ipEnds) { |
| | | this.ipEnds = ipEnds; |
| | | } |
| | | |
| | | public Long getIspId() { |
| | | return ispId; |
| | | } |
| | |
| | | private String url; |
| | | private String ipStart; |
| | | private String ipEnd; |
| | | private List<String> ipStarts = new ArrayList<>(); |
| | | private List<String> ipEnds = new ArrayList<>(); |
| | | private String memo; |
| | | private String tel; |
| | | private Long ispId; |
| | |
| | | |
| | | if (MapUtil.getStrings(params, "emails") != null) { |
| | | form.setEmailList(MapUtil.getStrings(params, "emails")); |
| | | } |
| | | |
| | | if (MapUtil.getStrings(params, "ipStarts") != null && MapUtil.getStrings(params, "ipEnds") != null) { |
| | | form.setIpStarts(MapUtil.getStrings(params, "ipStarts")); |
| | | form.setIpEnds(MapUtil.getStrings(params, "ipEnds")); |
| | | } |
| | | |
| | | if (MapUtil.getLongs(params,"removeIds") != null) { |
| | |
| | | this.ipEnd = ipEnd; |
| | | } |
| | | |
| | | public List<String> getIpStarts() { |
| | | return ipStarts; |
| | | } |
| | | |
| | | public void setIpStarts(List<String> ipStarts) { |
| | | this.ipStarts = ipStarts; |
| | | } |
| | | |
| | | public List<String> getIpEnds() { |
| | | return ipEnds; |
| | | } |
| | | |
| | | public void setIpEnds(List<String> ipEnds) { |
| | | this.ipEnds = ipEnds; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
New file |
| | |
| | | |
| | | /* 업체 IP 대역대 컬럼 변경 */ |
| | | ALTER TABLE `company_field` MODIFY COLUMN `ip_start` varchar(255) NULL; |
| | | ALTER TABLE `company_field` MODIFY COLUMN `ip_end` varchar(255) NULL; |
| | | ALTER TABLE `issue_company` MODIFY COLUMN `ip_start` varchar(255) NULL; |
| | | ALTER TABLE `issue_company` MODIFY COLUMN `ip_end` varchar(255) NULL; |
| | |
| | | cf.id as id, |
| | | cf.name as name, |
| | | cf.email as email, |
| | | cf.url as url |
| | | cf.url as url, |
| | | cf.ip_start AS ipStart, |
| | | cf.ip_end AS ipEnd |
| | | FROM |
| | | company_field cf |
| | | WHERE 1=1 |
| | |
| | | cf.id as id, |
| | | cf.name as name, |
| | | cf.email as email, |
| | | cf.url as url |
| | | cf.url as url, |
| | | cf.ip_start AS ipStart, |
| | | cf.ip_end AS ipEnd |
| | | FROM |
| | | company_field cf |
| | | WHERE 1=1 |
| | | <choose> |
| | | <when test="ipStart != null and ipStart != '' and ipEnd != null and ipEnd != ''"> |
| | | AND INET_ATON(cf.ip_start) BETWEEN #{ipStart} AND #{ipEnd} OR INET_ATON(cf.ip_end) BETWEEN #{ipStart} AND #{ipEnd} |
| | | AND (INET_ATON(cf.ip_start) BETWEEN #{ipStart} AND #{ipEnd} OR INET_ATON(cf.ip_end) BETWEEN #{ipStart} AND #{ipEnd} |
| | | OR #{ipStart} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end) OR #{ipEnd} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end)) |
| | | </when> |
| | | </choose> |
| | | </select> |
| | |
| | | cf.id as id, |
| | | cf.name as name, |
| | | cf.email as email, |
| | | cf.url as url |
| | | cf.url as url, |
| | | cf.ip_start AS ipStart, |
| | | cf.ip_end AS ipEnd |
| | | FROM |
| | | company_field cf |
| | | WHERE 1=1 |
| | | <choose> |
| | | <when test="ipStart != null and ipStart != '' and ipEnd != null and ipEnd != ''"> |
| | | AND (INET_ATON(cf.ip_start) BETWEEN #{ipStart} AND #{ipEnd} OR INET_ATON(cf.ip_end) BETWEEN #{ipStart} AND #{ipEnd}) |
| | | AND (INET_ATON(cf.ip_start) BETWEEN #{ipStart} AND #{ipEnd} OR INET_ATON(cf.ip_end) BETWEEN #{ipStart} AND #{ipEnd} |
| | | OR #{ipStart} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end) OR #{ipEnd} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end)) |
| | | </when> |
| | | </choose> |
| | | <if test="id != '' and id != null"> |
| | |
| | | .select3-selection__email__remove { |
| | | color: #0066ff; |
| | | margin-left: 8px; |
| | | margin-top: 7px; |
| | | margin-top: 9px; |
| | | cursor: pointer; |
| | | font-size: 0.79rem; |
| | | } |
| | | |
| | | .select3-selection__ipRange__remove { |
| | | color: #0066ff; |
| | | padding-left: 9px; |
| | | margin-top: 7px; |
| | | margin-left: -2px; |
| | | margin-right: 9px; |
| | | cursor: pointer; |
| | | font-size: 0.79rem; |
| | | } |
| | | |
| | | .select3-selection__ipRange__tilde { |
| | | padding-left: 9px; |
| | | margin-top: 7px; |
| | | margin-left: 6px; |
| | | margin-right: -18px; |
| | | } |
| | | |
| | | .select4-selection__choice { |
| | | font-size: 0.66rem; |
| | | letter-spacing: -0.01em; |
| | |
| | | "invalidTelFormat": "전화번호 형식이 맞지 않습니다. xxx-xxx-xxxx 형식으로 입력하세요.", |
| | | "writeCompanyTel": "전화번호를 입력해주세요.", |
| | | "writeTel": "전화번호를 입력하셔야 추가할수 있습니다.", |
| | | "ipRangeError": "IP 대역대 입력 실패", |
| | | "ipStartNotLargerThanEnd": "시작 IP가 끝 IP 보다 클 수 없습니다.", |
| | | "ipRangeNotEnter": "시작 IP와 끝 IP 모두 입력 해야 합니다.", |
| | | "ipRangeNotOverlap": "중복되는 ip 대역대가 존재합니다.", |
| | | "writeCompanyIpRange": "IP 대역대를 입력해주세요.", |
| | | "writeIpRange": "IP 대역대를 입력하셔야 추가할수 있습니다.", |
| | | "registerExcelCompanyFields": "엑셀로 업체 등록하기", |
| | | "registerExcelUploadCompanyField": "엑셀 업로드 업체 등록", |
| | | "succeededCompanyFieldRegistration": "업체 등록 성공", |
| | |
| | | getStatusListCallBack : getStatusListCallBack, |
| | | addTel : addTel, |
| | | addMail : addMail, |
| | | addIpRange : addIpRange, |
| | | removeTelInput : removeTelInput, |
| | | removeMailInput : removeMailInput |
| | | removeMailInput : removeMailInput, |
| | | removeIpRangeInput : removeIpRangeInput |
| | | }; |
| | | |
| | | $scope.vm = { |
| | |
| | | statusId : "", |
| | | status : "", //상태 |
| | | inputTels : [0], //연락처 |
| | | tels : {}, |
| | | tels : [], |
| | | inputMails : [0], //이메일 |
| | | emails : {} |
| | | emails : [], |
| | | inputIpStarts : [0], //ip 시작점 |
| | | ipStarts : [], |
| | | inputIpEnds : [0], //ip 종료점 |
| | | ipEnds : [] |
| | | }, |
| | | typeCategory : { |
| | | companyType : "COMPANYTYPE", |
| | |
| | | } |
| | | return url; |
| | | })(), |
| | | ipStart : $scope.vm.form.ipStart, // ip시작주소 |
| | | ipEnd : $scope.vm.form.ipEnd, // ip종료주소 |
| | | ipStarts : (function () { |
| | | var ipStarts = []; |
| | | if ($scope.vm.form.ipStarts != null) { |
| | | angular.forEach($scope.vm.form.ipStarts, function (ipS) { |
| | | ipStarts.push(ipS); |
| | | }); |
| | | ipStarts = ipStarts.filter(function(item) { //쓰레기 데이터 필터링 |
| | | return item !== null && item !== undefined && item !== ''; |
| | | }); |
| | | } |
| | | return ipStarts; |
| | | })(), |
| | | ipEnds : (function () { |
| | | var ipEnds = []; |
| | | if ($scope.vm.form.ipEnds != null) { |
| | | angular.forEach($scope.vm.form.ipEnds, function (ipE) { |
| | | ipEnds.push(ipE); |
| | | }); |
| | | ipEnds = ipEnds.filter(function(item) { //쓰레기 데이터 필터링 |
| | | return item !== null && item !== undefined && item !== ''; |
| | | }); |
| | | } |
| | | return ipEnds; |
| | | })(), |
| | | memo : $scope.vm.form.memo, //비고 |
| | | companyTypeId : (function () { |
| | | var companyTypeId = null; |
| | |
| | | statusName : $scope.vm.form.status |
| | | }; |
| | | |
| | | // ip 대역대 유효성 체크 |
| | | let result = ipRangeChk(content.ipStarts, content.ipEnds); |
| | | if (!result) { |
| | | $rootScope.spinner = false; |
| | | return; |
| | | } |
| | | |
| | | CompanyField.add($resourceProvider.getContent(content, |
| | | $resourceProvider.getPageContent(0, 10))).then(function (result) { |
| | | |
| | |
| | | $rootScope.$broadcast("getPageList", {}); |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("companyField.failedCompanyFieldRegistration"), result.data.message.message); |
| | | SweetAlert.warning($filter("translate")("companyField.failedCompanyFieldRegistration"), result.data.message.message); |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | |
| | | // ip 대역대 유효성 검사 |
| | | function ipRangeChk(ipStarts, ipEnds) { |
| | | let result = true; |
| | | |
| | | if ($rootScope.isDefined(ipStarts) && $rootScope.isDefined(ipEnds)) { |
| | | if (ipStarts.length !== ipEnds.length) { |
| | | SweetAlert.warning($filter("translate")("companyField.ipRangeError"), $filter("translate")("companyField.ipRangeNotEnter")); |
| | | result = false; |
| | | return; |
| | | } |
| | | |
| | | let ipStartArr = []; |
| | | let ipEndArr = []; |
| | | |
| | | for (let i=0; i<ipStarts.length; i++) { |
| | | let ipStart = ipToLong(ipStarts[i]); |
| | | let ipEnd = ipToLong(ipEnds[i]); |
| | | if (ipEnd < ipStart) { |
| | | SweetAlert.warning($filter("translate")("companyField.ipRangeError"), $filter("translate")("companyField.ipStartNotLargerThanEnd")); |
| | | result = false; |
| | | return; |
| | | } |
| | | ipStartArr.push(ipStart); |
| | | ipEndArr.push(ipEnd); |
| | | } |
| | | |
| | | for (let i=0; i<ipStartArr.length; i++) { |
| | | if ($rootScope.isDefined(ipStartArr[i+1])) { |
| | | if((ipStartArr[i] >= ipStartArr[i+1] && ipStartArr[i] <= ipEndArr[i+1]) |
| | | || (ipEndArr[i] >= ipStartArr[i+1] && ipEndArr[i] <= ipEndArr[i+1])) { |
| | | SweetAlert.warning($filter("translate")("companyField.ipRangeError"), $filter("translate")("companyField.ipRangeNotOverlap")); |
| | | result = false; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | // ip 주소 숫자로 변환 |
| | | function ipToLong(ip) { |
| | | let result = 0; |
| | | let ipArr = ip.split("."); |
| | | |
| | | for (let i=0; i<ipArr.length; i++) { |
| | | result += parseInt(ipArr[i]) * Math.pow(256, 3-i); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | // 연락처 input 창 추가 버튼 |
| | |
| | | } |
| | | } |
| | | |
| | | // IPRange input 창 추가 버튼 |
| | | function addIpRange() { |
| | | var arrayFull = true; // 배열이 가득 차 있는지 여부 |
| | | var startIdx = 0; |
| | | var endIdx = 0; |
| | | $scope.vm.form.inputIpStarts.forEach(function (start) { |
| | | if (!$rootScope.isDefined($scope.vm.form.ipStarts[startIdx])) { |
| | | arrayFull = false; |
| | | } |
| | | startIdx++; |
| | | }); |
| | | |
| | | $scope.vm.form.inputIpEnds.forEach(function (start) { |
| | | if (!$rootScope.isDefined($scope.vm.form.ipEnds[endIdx])) { |
| | | arrayFull = false; |
| | | } |
| | | endIdx++; |
| | | }); |
| | | |
| | | if (arrayFull) { |
| | | $scope.vm.form.inputIpStarts.push(startIdx); |
| | | $scope.vm.form.ipStarts[startIdx] = ""; |
| | | $scope.vm.form.inputIpEnds.push(endIdx); |
| | | $scope.vm.form.ipEnds[endIdx] = ""; |
| | | } else { |
| | | SweetAlert.warning($filter("translate")("companyField.writeCompanyIpRange"), $filter("translate")("companyField.writeIpRange")); // 추가버튼 경고 |
| | | } |
| | | } |
| | | |
| | | // 연락처 input 삭제 |
| | | function removeTelInput(index) { |
| | | $scope.vm.form.inputTels.splice(index, 1); |
| | | $scope.vm.form.tels.splice(index, 1); |
| | | } |
| | | |
| | | // 이메일 주소 input 삭제 |
| | | function removeMailInput(index) { |
| | | $scope.vm.form.inputMails.splice(index, 1); |
| | | $scope.vm.form.emails.splice(index, 1); |
| | | } |
| | | |
| | | // ipRange input 삭제 |
| | | function removeIpRangeInput(index) { |
| | | $scope.vm.form.inputIpStarts.splice(index, 1); |
| | | $scope.vm.form.ipStarts.splice(index, 1); |
| | | $scope.vm.form.inputIpEnds.splice(index, 1); |
| | | $scope.vm.form.ipEnds.splice(index, 1); |
| | | } |
| | | |
| | | // 팝업 창 닫기 |
| | |
| | | getStatusListCallBack : getStatusListCallBack, |
| | | addTel : addTel, |
| | | addMail : addMail, |
| | | addIpRange : addIpRange, |
| | | removeTelInput : removeTelInput, |
| | | removeMailInput : removeMailInput |
| | | removeMailInput : removeMailInput, |
| | | removeIpRangeInput : removeIpRangeInput |
| | | }; |
| | | |
| | | $scope.vm = { |
| | |
| | | statusId : "", |
| | | status : "", //상태 |
| | | inputTels : [0], |
| | | tels : {}, |
| | | tels : [], |
| | | inputMails : [0], |
| | | emails : {} |
| | | emails : [], |
| | | inputIpStarts : [0], //ip 시작점 |
| | | ipStarts : [], |
| | | inputIpEnds : [0], //ip 종료점 |
| | | ipEnds : [] |
| | | }, |
| | | typeCategory : { |
| | | companyType : "COMPANYTYPE", |
| | |
| | | } |
| | | return url; |
| | | })(), |
| | | ipStart : $scope.vm.form.ipStart, // ip시작주소 |
| | | ipEnd : $scope.vm.form.ipEnd, // ip종료주소 |
| | | ipStarts : (function () { |
| | | var ipStarts = []; |
| | | if ($scope.vm.form.ipStarts != null) { |
| | | angular.forEach($scope.vm.form.ipStarts, function (ipS) { |
| | | ipStarts.push(ipS); |
| | | }); |
| | | ipStarts = ipStarts.filter(function(item) { //쓰레기 데이터 필터링 |
| | | return item !== null && item !== undefined && item !== ''; |
| | | }); |
| | | } |
| | | return ipStarts; |
| | | })(), |
| | | ipEnds : (function () { |
| | | var ipEnds = []; |
| | | if ($scope.vm.form.ipEnds != null) { |
| | | angular.forEach($scope.vm.form.ipEnds, function (ipE) { |
| | | ipEnds.push(ipE); |
| | | }); |
| | | ipEnds = ipEnds.filter(function(item) { //쓰레기 데이터 필터링 |
| | | return item !== null && item !== undefined && item !== ''; |
| | | }); |
| | | } |
| | | return ipEnds; |
| | | })(), |
| | | memo : $scope.vm.form.memo, |
| | | companyTypeId : (function () { |
| | | var companyTypeId = null; |
| | |
| | | } |
| | | } |
| | | |
| | | // IPRange input 창 추가 버튼 |
| | | function addIpRange() { |
| | | var arrayFull = true; // 배열이 가득 차 있는지 여부 |
| | | var startIdx = 0; |
| | | var endIdx = 0; |
| | | $scope.vm.form.inputIpStarts.forEach(function (start) { |
| | | if (!$rootScope.isDefined($scope.vm.form.ipStarts[startIdx])) { |
| | | arrayFull = false; |
| | | } |
| | | startIdx++; |
| | | }); |
| | | |
| | | $scope.vm.form.inputIpEnds.forEach(function (start) { |
| | | if (!$rootScope.isDefined($scope.vm.form.ipEnds[endIdx])) { |
| | | arrayFull = false; |
| | | } |
| | | endIdx++; |
| | | }); |
| | | |
| | | if (arrayFull) { |
| | | $scope.vm.form.inputIpStarts.push(startIdx); |
| | | $scope.vm.form.ipStarts[startIdx] = ""; |
| | | $scope.vm.form.inputIpEnds.push(endIdx); |
| | | $scope.vm.form.ipEnds[endIdx] = ""; |
| | | } else { |
| | | SweetAlert.warning($filter("translate")("companyField.writeCompanyIpRange"), $filter("translate")("companyField.writeIpRange")); // 추가버튼 경고 |
| | | } |
| | | } |
| | | |
| | | // 연락처 input 삭제 |
| | | function removeTelInput(index) { |
| | | $scope.vm.form.inputTels.splice(index, 1); |
| | | $scope.vm.form.tels.splice(index, 1); |
| | | } |
| | | |
| | | // 이메일 주소 input 삭제 |
| | | function removeMailInput(index) { |
| | | $scope.vm.form.inputMails.splice(index, 1); |
| | | $scope.vm.form.emails.splice(index, 1); |
| | | } |
| | | |
| | | // ipRange input 삭제 |
| | | function removeIpRangeInput(index) { |
| | | $scope.vm.form.inputIpStarts.splice(index, 1); |
| | | $scope.vm.form.ipStarts.splice(index, 1); |
| | | $scope.vm.form.inputIpEnds.splice(index, 1); |
| | | $scope.vm.form.ipEnds.splice(index, 1); |
| | | } |
| | | |
| | | // 팝업 창 닫기 |
| | |
| | | $scope.vm.form.emails = angular.copy(inputMails); |
| | | } |
| | | |
| | | if (result.data.content.ipStart != null) { |
| | | var inputIpStarts = $scope.vm.form.inputIpStarts; |
| | | var ipStarts = result.data.content.ipStart |
| | | if (result.data.content.ipStart.indexOf("[") !== -1){ |
| | | ipStarts = result.data.content.ipStart.substr(1, result.data.content.ipStart.indexOf("]")-1); |
| | | } |
| | | var ipStartArr = ipStarts.split(","); |
| | | angular.forEach(ipStartArr, function (ipS) { |
| | | var ipStart = ipS.trim(); |
| | | inputIpStarts.push(ipStart); |
| | | }); |
| | | inputIpStarts = inputIpStarts.filter(function(item) { |
| | | return item !== null && item !== undefined && item !== ''; |
| | | }); |
| | | if(inputIpStarts[0] === 0 || inputIpStarts[0] === "") { // 첫번째 배열은 공백으로 |
| | | inputIpStarts.shift(); |
| | | } |
| | | inputIpStarts.push(""); |
| | | $scope.vm.form.ipStarts = angular.copy(inputIpStarts); |
| | | } |
| | | |
| | | if (result.data.content.ipEnd != null) { |
| | | var inputIpEnds = $scope.vm.form.inputIpEnds; |
| | | var ipEnds = result.data.content.ipEnd |
| | | if (result.data.content.ipEnd.indexOf("[") !== -1){ |
| | | ipEnds = result.data.content.ipEnd.substr(1, result.data.content.ipEnd.indexOf("]")-1); |
| | | } |
| | | var ipEndArr = ipEnds.split(","); |
| | | angular.forEach(ipEndArr, function (ipS) { |
| | | var ipEnd = ipS.trim(); |
| | | inputIpEnds.push(ipEnd); |
| | | }); |
| | | inputIpEnds = inputIpEnds.filter(function(item) { |
| | | return item !== null && item !== undefined && item !== ''; |
| | | }); |
| | | if(inputIpEnds[0] === 0 || inputIpEnds[0] === "") { // 첫번째 배열은 공백으로 |
| | | inputIpEnds.shift(); |
| | | } |
| | | inputIpEnds.push(""); |
| | | $scope.vm.form.ipEnds = angular.copy(inputIpEnds); |
| | | } |
| | | |
| | | $scope.vm.form.url = result.data.content.url; |
| | | $scope.vm.form.ipStart = result.data.content.ipStart; |
| | | $scope.vm.form.ipEnd = result.data.content.ipEnd; |
| | |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6 mw-49"> |
| | | <div class="col-lg-5 mw-49"> |
| | | <div class="form-group"> |
| | | <label for="companyFieldAddForm11" class="issue-label"> |
| | | <span translate="companyField.ipRange">ip 대역대</span> |
| | | </label> |
| | | <input id="companyFieldAddForm11" |
| | | name="ipStart" |
| | | type="text" |
| | | class="form-control" |
| | | kr-input |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 주소 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | ng-model="vm.form.ipStart" |
| | | > |
| | | <div ng-repeat="s in vm.form.inputIpStarts" style="display: flex"> |
| | | <input id="companyFieldAddForm11" |
| | | name="ipStart" |
| | | type="text" |
| | | class="form-control mt-1" |
| | | kr-input |
| | | ng-model="vm.form.ipStarts[$index]" |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | style="width: 189px;" |
| | | > |
| | | <div class="issue-label select3-selection__ipRange__tilde">~</div> |
| | | </div> |
| | | <div ng-if="companyFieldAddForm.ipStart.$error.pattern" class="help-block form-text text-danger" |
| | | translate="common.invalidipAdressFormat">IP주소 형식이 맞지 않습니다. |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="mt-30"> |
| | | <label class="issue-label">~</label> |
| | | </div> |
| | | <div class="col-lg-6 mw-49"> |
| | | <div class="col-lg-5 mw-49" style="margin-top: 4px;"> |
| | | <div class="form-group"> |
| | | <label for="companyFieldAddForm12" class="issue-label"></label> |
| | | <input id="companyFieldAddForm12" |
| | | name="ipEnd" |
| | | type="text" |
| | | class="form-control" |
| | | kr-input |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 주소 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | ng-model="vm.form.ipEnd" |
| | | > |
| | | <div ng-repeat="e in vm.form.inputIpEnds" style="display: flex"> |
| | | <input id="companyFieldAddForm12" |
| | | name="ipEnd" |
| | | type="text" |
| | | class="form-control mt-1" |
| | | kr-input |
| | | ng-model="vm.form.ipEnds[$index]" |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | style="width: 189px;" |
| | | > |
| | | <div class="select3-selection__ipRange__remove" |
| | | ng-click="fn.removeIpRangeInput($index)">×</div> |
| | | </div> |
| | | <div ng-if="companyFieldAddForm.ipEnd.$error.pattern" class="help-block form-text text-danger" |
| | | translate="common.invalidipAdressFormat">IP주소 형식이 맞지 않습니다. |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 mt-25" style="margin-left: -15px"> |
| | | <div> |
| | | <button type="button" class="btn btn-secondary" ng-click="fn.addIpRange()"> |
| | | <span translate="common.add">추가</span> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div>--> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 mt-25" style="margin-left: -15px"> |
| | | <div class="col-lg-2" style="margin-left: -19px; margin-top: 28px;"> |
| | | <div> |
| | | <button type="button" class="btn btn-secondary" ng-click="fn.addTel()"> |
| | | <span translate="common.add">추가</span> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-5"> |
| | | <div class="col-lg-5 ml--12"> |
| | | <div class="form-group"> |
| | | <label class="issue-label"> |
| | | <span translate="companyField.email">이메일</span> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 mt-25" style="margin-left: -15px; margin-right: -16px;"> |
| | | <div class="col-lg-2" style="margin-left: -19px; margin-right: -16px; margin-top: 28px;"> |
| | | <div> |
| | | <button type="button" class="btn btn-secondary" ng-click="fn.addMail()"> |
| | | <span translate="common.add">추가</span> |
| | |
| | | </div>--> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-lg-6 mw-49"> |
| | | <div class="col-lg-5 mw-49"> |
| | | <div class="form-group"> |
| | | <label for="companyFieldModifyForm11" class="issue-label"> |
| | | <span translate="companyField.ipRange">ip 대역대</span> |
| | | </label> |
| | | <input id="companyFieldModifyForm11" |
| | | name="ipStart" |
| | | type="text" |
| | | class="form-control" |
| | | kr-input |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 주소 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | ng-model="vm.form.ipStart" |
| | | > |
| | | <div ng-repeat="s in vm.form.inputIpStarts" style="display: flex"> |
| | | <input id="companyFieldModifyForm11" |
| | | name="ipStart" |
| | | type="text" |
| | | class="form-control mt-1" |
| | | kr-input |
| | | ng-model="vm.form.ipStarts[$index]" |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | style="width: 189px;" |
| | | > |
| | | <div class="issue-label select3-selection__ipRange__tilde">~</div> |
| | | </div> |
| | | <div ng-if="companyFieldModifyForm.ipStart.$error.pattern" class="help-block form-text text-danger" |
| | | translate="common.invalidipAdressFormat">IP주소 형식이 맞지 않습니다. |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="mt-30"> |
| | | <label class="issue-label">~</label> |
| | | </div> |
| | | <div class="col-lg-6 mw-49"> |
| | | <div class="col-lg-5 mw-49" style="margin-top: 4px;"> |
| | | <div class="form-group"> |
| | | <label for="companyFieldModifyForm12" class="issue-label"> |
| | | </label> |
| | | <input id="companyFieldModifyForm12" |
| | | name="ipEnd" |
| | | type="text" |
| | | class="form-control" |
| | | kr-input |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 주소 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | ng-model="vm.form.ipEnd" |
| | | > |
| | | <label for="companyFieldModifyForm12" class="issue-label"></label> |
| | | <div ng-repeat="e in vm.form.inputIpEnds" style="display: flex"> |
| | | <input id="companyFieldModifyForm12" |
| | | name="ipEnd" |
| | | type="text" |
| | | class="form-control mt-1" |
| | | kr-input |
| | | ng-model="vm.form.ipEnds[$index]" |
| | | ng-pattern="/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/" |
| | | placeholder="IP 형식만 입력 가능합니다." |
| | | autocomplete="off" |
| | | style="width: 189px;" |
| | | > |
| | | <div class="select3-selection__ipRange__remove" |
| | | ng-click="fn.removeIpRangeInput($index)">×</div> |
| | | </div> |
| | | <div ng-if="companyFieldModifyForm.ipEnd.$error.pattern" class="help-block form-text text-danger" |
| | | translate="common.invalidipAdressFormat">IP주소 형식이 맞지 않습니다. |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 mt-25" style="margin-left: -15px"> |
| | | <div> |
| | | <button type="button" class="btn btn-secondary" ng-click="fn.addIpRange()"> |
| | | <span translate="common.add">추가</span> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-lg-6"> |