feat: [문서인쇄] print.blade.php에 rendered_html 스냅샷 우선 출력 추가
- rendered_html 있으면 스냅샷 그대로 출력 - 없으면 기존 템플릿 기반 동적 렌더링 fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,13 @@ class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-4 py-2 rounded-lg transiti
|
||||
{{-- 성적서 본문 --}}
|
||||
<div class="bg-white border border-gray-300 p-8 print:p-4 print:border-0" id="printArea">
|
||||
|
||||
{{-- HTML 스냅샷 우선 출력 (React에서 저장한 rendered_html) --}}
|
||||
@if($document->rendered_html)
|
||||
<div class="document-snapshot-container">
|
||||
{!! $document->rendered_html !!}
|
||||
</div>
|
||||
@else
|
||||
{{-- 레거시: 템플릿 기반 동적 렌더링 --}}
|
||||
@php
|
||||
$template = $document->template;
|
||||
$hasComplexCol = $template->columns->contains(fn($c) => $c->column_type === 'complex' && $c->sub_labels);
|
||||
@@ -364,6 +371,7 @@ class="doc-th"
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
@endif {{-- 스냅샷 vs 레거시 분기 끝 --}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user