Implementacao upload anexos de ordens

This commit is contained in:
HalbeBruno
2026-03-12 15:20:38 -03:00
parent 6a1312d55c
commit fa96ec4aea
11 changed files with 352 additions and 11 deletions

View File

@@ -68,6 +68,38 @@
</label>
</div>
</div>
<div class="col-span-2">
<label class="block text-sm font-medium text-gray-700 mb-1">
Anexos <span class="text-gray-400 font-normal">(PDF, imagens, documentos opcional)</span>
</label>
<p class="text-xs text-gray-500 mb-2">Arquivos da ordem judicial (decisão, ofícios, etc.). Tipos aceitos: PDF, PNG, JPG, GIF, DOC, DOCX, XLS, XLSX, TXT máx. 20 MB por arquivo.</p>
<div x-data="{ attachNames: [] }" class="mt-1">
<label class="flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer hover:border-primary-500 transition-colors bg-white">
<div class="space-y-1 text-center w-full">
<svg class="mx-auto h-10 w-10 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13" />
</svg>
<div class="flex text-sm text-gray-600 justify-center">
<span class="font-medium text-primary-600 hover:text-primary-500">Selecionar arquivos</span>
<p class="pl-1">ou arraste e solte</p>
</div>
<template x-if="attachNames.length > 0">
<ul class="text-xs text-gray-700 mt-2 text-left list-disc list-inside">
<template x-for="name in attachNames" :key="name">
<li x-text="name"></li>
</template>
</ul>
</template>
<p x-show="attachNames.length === 0" class="text-xs text-gray-400 mt-1">Nenhum arquivo selecionado</p>
</div>
<input type="file" name="attachments[]" class="sr-only"
accept=".pdf,.png,.jpg,.jpeg,.gif,.doc,.docx,.xls,.xlsx,.txt"
multiple
@change="attachNames = Array.from($event.target.files).map(f => f.name)">
</label>
</div>
</div>
</div>
<div class="flex justify-end space-x-3 pt-4 border-t border-gray-100">