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 |   67 ++++++++++++++++++++++++++++++++-
 1 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/scripts/app/hostingField/hostingFieldList.controller.js b/src/main/webapp/scripts/app/hostingField/hostingFieldList.controller.js
index e7f15cf..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,12 +94,19 @@
                     $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()
+                        .setHName("companyField.url")
+                        .setHWidth("bold")
+                        .setDName("url")
                         .setDAlign("text-center"));
                     $scope.vm.tableConfigs.push($tableProvider.config()
                         .setHName("hostingField.memo")
@@ -122,8 +141,42 @@
 
                         if (result.data.message.status === "success") {
                             $scope.vm.page.selectedPage = currentPage + 1;
-                            $scope.vm.responseData = result.data;
 
+                            result.data.data.forEach(function (data) {
+                                // �쟾�솕踰덊샇 議고쉶�떆 �븯�씠�뵂 異붽�, 諛곗뿴 �삎�깭 �젣嫄�, 肄ㅻ쭏 湲곗� 以꾨컮轅�
+                                if (data.tel != null && data.tel !== "") {
+                                    var tels = data.tel;
+                                    if (data.tel.indexOf("[") !== -1){
+                                        tels = data.tel.substr(1, data.tel.indexOf("]")-1);
+                                    }
+                                    var telArr = tels.split(",");
+
+                                    for (var i = 0; i < telArr.length; i++) {
+                                        let hyphen = telArr[i].trim();
+                                        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>");
+                                }
+                                // �씠硫붿씪 議고쉶�떆 諛곗뿴 �삎�깭 �젣嫄� 諛� 肄ㅻ쭏 湲곗��쑝濡� 以꾨컮轅�
+                                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>");
+                                    }
+                                }
+                            });
+
+                            $scope.vm.responseData = result.data;
                         }
                         else {
                             SweetAlert.error($filter("translate")("hostingField.failedToSelectHostingFieldFullList"), result.data.message.message); // �샇�뒪�똿 愿�由� 紐⑸줉 議고쉶 �떎�뙣
@@ -224,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