feat: aggiunta ricerca testuale in cache nella pagina ricerca spudorata.

This commit is contained in:
Gabriele Cimaschi committed 2026-08-26 12:54:48 +02:00
1 parent 8d24759a15
commit a36e501596
4 files changed
+261 -254

No files matched your search

+17 -1
View File
@@ -14,6 +14,7 @@ const Filters = {
customer_user_id: '',
date_from: '',
date_to: '',
sub_search: '',
},
my: {
queue_id: '',
@@ -23,6 +24,7 @@ const Filters = {
customer_user_id: '',
date_from: '',
date_to: '',
sub_search: '',
},
spudorata: {
queue_id: '',
@@ -32,6 +34,7 @@ const Filters = {
customer_user_id: '',
date_from: '',
date_to: '',
sub_search: '',
}
},
@@ -93,7 +96,7 @@ const Filters = {
/** Reset all filters */
reset() {
this.state = { queue_id: '', state_id: '', priority_id: '', user_id: '', customer_user_id: '', date_from: '', date_to: '' };
this.state = { queue_id: '', state_id: '', priority_id: '', user_id: '', customer_user_id: '', date_from: '', date_to: '', sub_search: '' };
if (this.currentMode === 'my') {
const activeAgentId = localStorage.getItem('activeAgentId') || '1';
this.state.user_id = activeAgentId;
@@ -341,6 +344,10 @@ const Filters = {
<span class="filter-label">A Data/Ora</span>
<input type="datetime-local" class="filter-select" data-filter="date_to" id="filter-date-to" value="${this.state.date_to || ''}" style="width: 170px; padding: 4px 8px; font-family: inherit; font-size: 0.85rem;" />
</div>
<div class="filter-group">
<span class="filter-label">Cerca in Cache</span>
<input type="text" class="filter-select form-input" data-filter="sub_search" id="filter-sub-search" value="${App.escapeHtml(this.state.sub_search || '')}" placeholder="Filtra testo..." style="width: 140px; padding: 4px 8px; font-family: inherit; font-size: 0.85rem;" autocomplete="off" />
</div>
<div class="filters-actions" style="display:flex; gap:6px; align-items:center;">
<button class="btn btn-primary btn-xs" id="filter-refresh" title="Aggiorna lista ticket" style="display:inline-flex; align-items:center; gap:4px; height:26px; padding:0 10px; font-size:0.78rem;">
🔄 Aggiorna
@@ -363,6 +370,15 @@ const Filters = {
this.save();
if (onFilterChange) onFilterChange();
});
if (sel.tagName === 'INPUT' && sel.type === 'text') {
sel.addEventListener('input', (e) => {
this.selectedPresetId = null;
this.state[e.target.dataset.filter] = e.target.value;
this.save();
if (onFilterChange) onFilterChange();
});
}
});
// Helper to bind standard multiselect popover events