beeff8e2 by renchao@pashanhoo.com

Merge branch 'dev'

2 parents 1048ef83 0d02de40
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-12-13 14:19:09
* @LastEditTime: 2023-12-15 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) {
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-12-13 13:56:14
* @LastEditTime: 2023-12-15 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: 左右移动
......