ℹ первые строки таблиц в модалке, v1.11
This commit is contained in:
@@ -151,6 +151,10 @@ class ContractsApp:
|
||||
paragraphs = sum(1 for e in elements if e.get("type") == "paragraph")
|
||||
tables = sum(1 for e in elements if e.get("type") == "table")
|
||||
table_rows = sum(len(e.get("rows", [])) for e in elements if e.get("type") == "table")
|
||||
table_headers = [
|
||||
e["rows"][0] if e.get("rows") else []
|
||||
for e in elements if e.get("type") == "table"
|
||||
]
|
||||
return {
|
||||
"type": "file_done",
|
||||
"name": name,
|
||||
@@ -159,6 +163,7 @@ class ContractsApp:
|
||||
"paragraphs": paragraphs,
|
||||
"tables": tables,
|
||||
"table_rows": table_rows,
|
||||
"table_headers": table_headers,
|
||||
"errors": errors,
|
||||
"text_len": len(text) if text else 0,
|
||||
"text_preview": text[:200] if text else "",
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes">
|
||||
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.10</span></span>
|
||||
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.11</span></span>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
@@ -425,6 +425,14 @@
|
||||
html += '<pre>' + d.text_preview + '</pre>';
|
||||
}
|
||||
|
||||
if (d.table_headers && d.table_headers.length > 0) {
|
||||
html += '<div style="margin-top:10px;font-weight:600;font-size:13px;">Первые строки таблиц:</div>';
|
||||
d.table_headers.forEach(function(hdr, ti) {
|
||||
html += '<div style="margin-top:4px;font-size:11px;color:var(--muted);">Таблица ' + (ti+1) + ':</div>';
|
||||
html += '<pre>' + hdr.map(function(c) { return c || '(пусто)'; }).join(' | ') + '</pre>';
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('modalBody').innerHTML = html;
|
||||
document.getElementById('modalOverlay').classList.add('open');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user