style:高拍仪
Showing
1 changed file
with
36 additions
and
31 deletions
| 1 | <!-- | 1 | <!-- | 
| 2 | * @Description: | 2 | * @Description: | 
| 3 | * @Autor: renchao | 3 | * @Autor: renchao | 
| 4 | * @LastEditTime: 2023-12-13 13:44:24 | 4 | * @LastEditTime: 2023-12-14 16:42:28 | 
| 5 | --> | 5 | --> | 
| 6 | <template> | 6 | <template> | 
| 7 | <div class="rlPopup"> | 7 | <div class="rlPopup"> | 
| ... | @@ -12,8 +12,8 @@ | ... | @@ -12,8 +12,8 @@ | 
| 12 | <i class="el-icon-arrow-right"></i> | 12 | <i class="el-icon-arrow-right"></i> | 
| 13 | </div> | 13 | </div> | 
| 14 | <div class="img-list-wrap" v-Loading="loading"> | 14 | <div class="img-list-wrap" v-Loading="loading"> | 
| 15 | <img id="photo" src="" v-show="isScan && this.BASE_API.gaopaiyi=='jy'" alt="高拍仪捷宇"> | 15 | <img id="photo" src="" v-if="isScan && this.BASE_API.gaopaiyi=='jy'" alt="高拍仪捷宇"> | 
| 16 | <img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan && this.BASE_API.gaopaiyi=='lt'" alt="高拍仪良田"> | 16 | <img src="http://127.0.0.1:38088/video=stream&camidx=0" v-else-if="isScan && this.BASE_API.gaopaiyi=='lt'" alt="高拍仪良田"> | 
| 17 | <div v-for="(img, i) in previewImg.imgList" :key="i" v-else> | 17 | <div v-for="(img, i) in previewImg.imgList" :key="i" v-else> | 
| 18 | <photo-zoom :url="img.fjurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" | 18 | <photo-zoom :url="img.fjurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" | 
| 19 | overlayStyle="width: 100%;height:100%"> | 19 | overlayStyle="width: 100%;height:100%"> | 
| ... | @@ -109,37 +109,9 @@ | ... | @@ -109,37 +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 | formData.append("bsmSlsq", that.previewImg.bsmSlsq); | ||
| 128 | if (that.previewImg.imgList.length > 0) { | ||
| 129 | formData.append("ssBsmClmx", that.previewImg.imgList[that.previewImg.index].bsmClmx); | ||
| 130 | } | ||
| 131 | uploadSjClmx(formData).then((res) => { | ||
| 132 | if (res.code == 200) { | ||
| 133 | that.$emit('updateList', { children: res.result, bsmSj: that.previewImg.bsmSj }) | ||
| 134 | that.$message({ | ||
| 135 | message: '上传成功!', | ||
| 136 | type: 'success' | ||
| 137 | }) | ||
| 138 | } | ||
| 139 | }) | ||
| 140 | } | ||
| 141 | } | ||
| 142 | } | ||
| 143 | }, | 115 | }, | 
| 144 | computed: { | 116 | computed: { | 
| 145 | isFirst () { | 117 | isFirst () { | 
| ... | @@ -155,6 +127,7 @@ | ... | @@ -155,6 +127,7 @@ | 
| 155 | * @author: renchao | 127 | * @author: renchao | 
| 156 | */ | 128 | */ | 
| 157 | handleOpenScan () { | 129 | handleOpenScan () { | 
| 130 | let that = this | ||
| 158 | this.isScan = !this.isScan | 131 | this.isScan = !this.isScan | 
| 159 | if (this.isScan) { | 132 | if (this.isScan) { | 
| 160 | this.loading = true | 133 | this.loading = true | 
| ... | @@ -169,6 +142,38 @@ | ... | @@ -169,6 +142,38 @@ | 
| 169 | } else { | 142 | } else { | 
| 170 | this.scanTitle = '打开高拍仪' | 143 | this.scanTitle = '打开高拍仪' | 
| 171 | } | 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 | formData.append("bsmSlsq", that.previewImg.bsmSlsq); | ||
| 162 | if (that.previewImg.imgList.length > 0) { | ||
| 163 | formData.append("ssBsmClmx", that.previewImg.imgList[that.previewImg.index].bsmClmx); | ||
| 164 | } | ||
| 165 | uploadSjClmx(formData).then((res) => { | ||
| 166 | if (res.code == 200) { | ||
| 167 | that.$emit('updateList', { children: res.result, bsmSj: that.previewImg.bsmSj }) | ||
| 168 | that.$message({ | ||
| 169 | message: '上传成功!', | ||
| 170 | type: 'success' | ||
| 171 | }) | ||
| 172 | } | ||
| 173 | }) | ||
| 174 | } | ||
| 175 | } | ||
| 176 | } | ||
| 172 | }, | 177 | }, | 
| 173 | // 左右移动 | 178 | // 左右移动 | 
| 174 | handleMove (direction) { | 179 | handleMove (direction) { | ... | ... | 
- 
Please register or sign in to post a comment