style:捷宇高拍仪
Showing
11 changed files
with
136 additions
and
53 deletions
... | @@ -40,5 +40,8 @@ import { popupDialog,popupCacel} from "@/utils/popup.js"; | ... | @@ -40,5 +40,8 @@ import { popupDialog,popupCacel} from "@/utils/popup.js"; |
40 | popupDialog(title, "xxxx", data); | 40 | popupDialog(title, "xxxx", data); |
41 | popupCacel() 可以关闭弹框 | 41 | popupCacel() 可以关闭弹框 |
42 | 42 | ||
43 | <!-- 高拍仪类型 --> | ||
44 | <!-- lt:良田 jy:捷宇 --> | ||
45 | |||
43 | 46 | ||
44 | 47 | ... | ... |
... | @@ -2,5 +2,6 @@ | ... | @@ -2,5 +2,6 @@ |
2 | "TITLE": "不动产登记系统", | 2 | "TITLE": "不动产登记系统", |
3 | "SERVERAPI": "/bdcdj", | 3 | "SERVERAPI": "/bdcdj", |
4 | "IDCARDURL": "http://127.0.0.1:33088/function=get_idcard&readnew=0", | 4 | "IDCARDURL": "http://127.0.0.1:33088/function=get_idcard&readnew=0", |
5 | "adapter": "dysqs-630222" | 5 | "adapter": "dysqs-630222", |
6 | "gaopaiyi": "jy" | ||
6 | } | 7 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -66,7 +66,6 @@ export function judgeSort (arr) { | ... | @@ -66,7 +66,6 @@ export function judgeSort (arr) { |
66 | } | 66 | } |
67 | return arr | 67 | return arr |
68 | } | 68 | } |
69 | // 上下移动 | ||
70 | /** | 69 | /** |
71 | * @description: 上下移动 | 70 | * @description: 上下移动 |
72 | * @param {*} bsmDict | 71 | * @param {*} bsmDict |
... | @@ -98,7 +97,6 @@ export function realMove (bsmDict, operate, data) { | ... | @@ -98,7 +97,6 @@ export function realMove (bsmDict, operate, data) { |
98 | } | 97 | } |
99 | data = judgeSort(changeSort(data, bsmDict)); | 98 | data = judgeSort(changeSort(data, bsmDict)); |
100 | } | 99 | } |
101 | // 获取所有父节点 | ||
102 | /** | 100 | /** |
103 | * @description: 获取所有父节点 | 101 | * @description: 获取所有父节点 |
104 | * @param {*} treeData | 102 | * @param {*} treeData | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-11-14 13:25:36 | 4 | * @LastEditTime: 2023-12-13 13:44:24 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="rlPopup"> | 7 | <div class="rlPopup"> |
... | @@ -12,7 +12,8 @@ | ... | @@ -12,7 +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 src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪"> | 15 | <img id="photo" src="" v-show="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 | <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> |
17 | <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" |
18 | overlayStyle="width: 100%;height:100%"> | 19 | overlayStyle="width: 100%;height:100%"> |
... | @@ -89,6 +90,7 @@ | ... | @@ -89,6 +90,7 @@ |
89 | showViewer: false, | 90 | showViewer: false, |
90 | initialIndex: 0, | 91 | initialIndex: 0, |
91 | allLi: [], | 92 | allLi: [], |
93 | webSocket: null | ||
92 | } | 94 | } |
93 | }, | 95 | }, |
94 | watch: { | 96 | watch: { |
... | @@ -107,9 +109,37 @@ | ... | @@ -107,9 +109,37 @@ |
107 | } | 109 | } |
108 | }, | 110 | }, |
109 | created () { | 111 | created () { |
112 | let that = this | ||
110 | this.maxLength = 0; | 113 | this.maxLength = 0; |
111 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) | 114 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) |
112 | this.thumbnailImages = this.previewImg.imgList | 115 | 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 | } | ||
113 | }, | 143 | }, |
114 | computed: { | 144 | computed: { |
115 | isFirst () { | 145 | isFirst () { |
... | @@ -164,32 +194,36 @@ | ... | @@ -164,32 +194,36 @@ |
164 | * @description: 拍照 | 194 | * @description: 拍照 |
165 | * @author: renchao | 195 | * @author: renchao |
166 | */ | 196 | */ |
167 | handleViewScan () { | 197 | dataURLtoBlob (base64String) { |
168 | function dataURLtoBlob (base64String) { | 198 | const arr = base64String.split(','); |
169 | const arr = base64String.split(','); | 199 | if (arr.length !== 2) { |
170 | if (arr.length !== 2) { | 200 | throw new Error('Invalid Base64 format'); |
171 | throw new Error('Invalid Base64 format'); | 201 | } |
172 | } | 202 | const mime = arr[0].match(/:(.*?);/)[1]; |
173 | const mime = arr[0].match(/:(.*?);/)[1]; | 203 | if (!mime) { |
174 | if (!mime) { | 204 | throw new Error('Cannot retrieve MIME type'); |
175 | throw new Error('Cannot retrieve MIME type'); | 205 | } |
176 | } | 206 | const bstr = atob(arr[1]); |
177 | const bstr = atob(arr[1]); | 207 | const n = bstr.length; |
178 | const n = bstr.length; | 208 | const u8arr = new Uint8Array(n); |
179 | const u8arr = new Uint8Array(n); | 209 | for (let i = 0; i < n; i++) { |
180 | for (let i = 0; i < n; i++) { | 210 | u8arr[i] = bstr.charCodeAt(i); |
181 | u8arr[i] = bstr.charCodeAt(i); | ||
182 | } | ||
183 | return new Blob([u8arr], { type: mime }); | ||
184 | } | 211 | } |
185 | function blobToFile (blob) { | 212 | return new Blob([u8arr], { type: mime }); |
186 | let name = getUuid(8) + '.jpg' | 213 | }, |
187 | const file = new File([blob], name); | 214 | blobToFile (blob) { |
188 | return file; | 215 | let name = getUuid(8) + '.jpg' |
216 | const file = new File([blob], name); | ||
217 | return file; | ||
218 | }, | ||
219 | handleViewScan () { | ||
220 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
221 | this.webSocket.send('sGetBase64'); | ||
222 | return | ||
189 | } | 223 | } |
190 | getAltimeterInfo().then(res => { | 224 | getAltimeterInfo().then(res => { |
191 | let blob = dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64); | 225 | let blob = this.dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64); |
192 | let file = blobToFile(blob); | 226 | let file = this.blobToFile(blob); |
193 | var formData = new FormData(); | 227 | var formData = new FormData(); |
194 | formData.append('file', file) | 228 | formData.append('file', file) |
195 | formData.append("bsmSj", this.previewImg.bsmSj); | 229 | formData.append("bsmSj", this.previewImg.bsmSj); | ... | ... |
... | @@ -46,6 +46,7 @@ | ... | @@ -46,6 +46,7 @@ |
46 | </div> | 46 | </div> |
47 | <image-preview | 47 | <image-preview |
48 | ref="imageRef" | 48 | ref="imageRef" |
49 | :key="imgKey" | ||
49 | v-if="tableData.length > 0" | 50 | v-if="tableData.length > 0" |
50 | :previewImg="previewImg" | 51 | :previewImg="previewImg" |
51 | @updateList="updateList" | 52 | @updateList="updateList" |
... | @@ -75,6 +76,7 @@ | ... | @@ -75,6 +76,7 @@ |
75 | }, | 76 | }, |
76 | data () { | 77 | data () { |
77 | return { | 78 | return { |
79 | imgKey: 0, | ||
78 | isDialog: false, | 80 | isDialog: false, |
79 | iclass: "", | 81 | iclass: "", |
80 | // 材料目录选中 | 82 | // 材料目录选中 |
... | @@ -284,6 +286,7 @@ | ... | @@ -284,6 +286,7 @@ |
284 | if (this.$refs.imageRef) { | 286 | if (this.$refs.imageRef) { |
285 | this.$refs.imageRef.initialIndex = 0 | 287 | this.$refs.imageRef.initialIndex = 0 |
286 | } | 288 | } |
289 | this.imgKey++ | ||
287 | }, | 290 | }, |
288 | /** | 291 | /** |
289 | * @description: 小图片点击 | 292 | * @description: 小图片点击 | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-11-21 16:30:43 | 4 | * @LastEditTime: 2023-11-23 13:29:37 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules"> | 7 | <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules"> |
... | @@ -109,6 +109,7 @@ | ... | @@ -109,6 +109,7 @@ |
109 | * @author: renchao | 109 | * @author: renchao |
110 | */ | 110 | */ |
111 | addTemplate () { | 111 | addTemplate () { |
112 | store.dispatch('user/refreshPage', false); | ||
112 | addPrintTemplate(this.ruleForm).then(res => { | 113 | addPrintTemplate(this.ruleForm).then(res => { |
113 | if (res.code == 200) { | 114 | if (res.code == 200) { |
114 | store.dispatch('user/refreshPage', true); | 115 | store.dispatch('user/refreshPage', true); | ... | ... |
... | @@ -46,6 +46,7 @@ | ... | @@ -46,6 +46,7 @@ |
46 | </div> | 46 | </div> |
47 | <image-preview | 47 | <image-preview |
48 | ref="imageRef" | 48 | ref="imageRef" |
49 | :key="imgKey" | ||
49 | v-if="tableData.length > 0" | 50 | v-if="tableData.length > 0" |
50 | :previewImg="previewImg" | 51 | :previewImg="previewImg" |
51 | :ableOperation="ableOperation" | 52 | :ableOperation="ableOperation" |
... | @@ -66,6 +67,7 @@ | ... | @@ -66,6 +67,7 @@ |
66 | components: { clxxAddDialog, imagePreview, clxxDetailDialog }, | 67 | components: { clxxAddDialog, imagePreview, clxxDetailDialog }, |
67 | data () { | 68 | data () { |
68 | return { | 69 | return { |
70 | imgKey: 0, | ||
69 | //表单是否可操作 | 71 | //表单是否可操作 |
70 | ableOperation: true, | 72 | ableOperation: true, |
71 | isDialog: false, | 73 | isDialog: false, |
... | @@ -292,6 +294,7 @@ | ... | @@ -292,6 +294,7 @@ |
292 | if (this.$refs.imageRef) { | 294 | if (this.$refs.imageRef) { |
293 | this.$refs.imageRef.initialIndex = 0 | 295 | this.$refs.imageRef.initialIndex = 0 |
294 | } | 296 | } |
297 | this.imgKey++ | ||
295 | }, | 298 | }, |
296 | /** | 299 | /** |
297 | * @description: 小图片点击 | 300 | * @description: 小图片点击 | ... | ... |
1 | <!-- | ||
2 | * @Description: | ||
3 | * @Autor: renchao | ||
4 | * @LastEditTime: 2023-11-23 17:20:01 | ||
5 | --> | ||
1 | <template> | 6 | <template> |
2 | <iframe :src="ip +'/txdw/#/' + formData.bsmZd" frameborder="0" style="width: 100%; height:710px;"></iframe> | 7 | <iframe :src="ip +'/txdw/#/' + formData.bsmZd" frameborder="0" style="width: 100%; height:710px;"></iframe> |
3 | </template> | 8 | </template> | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-11-14 13:25:52 | 4 | * @LastEditTime: 2023-12-13 13:56:14 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="rlPopup"> | 7 | <div class="rlPopup"> |
... | @@ -12,7 +12,8 @@ | ... | @@ -12,7 +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 src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪"> | 15 | <img id="photo" src="" v-show="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 | <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> |
17 | <photo-zoom :url="img.fileurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" | 18 | <photo-zoom :url="img.fileurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" |
18 | overlayStyle="width: 100%;height:100%"> | 19 | overlayStyle="width: 100%;height:100%"> |
... | @@ -89,6 +90,7 @@ | ... | @@ -89,6 +90,7 @@ |
89 | showViewer: false, | 90 | showViewer: false, |
90 | initialIndex: 0, | 91 | initialIndex: 0, |
91 | allLi: [], | 92 | allLi: [], |
93 | webSocket: null | ||
92 | } | 94 | } |
93 | }, | 95 | }, |
94 | watch: { | 96 | watch: { |
... | @@ -107,9 +109,35 @@ | ... | @@ -107,9 +109,35 @@ |
107 | } | 109 | } |
108 | }, | 110 | }, |
109 | created () { | 111 | created () { |
112 | let that = this | ||
110 | this.maxLength = 0; | 113 | this.maxLength = 0; |
111 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) | 114 | this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) |
112 | this.thumbnailImages = this.previewImg.imgList | 115 | 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 | } | ||
113 | }, | 141 | }, |
114 | computed: { | 142 | computed: { |
115 | isFirst () { | 143 | isFirst () { |
... | @@ -168,28 +196,32 @@ | ... | @@ -168,28 +196,32 @@ |
168 | * @description: 拍照 | 196 | * @description: 拍照 |
169 | * @author: renchao | 197 | * @author: renchao |
170 | */ | 198 | */ |
171 | handleViewScan () { | 199 | dataURLtoBlob (base64String) { |
172 | function dataURLtoBlob (base64String) { | 200 | const arr = base64String.split(','); |
173 | const arr = base64String.split(','); | 201 | if (arr.length !== 2) { |
174 | if (arr.length !== 2) { | 202 | throw new Error('Invalid Base64 format'); |
175 | throw new Error('Invalid Base64 format'); | 203 | } |
176 | } | 204 | const mime = arr[0].match(/:(.*?);/)[1]; |
177 | const mime = arr[0].match(/:(.*?);/)[1]; | 205 | if (!mime) { |
178 | if (!mime) { | 206 | throw new Error('Cannot retrieve MIME type'); |
179 | throw new Error('Cannot retrieve MIME type'); | 207 | } |
180 | } | 208 | const bstr = atob(arr[1]); |
181 | const bstr = atob(arr[1]); | 209 | const n = bstr.length; |
182 | const n = bstr.length; | 210 | const u8arr = new Uint8Array(n); |
183 | const u8arr = new Uint8Array(n); | 211 | for (let i = 0; i < n; i++) { |
184 | for (let i = 0; i < n; i++) { | 212 | u8arr[i] = bstr.charCodeAt(i); |
185 | u8arr[i] = bstr.charCodeAt(i); | ||
186 | } | ||
187 | return new Blob([u8arr], { type: mime }); | ||
188 | } | 213 | } |
189 | function blobToFile (blob) { | 214 | return new Blob([u8arr], { type: mime }); |
190 | let name = getUuid(8) + '.jpg' | 215 | }, |
191 | const file = new File([blob], name); | 216 | blobToFile (blob) { |
192 | return file; | 217 | let name = getUuid(8) + '.jpg' |
218 | const file = new File([blob], name); | ||
219 | return file; | ||
220 | }, | ||
221 | handleViewScan () { | ||
222 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
223 | this.webSocket.send('sGetBase64'); | ||
224 | return | ||
193 | } | 225 | } |
194 | getAltimeterInfo().then(res => { | 226 | getAltimeterInfo().then(res => { |
195 | let blob = dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64); | 227 | let blob = dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64); | ... | ... |
... | @@ -46,6 +46,7 @@ | ... | @@ -46,6 +46,7 @@ |
46 | </div> | 46 | </div> |
47 | <image-preview | 47 | <image-preview |
48 | ref="imageRef" | 48 | ref="imageRef" |
49 | :key="imgKey" | ||
49 | v-if="tableData.length > 0" | 50 | v-if="tableData.length > 0" |
50 | :previewImg="previewImg" | 51 | :previewImg="previewImg" |
51 | @updateList="updateList" | 52 | @updateList="updateList" |
... | @@ -75,6 +76,7 @@ | ... | @@ -75,6 +76,7 @@ |
75 | }, | 76 | }, |
76 | data () { | 77 | data () { |
77 | return { | 78 | return { |
79 | imgKey: 0, | ||
78 | isDialog: false, | 80 | isDialog: false, |
79 | iclass: "", | 81 | iclass: "", |
80 | // 材料目录选中 | 82 | // 材料目录选中 |
... | @@ -275,6 +277,7 @@ | ... | @@ -275,6 +277,7 @@ |
275 | if (this.$refs.imageRef) { | 277 | if (this.$refs.imageRef) { |
276 | this.$refs.imageRef.initialIndex = 0 | 278 | this.$refs.imageRef.initialIndex = 0 |
277 | } | 279 | } |
280 | this.imgKey++ | ||
278 | }, | 281 | }, |
279 | /** | 282 | /** |
280 | * @description: 小图片点击 | 283 | * @description: 小图片点击 | ... | ... |
-
Please register or sign in to post a comment