From f627572abb8dce9b4b432f55b94a06fbdf4f41df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Wed, 17 Jun 2026 07:19:38 +0400 Subject: [PATCH] =?UTF-8?q?=E2=84=B9=20=D0=BC=D0=BE=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=BE=D0=BA=D0=BD=D0=BE=20=D1=81=20?= =?UTF-8?q?=D0=B4=D0=B5=D1=82=D0=B0=D0=BB=D1=8F=D0=BC=D0=B8=20=D0=BF=D0=B0?= =?UTF-8?q?=D1=80=D1=81=D0=B8=D0=BD=D0=B3=D0=B0=20(=D0=BF=D0=B0=D1=80?= =?UTF-8?q?=D0=B0=D0=B3=D1=80=D0=B0=D1=84=D1=8B,=20=D1=82=D0=B0=D0=B1?= =?UTF-8?q?=D0=BB=D0=B8=D1=86=D1=8B,=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA?= =?UTF-8?q?=D0=B8,=20=D0=BF=D1=80=D0=B5=D0=B2=D1=8C=D1=8E),=20v1.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 21 ++++++++- site/templates/upload.html | 94 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 110 insertions(+), 5 deletions(-) diff --git a/site/app.py b/site/app.py index a8961ff..fbdde64 100644 --- a/site/app.py +++ b/site/app.py @@ -147,6 +147,23 @@ class ContractsApp: supp_rows = [dict(zip(supps["columns"], r)) for r in supps["rows"]] + def _file_done(name, elapsed, elements, errors, text): + 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") + return { + "type": "file_done", + "name": name, + "time_s": elapsed, + "elements": len(elements), + "paragraphs": paragraphs, + "tables": tables, + "table_rows": table_rows, + "errors": errors, + "text_len": len(text) if text else 0, + "text_preview": text[:200] if text else "", + } + for s in supp_rows: # Пропустить уже распарсенные existing, _ = db.query( @@ -223,7 +240,7 @@ class ContractsApp: ) zelapsed = round(time_mod.time() - zf_start, 2) files_processed += 1 - yield f"data: {json.dumps({'type': 'file_done', 'name': zname, 'time_s': zelapsed, 'elements': len(zelements)})}\n\n" + yield f"data: {json.dumps(_file_done(zname, zelapsed, zelements, zpr.get('errors',[]), ztext))}\n\n" except Exception as e: yield f"data: {json.dumps({'type': 'file_error', 'name': zname, 'error': str(e)})}\n\n" @@ -244,7 +261,7 @@ class ContractsApp: ) elapsed = round(time_mod.time() - file_start, 2) files_processed += 1 - yield f"data: {json.dumps({'type': 'file_done', 'name': s['filename'], 'time_s': elapsed, 'elements': len(elements)})}\n\n" + yield f"data: {json.dumps(_file_done(s['filename'], elapsed, elements, pr.get('errors',[]), text))}\n\n" total_time = round(time_mod.time() - start_time, 2) yield f"data: {json.dumps({'type': 'summary', 'total_time_s': total_time, 'total_bytes': total_bytes, 'files_processed': files_processed})}\n\n" diff --git a/site/templates/upload.html b/site/templates/upload.html index e701205..2c38d96 100644 --- a/site/templates/upload.html +++ b/site/templates/upload.html @@ -42,12 +42,25 @@ .empty-row td { color: var(--muted); text-align: center; padding: 24px; } .remove-btn { cursor: pointer; color: var(--muted); background: none; border: none; padding: 2px 4px; font-size: 16px; line-height: 1; } .remove-btn:hover { color: var(--destructive); } + .info-btn { cursor: pointer; color: var(--muted); background: none; border: none; padding: 2px 4px; font-size: 14px; display: none; } + .info-btn:hover { color: var(--brand-primary); } + .info-btn.visible { display: inline; } + /* Modal */ + .modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.4); z-index: 100; justify-content: center; align-items: center; } + .modal-overlay.open { display: flex; } + .modal { background: var(--background); border-radius: 12px; border: 1px solid var(--brand-gray); box-shadow: 0 4px 24px rgba(0,0,0,.15); max-width: 520px; width: 90%; max-height: 80vh; overflow-y: auto; } + .modal-header { padding: 14px 16px; border-bottom: 1px solid var(--brand-gray); display: flex; align-items: center; gap: 8px; font-weight: 600; } + .modal-body { padding: 16px; } + .modal-body .kv { display: flex; margin-bottom: 6px; font-size: 13px; } + .modal-body .kv .k { color: var(--muted); width: 110px; flex-shrink: 0; } + .modal-body .kv .v { word-break: break-all; } + .modal-body pre { background: var(--brand-grey-light); padding: 10px; border-radius: 6px; font-size: 12px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; margin-top: 4px; }
Nubes - Сверка договоров v1.9 + Сверка договоров v1.10
@@ -62,7 +75,7 @@
- +
ИмяИзменёнРазмерСтатус
ИмяИзменёнРазмерСтатус
@@ -75,6 +88,18 @@
+ + +