Merge branch 'dev'
Showing
2 changed files
with
65 additions
and
55 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-12-13 14:19:09 | 4 | * @LastEditTime: 2023-12-15 09:46:11 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="rlPopup"> | 7 | <div class="rlPopup"> |
... | @@ -109,36 +109,9 @@ | ... | @@ -109,36 +109,9 @@ |
109 | } | 109 | } |
110 | }, | 110 | }, |
111 | created () { | 111 | created () { |
112 | let that = this | ||
113 | this.maxLength = 0; | 112 | this.maxLength = 0; |
114 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) | 113 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) |
115 | this.thumbnailImages = this.previewImg.imgList | 114 | this.thumbnailImages = this.previewImg.imgList |
116 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
117 | this.webSocket = new WebSocket('ws://localhost:1818'); | ||
118 | this.webSocket.onmessage = function (event) { | ||
119 | let begin_data = "data:image/jpeg;base64,"; | ||
120 | document.getElementById('photo').src = begin_data + event.data; | ||
121 | if (event.data.indexOf('BeginsGetBase64') >= 0) { | ||
122 | let blob = that.dataURLtoBlob('data:image/png;base64,' + event.data.replace('BeginsGetBase64', '').replace('EndsGetBase64', '')); | ||
123 | let file = that.blobToFile(blob); | ||
124 | var formData = new FormData(); | ||
125 | formData.append('file', file) | ||
126 | formData.append("bsmSj", that.previewImg.bsmSj); | ||
127 | if (that.previewImg.imgList.length > 0) { | ||
128 | formData.append("index", that.previewImg.imgList[that.previewImg.index].sxh); | ||
129 | } | ||
130 | uploadSjClmx(formData).then((res) => { | ||
131 | if (res.code == 200) { | ||
132 | that.$emit('updateList', { children: res.result, bsmSj: that.previewImg.bsmSj }) | ||
133 | that.$message({ | ||
134 | message: '上传成功!', | ||
135 | type: 'success' | ||
136 | }) | ||
137 | } | ||
138 | }) | ||
139 | } | ||
140 | } | ||
141 | } | ||
142 | }, | 115 | }, |
143 | computed: { | 116 | computed: { |
144 | isFirst () { | 117 | isFirst () { |
... | @@ -154,6 +127,7 @@ | ... | @@ -154,6 +127,7 @@ |
154 | * @author: renchao | 127 | * @author: renchao |
155 | */ | 128 | */ |
156 | handleOpenScan () { | 129 | handleOpenScan () { |
130 | let that = this | ||
157 | this.isScan = !this.isScan | 131 | this.isScan = !this.isScan |
158 | if (this.isScan) { | 132 | if (this.isScan) { |
159 | this.loading = true | 133 | this.loading = true |
... | @@ -168,6 +142,37 @@ | ... | @@ -168,6 +142,37 @@ |
168 | } else { | 142 | } else { |
169 | this.scanTitle = '打开高拍仪' | 143 | this.scanTitle = '打开高拍仪' |
170 | } | 144 | } |
145 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
146 | let webSocket = new WebSocket('ws://localhost:1818'); | ||
147 | this.webSocket = webSocket | ||
148 | webSocket.onopen = function (event) { | ||
149 | webSocket.send('bStartPlay') | ||
150 | webSocket.send('vSetPreviewRect(1600,1200)') | ||
151 | } | ||
152 | webSocket.onmessage = function (event) { | ||
153 | let begin_data = "data:image/jpeg;base64,"; | ||
154 | document.getElementById('photo').src = begin_data + event.data; | ||
155 | if (event.data.indexOf('BeginsGetBase64') >= 0) { | ||
156 | let blob = that.dataURLtoBlob('data:image/png;base64,' + event.data.replace('BeginsGetBase64', '').replace('EndsGetBase64', '')); | ||
157 | let file = that.blobToFile(blob); | ||
158 | var formData = new FormData(); | ||
159 | formData.append('file', file) | ||
160 | formData.append("bsmSj", that.previewImg.bsmSj); | ||
161 | if (that.previewImg.imgList.length > 0) { | ||
162 | formData.append("index", that.previewImg.imgList[that.previewImg.index].sxh); | ||
163 | } | ||
164 | uploadSjClmx(formData).then((res) => { | ||
165 | if (res.code == 200) { | ||
166 | that.$emit('updateList', { children: res.result, bsmSj: that.previewImg.bsmSj }) | ||
167 | that.$message({ | ||
168 | message: '上传成功!', | ||
169 | type: 'success' | ||
170 | }) | ||
171 | } | ||
172 | }) | ||
173 | } | ||
174 | } | ||
175 | } | ||
171 | }, | 176 | }, |
172 | // 左右移动 | 177 | // 左右移动 |
173 | handleMove (direction) { | 178 | handleMove (direction) { | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-12-13 13:56:14 | 4 | * @LastEditTime: 2023-12-15 09:46:55 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="rlPopup"> | 7 | <div class="rlPopup"> |
... | @@ -109,35 +109,9 @@ | ... | @@ -109,35 +109,9 @@ |
109 | } | 109 | } |
110 | }, | 110 | }, |
111 | created () { | 111 | created () { |
112 | let that = this | ||
113 | this.maxLength = 0; | 112 | this.maxLength = 0; |
114 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) | 113 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) |
115 | this.thumbnailImages = this.previewImg.imgList | 114 | this.thumbnailImages = this.previewImg.imgList |
116 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
117 | this.webSocket = new WebSocket('ws://localhost:1818'); | ||
118 | this.webSocket.onmessage = function (event) { | ||
119 | let begin_data = "data:image/jpeg;base64,"; | ||
120 | document.getElementById('photo').src = begin_data + event.data; | ||
121 | if (event.data.indexOf('BeginsGetBase64') >= 0) { | ||
122 | let blob = that.dataURLtoBlob('data:image/png;base64,' + event.data.replace('BeginsGetBase64', '').replace('EndsGetBase64', '')); | ||
123 | let file = that.blobToFile(blob); | ||
124 | var formData = new FormData(); | ||
125 | formData.append('file', file) | ||
126 | if (that.previewImg.imgList.length > 0) { | ||
127 | formData.append("index", that.previewImg.imgList[that.previewImg.index].sxh); | ||
128 | } | ||
129 | uploadSjClmx(formData, that.previewImg.bsmMaterial).then((res) => { | ||
130 | if (res.code == 200) { | ||
131 | that.$emit('updateList', { children: res.result, bsmMaterial: that.previewImg.bsmMaterial }) | ||
132 | that.$message({ | ||
133 | message: '上传成功!', | ||
134 | type: 'success' | ||
135 | }) | ||
136 | } | ||
137 | }) | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | }, | 115 | }, |
142 | computed: { | 116 | computed: { |
143 | isFirst () { | 117 | isFirst () { |
... | @@ -153,6 +127,7 @@ | ... | @@ -153,6 +127,7 @@ |
153 | * @author: renchao | 127 | * @author: renchao |
154 | */ | 128 | */ |
155 | handleOpenScan () { | 129 | handleOpenScan () { |
130 | let that = this | ||
156 | this.isScan = !this.isScan | 131 | this.isScan = !this.isScan |
157 | if (this.isScan) { | 132 | if (this.isScan) { |
158 | this.loading = true | 133 | this.loading = true |
... | @@ -167,6 +142,36 @@ | ... | @@ -167,6 +142,36 @@ |
167 | } else { | 142 | } else { |
168 | this.scanTitle = '打开高拍仪' | 143 | this.scanTitle = '打开高拍仪' |
169 | } | 144 | } |
145 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
146 | let webSocket = new WebSocket('ws://localhost:1818'); | ||
147 | this.webSocket = webSocket | ||
148 | webSocket.onopen = function (event) { | ||
149 | webSocket.send('bStartPlay') | ||
150 | webSocket.send('vSetPreviewRect(1600,1200)') | ||
151 | } | ||
152 | webSocket.onmessage = function (event) { | ||
153 | let begin_data = "data:image/jpeg;base64,"; | ||
154 | document.getElementById('photo').src = begin_data + event.data; | ||
155 | if (event.data.indexOf('BeginsGetBase64') >= 0) { | ||
156 | let blob = that.dataURLtoBlob('data:image/png;base64,' + event.data.replace('BeginsGetBase64', '').replace('EndsGetBase64', '')); | ||
157 | let file = that.blobToFile(blob); | ||
158 | var formData = new FormData(); | ||
159 | formData.append('file', file) | ||
160 | if (that.previewImg.imgList.length > 0) { | ||
161 | formData.append("index", that.previewImg.imgList[that.previewImg.index].sxh); | ||
162 | } | ||
163 | uploadSjClmx(formData, that.previewImg.bsmMaterial).then((res) => { | ||
164 | if (res.code == 200) { | ||
165 | that.$emit('updateList', { children: res.result, bsmMaterial: that.previewImg.bsmMaterial }) | ||
166 | that.$message({ | ||
167 | message: '上传成功!', | ||
168 | type: 'success' | ||
169 | }) | ||
170 | } | ||
171 | }) | ||
172 | } | ||
173 | } | ||
174 | } | ||
170 | }, | 175 | }, |
171 | /** | 176 | /** |
172 | * @description: 左右移动 | 177 | * @description: 左右移动 | ... | ... |
-
Please register or sign in to post a comment