From 916a3cbabe4e50062fce61ff6f2f5d46c05dfbd1 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 목, 17 3월 2022 17:47:45 +0900 Subject: [PATCH] - api로 이슈 추가 시 url/ip로 업체 찾는 코드 수정 --- src/main/webapp/scripts/app/issue/issueModify.controller.js | 134 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 104 insertions(+), 30 deletions(-) diff --git a/src/main/webapp/scripts/app/issue/issueModify.controller.js b/src/main/webapp/scripts/app/issue/issueModify.controller.js index d2b8575..196b69a 100644 --- a/src/main/webapp/scripts/app/issue/issueModify.controller.js +++ b/src/main/webapp/scripts/app/issue/issueModify.controller.js @@ -98,6 +98,8 @@ companyTel : "", // �뾽泥� �쟾�솕踰덊샇 companyEmail : "", // �뾽泥� �씠硫붿씪 companyUrl : "", // �뾽泥� url + ipStart : "", //ip�떆�옉二쇱냼 + ipEnd : "", //ip醫낅즺二쇱냼 companyMemo : "", // �뾽泥� 鍮꾧퀬 ispId : -1, ispName : "", // ISP 紐� @@ -169,6 +171,9 @@ priorities : [], // �슦�꽑�닚�쐞 �젙蹂� severities : [], // 以묒슂�룄 �젙蹂� fileTableConfigs : [], // �뙆�씪 �뾽濡쒕뱶 �젙蹂� �뀒�씠釉� + inheritPartners : parameter.inheritPartners, + downTotalCount : parameter.downTotalCount, + usePartner : parameter.usePartner, }; // �뿰愿� �씪媛� 愿��젴 @@ -490,6 +495,8 @@ $scope.vm.companyTel = result[0].tel; $scope.vm.companyEmail = result[0].email; $scope.vm.companyUrl = result[0].url; + $scope.vm.ipStart = result[0].ipStart; + $scope.vm.ipEnd = result[0].ipEnd; $scope.vm.companyMemo = result[0].memo; $scope.vm.form.companyTypeId = result[0].companyTypeId; $scope.vm.form.parentSectorId = result[0].parentSectorId; @@ -575,16 +582,20 @@ function formSubmit() { $rootScope.spinner = true; + let inheritYn = false; var content = { id : parameter.id, title : $rootScope.preventXss($scope.vm.form.title), // �젣紐� description : $rootScope.preventXss($scope.vm.form.description), // �궡�슜 + inheritYn : inheritYn, companyName : $scope.vm.companyName, companyManager : $scope.vm.companyManager, companyTel : $scope.vm.companyTel, companyEmail :$scope.vm.companyEmail, companyUrl : $scope.vm.companyUrl, + ipStart :$scope.vm.ipStart, + ipEnd :$scope.vm.ipEnd, companyMemo : $scope.vm.companyMemo, companyTypeId : (function () { @@ -743,6 +754,8 @@ tel : $scope.vm.companyTel, email :$scope.vm.companyEmail, url :$scope.vm.companyUrl, + ipStart :$scope.vm.ipStart, + ipEnd :$scope.vm.ipEnd, memo : $scope.vm.companyMemo, companyTypeId : $scope.vm.form.companyTypeId, parentSectorId : $scope.vm.form.parentSectorId, @@ -839,42 +852,101 @@ })() }; - Issue.modify({ - method : "POST", - file : (function () { - var files = []; - - angular.forEach($scope.vm.form.files, function (file) { - if (angular.isUndefined(file.id)) { - files.push(file); - } - }); - - return files; - })(), - // data �냽�꽦�쑝濡� 蹂꾨룄�쓽 �뜲�씠�꽣 �쟾�넚 - fields : { - content : content + if ($rootScope.isDefined($scope.vm.usePartner) && $scope.vm.usePartner.length > 0 + && $rootScope.isDefined($scope.vm.inheritPartners) && $scope.vm.inheritPartners + && $rootScope.isDefined($scope.vm.downTotalCount) && $scope.vm.downTotalCount > 0) { + SweetAlert.swal({ + title : $filter("translate")("issue.modifyIssues"), // �씠�뒋 蹂�寃� + text : $filter("translate")("issue.wantToInheritPartnersOfIssue"), // �쁽�옱 �씠�뒋�쓽 �뙆�듃�꼫 �젙蹂�(�뾽泥�/ISP/�샇�뒪�똿)瑜� 紐⑤뱺 �븯�쐞�씠�뒋�뿉 �씪愿� �쟻�슜�떆�궎寃좎뒿�땲源�? + type : "warning", + showCancelButton : true, + confirmButtonColor : "#DD6B55", + confirmButtonText : $filter("translate")("common.ok"), // �꽕 + cancelButtonText : $filter("translate")("common.no"), // �븘�땲�삤 + closeOnConfirm : false, + closeOnCancel : false }, - fileFormDataName : "file" - }).then(function (result) { + function (isConfirm) { + if (isConfirm) { + inheritYn = true; + content.inheritYn = true; + } - if (result.data.message.status === "success") { - $scope.fn.cancel(); + Issue.modify({ + method : "POST", + file : (function () { + var files = []; - // �씠�뒋 �긽�꽭 �솕硫� �슂泥� - $rootScope.$broadcast("getIssueDetail", { - id : parameter.id + angular.forEach($scope.vm.form.files, function (file) { + if (angular.isUndefined(file.id)) { + files.push(file); + } + }); + + return files; + })(), + // data �냽�꽦�쑝濡� 蹂꾨룄�쓽 �뜲�씠�꽣 �쟾�넚 + fields : { + content : content + }, + fileFormDataName : "file" + }).then(function (result) { + + if (result.data.message.status === "success") { + $scope.fn.cancel(); + + // �씠�뒋 �긽�꽭 �솕硫� �슂泥� + $rootScope.$broadcast("getIssueDetail", { + id : parameter.id + }); + + $rootScope.$broadcast("getIssueList"); + } + else { + SweetAlert.error($filter("translate")("issue.failedIssueModify"), result.data.message.message); // �씠�뒋 �닔�젙 �떎�뙣 + } + + $rootScope.spinner = false; }); + }); + } else { + Issue.modify({ + method : "POST", + file : (function () { + var files = []; - $rootScope.$broadcast("getIssueList"); - } - else { - SweetAlert.error($filter("translate")("issue.failedIssueModify"), result.data.message.message); // �씠�뒋 �닔�젙 �떎�뙣 - } + angular.forEach($scope.vm.form.files, function (file) { + if (angular.isUndefined(file.id)) { + files.push(file); + } + }); - $rootScope.spinner = false; - }); + return files; + })(), + // data �냽�꽦�쑝濡� 蹂꾨룄�쓽 �뜲�씠�꽣 �쟾�넚 + fields : { + content : content + }, + fileFormDataName : "file" + }).then(function (result) { + + if (result.data.message.status === "success") { + $scope.fn.cancel(); + + // �씠�뒋 �긽�꽭 �솕硫� �슂泥� + $rootScope.$broadcast("getIssueDetail", { + id : parameter.id + }); + + $rootScope.$broadcast("getIssueList"); + } + else { + SweetAlert.error($filter("translate")("issue.failedIssueModify"), result.data.message.message); // �씠�뒋 �닔�젙 �떎�뙣 + } + + $rootScope.spinner = false; + }); + } } function cancel() { @@ -1075,6 +1147,8 @@ $scope.vm.companyTel = issueCompanyFieldValue.tel; $scope.vm.companyEmail = issueCompanyFieldValue.email; $scope.vm.companyUrl = issueCompanyFieldValue.url; + $scope.vm.ipStart = issueCompanyFieldValue.ipStart; + $scope.vm.ipEnd = issueCompanyFieldValue.ipEnd; $scope.vm.companyMemo = issueCompanyFieldValue.memo; $scope.vm.form.companyTypeId = issueCompanyFieldValue.companyTypeId; $scope.vm.form.companyType = issueCompanyFieldValue.companyTypeName; -- Gitblit v1.8.0