Suche-Reiter: eigenes Suchfeld, wird beim Verlassen geleert

Der Suche-Reiter nutzt jetzt ein eigenes Such-Feld (sucheText) getrennt
vom globalen Filter – die Eingabe wird nicht mehr in die anderen Reiter
(Neu, Warteschlange …) übernommen und beim Verlassen des Reiters
geleert. Das globale Filter-Feld ist im Suche-Reiter ausgeblendet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
s4luorth
2026-09-21 20:17:30 +02:00
parent af7126b03d
commit 65b826dc83

View File

@@ -175,6 +175,10 @@ const Board = defineComponent({
// Templates werden NICHT hier gewählt, sondern in den Einstellungen den // Templates werden NICHT hier gewählt, sondern in den Einstellungen den
// Formaten zugeordnet (format_templates.default_format). // Formaten zugeordnet (format_templates.default_format).
const sucheTyp = ref('brief'); const sucheTyp = ref('brief');
// Eigenes Such-Feld NUR für den Suche-Reiter – getrennt vom globalen Filter
// `suche`, damit die Eingabe nicht in die anderen Reiter (Neu, Warteschlange …)
// mitgenommen wird. Wird beim Verlassen des Reiters geleert.
const sucheText = ref('');
const sucheEintraege = ref([]); const sucheEintraege = ref([]);
const loading = ref(false); const loading = ref(false);
const fehler = ref(''); const fehler = ref('');
@@ -470,13 +474,14 @@ const Board = defineComponent({
return m; return m;
}); });
const sucheTreffer = computed(() => { const sucheTreffer = computed(() => {
const q = suche.value.trim(); const q = sucheText.value.trim().toLowerCase();
if (!q) return []; if (!q) return [];
const res = []; const res = [];
for (const e of sucheEintraege.value) { for (const e of sucheEintraege.value) {
const o = orderById.value[e.orderId]; const o = orderById.value[e.orderId];
if (!o || !SUCHE_AKTIV.includes(o.production_status || 'eingegangen')) continue; if (!o || !SUCHE_AKTIV.includes(o.production_status || 'eingegangen')) continue;
if (!trifftSuche([e.hay, o.order_number, o.product?.name].filter(Boolean).join(' '))) continue; const hay = [e.hay, o.order_number, o.product?.name].filter(Boolean).join(' ').toLowerCase();
if (!hay.includes(q)) continue;
res.push({ e, o }); res.push({ e, o });
if (res.length >= 200) break; if (res.length >= 200) break;
} }
@@ -1302,17 +1307,17 @@ const Board = defineComponent({
// Großes, unverkennbar weißes Suchfeld. // Großes, unverkennbar weißes Suchfeld.
const feld = h('div', { style: 'margin-top:18px;' }, [ const feld = h('div', { style: 'margin-top:18px;' }, [
h('div', { style: 'font-size:13px;font-weight:700;color:var(--foreground-normal);margin-bottom:8px;' }, '2. Empfänger suchen'), h('div', { style: 'font-size:13px;font-weight:700;color:var(--foreground-normal);margin-bottom:8px;' }, '2. Empfänger suchen'),
h('input', { type: 'search', value: suche.value, placeholder: 'Name, Straße, Ort oder Auftragsnummer eingeben …', h('input', { type: 'search', value: sucheText.value, placeholder: 'Name, Straße, Ort oder Auftragsnummer eingeben …',
style: 'width:100%;box-sizing:border-box;background:#fff;color:#111;border:2px solid #cdd6e2;border-radius:10px;' style: 'width:100%;box-sizing:border-box;background:#fff;color:#111;border:2px solid #cdd6e2;border-radius:10px;'
+ 'font:inherit;font-size:22px;padding:16px 20px;outline:none;box-shadow:0 1px 3px rgba(0,0,0,.08);', + 'font:inherit;font-size:22px;padding:16px 20px;outline:none;box-shadow:0 1px 3px rgba(0,0,0,.08);',
onInput: (e) => { suche.value = e.target.value; } }), onInput: (e) => { sucheText.value = e.target.value; } }),
]); ]);
const rahmen = (inhalt) => h('div', { style: 'display:flex;flex-direction:column;gap:0;' }, [ const rahmen = (inhalt) => h('div', { style: 'display:flex;flex-direction:column;gap:0;' }, [
h('div', { style: 'background:#fff;border:1px solid #cdd6e2;border-radius:12px;padding:20px 22px;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,.06);' }, [typWahl, feld]), h('div', { style: 'background:#fff;border:1px solid #cdd6e2;border-radius:12px;padding:20px 22px;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,.06);' }, [typWahl, feld]),
inhalt, inhalt,
]); ]);
if (!suche.value.trim()) return rahmen(subdued('Suchbegriff eingeben – durchsucht Neu, Warteschlange, Im Druck, Kuvertierung und Versandfertig.')); if (!sucheText.value.trim()) return rahmen(subdued('Suchbegriff eingeben – durchsucht Neu, Warteschlange, Im Druck, Kuvertierung und Versandfertig.'));
const treffer = sucheTreffer.value; const treffer = sucheTreffer.value;
if (!treffer.length) return rahmen(subdued('Keine Treffer in den aktiven Aufträgen.')); if (!treffer.length) return rahmen(subdued('Keine Treffer in den aktiven Aufträgen.'));
@@ -1692,7 +1697,7 @@ const Board = defineComponent({
return () => { return () => {
const navi = h('div', { style: 'padding:12px 10px;' }, TABS.map((t) => const navi = h('div', { style: 'padding:12px 10px;' }, TABS.map((t) =>
h('button', { h('button', {
type: 'button', onClick: () => { tab.value = t.key; }, type: 'button', onClick: () => { if (tab.value === 'suche' && t.key !== 'suche') sucheText.value = ''; tab.value = t.key; },
style: 'display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;text-align:left;' style: 'display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;text-align:left;'
+ 'cursor:pointer;border:none;border-radius:6px;padding:10px 12px;margin-bottom:3px;font:inherit;font-size:14px;' + 'cursor:pointer;border:none;border-radius:6px;padding:10px 12px;margin-bottom:3px;font:inherit;font-size:14px;'
+ (tab.value === t.key ? `background:${ACCENT};color:#fff;font-weight:600;` : 'background:transparent;color:var(--foreground-normal);'), + (tab.value === t.key ? `background:${ACCENT};color:#fff;font-weight:600;` : 'background:transparent;color:var(--foreground-normal);'),
@@ -1702,7 +1707,9 @@ const Board = defineComponent({
]))); ])));
const kopfzeile = h('div', { style: 'display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:18px;' }, [ const kopfzeile = h('div', { style: 'display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:18px;' }, [
h('input', { type: 'search', value: suche.value, placeholder: '🔎 Auftrag, Kunde, Empfänger …', // Globales Filter-Feld – im Suche-Reiter ausgeblendet (dort gilt das eigene
// große Suchfeld, das nicht in die anderen Reiter übernommen wird).
tab.value === 'suche' ? null : h('input', { type: 'search', value: suche.value, placeholder: '🔎 Auftrag, Kunde, Empfänger …',
style: S_INPUT + 'flex:1;min-width:240px;', onInput: (e) => { suche.value = e.target.value; } }), style: S_INPUT + 'flex:1;min-width:240px;', onInput: (e) => { suche.value = e.target.value; } }),
sichtbareOrders().length ? btn(alleSichtbarGewaehlt() ? '☐ Auswahl aufheben' : '☑ Alle auswählen', alleAuswaehlen) : null, sichtbareOrders().length ? btn(alleSichtbarGewaehlt() ? '☐ Auswahl aufheben' : '☑ Alle auswählen', alleAuswaehlen) : null,
btn('↻ Aktualisieren', laden), btn('↻ Aktualisieren', laden),