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-20 11:40:04 +0700
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
01d91a3a2fdba5ae6d0c98d0c5070e5ed6884f4c
01d91a3a
1 parent
ad395fb9
remove func
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
35 deletions
resources/views/ocr/index.blade.php
resources/views/ocr/index.blade.php
View file @
01d91a3
...
...
@@ -413,47 +413,12 @@
if
(
idx
!==
-
1
)
{
this
.
activeIndex
=
idx
;
this
.
scrollToBox
(
idx
);
// Reset selectingIndex để không hiển thị dropdown khi highlight từ input
this
.
selectingIndex
=
null
;
}
else
{
this
.
activeIndex
=
null
;
}
},
scrollToBox
(
index
)
{
if
(
!
this
.
$refs
.
pdfContainer
||
index
<
0
||
index
>=
this
.
ocrData
.
length
)
return
;
const
item
=
this
.
ocrData
[
index
];
if
(
!
item
||
item
.
isDeleted
)
return
;
// Tính vị trí hiển thị của box
const
[
x1
,
y1
,
x2
,
y2
]
=
item
.
bbox
;
if
(
!
this
.
imageWidth
||
!
this
.
imageHeight
||
!
this
.
$refs
.
pdfImage
)
return
;
const
displayedWidth
=
this
.
$refs
.
pdfImage
.
clientWidth
;
const
displayedHeight
=
this
.
$refs
.
pdfImage
.
clientHeight
;
const
scaleX
=
displayedWidth
/
this
.
imageWidth
;
const
scaleY
=
displayedHeight
/
this
.
imageHeight
;
const
displayX
=
Math
.
round
(
x1
*
scaleX
);
const
displayY
=
Math
.
round
(
y1
*
scaleY
);
// Scroll đến vị trí box
const
container
=
this
.
$refs
.
pdfContainer
;
const
containerRect
=
container
.
getBoundingClientRect
();
const
scrollTop
=
container
.
scrollTop
;
const
scrollLeft
=
container
.
scrollLeft
;
// Tính vị trí scroll để box nằm ở giữa viewport
const
targetScrollTop
=
scrollTop
+
displayY
-
(
containerRect
.
height
/
2
);
const
targetScrollLeft
=
scrollLeft
+
displayX
-
(
containerRect
.
width
/
2
);
container
.
scrollTo
({
top
:
Math
.
max
(
0
,
targetScrollTop
),
left
:
Math
.
max
(
0
,
targetScrollLeft
),
behavior
:
'smooth'
});
},
// Xử lý khi click vào input
onInputClick
(
fieldName
)
{
// Kiểm tra xem field này có data không
...
...
Please
register
or
sign in
to post a comment