Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
484e387e
authored
2023-12-14 16:44:30 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:高拍仪
1 parent
ba9f5e9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
31 deletions
src/views/components/imagePreview.vue
src/views/components/imagePreview.vue
View file @
484e387
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-12-1
3 13:44:24
* @LastEditTime: 2023-12-1
4 16:42:28
-->
<
template
>
<div
class=
"rlPopup"
>
...
...
@@ -12,8 +12,8 @@
<i
class=
"el-icon-arrow-right"
></i>
</div>
<div
class=
"img-list-wrap"
v-Loading=
"loading"
>
<img
id=
"photo"
src=
""
v-
show
=
"isScan && this.BASE_API.gaopaiyi=='jy'"
alt=
"高拍仪捷宇"
>
<img
src=
"http://127.0.0.1:38088/video=stream&camidx=0"
v-if=
"isScan && this.BASE_API.gaopaiyi=='lt'"
alt=
"高拍仪良田"
>
<img
id=
"photo"
src=
""
v-
if
=
"isScan && this.BASE_API.gaopaiyi=='jy'"
alt=
"高拍仪捷宇"
>
<img
src=
"http://127.0.0.1:38088/video=stream&camidx=0"
v-
else-
if=
"isScan && this.BASE_API.gaopaiyi=='lt'"
alt=
"高拍仪良田"
>
<div
v-for=
"(img, i) in previewImg.imgList"
:key=
"i"
v-else
>
<photo-zoom
:url=
"img.fjurl"
:bigWidth=
"165"
v-if=
"i === previewImg.index"
:scale=
"2"
overlayStyle=
"width: 100%;height:100%"
>
...
...
@@ -109,37 +109,9 @@
}
},
created
()
{
let
that
=
this
this
.
maxLength
=
0
;
this
.
allLi
=
_
.
cloneDeep
(
this
.
previewImg
.
imgList
).
map
(
item
=>
item
.
fjurl
)
this
.
thumbnailImages
=
this
.
previewImg
.
imgList
if
(
this
.
BASE_API
.
gaopaiyi
==
'jy'
)
{
this
.
webSocket
=
new
WebSocket
(
'ws://localhost:1818'
);
this
.
webSocket
.
onmessage
=
function
(
event
)
{
let
begin_data
=
"data:image/jpeg;base64,"
;
document
.
getElementById
(
'photo'
).
src
=
begin_data
+
event
.
data
;
if
(
event
.
data
.
indexOf
(
'BeginsGetBase64'
)
>=
0
)
{
let
blob
=
that
.
dataURLtoBlob
(
'data:image/png;base64,'
+
event
.
data
.
replace
(
'BeginsGetBase64'
,
''
).
replace
(
'EndsGetBase64'
,
''
));
let
file
=
that
.
blobToFile
(
blob
);
var
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
)
formData
.
append
(
"bsmSj"
,
that
.
previewImg
.
bsmSj
);
formData
.
append
(
"bsmSlsq"
,
that
.
previewImg
.
bsmSlsq
);
if
(
that
.
previewImg
.
imgList
.
length
>
0
)
{
formData
.
append
(
"ssBsmClmx"
,
that
.
previewImg
.
imgList
[
that
.
previewImg
.
index
].
bsmClmx
);
}
uploadSjClmx
(
formData
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
that
.
$emit
(
'updateList'
,
{
children
:
res
.
result
,
bsmSj
:
that
.
previewImg
.
bsmSj
})
that
.
$message
({
message
:
'上传成功!'
,
type
:
'success'
})
}
})
}
}
}
},
computed
:
{
isFirst
()
{
...
...
@@ -155,6 +127,7 @@
* @author: renchao
*/
handleOpenScan
()
{
let
that
=
this
this
.
isScan
=
!
this
.
isScan
if
(
this
.
isScan
)
{
this
.
loading
=
true
...
...
@@ -169,6 +142,38 @@
}
else
{
this
.
scanTitle
=
'打开高拍仪'
}
if
(
this
.
BASE_API
.
gaopaiyi
==
'jy'
)
{
let
webSocket
=
new
WebSocket
(
'ws://localhost:1818'
);
this
.
webSocket
=
webSocket
webSocket
.
onopen
=
function
(
event
)
{
webSocket
.
send
(
'bStartPlay'
)
webSocket
.
send
(
'vSetPreviewRect(1600,1200)'
)
};
webSocket
.
onmessage
=
function
(
event
)
{
let
begin_data
=
"data:image/jpeg;base64,"
;
document
.
getElementById
(
'photo'
).
src
=
begin_data
+
event
.
data
;
if
(
event
.
data
.
indexOf
(
'BeginsGetBase64'
)
>=
0
)
{
let
blob
=
that
.
dataURLtoBlob
(
'data:image/png;base64,'
+
event
.
data
.
replace
(
'BeginsGetBase64'
,
''
).
replace
(
'EndsGetBase64'
,
''
));
let
file
=
that
.
blobToFile
(
blob
);
var
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
)
formData
.
append
(
"bsmSj"
,
that
.
previewImg
.
bsmSj
);
formData
.
append
(
"bsmSlsq"
,
that
.
previewImg
.
bsmSlsq
);
if
(
that
.
previewImg
.
imgList
.
length
>
0
)
{
formData
.
append
(
"ssBsmClmx"
,
that
.
previewImg
.
imgList
[
that
.
previewImg
.
index
].
bsmClmx
);
}
uploadSjClmx
(
formData
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
that
.
$emit
(
'updateList'
,
{
children
:
res
.
result
,
bsmSj
:
that
.
previewImg
.
bsmSj
})
that
.
$message
({
message
:
'上传成功!'
,
type
:
'success'
})
}
})
}
}
}
},
// 左右移动
handleMove
(
direction
)
{
...
...
Please
register
or
sign in
to post a comment