tien_nemo

xong buoc 1

......@@ -59,7 +59,7 @@ class OcrController extends Controller
{
try {
// Lấy template name từ request hoặc mặc định
$templateName = $request->get('template_name', 'A');
$templateName = $request->get('template_name', '');
// Giả sử file OCR JSON & ảnh nằm trong storage/app/public/image/
$jsonPath = public_path("image/data_picking_detail_1754967679.json");
......@@ -110,6 +110,7 @@ class OcrController extends Controller
];
}
}
// dd($formData, $dataMapping);
return response()->json([
'success' => true,
......
......@@ -802,8 +802,10 @@
// Tìm tất cả các box OCR nằm trong vùng manual
this.ocrData.forEach(item => {
if (!item.isManual && this.isBoxInside(item.bbox, newBbox) && item.text.trim()) {
const partial = this.getPartialText(item.text, item.bbox, newBbox);
// console.log(`Found OCR item for manual mapping: ${partial} at bbox ${item.bbox}`);
foundItems.push({
text: item.text,
text: partial,
bbox: item.bbox,
index: this.ocrData.indexOf(item)
});
......