28f8b95d by renchao@pashanhoo.com

style:捷宇高拍仪

1 parent b71fbd9a
......@@ -40,5 +40,8 @@ import { popupDialog,popupCacel} from "@/utils/popup.js";
popupDialog(title, "xxxx", data);
popupCacel() 可以关闭弹框
<!-- 高拍仪类型 -->
<!-- lt:良田 jy:捷宇 -->
......
......@@ -2,5 +2,6 @@
"TITLE": "不动产登记系统",
"SERVERAPI": "/bdcdj",
"IDCARDURL": "http://127.0.0.1:33088/function=get_idcard&readnew=0",
"adapter": "dysqs-630222"
"adapter": "dysqs-630222",
"gaopaiyi": "jy"
}
\ No newline at end of file
......
......@@ -66,7 +66,6 @@ export function judgeSort (arr) {
}
return arr
}
// 上下移动
/**
* @description: 上下移动
* @param {*} bsmDict
......@@ -98,7 +97,6 @@ export function realMove (bsmDict, operate, data) {
}
data = judgeSort(changeSort(data, bsmDict));
}
// 获取所有父节点
/**
* @description: 获取所有父节点
* @param {*} treeData
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-14 13:25:36
* @LastEditTime: 2023-12-13 13:44:24
-->
<template>
<div class="rlPopup">
......@@ -12,7 +12,8 @@
<i class="el-icon-arrow-right"></i>
</div>
<div class="img-list-wrap" v-Loading="loading">
<img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪">
<img id="photo" src="" v-show="isScan && this.BASE_API.gaopaiyi=='jy'" alt="高拍仪捷宇">
<img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan && this.BASE_API.gaopaiyi=='lt'" alt="高拍仪良田">
<div v-for="(img, i) in previewImg.imgList" :key="i" v-else>
<photo-zoom :url="img.fjurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2"
overlayStyle="width: 100%;height:100%">
......@@ -89,6 +90,7 @@
showViewer: false,
initialIndex: 0,
allLi: [],
webSocket: null
}
},
watch: {
......@@ -107,9 +109,37 @@
}
},
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);
formData.append("bsmSlsq", that.previewImg.bsmSlsq);
if (that.previewImg.imgList.length > 0) {
formData.append("ssBsmClmx", that.previewImg.imgList[that.previewImg.index].bsmClmx);
}
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 () {
......@@ -164,32 +194,36 @@
* @description: 拍照
* @author: renchao
*/
handleViewScan () {
function dataURLtoBlob (base64String) {
const arr = base64String.split(',');
if (arr.length !== 2) {
throw new Error('Invalid Base64 format');
}
const mime = arr[0].match(/:(.*?);/)[1];
if (!mime) {
throw new Error('Cannot retrieve MIME type');
}
const bstr = atob(arr[1]);
const n = bstr.length;
const u8arr = new Uint8Array(n);
for (let i = 0; i < n; i++) {
u8arr[i] = bstr.charCodeAt(i);
}
return new Blob([u8arr], { type: mime });
dataURLtoBlob (base64String) {
const arr = base64String.split(',');
if (arr.length !== 2) {
throw new Error('Invalid Base64 format');
}
const mime = arr[0].match(/:(.*?);/)[1];
if (!mime) {
throw new Error('Cannot retrieve MIME type');
}
const bstr = atob(arr[1]);
const n = bstr.length;
const u8arr = new Uint8Array(n);
for (let i = 0; i < n; i++) {
u8arr[i] = bstr.charCodeAt(i);
}
function blobToFile (blob) {
let name = getUuid(8) + '.jpg'
const file = new File([blob], name);
return file;
return new Blob([u8arr], { type: mime });
},
blobToFile (blob) {
let name = getUuid(8) + '.jpg'
const file = new File([blob], name);
return file;
},
handleViewScan () {
if (this.BASE_API.gaopaiyi == 'jy') {
this.webSocket.send('sGetBase64');
return
}
getAltimeterInfo().then(res => {
let blob = dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64);
let file = blobToFile(blob);
let blob = this.dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64);
let file = this.blobToFile(blob);
var formData = new FormData();
formData.append('file', file)
formData.append("bsmSj", this.previewImg.bsmSj);
......
......@@ -46,6 +46,7 @@
</div>
<image-preview
ref="imageRef"
:key="imgKey"
v-if="tableData.length > 0"
:previewImg="previewImg"
@updateList="updateList"
......@@ -75,6 +76,7 @@
},
data () {
return {
imgKey: 0,
isDialog: false,
iclass: "",
// 材料目录选中
......@@ -284,6 +286,7 @@
if (this.$refs.imageRef) {
this.$refs.imageRef.initialIndex = 0
}
this.imgKey++
},
/**
* @description: 小图片点击
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-14 13:25:49
* @LastEditTime: 2023-12-13 13:59:52
-->
<template>
<div class="rlPopup">
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-21 16:30:43
* @LastEditTime: 2023-11-23 13:29:37
-->
<template>
<el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules">
......@@ -109,6 +109,7 @@
* @author: renchao
*/
addTemplate () {
store.dispatch('user/refreshPage', false);
addPrintTemplate(this.ruleForm).then(res => {
if (res.code == 200) {
store.dispatch('user/refreshPage', true);
......
......@@ -46,6 +46,7 @@
</div>
<image-preview
ref="imageRef"
:key="imgKey"
v-if="tableData.length > 0"
:previewImg="previewImg"
:ableOperation="ableOperation"
......@@ -66,6 +67,7 @@
components: { clxxAddDialog, imagePreview, clxxDetailDialog },
data () {
return {
imgKey: 0,
//表单是否可操作
ableOperation: true,
isDialog: false,
......@@ -292,6 +294,7 @@
if (this.$refs.imageRef) {
this.$refs.imageRef.initialIndex = 0
}
this.imgKey++
},
/**
* @description: 小图片点击
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-23 17:20:01
-->
<template>
<iframe :src="ip +'/txdw/#/' + formData.bsmZd" frameborder="0" style="width: 100%; height:710px;"></iframe>
</template>
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-11-14 13:25:52
* @LastEditTime: 2023-12-13 13:56:14
-->
<template>
<div class="rlPopup">
......@@ -12,7 +12,8 @@
<i class="el-icon-arrow-right"></i>
</div>
<div class="img-list-wrap" v-Loading="loading">
<img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪">
<img id="photo" src="" v-show="isScan && this.BASE_API.gaopaiyi=='jy'" alt="高拍仪捷宇">
<img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan && this.BASE_API.gaopaiyi=='lt'" alt="高拍仪良田">
<div v-for="(img, i) in previewImg.imgList" :key="i" v-else>
<photo-zoom :url="img.fileurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2"
overlayStyle="width: 100%;height:100%">
......@@ -89,6 +90,7 @@
showViewer: false,
initialIndex: 0,
allLi: [],
webSocket: null
}
},
watch: {
......@@ -107,9 +109,35 @@
}
},
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 () {
......@@ -168,28 +196,32 @@
* @description: 拍照
* @author: renchao
*/
handleViewScan () {
function dataURLtoBlob (base64String) {
const arr = base64String.split(',');
if (arr.length !== 2) {
throw new Error('Invalid Base64 format');
}
const mime = arr[0].match(/:(.*?);/)[1];
if (!mime) {
throw new Error('Cannot retrieve MIME type');
}
const bstr = atob(arr[1]);
const n = bstr.length;
const u8arr = new Uint8Array(n);
for (let i = 0; i < n; i++) {
u8arr[i] = bstr.charCodeAt(i);
}
return new Blob([u8arr], { type: mime });
dataURLtoBlob (base64String) {
const arr = base64String.split(',');
if (arr.length !== 2) {
throw new Error('Invalid Base64 format');
}
const mime = arr[0].match(/:(.*?);/)[1];
if (!mime) {
throw new Error('Cannot retrieve MIME type');
}
const bstr = atob(arr[1]);
const n = bstr.length;
const u8arr = new Uint8Array(n);
for (let i = 0; i < n; i++) {
u8arr[i] = bstr.charCodeAt(i);
}
function blobToFile (blob) {
let name = getUuid(8) + '.jpg'
const file = new File([blob], name);
return file;
return new Blob([u8arr], { type: mime });
},
blobToFile (blob) {
let name = getUuid(8) + '.jpg'
const file = new File([blob], name);
return file;
},
handleViewScan () {
if (this.BASE_API.gaopaiyi == 'jy') {
this.webSocket.send('sGetBase64');
return
}
getAltimeterInfo().then(res => {
let blob = dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64);
......
......@@ -46,6 +46,7 @@
</div>
<image-preview
ref="imageRef"
:key="imgKey"
v-if="tableData.length > 0"
:previewImg="previewImg"
@updateList="updateList"
......@@ -75,6 +76,7 @@
},
data () {
return {
imgKey: 0,
isDialog: false,
iclass: "",
// 材料目录选中
......@@ -275,6 +277,7 @@
if (this.$refs.imageRef) {
this.$refs.imageRef.initialIndex = 0
}
this.imgKey++
},
/**
* @description: 小图片点击
......