This commit is contained in:
2026-03-11 17:54:14 -03:00
parent 9a0ef21ec8
commit 49491411f3
83 changed files with 5082 additions and 2776 deletions
@@ -2,7 +2,7 @@
class="super-widget wcm-widget-class fluig-style-guide"
data-params="FiltroDash.instance()">
<div class="fdash-wrap">
<div class="fdash-title">AUDITORIAS DE LOJA - IAF 2026</div>
<div class="fdash-title">AUDITORIAS DE LOJA</div>
<div class="fdash-filters-row">
<div class="fdash-filter-card">
@@ -10,12 +10,15 @@ data-params="FiltroDash.instance()">
<div id="chips_ciclo_${instanceId}" class="fdash-chips"></div>
</div>
<div class="fdash-filter-card">
<div class="fdash-filter-label">REGIONAL</div>
<div class="fdash-filter-label"> SUPERVISOR REGIONAL</div>
<div id="chips_regional_${instanceId}" class="fdash-chips"></div>
</div>
<div class="fdash-filter-card">
<div class="fdash-filter-label">GESTOR</div>
<div id="chips_supervisao_${instanceId}" class="fdash-chips"></div>
<div class="fdash-filter-label">LOJA</div>
<div class="fdash-autocomplete-wrap">
<input type="text" class="form-control fdash-autocomplete" id="loja_${instanceId}" placeholder="Digite a loja">
<div id="lojaSugestoes_${instanceId}" class="fdash-sugestoes" style="display:none;"></div>
</div>
</div>
</div>
@@ -1,53 +1,94 @@
div[id^="filtroDash_"] .fdash-wrap {
background: #9d9d9f;
border-radius: 16px;
padding: 12px;
padding: 10px;
color: #ffffff;
}
div[id^="filtroDash_"] .fdash-title {
text-align: center;
font-size: 30px;
font-size: 24px;
line-height: 1.12;
font-weight: 800;
margin-bottom: 10px;
margin-bottom: 8px;
letter-spacing: 0.5px;
}
div[id^="filtroDash_"] .fdash-filters-row {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
gap: 6px;
}
div[id^="filtroDash_"] .fdash-filter-card {
background: #ececed;
border-radius: 12px;
padding: 8px;
padding: 6px 8px;
}
div[id^="filtroDash_"] .fdash-autocomplete-wrap {
position: relative;
}
div[id^="filtroDash_"] .fdash-autocomplete {
border-radius: 8px;
height: 32px;
font-size: 12px;
border: 1px solid #c7d2da;
color: #1c4a62;
}
div[id^="filtroDash_"] .fdash-sugestoes {
position: absolute;
top: calc(100% + 4px);
left: 0;
right: 0;
z-index: 50;
max-height: 220px;
overflow-y: auto;
background: #ffffff;
border: 1px solid #c7d2da;
border-radius: 8px;
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}
div[id^="filtroDash_"] .fdash-sugestao-item {
width: 100%;
border: 0;
background: #ffffff;
color: #1c4a62;
text-align: left;
font-size: 12px;
padding: 8px 10px;
cursor: pointer;
}
div[id^="filtroDash_"] .fdash-sugestao-item:hover {
background: #eef4f8;
}
div[id^="filtroDash_"] .fdash-filter-label {
color: #004a6a;
font-size: 15px;
font-size: 13px;
font-weight: 800;
margin-bottom: 6px;
margin-bottom: 4px;
}
div[id^="filtroDash_"] .fdash-chips {
display: flex;
flex-wrap: wrap;
gap: 5px;
min-height: 36px;
gap: 4px;
min-height: 30px;
}
div[id^="filtroDash_"] .fdash-chip {
border: 1px solid #0a4f70;
background: #0a5d82;
color: #ffffff;
padding: 3px 8px;
padding: 2px 7px;
border-radius: 6px;
font-weight: 700;
font-size: 12px;
font-size: 11px;
cursor: pointer;
}
@@ -60,33 +101,33 @@ div[id^="filtroDash_"] .fdash-actions {
display: flex;
align-items: flex-end;
justify-content: center;
gap: 8px;
margin-top: 8px;
gap: 6px;
margin-top: 6px;
}
div[id^="filtroDash_"] .fdash-date {
min-width: 160px;
min-width: 150px;
}
div[id^="filtroDash_"] .fdash-date label {
margin: 0 0 2px 0;
color: #ffffff;
font-weight: 700;
font-size: 12px;
font-size: 11px;
}
div[id^="filtroDash_"] .fdash-date input {
border-radius: 8px;
height: 34px;
font-size: 13px;
height: 30px;
font-size: 12px;
}
div[id^="filtroDash_"] .fdash-actions .btn {
font-weight: 700;
border-radius: 8px;
min-height: 34px;
padding: 6px 12px;
font-size: 13px;
min-height: 30px;
padding: 4px 10px;
font-size: 12px;
}
div[id^="filtroDash_"] .fdash-actions button[id^="limpar_"] {
@@ -109,7 +150,7 @@ div[id^="filtroDash_"] .fdash-actions button[id^="filtrar_"]:focus {
@media (max-width: 1300px) {
div[id^="filtroDash_"] .fdash-title {
font-size: 24px;
font-size: 20px;
}
div[id^="filtroDash_"] .fdash-filters-row {
@@ -117,11 +158,11 @@ div[id^="filtroDash_"] .fdash-actions button[id^="filtrar_"]:focus {
}
div[id^="filtroDash_"] .fdash-filter-label {
font-size: 14px;
font-size: 13px;
}
div[id^="filtroDash_"] .fdash-chip {
font-size: 12px;
font-size: 11px;
}
div[id^="filtroDash_"] .fdash-actions {
@@ -1,10 +1,10 @@
var FiltroDash = SuperWidget.extend({
dadosBase: [],
lojasDisponiveis: [],
selecionados: {
ciclo: {},
regional: {},
supervisao: {}
regional: {}
},
init: function () {
@@ -51,11 +51,11 @@ var FiltroDash = SuperWidget.extend({
renderFiltros: function () {
var ciclos = this.valoresUnicos(function (x) { return x.ciclo; });
var regionais = this.valoresUnicos(function (x) { return x.regional; });
var supervisoes = this.valoresUnicos(function (x) { return x.responsavelLoja; });
var lojas = this.valoresUnicos(function (x) { return x.loja; });
this.renderChips("ciclo", ciclos, "#chips_ciclo_" + this.instanceId);
this.renderChips("regional", regionais, "#chips_regional_" + this.instanceId);
this.renderChips("supervisao", supervisoes, "#chips_supervisao_" + this.instanceId);
this.renderAutocomplete(lojas);
},
valoresUnicos: function (getter) {
@@ -107,15 +107,83 @@ var FiltroDash = SuperWidget.extend({
});
},
renderAutocomplete: function (valores) {
var self = this;
var inputId = "#loja_" + this.instanceId;
var sugestoesId = "#lojaSugestoes_" + this.instanceId;
this.lojasDisponiveis = valores.slice();
$(sugestoesId).empty().hide();
$(inputId).off(".fdashLoja");
$(document).off(".fdashLojaDoc" + this.instanceId);
$(inputId).on("input.fdashLoja focus.fdashLoja", function () {
self.mostrarSugestoes($(this).val());
self.aplicar();
});
$(inputId).on("change.fdashLoja blur.fdashLoja", function () {
self.aplicar();
setTimeout(function () {
$(sugestoesId).hide();
}, 150);
});
$(document).on("click.fdashLojaDoc" + this.instanceId, function (e) {
if (!$(e.target).closest(".fdash-autocomplete-wrap").length) {
$(sugestoesId).hide();
}
});
},
mostrarSugestoes: function (texto) {
var self = this;
var sugestoes = this.filtrarLojas(texto);
var box = $("#lojaSugestoes_" + this.instanceId);
box.empty();
if (!texto || !sugestoes.length) {
box.hide();
return;
}
sugestoes.slice(0, 12).forEach(function (valor) {
var item = $("<button>")
.attr("type", "button")
.addClass("fdash-sugestao-item")
.text(valor);
item.on("click", function () {
$("#loja_" + self.instanceId).val(valor);
box.hide();
self.aplicar();
});
box.append(item);
});
box.show();
},
filtrarLojas: function (texto) {
var query = normalizaTexto(texto);
if (!query) return [];
return this.lojasDisponiveis.filter(function (valor) {
return normalizaTexto(valor).indexOf(query) > -1;
});
},
limpar: function () {
this.selecionados = {
ciclo: {},
regional: {},
supervisao: {}
regional: {}
};
$("#dtInicio_" + this.instanceId).val("");
$("#dtFim_" + this.instanceId).val("");
$("#loja_" + this.instanceId).val("");
$("#filtroDash_" + this.instanceId + " .fdash-chip").addClass("is-off");
this.aplicar();
},
@@ -126,9 +194,13 @@ var FiltroDash = SuperWidget.extend({
dataFim: $("#dtFim_" + this.instanceId).val(),
ciclo: Object.keys(this.selecionados.ciclo),
regional: Object.keys(this.selecionados.regional),
supervisao: Object.keys(this.selecionados.supervisao)
loja: $("#loja_" + this.instanceId).val()
};
try {
console.log("[filtrosDash] filtros aplicados:", filtros);
} catch (e) {}
window.dispatchEvent(new CustomEvent("dashboardFiltro", { detail: filtros }));
}