Commit ecd43e80c5041e24ff564230c311140e72f1f694
1 parent
1688fb09
Exists in
master
redmine #4856 Construção do relatório de Lista de verificação;
Showing
1 changed file
with
32 additions
and
0 deletions
Show diff stats
cit-portal-web/src/main/webapp/assets/js/angular/custom/controller/AppController.js
... | ... | @@ -796,6 +796,38 @@ citApp.controller('AppController', ['$scope', '$routeParams', '$timeout', '$loca |
796 | 796 | }); |
797 | 797 | }; |
798 | 798 | |
799 | + $scope.abrirRelatorio = function(response, titleTab) { | |
800 | + | |
801 | + var file = new Blob([response], {type: 'application/pdf'}); | |
802 | + var fileURL = URL.createObjectURL(file); | |
803 | + | |
804 | + $scope.idRelatorio = ++idRelatorioCount; | |
805 | + | |
806 | + $scope.arrayContentReports[$scope.idRelatorio] = angular.copy($sce.trustAsResourceUrl(fileURL)); | |
807 | + | |
808 | + obterWorskspaceAtiva(); | |
809 | + $timeout(function(){ | |
810 | + $scope.addNewWorkspace(titleTab, "relatorioTab.html", true, $scope.workspaceAtiva ? $scope.workspaceAtiva.classePagina : classePaginaPortal , undefined, undefined, undefined, $scope.idRelatorio); | |
811 | + | |
812 | + $timeout(function(){ | |
813 | + | |
814 | + var relatorios = $scope.workspaces.filter(function(f){ | |
815 | + return f.idRelatorio === $scope.idRelatorio; | |
816 | + }); | |
817 | + | |
818 | + if(relatorios && relatorios.length > 0){ | |
819 | + $scope.activeWorkspace(relatorios[0]); | |
820 | + } else{ | |
821 | + $scope.workspaces.splice($scope.workspaces.length - 1, 1); | |
822 | + $scope.showAlert("error", $translate.instant("PORTAL.MSG.ERRO_RELATORIO") + " ", false ); | |
823 | + } | |
824 | + | |
825 | + $scope.setLoading(false); | |
826 | + }, 2000); | |
827 | + | |
828 | + }); | |
829 | + }; | |
830 | + | |
799 | 831 | // Metodo responsavel por fazer a requisicao relatorios no GRP em uma MODAL, abrindo uma nova $modalRelatorioInstace posteriormente |
800 | 832 | $scope.visualizarRelatorioModal = function(url) { |
801 | 833 | ... | ... |