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
beeff8e2
authored
2023-12-15 09:48:24 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev'
2 parents
1048ef83
0d02de40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
55 deletions
src/views/djbworkflow/components/clxx/dialog/imagePreview.vue
src/views/xxba/components/clxx/dialog/imagePreview.vue
src/views/djbworkflow/components/clxx/dialog/imagePreview.vue
View file @
beeff8e
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-12-1
3 14:19:09
* @LastEditTime: 2023-12-1
5 09:46:11
-->
<
template
>
<div
class=
"rlPopup"
>
...
...
@@ -109,36 +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
);
if
(
that
.
previewImg
.
imgList
.
length
>
0
)
{
formData
.
append
(
"index"
,
that
.
previewImg
.
imgList
[
that
.
previewImg
.
index
].
sxh
);
}
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
()
{
...
...
@@ -154,6 +127,7 @@
* @author: renchao
*/
handleOpenScan
()
{
let
that
=
this
this
.
isScan
=
!
this
.
isScan
if
(
this
.
isScan
)
{
this
.
loading
=
true
...
...
@@ -168,6 +142,37 @@
}
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
);
if
(
that
.
previewImg
.
imgList
.
length
>
0
)
{
formData
.
append
(
"index"
,
that
.
previewImg
.
imgList
[
that
.
previewImg
.
index
].
sxh
);
}
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
)
{
...
...
src/views/xxba/components/clxx/dialog/imagePreview.vue
View file @
beeff8e
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-12-1
3 13:56:14
* @LastEditTime: 2023-12-1
5 09:46:55
-->
<
template
>
<div
class=
"rlPopup"
>
...
...
@@ -109,35 +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
)
if
(
that
.
previewImg
.
imgList
.
length
>
0
)
{
formData
.
append
(
"index"
,
that
.
previewImg
.
imgList
[
that
.
previewImg
.
index
].
sxh
);
}
uploadSjClmx
(
formData
,
that
.
previewImg
.
bsmMaterial
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
that
.
$emit
(
'updateList'
,
{
children
:
res
.
result
,
bsmMaterial
:
that
.
previewImg
.
bsmMaterial
})
that
.
$message
({
message
:
'上传成功!'
,
type
:
'success'
})
}
})
}
}
}
},
computed
:
{
isFirst
()
{
...
...
@@ -153,6 +127,7 @@
* @author: renchao
*/
handleOpenScan
()
{
let
that
=
this
this
.
isScan
=
!
this
.
isScan
if
(
this
.
isScan
)
{
this
.
loading
=
true
...
...
@@ -167,6 +142,36 @@
}
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
)
if
(
that
.
previewImg
.
imgList
.
length
>
0
)
{
formData
.
append
(
"index"
,
that
.
previewImg
.
imgList
[
that
.
previewImg
.
index
].
sxh
);
}
uploadSjClmx
(
formData
,
that
.
previewImg
.
bsmMaterial
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
that
.
$emit
(
'updateList'
,
{
children
:
res
.
result
,
bsmMaterial
:
that
.
previewImg
.
bsmMaterial
})
that
.
$message
({
message
:
'上传成功!'
,
type
:
'success'
})
}
})
}
}
}
},
/**
* @description: 左右移动
...
...
Please
register
or
sign in
to post a comment