Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Satini_pvduc
/
ocrpdf
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
tien_nemo
2025-08-13 23:10:41 +0700
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
7ba730da4dde1f32314f98e9be233bfd4dee5ba5
7ba730da
1 parent
93e15a32
test ok1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
resources/views/ocr/index.blade.php
resources/views/ocr/index.blade.php
View file @
7ba730d
...
...
@@ -770,10 +770,11 @@
// Cập nhật formData để hiển thị trong input
this
.
formData
[
item
.
field
]
=
item
.
text
||
''
;
// Cập nhật manualBoxData với tọa độ mới
// Cập nhật manualBoxData với tọa độ mới
(box OCR không có nút xóa)
this
.
manualBoxData
[
item
.
field
]
=
{
coords
:
item
.
bbox
,
text
:
item
.
text
||
''
text
:
item
.
text
||
''
,
isFromOCR
:
true
// Đánh dấu đây là box OCR, không phải quét chọn
};
// Xóa dataMapping cũ để tránh focus về tọa độ cũ
...
...
@@ -784,7 +785,7 @@
// Set active index
this
.
activeIndex
=
this
.
selectingIndex
;
console
.
log
(
`Updated field "
${
item
.
field
}
" for box at index
${
this
.
selectingIndex
}
with new coordinates`
);
console
.
log
(
`Updated field "
${
item
.
field
}
" for box
OCR
at index
${
this
.
selectingIndex
}
with new coordinates`
);
}
this
.
selectingIndex
=
null
;
...
...
@@ -835,10 +836,11 @@
// Cập nhật formData để hiển thị trong input
this
.
formData
[
this
.
manualField
]
=
finalText
.
trim
();
// Cập nhật manualBoxData
// Cập nhật manualBoxData
(box quét chọn có nút xóa)
this
.
manualBoxData
[
this
.
manualField
]
=
{
coords
:
newBbox
,
text
:
finalText
.
trim
()
text
:
finalText
.
trim
(),
isFromOCR
:
false
// Đánh dấu đây là box quét chọn, không phải OCR
};
// Xóa dataMapping cũ để tránh focus về tọa độ cũ
...
...
@@ -989,19 +991,22 @@
// Xóa box cũ có cùng fieldName trước khi hiển thị lại
this
.
ocrData
=
this
.
ocrData
.
filter
(
box
=>
!
(
box
.
field
===
fieldName
&&
box
.
isManual
));
// Hiển thị lại box manual đã quét chọn (có nút xóa)
// Kiểm tra xem đây có phải box quét chọn hay box OCR
const
isFromOCR
=
this
.
manualBoxData
[
fieldName
]
&&
this
.
manualBoxData
[
fieldName
].
isFromOCR
;
// Hiển thị lại box manual (có nút xóa nếu là quét chọn, không có nút xóa nếu là OCR)
const
manualBox
=
{
text
:
text
||
''
,
bbox
:
coords
,
field
:
fieldName
,
isManual
:
true
,
showDelete
:
true
,
showDelete
:
!
isFromOCR
,
// Chỉ hiển thị nút xóa nếu KHÔNG phải từ OCR
isDeleted
:
false
,
hideBorder
:
false
};
this
.
ocrData
.
push
(
manualBox
);
console
.
log
(
'Manual box shown successfully:'
,
manualBox
);
console
.
log
(
`Manual box shown successfully:
${
isFromOCR
?
'from OCR (no delete btn)'
:
'from manual selection (with delete btn)'
}
`
);
// Force re-render
this
.
$forceUpdate
();
...
...
Please
register
or
sign in
to post a comment