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-19 10:14:07 +0700
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
6c96495ba37331e782b7fff6a1713fa24c076dd8
6c96495b
1 parent
a3c898f3
remove select
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
resources/views/ocr/index.blade.php
resources/views/ocr/index.blade.php
View file @
6c96495
...
...
@@ -123,7 +123,6 @@
<div
v-for=
"field in fieldOptions"
:key=
"field.value"
class=
"form-group"
>
<label>
@{{ field.label }}
</label>
<input
v-model=
"formData[field.value]"
@
focus=
"highlightField(field.value)"
@
click=
"onInputClick(field.value)"
@
blur=
"removeAllFocus()"
...
...
@@ -164,10 +163,13 @@
},
mounted
()
{
this
.
loadOCRData
();
// Thêm event listener để xóa focus khi click ra ngoài
//Thêm event listener để xóa focus khi click ra ngoài
document
.
addEventListener
(
'click'
,
(
e
)
=>
{
if
(
!
e
.
target
.
closest
(
'.left-panel'
)
&&
!
e
.
target
.
closest
(
'.bbox'
))
{
if
(
!
e
.
target
.
closest
(
'.left-panel'
)
&&
!
e
.
target
.
closest
(
'.bbox'
)
&&
!
e
.
target
.
closest
(
'select'
)
)
{
this
.
removeAllFocus
();
}
});
...
...
@@ -179,11 +181,9 @@
}
},
methods
:
{
// Map field cho box (không set active, chỉ dùng để load data từ DB)
mapFieldToBox
(
index
,
fieldName
,
text
=
null
)
{
if
(
index
==
null
)
return
;
// Xóa tất cả box có fieldName trùng lặp, chỉ giữ lại box hiện tại
this
.
ocrData
=
this
.
ocrData
.
filter
((
box
,
i
)
=>
{
if
(
i
===
index
)
return
true
;
...
...
@@ -254,7 +254,6 @@
};
}
});
fields
=
(
fieldsByName
);
console
.
log
(
'Using ocrData for customer_name:'
,
customer_name
,
customer_coords
);
}
...
...
@@ -292,7 +291,6 @@
}
},
deleteBox
(
index
)
{
const
item
=
this
.
ocrData
[
index
];
if
(
item
.
isManual
)
{
...
...
@@ -303,7 +301,6 @@
o
.
hideBorder
=
false
;
}
});
// Đánh dấu xoá vùng thủ công
this
.
ocrData
[
index
].
isDeleted
=
true
;
this
.
ocrData
[
index
].
showDelete
=
false
;
...
...
@@ -352,8 +349,7 @@
},
autoMapFieldsFromFormData
()
{
this
.
manualBoxData
=
{};
// reset
this
.
manualBoxData
=
{};
if
(
this
.
is_template
)
{
this
.
formData
=
{};
}
...
...
@@ -536,6 +532,7 @@
removeAllFocus
()
{
// Reset active index (chỉ mất màu xanh, không xóa box)
this
.
activeIndex
=
null
;
this
.
selectingIndex
=
null
;
// Ẩn hoàn toàn các box manual được tạo từ DB (không phải quét chọn thủ công)
this
.
ocrData
.
forEach
(
item
=>
{
...
...
Please
register
or
sign in
to post a comment