Commit 59e257e3288b1e47f4dccd2a779fcd13c3ef3064
1 parent
24ba0867
Exists in
master
#4289 - Implementação tipo suporte documento
Showing
3 changed files
with
63 additions
and
5 deletions
Show diff stats
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
... | ... | @@ -417,6 +417,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
417 | 417 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.UNIDADE_GESTORA ", "Unidade gestora", dominio, modulo)); |
418 | 418 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DATA_CRIACAO ", "Data criação", dominio, modulo)); |
419 | 419 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.PLACEHOLDER_PESQUISA ", "Digite o Nup, tipo de processo, tipo de documento, conteúdo do documento, autor, assunto, destinatário...", dominio, modulo)); |
420 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ATE ", "Até", dominio, modulo)); | |
420 | 421 | |
421 | 422 | |
422 | 423 | } | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/SolrSearchController.js
... | ... | @@ -129,6 +129,12 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
129 | 129 | query.setOption("facet.limit", $scope.maxHints); |
130 | 130 | query.setOption('start', $scope.start * $scope.documentsPerPage); |
131 | 131 | |
132 | + //Verifica se foi selecionado filtro de data | |
133 | + if($scope.dateMathFilter != ""){ | |
134 | + | |
135 | + query.setOption("fq", $scope.dateMathFilter); | |
136 | + } | |
137 | + | |
132 | 138 | var hints = $scope.searchHintsField.split(','); |
133 | 139 | for(var i = 0; i < hints.length; i++){ |
134 | 140 | query.setOption("facet.field#" + i, hints[i]); |
... | ... | @@ -136,6 +142,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
136 | 142 | |
137 | 143 | query.setNearMatch($scope.nearMatch); |
138 | 144 | query.setUserQuery($scope.userQuery); |
145 | + query.setQueryParameters($scope.queryParameters); | |
139 | 146 | SolrSearchService.setQuery($scope.queryName, query); |
140 | 147 | SolrSearchService.updateQuery($scope.queryName); |
141 | 148 | }, 350); |
... | ... | @@ -491,10 +498,22 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
491 | 498 | $scope.addParameterDate = function(){ |
492 | 499 | |
493 | 500 | $timeout(function () { |
494 | - //Última Hora | |
495 | - if($scope.parameterDatePesquisa.codigo == 1){ | |
501 | + | |
502 | + if($scope.parameterDatePesquisa.codigo == 0){ | |
503 | + | |
504 | + $scope.dateMathFilter = ""; | |
505 | + | |
506 | + $scope.onkeyup(); | |
507 | + | |
508 | + //Última Hora | |
509 | + }else if($scope.parameterDatePesquisa.codigo == 1){ | |
510 | + | |
511 | + var date = new Date(); | |
512 | + date.setHours(date.getHours() - 1); | |
496 | 513 | |
497 | - $scope.dateMathFilter = "dataCriacao:[NOW-1HOUR TO NOW]"; | |
514 | + var dataUltimaHora = $filter('date')(date, "yyyy-MM-dd'T'HH:mm:ss'Z'"); | |
515 | + | |
516 | + $scope.dateMathFilter = "dataCriacao:["+dataUltimaHora+" TO NOW]"; | |
498 | 517 | $scope.onkeyup(); |
499 | 518 | //Útimas 24 horas |
500 | 519 | }else if($scope.parameterDatePesquisa.codigo == 2){ |
... | ... | @@ -521,6 +540,26 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
521 | 540 | |
522 | 541 | }; |
523 | 542 | |
543 | + //adiciona o filtro entre datas | |
544 | + $scope.addParameterDatePersonalisada = function(){ | |
545 | + | |
546 | + var dataInicioFormat = $filter('date')($scope.dataInicioFiltro, "yyyy-MM-dd'T'HH:mm:ss'Z'"); | |
547 | + | |
548 | + var dataFimFormat = $filter('date')($scope.dataFimFiltro, "yyyy-MM-dd'T'HH:mm:ss'Z'"); | |
549 | + | |
550 | + if($scope.dataInicioFiltro && $scope.dataFimFiltro){ | |
551 | + | |
552 | + $scope.dateMathFilter = "dataCriacao:["+dataInicioFormat+" TO "+dataFimFormat+ "]"; | |
553 | + | |
554 | + $scope.onkeyup(); | |
555 | + }else{ | |
556 | + | |
557 | + $scope.dateMathFilter = ""; | |
558 | + } | |
559 | + | |
560 | + | |
561 | + }; | |
562 | + | |
524 | 563 | /** |
525 | 564 | * Add a query parameter. The parameter setting is added only if it is |
526 | 565 | * unique. | ... | ... |
cit-ecm-web/src/main/webapp/html/pesquisa/pesquisa.html
... | ... | @@ -42,14 +42,32 @@ |
42 | 42 | <div class="row" ng-show="$showAdvancedFilters" style="padding-top: 10px;"> |
43 | 43 | <hr> |
44 | 44 | <div class="col-sm-2"> |
45 | - <label-select ng-id="parameterPesquisa" ng-model="parameterPesquisa" form="solrForm" ng-list="filtroPesquisaList" | |
45 | + <label-select ng-id="parameterPesquisa" ng-model="parameterPesquisa" ng-label="ECM.LABEL.OBJETO" form="solrForm" ng-list="filtroPesquisaList" | |
46 | 46 | ng-custom-options="dominio.originalElement as dominio.descricao for dominio" show-selecione='false' ng-custom-change="addParameter()"> </label-select> |
47 | 47 | </div> |
48 | 48 | |
49 | 49 | <div class="col-sm-2"> |
50 | - <label-select ng-id="parameterDatePesquisa" ng-model="parameterDatePesquisa" form="solrForm" ng-list="filtroDateList" | |
50 | + <label-select ng-id="parameterDatePesquisa" ng-label="ECM.LABEL.DATA_CRIACAO" ng-model="parameterDatePesquisa" form="solrForm" ng-list="filtroDateList" | |
51 | 51 | ng-custom-options="dominio.originalElement as dominio.descricao for dominio" show-selecione='false' ng-custom-change="addParameterDate()"> </label-select> |
52 | 52 | </div> |
53 | + | |
54 | + <div class='col-sm-2' ng-show="parameterDatePesquisa.codigo == 6"> | |
55 | + <div class="form-group"> | |
56 | + <label for="date-birth" class="control-label">De</label> | |
57 | + <div class="control"> | |
58 | + <input id="date-birth" class="form-control" type="date" ng-model="dataInicioFiltro" ng-change="addParameterDatePersonalisada();"> | |
59 | + </div> | |
60 | + </div> | |
61 | + </div> | |
62 | + | |
63 | + <div class='col-sm-2' ng-show="parameterDatePesquisa.codigo == 6"> | |
64 | + <div class="form-group"> | |
65 | + <label for="date-birth" class="control-label"><translate>ECM.LABEL.ATE</translate></label> | |
66 | + <div class="control"> | |
67 | + <input id="date-birth" class="form-control" type="date" ng-model="dataFimFiltro" ng-change="addParameterDatePersonalisada();"> | |
68 | + </div> | |
69 | + </div> | |
70 | + </div> | |
53 | 71 | </div> |
54 | 72 | |
55 | 73 | <div class="row"> | ... | ... |