Ersetzt durch added, farben
This commit is contained in:
@@ -6,4 +6,5 @@ Ben8 (Deutscher Text)
|
|||||||
Hersteller
|
Hersteller
|
||||||
Text -> Text aus der tabelle TEXT durch TextId verknüpft
|
Text -> Text aus der tabelle TEXT durch TextId verknüpft
|
||||||
PrsVK -> Aus Tabelle TSSAEF verknüpft durch Teil
|
PrsVK -> Aus Tabelle TSSAEF verknüpft durch Teil
|
||||||
|
Ersatz (Ersetzte durch) -> Aus Tabelle TSSAEF, Spalte Ersatz
|
||||||
|
|
||||||
|
|||||||
@@ -207,8 +207,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||||||
t.Ben7,
|
t.Ben7,
|
||||||
t.Ben8,
|
t.Ben8,
|
||||||
t.Hersteller,
|
t.Hersteller,
|
||||||
|
t.Stat,
|
||||||
txt.Text AS [Text],
|
txt.Text AS [Text],
|
||||||
ts.PrsVk AS PrsVK
|
ts.PrsVk AS PrsVK,
|
||||||
|
ts.Ersatz AS Ersatz
|
||||||
FROM TEILE t WITH (NOLOCK)
|
FROM TEILE t WITH (NOLOCK)
|
||||||
OUTER APPLY (
|
OUTER APPLY (
|
||||||
SELECT TOP 1 [Text]
|
SELECT TOP 1 [Text]
|
||||||
@@ -217,7 +219,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||||||
ORDER BY LfdNr
|
ORDER BY LfdNr
|
||||||
) txt
|
) txt
|
||||||
OUTER APPLY (
|
OUTER APPLY (
|
||||||
SELECT TOP 1 PrsVk
|
SELECT TOP 1 PrsVk, Ersatz
|
||||||
FROM TSSAEF WITH (NOLOCK)
|
FROM TSSAEF WITH (NOLOCK)
|
||||||
WHERE Teil = t.Teil
|
WHERE Teil = t.Teil
|
||||||
ORDER BY ISN
|
ORDER BY ISN
|
||||||
|
|||||||
@@ -160,12 +160,40 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.record {
|
.record {
|
||||||
background: #f9f9f9;
|
display: flex;
|
||||||
padding: 15px;
|
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border-left: 4px solid #667eea;
|
overflow: hidden;
|
||||||
|
background: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
.record-status-bar {
|
||||||
|
width: 16px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
.record-status-label {
|
||||||
|
writing-mode: vertical-rl;
|
||||||
|
text-orientation: mixed;
|
||||||
|
transform: rotate(180deg);
|
||||||
|
color: rgba(255,255,255,0.95);
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
white-space: nowrap;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
.record-body {
|
||||||
|
flex: 1;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
/* Status-Farben (siehe status.txt): aktiv=grün, inaktiv/löschbar=rot, prüfbar=orange, pseudoteil=grün */
|
||||||
|
.record-status-bar.record--aktiv { background: #2e7d32; }
|
||||||
|
.record-status-bar.record--inaktiv { background: #c62828; }
|
||||||
|
.record-status-bar.record--loeschbar { background: #c62828; }
|
||||||
|
.record-status-bar.record--pruefbar { background: #e65100; }
|
||||||
|
.record-status-bar.record--pseudoteil { background: #2e7d32; }
|
||||||
|
|
||||||
.record-field {
|
.record-field {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -396,11 +424,37 @@
|
|||||||
{ key: 'Ben8', label: 'Deutscher Text' },
|
{ key: 'Ben8', label: 'Deutscher Text' },
|
||||||
{ key: 'Hersteller', label: 'Hersteller' },
|
{ key: 'Hersteller', label: 'Hersteller' },
|
||||||
{ key: 'Text', label: 'Zusatztext' },
|
{ key: 'Text', label: 'Zusatztext' },
|
||||||
{ key: 'PrsVK', label: 'Verkaufspreis in €' }
|
{ key: 'PrsVK', label: 'Verkaufspreis in €' },
|
||||||
|
{ key: 'Ersatz', label: 'Ersetzt durch' }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
function getStatusClass(stat) {
|
||||||
|
const s = (stat == null ? '' : String(stat).trim());
|
||||||
|
if (s === 'i') return 'record--inaktiv';
|
||||||
|
if (s === 'l') return 'record--loeschbar';
|
||||||
|
if (s === 'L') return 'record--pruefbar';
|
||||||
|
if (s === 'p') return 'record--pseudoteil';
|
||||||
|
return 'record--aktiv'; // "" oder leer = aktiv
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStatusLabel(stat) {
|
||||||
|
const s = (stat == null ? '' : String(stat).trim());
|
||||||
|
if (s === 'i') return 'Inaktiv';
|
||||||
|
if (s === 'l') return 'Löschbar';
|
||||||
|
if (s === 'L') return 'Prüfbar';
|
||||||
|
if (s === 'p') return 'Pseudoteil';
|
||||||
|
return 'Aktiv';
|
||||||
|
}
|
||||||
|
|
||||||
function renderRecord(record) {
|
function renderRecord(record) {
|
||||||
let html = '<div class="record">';
|
const statusClass = getStatusClass(record.Stat);
|
||||||
|
const statusLabel = getStatusLabel(record.Stat);
|
||||||
|
let html = `
|
||||||
|
<div class="record">
|
||||||
|
<div class="record-status-bar ${statusClass}">
|
||||||
|
<span class="record-status-label">${escapeHtml(statusLabel)}</span>
|
||||||
|
</div>
|
||||||
|
<div class="record-body">`;
|
||||||
for (const { key, label } of DISPLAY_COLUMNS) {
|
for (const { key, label } of DISPLAY_COLUMNS) {
|
||||||
if (!(key in record)) continue;
|
if (!(key in record)) continue;
|
||||||
const value = record[key];
|
const value = record[key];
|
||||||
@@ -409,10 +463,11 @@
|
|||||||
<div class="record-field">
|
<div class="record-field">
|
||||||
<span class="field-name">${escapeHtml(label)}:</span>
|
<span class="field-name">${escapeHtml(label)}:</span>
|
||||||
<span class="field-value">${displayValue}</span>
|
<span class="field-value">${displayValue}</span>
|
||||||
</div>
|
</div>`;
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
html += '</div>';
|
html += `
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
#<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ const TEILE_SEARCH_COLUMNS = [
|
|||||||
'Hersteller'
|
'Hersteller'
|
||||||
];
|
];
|
||||||
|
|
||||||
// Ausgabe-Spalten für Suchergebnisse (nur diese 8 Felder, siehe Spalten.txt)
|
// Ausgabe-Spalten für Suchergebnisse (siehe Spalten.txt)
|
||||||
// Text aus TEXT (TEILE.MemoID = TEXT.TextId), PrsVK aus TSSAEF (Teil = Teil)
|
// Text aus TEXT (TEILE.MemoID = TEXT.TextId), PrsVK + Ersatz aus TSSAEF (Teil = Teil)
|
||||||
const TEILE_OUTPUT_COLUMNS = [
|
const TEILE_OUTPUT_COLUMNS = [
|
||||||
'Teil',
|
'Teil',
|
||||||
'Bez',
|
'Bez',
|
||||||
@@ -30,7 +30,8 @@ const TEILE_OUTPUT_COLUMNS = [
|
|||||||
'Ben8',
|
'Ben8',
|
||||||
'Hersteller',
|
'Hersteller',
|
||||||
'Text', // aus Tabelle TEXT
|
'Text', // aus Tabelle TEXT
|
||||||
'PrsVK' // aus Tabelle TSSAEF
|
'PrsVK', // aus Tabelle TSSAEF
|
||||||
|
'Ersatz' // aus Tabelle TSSAEF (Ersetzte durch)
|
||||||
];
|
];
|
||||||
|
|
||||||
const SEARCH_CONFIG = [
|
const SEARCH_CONFIG = [
|
||||||
@@ -100,8 +101,10 @@ const fullTextSearch = async (searchTerm) => {
|
|||||||
t.Ben7,
|
t.Ben7,
|
||||||
t.Ben8,
|
t.Ben8,
|
||||||
t.Hersteller,
|
t.Hersteller,
|
||||||
|
t.Stat,
|
||||||
txt.Text AS [Text],
|
txt.Text AS [Text],
|
||||||
ts.PrsVk AS PrsVK
|
ts.PrsVk AS PrsVK,
|
||||||
|
ts.Ersatz AS Ersatz
|
||||||
FROM [${tableConfig.tableName}] t WITH (NOLOCK)
|
FROM [${tableConfig.tableName}] t WITH (NOLOCK)
|
||||||
OUTER APPLY (
|
OUTER APPLY (
|
||||||
SELECT TOP 1 [Text]
|
SELECT TOP 1 [Text]
|
||||||
@@ -110,7 +113,7 @@ const fullTextSearch = async (searchTerm) => {
|
|||||||
ORDER BY LfdNr
|
ORDER BY LfdNr
|
||||||
) txt
|
) txt
|
||||||
OUTER APPLY (
|
OUTER APPLY (
|
||||||
SELECT TOP 1 PrsVk
|
SELECT TOP 1 PrsVk, Ersatz
|
||||||
FROM TSSAEF WITH (NOLOCK)
|
FROM TSSAEF WITH (NOLOCK)
|
||||||
WHERE Teil = t.Teil
|
WHERE Teil = t.Teil
|
||||||
ORDER BY ISN
|
ORDER BY ISN
|
||||||
|
|||||||
5
status.txt
Normal file
5
status.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
i = inaktiv -> rot
|
||||||
|
"" = aktiv -> grün
|
||||||
|
L = prüfbar -> orange
|
||||||
|
l = löschbar -> rot
|
||||||
|
p = pseudoteil -> grün
|
||||||
Reference in New Issue
Block a user