v1.0.43: превью текста + первые строки таблиц в модалке

This commit is contained in:
2026-06-19 07:36:27 +04:00
parent 836b0eca6b
commit 6fc85811b7
2 changed files with 27 additions and 3 deletions
+15 -2
View File
@@ -309,16 +309,29 @@
<cfset paraCount = 0>
<cfset tblCount = 0>
<cfset tblRows = 0>
<cfset textPreview = "">
<cfset tblHeaders = []>
<cfloop array="#elements#" index="el">
<cfif el.type EQ "paragraph"><cfset paraCount++>
<cfelseif el.type EQ "table"><cfset tblCount++><cfset tblRows += arrayLen(el.rows)>
<cfif el.type EQ "paragraph">
<cfset paraCount++>
<cfif len(textPreview) LT 200>
<cfset textPreview &= el.text & chr(10)>
</cfif>
<cfelseif el.type EQ "table">
<cfset tblCount++>
<cfset tblRows += arrayLen(el.rows)>
<cfif arrayLen(el.rows) GT 0>
<cfset arrayAppend(tblHeaders, el.rows[1])>
</cfif>
</cfif>
</cfloop>
<cfset textPreview = left(textPreview, 200)>
<cfset result = {ok: true, doc_id: url.doc_id, filename: doc.filename,
mime_type: doc.mime_type, status: newStatus,
element_count: arrayLen(elements), error_count: arrayLen(errors),
paragraphs: paraCount, tables: tblCount, table_rows: tblRows,
text_preview: textPreview, table_headers: tblHeaders,
errors: errors, files: files}>
</cfif>
</cfif>