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/hostingField/hostingFieldList.controller.js | 45 +++++++++++++++++++++++++++++++++++++-------- 1 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/scripts/app/hostingField/hostingFieldList.controller.js b/src/main/webapp/scripts/app/hostingField/hostingFieldList.controller.js index ae45356..175cd43 100644 --- a/src/main/webapp/scripts/app/hostingField/hostingFieldList.controller.js +++ b/src/main/webapp/scripts/app/hostingField/hostingFieldList.controller.js @@ -15,10 +15,12 @@ $scope.fn = { getPageList : getPageList, // �샇�뒪�똿 愿�由� 由ъ뒪�듃 makeTableConfigs : makeTableConfigs, // �뀒�씠釉� �꽕�젙 + changePageRowCount : changePageRowCount, // �럹�씠吏� 蹂�寃� initSearch : initSearch, //寃��깋 議곌굔 珥덇린�솕 add : add, //�샇�뒪�똿 �깮�꽦 removes : removes, //�샇�뒪�똿 �궘�젣 - makeSearchConditions : makeSearchConditions //�뿊�� �떎�슫濡쒕뱶 + makeSearchConditions : makeSearchConditions, //�뿊�� �떎�슫濡쒕뱶 + importExcel : importExcel, // �뿊�� import 湲곕뒫 �뙘�뾽 �샇異� }; // 蹂��닔 @@ -48,9 +50,19 @@ $scope.fn.getPageList(0); }); + // �샇�뒪�똿 紐⑸줉 �뜲�씠�꽣 媛깆떊 + $scope.$on("getHostingFieldList", function () { + $scope.fn.getPageList(0); + }); + // 寃��깋 議곌굔 珥덇린�솕 function initSearch() { $scope.vm.search.name = ""; + $scope.fn.getPageList(0); + } + + // �럹�씠吏� 蹂�寃� + function changePageRowCount() { $scope.fn.getPageList(0); } @@ -82,11 +94,13 @@ $scope.vm.tableConfigs.push($tableProvider.config() .setHName("hostingField.tel") .setHWidth("bold") + .setHWidth("width-200-p bold") .setDName("tel") .setDAlign("text-center")); $scope.vm.tableConfigs.push($tableProvider.config() .setHName("hostingField.email") .setHWidth("bold") + .setHWidth("width-200-p bold") .setDName("email") .setDAlign("text-center")); $scope.vm.tableConfigs.push($tableProvider.config() @@ -128,8 +142,8 @@ if (result.data.message.status === "success") { $scope.vm.page.selectedPage = currentPage + 1; - // �쟾�솕踰덊샇 議고쉶�떆 �븯�씠�뵂 異붽� �빐�꽌 議고쉶 result.data.data.forEach(function (data) { + // �쟾�솕踰덊샇 議고쉶�떆 �븯�씠�뵂 異붽�, 諛곗뿴 �삎�깭 �젣嫄�, 肄ㅻ쭏 湲곗� 以꾨컮轅� if (data.tel != null && data.tel !== "") { var tels = data.tel; if (data.tel.indexOf("[") !== -1){ @@ -139,20 +153,25 @@ for (var i = 0; i < telArr.length; i++) { let hyphen = telArr[i].trim(); - telArr[i] = hyphen.replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]+)([0-9]{4})/, "$1-$2-$3"); + if (hyphen.length < 9) { + telArr[i] = hyphen.replace(/^(\d{3,4})(\d{4})$/, "$1-$2"); + } else { + telArr[i] = hyphen.replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]+)([0-9]{4})/, "$1-$2-$3"); + } if (telArr[i] === "") { telArr.splice(i,1); } } data.tel = telArr.join(); + data.tel = data.tel.replace(/\,/g,"</br>"); } - }); - - // �씠硫붿씪 議고쉶�떆 諛곗뿴 �삎�깭 �젣嫄� - result.data.data.forEach(function (data) { - if (data.email != null && data.email !== "") { + // �씠硫붿씪 議고쉶�떆 諛곗뿴 �삎�깭 �젣嫄� 諛� 肄ㅻ쭏 湲곗��쑝濡� 以꾨컮轅� + if ($rootScope.isDefined(data.email)) { if (data.email.indexOf("[") !== -1){ data.email = data.email.substr(1, data.email.indexOf("]")-1); + } + if (data.email.indexOf(",") !== -1) { + data.email = data.email.replace(/\,/g,"</br>"); } } }); @@ -258,6 +277,16 @@ }); } + // �뿊�� import �뙘�뾽 �샇異� + function importExcel() { + $uibModal.open({ + templateUrl : 'views/hostingField/hostingFieldExcelImport.html', + size : "lg", + controller : 'hostingFieldImportExcelController', + backdrop : 'static' + }); + } + function makeSearchConditions() { var conditions = { name: $scope.vm.search.name -- Gitblit v1.8.0