| | |
| | | formCheck : formCheck, // 폼 체크 |
| | | getUserListCallBack : getUserListCallBack, // 담당자 autocomplete 페이징 |
| | | getProjectListCallBack : getProjectListCallBack, // 프로젝트 autocomplete 페이징 |
| | | getCompanyFieldListCallBack : getCompanyFieldListCallBack, // 업체정보 autocomplete 페이징 |
| | | getIssueCompanyFieldListCallBack : getIssueCompanyFieldListCallBack, // 업체정보 autocomplete 페이징 |
| | | getIssueDepartmentListCallBack : getIssueDepartmentListCallBack, // 담당자 -> 담당부서 autocomplete 페이징 |
| | | getIspFieldListCallBack : getIspFieldListCallBack, // ISP정보 autocomplete 페이징 |
| | | getHostingFieldListCallBack : getHostingFieldListCallBack, // 호스팅정보 autocomplete 페이징 |
| | | getIssueIspFieldListCallBack : getIssueIspFieldListCallBack, // ISP정보 autocomplete 페이징 |
| | | getIssueHostingFieldListCallBack : getIssueHostingFieldListCallBack, // 호스팅정보 autocomplete 페이징 |
| | | getOptionColor : getOptionColor, // 우선순위, 중요도 색상으로 Select 태그 적용 |
| | | onFileSelect : onFileSelect, // 파일 첨부 |
| | | infiniteAddForm : infiniteAddForm, // 계속 생성 |
| | |
| | | getIssueTypeCustomFields : getIssueTypeCustomFields, // 이슈 유형에 연결된 사용자 정의 필드 목록 가져오기 |
| | | removeUploadFile : removeUploadFile, // 업로드하려는 특정 파일을 삭제 |
| | | removeManager : removeManager, // 담당자 삭제 |
| | | removeDepartment : removeDepartment, // 담당부서 삭제 |
| | | setIssueTypeTemplate : setIssueTypeTemplate, // 이슈 유형 템플릿 적용하기 |
| | | startExecute : startExecute // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | startExecute : startExecute, // 컨트롤 로딩시 처음으로 시작되는 함수 |
| | | containsPartner : containsPartner, |
| | | getPartners : getPartners |
| | | }; |
| | | |
| | | $scope.vm = { |
| | | partnerVos : "", |
| | | form : { |
| | | title : "", // 제목 |
| | | description : "", // 내용 |
| | | projects : [], // 프로젝트 |
| | | companyFields : [], // 업체정보 |
| | | ispFields : [], // ISP 정보 |
| | | hostingFields : [], // 호스팅정보 |
| | | issueCompanyFields : [], // 업체정보 |
| | | issueIspFields : [], // ISP 정보 |
| | | issueHostingFields : [], // 호스팅정보 |
| | | issueTypeId : "", // 이슈 유형 아이디 |
| | | priorityId : "", // 우선순위 아이디 |
| | | severityId : "", // 중요도 아이디 |
| | |
| | | projectName : "", // 프로젝트 명 검색 |
| | | userName : "", // 사용자 검색 |
| | | departmentName : "", // 부서명 검색 |
| | | companyId : -1, // 부서 ID |
| | | companyName : "", // 업체명 검색 |
| | | companyCode : "", // 업체 코드 |
| | | companyManager : "", // 업체 담당자 |
| | | companyTel : "", // 업체 전화번호 |
| | | companyEmail : "", // 업체 이메일 |
| | | companyMemo : "", // 업체 비고 |
| | | ispId : -1, // ISP ID |
| | | ispName : "", // ISP 명 |
| | | ispCode : "", // ISP 코드 |
| | | ispManager : "", // ISP 담당자 |
| | | ispTel : "", // ISP 전화번호 |
| | | ispEmail : "", // ISP 이메일 |
| | | ispMemo : "", // ISP 비고 |
| | | hostingId : -1, // 호스팅 ID |
| | | hostingName : "", // 호스팅명 검색 |
| | | hostingManager : "", // 호스팅 담당자 |
| | | hostingTel : "", // 호스팅 전화번호 |
| | | hostingEmail : "", // 호스팅 이메일 |
| | | hostingMemo : "", // 호스팅 비고 |
| | | hostingMemo :"", // 호스팅 비고 |
| | | |
| | | autoCompletePage : { |
| | | user : { |
| | | page : 0, |
| | |
| | | // 이슈 유형에 연결된 사용자 정의 필드 가져오기 |
| | | $scope.fn.getIssueTypeCustomFields(); |
| | | } |
| | | }); |
| | | |
| | | $scope.$watch("vm.form.issueTypeId", function (newValue, oldValue) { |
| | | $scope.vm.partnerVos = $scope.fn.getPartners(); |
| | | }); |
| | | |
| | | // 섬머노트 이미지 업로드 |
| | |
| | | $scope.vm.form.departments.splice(index, 1); |
| | | } |
| | | |
| | | // 담당부서 삭제 |
| | | function removeDepartment(index) { |
| | | $scope.vm.form.departments.splice(index, 1); |
| | | } |
| | | |
| | | // 업로드 파일 삭제 |
| | | function removeUploadFile(index) { |
| | | $scope.vm.form.files.splice(index, 1); |
| | |
| | | angular.forEach($scope.vm.form.files, function (file, index) { |
| | | file.index = index; |
| | | }); |
| | | } |
| | | |
| | | // 업체/ISP/호스팅 이름이 포함 여부 확인 |
| | | function containsPartner(name) { |
| | | var result = false; |
| | | |
| | | if ($scope.vm.partnerVos != null) { |
| | | $scope.vm.partnerVos.forEach(function (partnerVo) { |
| | | if (name === partnerVo.name) { |
| | | result = true; |
| | | } |
| | | }); |
| | | } |
| | | return result; |
| | | |
| | | } |
| | | |
| | | // 담당자 autocomplete page 업데이트트 |
| | |
| | | } |
| | | |
| | | // 업체정보 autocomplete page 업데이트 |
| | | function getCompanyFieldListCallBack(result) { |
| | | function getIssueCompanyFieldListCallBack(result) { |
| | | $scope.vm.autoCompletePage.companyField.totalPage = result.data.page.totalPage; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // ISP정보 autocomplete page 업데이트 |
| | | function getIspFieldListCallBack(result) { |
| | | function getIssueIspFieldListCallBack(result) { |
| | | $scope.vm.autoCompletePage.ispField.totalPage = result.data.page.totalPage; |
| | | } |
| | | |
| | | // 호스팅정보 autocomplete page 업데이트 |
| | | function getHostingFieldListCallBack(result) { |
| | | function getIssueHostingFieldListCallBack(result) { |
| | | $scope.vm.autoCompletePage.hostingField.totalPage = result.data.page.totalPage; |
| | | } |
| | | |
| | |
| | | |
| | | // 업체정보 결과 값 Event 처리(set) |
| | | $scope.$on("companyFieldEvent", function (event, result) { |
| | | $scope.vm.companyId = result[0].id; |
| | | $scope.vm.companyName = result[0].name; |
| | | $scope.vm.companyManager = result[0].manager; |
| | | $scope.vm.companyTel = result[0].tel; |
| | | $scope.vm.companyEmail = result[0].email; |
| | |
| | | |
| | | // ISP정보 결과 값 Event 처리(set) |
| | | $scope.$on("ispFieldEvent", function (event, result) { |
| | | $scope.vm.ispId = result[0].id; |
| | | $scope.vm.ispName = result[0].name; |
| | | $scope.vm.ispCode = result[0].code; |
| | | $scope.vm.ispManager = result[0].manager; |
| | | $scope.vm.ispTel = result[0].tel; |
| | |
| | | |
| | | // 호스팅정보 결과 값 Event 처리(set) |
| | | $scope.$on("hostingFieldEvent", function (event, result) { |
| | | $scope.vm.hostingId = result[0].id; |
| | | $scope.vm.hostingName = result[0].name; |
| | | $scope.vm.hostingCode = result[0].code; |
| | | $scope.vm.hostingManager = result[0].manager; |
| | | $scope.vm.hostingTel = result[0].tel; |
| | |
| | | var content = { |
| | | title : $rootScope.preventXss($scope.vm.form.title), // 제목 |
| | | description : $rootScope.preventXss($scope.vm.form.description), // 내용 |
| | | |
| | | projectId : (function () { // 프로젝트 아이디 |
| | | var projectId = ""; |
| | | |
| | |
| | | |
| | | return projectId; |
| | | })(), |
| | | |
| | | issueTypeId : $scope.vm.form.issueTypeId, // 이슈 유형 아이디 |
| | | priorityId : $scope.vm.form.priorityId, // 우선순위 아이디 |
| | | severityId : $scope.vm.form.severityId, // 중요도 아이디 |
| | | companyId : (function () { // 프로젝트 아이디 |
| | | var companyId = ""; |
| | | |
| | | if ($scope.vm.form.companyFields.length > 0) { |
| | | companyId = $scope.vm.form.companyFields[0].id; |
| | | companyId : (function () { // 업체 아이디 |
| | | var companyId = -1; |
| | | if ($scope.vm.form.issueCompanyFields.length > 0) { |
| | | companyId = $scope.vm.form.issueCompanyFields[0].id; |
| | | } |
| | | |
| | | return companyId; |
| | | })(), |
| | | |
| | | ispId : (function () { |
| | | var ispId = ""; |
| | | |
| | | if ($scope.vm.form.ispFields.length > 0) { |
| | | ispId = $scope.vm.form.ispFields[0].id; |
| | | ispId : (function () { // ISP 아이디 |
| | | var ispId = -1; |
| | | if ($scope.vm.form.issueIspFields.length > 0) { |
| | | ispId = $scope.vm.form.issueIspFields[0].id; |
| | | } |
| | | |
| | | return ispId; |
| | | })(), |
| | | hostingId : (function () { |
| | | var hostingId = ""; |
| | | |
| | | if ($scope.vm.form.hostingFields.length > 0) { |
| | | hostingId = $scope.vm.form.hostingFields[0].id; |
| | | hostingId : (function () { // Hosting 아이디 |
| | | var hostingId = -1; |
| | | if ($scope.vm.form.issueHostingFields.length > 0) { |
| | | hostingId = $scope.vm.form.issueHostingFields[0].id; |
| | | } |
| | | |
| | | return hostingId; |
| | | })(), |
| | | |
| | |
| | | |
| | | return departmentIds; |
| | | })(), |
| | | |
| | | attachedFileIds : (function () { |
| | | var attachedFileIds = []; |
| | | |
| | |
| | | |
| | | return attachedFileIds; |
| | | })(), |
| | | |
| | | issueCompanyFields : (function () { |
| | | var issueCompanyFields = []; |
| | | if ($scope.vm.form.issueCompanyFields != null && $scope.vm.form.issueCompanyFields.length > 0 ){ |
| | | var companyField = $scope.vm.form.issueCompanyFields[0]; |
| | | |
| | | issueCompanyFields.push({ |
| | | id : companyField.id, |
| | | companyId : $scope.vm.companyId, |
| | | name : $scope.vm.companyName, |
| | | manager : $scope.vm.companyManager, |
| | | tel : $scope.vm.companyTel, |
| | | email :$scope.vm.companyEmail, |
| | | memo : $scope.vm.companyMemo |
| | | }); |
| | | } |
| | | |
| | | return issueCompanyFields; |
| | | })(), |
| | | |
| | | issueIspFields : (function () { |
| | | var issueIspFields = []; |
| | | if ($scope.vm.form.issueIspFields != null && $scope.vm.form.issueIspFields.length > 0 ){ |
| | | var ispField = $scope.vm.form.issueIspFields[0]; |
| | | |
| | | issueIspFields[0] = { |
| | | id : ispField.id, |
| | | ispId : $scope.vm.ispId, |
| | | name : $scope.vm.ispName, |
| | | code : $scope.vm.ispCode, |
| | | manager : $scope.vm.ispManager, |
| | | tel : $scope.vm.ispTel, |
| | | email :$scope.vm.ispEmail, |
| | | memo : $scope.vm.ispMemo |
| | | }; |
| | | |
| | | } |
| | | |
| | | return issueIspFields; |
| | | })(), |
| | | |
| | | issueHostingFields : (function () { |
| | | var issueHostingFields = []; |
| | | if ($scope.vm.form.issueHostingFields != null && $scope.vm.form.issueHostingFields.length > 0 ){ |
| | | |
| | | var hostingField = $scope.vm.form.issueHostingFields[0]; |
| | | |
| | | issueHostingFields[0] = { |
| | | id : hostingField.id, |
| | | hostingId : $scope.vm.hostingId, |
| | | name : $scope.vm.hostingName, |
| | | code : $scope.vm.hostingCode, |
| | | manager : $scope.vm.hostingManager, |
| | | tel : $scope.vm.hostingTel, |
| | | email :$scope.vm.hostingEmail, |
| | | memo : $scope.vm.hostingMemo |
| | | }; |
| | | } |
| | | |
| | | return issueHostingFields; |
| | | })(), |
| | | |
| | | startCompleteDateRange : $scope.vm.form.startCompleteDateRange, |
| | | detectingDateRange : $scope.vm.form.detectingDateRange, |
| | | |
| | |
| | | }, |
| | | fileFormDataName : "file" |
| | | }).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | // 연속 등록 체크시 이동하지 않음. |
| | | if ($scope.vm.infiniteAdd) { |
| | | $scope.fn.infiniteAddForm(); |
| | | } |
| | | else { |
| | | $scope.fn.cancel(); |
| | | |
| | | if ($state.current.name !== "issues.list") { |
| | | $state.go("issues.list"); |
| | | } |
| | | } |
| | | |
| | | $rootScope.$broadcast("getIssueList", {}); |
| | | if (result.data.message.status === "success") { |
| | | // 연속 등록 체크시 이동하지 않음. |
| | | if ($scope.vm.infiniteAdd) { |
| | | $scope.fn.infiniteAddForm(); |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueRegistration"), result.data.message.message); // 이슈 등록 실패 |
| | | $scope.fn.cancel(); |
| | | |
| | | if ($state.current.name !== "issues.list" || $state.current.name === "issues.list") { |
| | | $state.go("issues.list"); |
| | | } |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | $rootScope.$broadcast("getIssueList", {}); |
| | | } |
| | | else { |
| | | SweetAlert.error($filter("translate")("issue.failedIssueRegistration"), result.data.message.message); // 이슈 등록 실패 |
| | | } |
| | | |
| | | $rootScope.spinner = false; |
| | | }); |
| | | } |
| | | |
| | | // 팝업 창 닫기 |
| | |
| | | angular.forEach(result.data.data, function (issueTypeCustomField) { |
| | | switch (issueTypeCustomField.customFieldVo.customFieldType) { |
| | | case "INPUT" : |
| | | case "NUMBER" : |
| | | case "DATETIME" : |
| | | case "IP_ADDRESS" : |
| | | case "EMAIL" : |
| | | case "SITE" : |
| | | case "TEL" : |
| | | issueTypeCustomField.useValues = issueTypeCustomField.customFieldVo.defaultValue; |
| | | break; |
| | | case "SINGLE_SELECT" : |
| | |
| | | } |
| | | } |
| | | |
| | | function getPartners() { |
| | | var content = { |
| | | issueTypeId : $scope.vm.form.issueTypeId |
| | | }; |
| | | Issue.findPartners($resourceProvider.getContent( |
| | | content, |
| | | $resourceProvider.getPageContent(0, 1))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.partnerVos = result.data.data; |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | // 최초 실행 |
| | | function startExecute() { |
| | | |
| | | var promises = { |
| | | getIssueTypes : $scope.fn.getIssueTypes(), |
| | | getPriorities : $scope.fn.getPriorities(), |
| | | getSeverities : $scope.fn.getSeverities() |
| | | getSeverities : $scope.fn.getSeverities(), |
| | | getPartners : $scope.fn.getPartners() |
| | | }; |
| | | $q.all(promises).then(function (results) { |
| | | // 현재 프로젝트 설정 |
| | |
| | | $scope.fn.projects.push($rootScope.workProject); |
| | | $scope.fn.getProjectList($scope.vm.projectName, $scope.vm.form.projects, $scope.vm.autoCompletePage.project.page, getStartProjectListCallback); |
| | | } |
| | | |
| | | // 현재 이슈타입 유형 설정 |
| | | var id = $rootScope.getCurrentIssueTypeId(); |
| | | if (id != null) { |
| | | $scope.vm.form.issueTypeId = id.toString(); |
| | | } |
| | | $log.debug("promises 결과 ", results); |
| | | }); |
| | | } |
| | | |
| | | $scope.fn.startExecute(); |
| | | }]); |
| | | }); |
| | | }); |