Commit d0c54ff8 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents fd2652d0 76333111
<template> <template>
<div> <div>
<el-drawer size="70%" :visible.sync="drawer" direction="rtl"> <el-drawer size="1200px" :visible.sync="drawer" direction="rtl">
<div slot="title" class="title flex"> <div slot="title" class="title flex">
<span <span
>材料列表(共{{ >材料列表(共{{
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</div> </div>
<div class="for-short">{{ v.materialName }}</div> <div class="for-short">{{ v.materialName }}</div>
<div class="matterDatumList-name"> <div class="matterDatumList-name">
{{ v.materiaFullName }} 材料全称:{{ v.materiaFullName }}
</div> </div>
<!-- <div class="check-btn" @click.stop>点击查看二维码</div> --> <!-- <div class="check-btn" @click.stop>点击查看二维码</div> -->
</div> </div>
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
api: local.getLocal("baseUrl") api: local.getLocal("baseUrl")
? local.getLocal("baseUrl") + "/" ? local.getLocal("baseUrl") + "/"
: "http://192.168.0.98:11078/", : "http://192.168.0.98:11078/",
row: 5, row: 4,
}; };
}, },
computed: { computed: {
...@@ -102,6 +102,20 @@ export default { ...@@ -102,6 +102,20 @@ export default {
border-top: 1px solid #e0e0e0; border-top: 1px solid #e0e0e0;
padding: 40px; padding: 40px;
padding-top: 0px; padding-top: 0px;
overflow-y: auto;
&::-webkit-scrollbar {
width: 12px;
overflow-y: auto;
}
&::-webkit-scrollbar-thumb {
border-radius: 6px;
background-color: rgba(144, 147, 153, 0.5);
}
&::-webkit-scrollbar-track {
border-radius: 6px;
background: #fff;
}
} }
.title { .title {
font-size: 28px; font-size: 28px;
...@@ -124,35 +138,22 @@ export default { ...@@ -124,35 +138,22 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
align-content: flex-start; align-content: flex-start;
overflow-y: auto;
&::-webkit-scrollbar {
width: 12px;
overflow-y: auto;
}
&::-webkit-scrollbar-thumb {
border-radius: 6px;
background-color: rgba(144, 147, 153, 0.5);
}
&::-webkit-scrollbar-track {
border-radius: 6px;
background: #fff;
}
.list { .list {
content: ""; content: "";
width: 19%; width: 236px;
border: 1px solid transparent; border: 1px solid transparent;
padding: 5px; padding: 5px;
overflow: hidden; overflow: hidden;
} }
} }
.matterDatumList-item { .matterDatumList-item {
width: 19%; width: 236px;
margin-top: 40px; margin-top: 40px;
// height: 430px; // height: 430px;
.pic-box { .pic-box {
width: 207px; width: 236px;
height: 256px; height: 300px;
padding: 16px 24px; padding: 16px 24px;
background: #f4f6fc; background: #f4f6fc;
border-radius: 16px; border-radius: 16px;
...@@ -169,22 +170,26 @@ export default { ...@@ -169,22 +170,26 @@ export default {
} }
} }
.for-short { .for-short {
width: 100%;
margin-top: 18px; margin-top: 18px;
margin-bottom: 8px; margin-bottom: 8px;
font-size: 24px; font-size: 24px;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
color: #333333; color: #333333;
letter-spacing: 1px;
overflow: hidden; overflow: hidden;
text-align: center; text-align: center;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.matterDatumList-name { .matterDatumList-name {
width: 100%;
font-size: 18px; font-size: 18px;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
color: #777777; color: #777777;
line-height: 30px; line-height: 30px;
text-align: center; letter-spacing: 1px;
text-align: left;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
......
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
computed: { computed: {
optionLeft() { optionLeft() {
return { return {
direction: 2, // 向左滚动 direction: 2, // 滚动方向
step: 0.5, // 数值越大速度滚动越快 step: 0.5, // 数值越大速度滚动越快
limitMoveNum: 5, // 开启无缝滚动的数据量 设置(数值<=页面展示数据条数不滚)(超过页面展示条数滚动) limitMoveNum: 5, // 开启无缝滚动的数据量 设置(数值<=页面展示数据条数不滚)(超过页面展示条数滚动)
openWatch: true, // 开启数据实时监控刷新dom openWatch: true, // 开启数据实时监控刷新dom
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,7 @@ export default {
}, },
optionTop() { optionTop() {
return { return {
direction: 1, // 向左滚动 direction: 1, // 滚动方向
step: 0.5, // 数值越大速度滚动越快 step: 0.5, // 数值越大速度滚动越快
limitMoveNum: 4, // 开启无缝滚动的数据量 设置(数值<=页面展示数据条数不滚)(超过页面展示条数滚动) limitMoveNum: 4, // 开启无缝滚动的数据量 设置(数值<=页面展示数据条数不滚)(超过页面展示条数滚动)
openWatch: true, // 开启数据实时监控刷新dom openWatch: true, // 开启数据实时监控刷新dom
...@@ -442,6 +442,7 @@ export default { ...@@ -442,6 +442,7 @@ export default {
border-radius: 8px; border-radius: 8px;
font-size: 22px; font-size: 22px;
color: var(--main-theme-color1); color: var(--main-theme-color1);
letter-spacing: 2px;
&:nth-child(2n-1) { &:nth-child(2n-1) {
background-color: #fff; background-color: #fff;
} }
...@@ -484,18 +485,18 @@ export default { ...@@ -484,18 +485,18 @@ export default {
animation: shadow 6s infinite; animation: shadow 6s infinite;
} }
.fill-btn-text1 { // .fill-btn-text1 {
animation: ring 6s 20ms infinite; // animation: ring 6s 20ms infinite;
} // }
.fill-btn-text2 { // .fill-btn-text2 {
animation: ring 6s 60ms infinite; // animation: ring 6s 60ms infinite;
} // }
.fill-btn-text3 { // .fill-btn-text3 {
animation: ring 6s 105ms infinite; // animation: ring 6s 105ms infinite;
} // }
.fill-btn-text4 { // .fill-btn-text4 {
animation: ring 6s 145ms infinite; // animation: ring 6s 145ms infinite;
} // }
} }
.empty-btn { .empty-btn {
width: 284px; width: 284px;
...@@ -524,8 +525,9 @@ export default { ...@@ -524,8 +525,9 @@ export default {
margin-bottom: 4px; margin-bottom: 4px;
line-height: 45px; line-height: 45px;
border-radius: 8px; border-radius: 8px;
font-size: 22px; font-size: 20px;
color: var(--main-theme-color1); color: var(--main-theme-color1);
letter-spacing: 2px;
&:nth-child(2n) { &:nth-child(2n) {
background-color: #f6f9fe; background-color: #f6f9fe;
} }
......
...@@ -221,6 +221,7 @@ export default { ...@@ -221,6 +221,7 @@ export default {
font-weight: 500; font-weight: 500;
line-height: 36px; line-height: 36px;
color: #333333; color: #333333;
letter-spacing: 1px;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
...@@ -235,6 +236,7 @@ export default { ...@@ -235,6 +236,7 @@ export default {
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
color: #888888; color: #888888;
line-height: 24px; line-height: 24px;
letter-spacing: 1px;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
...@@ -246,7 +248,6 @@ export default { ...@@ -246,7 +248,6 @@ export default {
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
color: #333333; color: #333333;
line-height: 28px; line-height: 28px;
.count { .count {
color: #2878ff; color: #2878ff;
} }
......
var produceMessage = function (functionName, Result) {
console.log(functionName);
};
var device = {
getIDCard: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=2";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: {
name: data.username,
sex: data.sex,
nationality: data.Nation,
birthday: data.Born,
address: data.address,
idcard: data.idcardno,
issue: data.GrantDept,
startDate: data.UserLifeBegin,
endDate: data.UserLifeEnd,
pic: data.PhotoBase64String,
},
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: {},
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
closeIDCard: function (obj) {
var url = "http://127.0.0.1/GetHardWareInfo?GetType=2";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onCloseIdCard(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: {
name: data.username,
sex: data.sex,
nationality: data.Nation,
birthday: data.Born,
address: data.address,
idcard: data.idcardno,
issue: data.GrantDept,
startDate: data.UserLifeBegin,
endDate: data.UserLifeEnd,
pic: data.PhotoBase64String,
},
};
obj.success(info);
} else {
var info = {
code: "00001",
message: data.message,
ok: false,
data: {},
};
obj.fail(info);
}
}
callServer(url, {}, onCloseIdCard);
},
getNetworkAddr: function (obj) {
var url = "http://127.0.0.1:8081/GetNetworkAddress";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onEvent(res) {
var data = JSON.parse(res);
if (data.ok) {
obj.success(res);
} else {
obj.fail(res);
}
}
callServer(url, onEvent);
},
voiceBroadcast: function (obj) {
var url =
"http://127.0.0.1:8081/VoiceBroadcast?word=" + encodeURI(obj.word);
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onEvent(res) {
var data = JSON.parse(res);
if (data.ok) {
obj.success(res);
} else {
obj.fail(res);
}
}
callServer(url, onEvent);
},
// 获取高拍照片
// getHighCamera: function (obj) {
// var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=3";
// if (obj.success == null) {
// obj.success = function () {
// }
// }
// if (obj.fail == null) {
// obj.fail = function () {
// }
// }
// if (obj.complete == null) {
// obj.complete = function () {
// }
// }
// function onConnect(res) {
// var data = JSON.parse(res);
// if (data.status === '1') {
// var printerArr = []
// for(var i=0;i<data.filelist.length;++i){
// printerArr.push({filename:data.filelist[i].filename,file:data.filelist[i].Base64String})
// }
// var info = {
// code:'00000',
// message:'OK',
// ok:true,
// data:printerArr
// }
// obj.success(info);
// }
// else {
// var info = {
// code:data.status,
// message:data.message,
// ok:false,
// data:[]
// }
// obj.fail(info);
// }
// }
// callServer(openUrl, {}, onConnect);
// },
getHighCamera: function (obj) {
var _this = this;
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
var isCapture = false; //是否允许拍照
var isfirst = true; //初始化
switch (obj.type) {
// 拍照获取图片
case 1:
CaptureBase64(0); //0-jpg,1-bmp,2-png,3-tif格式
break;
// 初始化高拍仪
case 0:
ConnectServer(); //连接后台服务
StartVideo(0); //开启设备
ChangeVideoDevice(3);
break;
// 直接拍照
default: //连接后台服务
//开启设备
if (isCapture && !isfirst) {
_this.lightControl({
light: "12",
state: "4",
success: function () {
CaptureBase64(0); //0-jpg,1-bmp,2-png,3-tif格式
},
});
// CaptureBase64(0);//0-jpg,1-bmp,2-png,3-tif格式
return;
}
// GetDeviceInfo()
ConnectServer();
StartVideo(0);
ChangeVideoDevice(3);
break;
}
produceMessage = function (functionName, Result) {
switch (functionName) {
case "StartVideo":
if (obj.type != undefined) {
onConnect(Result);
}
break;
case "ShowVideo":
if (obj.type == undefined) {
isCapture = true;
if (isfirst) {
setTimeout(function () {
_this.lightControl({
light: "12",
state: "4",
success: function () {
CaptureBase64(0); //0-jpg,1-bmp,2-png,3-tif格式
},
});
// CaptureBase64(0);//0-jpg,1-bmp,2-png,3-tif格式
}, 1000);
isfirst = false;
}
return;
} else {
try {
var myimg = document.getElementById("pic");
myimg.src = "data:image/jpeg;base64," + Result;
} catch (error) {
console.log(error);
}
}
break;
case "CaptureBase64":
// 拍照成功关灯
try {
// _this.lightControl({
// light:'12',
// state:'2'
// })
} catch (error) {
console.log(error);
}
onConnect(Result, "CaptureBase64");
break;
}
};
function onConnect(res, type) {
var info = {
code: "00000",
message: "OK",
ok: true,
data: res,
};
if (type == "CaptureBase64") {
info = {
code: "00000",
message: "OK",
ok: true,
data: {
filename: Math.random() + ".jpg",
file: res,
},
};
}
obj.success(info);
}
},
// 关闭高拍仪
closeHighCamera: function (obj) {
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
Stop();
onConnect();
function onConnect(res) {
var info = {
code: "00000",
message: "OK",
ok: true,
data: res || "",
};
obj.success(info);
}
},
// 摄像头
getVideoCamera: function (obj) {
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
switch (obj.type) {
// 拍照获取图片
case 1:
CaptureBase64(0); //0-jpg,1-bmp,2-png,3-tif格式
break;
default: //连接后台服务
//开启设备
ConnectServer();
StartVideo(1);
break;
}
produceMessage = function (functionName, Result) {
switch (functionName) {
case "StartVideo":
onConnect(Result, "StartVideo");
break;
case "ShowVideo":
try {
var myimg = document.getElementById("pic1");
myimg.src = "data:image/jpeg;base64," + Result;
} catch (error) {}
onConnect(Result, "ShowVideo");
break;
case "CaptureBase64":
onConnect(Result, "CaptureBase64");
break;
}
};
function onConnect(res, type) {
var info = {
code: "00000",
message: type,
ok: true,
data: res,
};
if (type == "CaptureBase64") {
info = {
code: "00000",
message: "OK",
ok: true,
data: {
filename: "",
file: res,
},
};
}
obj.success(info);
}
},
// 关闭摄像头
closeVideoCamera: function (obj) {
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
Stop();
onConnect();
function onConnect(res) {
var info = {
code: "00000",
message: "OK",
ok: true,
data: res || "",
};
obj.success(info);
}
},
// 双目摄像头
getDoubleCamera: function (obj) {
Stop();
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
// 活体检测
StartLiveDetect(5);
produceMessage = function (functionName, Result) {
switch (functionName) {
case "StartVideo":
onConnect(Result, "StartVideo");
break;
case "ShowVideo":
var myimg = document.getElementById("pic1");
myimg.src = "data:image/jpeg;base64," + Result;
break;
// 单目
case "StartLiveDetectSingle":
onConnect(Result, "StartLiveDetectSingle");
break;
// 双目
case "StartLiveDetect":
onConnect(Result, "StartLiveDetect");
break;
case "CaptureBase64":
onConnect(Result, "CaptureBase64");
break;
}
};
function onConnect(res, type) {
var info = {
code: "00001",
message: type,
ok: false,
data: res,
};
if (type == "StartLiveDetect" && res === 1) {
// 活体检测成功拍照
CaptureBase64(0); //0-jpg,1-bmp,2-png,3-tif格式
}
// 拍照成功后返回文件流
if (type == "CaptureBase64") {
info = {
code: "00000",
message: "OK",
ok: true,
data: {
filenameIr: Math.random() + ".jpg",
fileIr: res,
},
};
}
obj.success(info);
}
},
// 关闭双目摄像头
closeDoubleCamera: function (obj) {
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
Stop();
onConnect();
function onConnect(res) {
var info = {
code: "00000",
message: "OK",
ok: true,
data: res || "",
};
obj.success(info);
}
},
getPrinterList: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=73";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var printerArr = [];
for (var i = 0; i < data.PrinterList.length; ++i) {
printerArr.push({ printerName: data.PrinterList[i].pinter });
}
var info = {
code: "00000",
message: "OK",
ok: true,
data: printerArr,
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: [],
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 打印文件
printer: function (obj) {
var fileType = "";
if (obj.fileType == "jpg") {
fileType = "data:image/jpg;base64,";
} else if (obj.fileType == "pdf") {
fileType = "data:application/pdf;base64,";
} else if (obj.fileType == "doc") {
fileType = "application/msword;base64,";
} else if (obj.fileType == "docx") {
fileType =
"application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,";
}
var PrinterJson = {
papertype: obj.papertype || "ticket", //PrinterJson中增加papertype参数,为空则按以前逻辑处理,为ticket、A3、A4
printername: obj.printerName || "", // 打印机名称,为空则为默认打印机
printerpaperwidth: "0", // 纸张宽度
printertype: obj.printertype || "base64", //图片格式:jpg,PDF格式:pdf,OFD格式:ofd 打印类型,url/base64/normal,url为网络文件打印,base64为串文件打印,normal为普通行打印
base64: fileType + obj.fileData || "", //当printertype为base64时有效,
url: obj.url || "", // 打印文件地址, 打印类型printertype为url时有效
contents: obj.contents || "", // 当printertype为normal时有效,其它参数时可省略
};
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=71";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(
openUrl,
{ PrinterJson: JSON.stringify(PrinterJson) },
onConnect
);
},
// 获取打印队列
getPrintQueue: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=74";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var printerArr = [];
for (var i = 0; i < data.QueueList.length; ++i) {
printerArr.push({ queue: data.QueueList[i].queueName });
}
var info = {
code: "00000",
message: "OK",
ok: true,
data: printerArr,
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: [],
};
obj.fail(info);
}
}
callServer(openUrl, { printerName: obj.printerName || "" }, onConnect);
},
// 设备网络地址
getNetworkAddr: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=888";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: data.data,
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: {},
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 播放声音
voiceBroadcast: function (obj) {
var jsonString = {
text: obj.word || "",
appid: obj.appid || "",
voice_name: obj.voice_name || "",
speed: obj.speed || "",
volume: obj.volume || "",
};
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=777";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(
openUrl,
{ TextToViceJson: JSON.stringify(jsonString) },
onConnect
);
},
// 键盘输入
openKeyboard: function (obj) {
var model = "";
if (obj.type == "string") {
model = "mode(py26)";
} else {
model = obj.type ? "mode(" + obj.type + ")" : "mode(py26)";
}
var openUrl = "http://127.0.0.1:1606/show/" + model;
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
// var data = res;
// if (data.mode === 'ok') {
// var info = {
// code:'00000',
// message:'OK',
// ok:true,
// data:''
// }
// obj.success(info);
// }
// else {
// var info = {
// code:data.status,
// message:data.message,
// ok:false,
// data:''
// }
// obj.fail(info);
// }
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
}
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
callServer(openUrl, {}, onConnect);
},
// 关闭键盘输入
closeKeyboard: function (obj) {
var openUrl = "http://127.0.0.1:1606/hide/";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = res;
// if (data.mode === 'ok') {
// var info = {
// code:'00000',
// message:'OK',
// ok:true,
// data:''
// }
// obj.success(info);
// }
// else {
// var info = {
// code:data.status,
// message:data.message,
// ok:false,
// data:''
// }
// obj.fail(info);
// }
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
}
callServer(openUrl, {}, onConnect);
},
// 控制灯光
lightControl: function (obj) {
var JonsString = {
device: "",
status: "open",
};
switch (obj.light) {
// 编号 1 社保卡 2 身份证 3 打印机 4 高拍仪绿灯 5 高拍仪红灯 6 证照打印机绿灯 7 证照打印机红灯 8 A4打印机绿灯 9 A4打印机红灯 10 社保卡绿灯 11 社保卡红灯 12 p21高拍仪补光灯 13 p22高拍仪补光灯 14 蜂鸣器 15小票打印机绿灯 16小票打印机红灯
case "1":
JonsString.device = "scardgreen";
break;
case "2":
JonsString.device = "scardgreen";
break;
case "3":
JonsString.device = "A4green";
break;
case "4":
JonsString.device = "docphotogreen";
break;
case "5":
JonsString.device = "docphotored";
break;
case "6":
JonsString.device = "certificatgreen";
break;
case "7":
JonsString.device = "certificatred";
break;
case "8":
JonsString.device = "A4green";
break;
case "9":
JonsString.device = "A4red";
break;
case "10":
JonsString.device = "scardgreen";
break;
case "11":
JonsString.device = "scardred";
break;
case "12":
JonsString.device = "p21";
break;
case "13":
JonsString.device = "p22";
break;
case "14":
JonsString.device = "bee";
break;
case "15":
JonsString.device = "ticketgreen";
break;
case "16":
JonsString.device = "ticketred";
break;
case "-1":
JonsString.device = "all";
break;
}
switch (obj.state) {
// 状态 0 常亮 1 闪烁 2 关闭 3一秒闪烁 4两秒闪烁 5零点五秒闪烁
case "0":
JonsString.status = "open";
break;
case "1":
JonsString.status = "flash";
break;
case "2":
JonsString.status = "close";
break;
case "3":
JonsString.status = "flash";
break;
case "4":
JonsString.status = "flash_slow";
break;
case "5":
JonsString.status = "flash_fast";
break;
}
var openUrl = "http://192.168.0.249/GetHardWareInfo?GetType=43";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, { LightJson: JSON.stringify(JonsString) }, onConnect);
},
// 关闭灯光
closeLight: function (obj) {
var JonsString = {
device: "all",
status: "close",
};
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=43";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, { LightJson: JSON.stringify(JonsString) }, onConnect);
},
// 签名板
signatureBoard: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=55";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: data.data.Base64String,
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 指纹
fingerprint: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=61";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: data.data.Base64String,
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 打开营业执照
openBusinessLicense: function (obj) {
var CallExeJson = {
exeName: "D:\\smile\\BusinessLicense\\webbrowser.exe",
exePara: "licenseinfo.html 营业执照打印 450 120 1027 768",
waitExeClose: "true",
};
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=998";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(
openUrl,
{ CallExeJson: JSON.stringify(CallExeJson) },
onConnect
);
},
// 调用应用程序接口
callApplicationProgram: function (obj, params) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=998";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, { CallExeJson: JSON.stringify(params) }, onConnect);
},
// 隐藏任务栏接口
hiddenTaskbar: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=801";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 显示任务栏接口
showTaskbar: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=802";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 隐藏桌面接口
hiddenDesktop: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=803";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 显示桌面接口
showDesktop: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=804";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 隐藏任务管理器接口
hiddenTaskManager: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=805";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 显示任务管理器接口
showTaskManager: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=806";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 屏蔽系统按键
shieldKey: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=807";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 允许系统按键
allowKey: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=808";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 屏幕截图
screenCapture: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=809";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
// 人脸识别
faceIdentification: function (obj, params) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=666";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, { ArcFaceJson: JSON.stringify(params) }, onConnect);
},
// 二维码扫码
QrCodeScanning: function (obj, params) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=62";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, { QrcodeScanJson: JSON.stringify(params) }, onConnect);
},
// 取件柜锁控
cabinetLock: function (obj, params) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=63";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: "",
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, { LockDoorJson: JSON.stringify(params) }, onConnect);
},
// 实体社保卡
stSbcard: function (obj, params) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=22";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: data,
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, { SbcardJson: JSON.stringify(params) }, onConnect);
},
// 社保卡基础信息
SbcradInfo: function (obj) {
var openUrl = "http://127.0.0.1/GetHardWareInfo?GetType=21";
if (obj.success == null) {
obj.success = function () {};
}
if (obj.fail == null) {
obj.fail = function () {};
}
if (obj.complete == null) {
obj.complete = function () {};
}
function onConnect(res) {
var data = JSON.parse(res);
if (data.status === "1") {
var info = {
code: "00000",
message: "OK",
ok: true,
data: data,
};
obj.success(info);
} else {
var info = {
code: data.status,
message: data.message,
ok: false,
data: "",
};
obj.fail(info);
}
}
callServer(openUrl, {}, onConnect);
},
};
// 关闭视频
function Stop() {
StopVideo();
}
function GetDeviceInfo() {
GetVideoDevices(); //获取视频设备列表
SetSavePath("c:\\456"); //设置图像保存路径,当采用文件方式拍照时必须设置,base64方式非必须设置
SetJPGQuality(70); //jpg格式时有效
SetColorType("彩色"); //指定图像色彩模式,“彩色”、“灰度”、“黑白”三个选项
//SetWaterMark("这是测试水印", "宋体", 5, 150, 255, 128, 0, 0, 0.5, 1);
SetBoardColor(0); //1灰色底板机型,0或其他值为黑色底板机型
}
function callServer(url, data, func) {
var options = new Object();
options.type = "POST";
options.url = url;
options.timeout = 500000000000;
options.onSuccess = func;
options.data = data;
ajax(options);
}
function ajax(options) {
if (options.type == null) {
options.type = "GET";
}
if (options.url == null) {
options.url = "";
}
if (options.timeout == null) {
options.timeout = 5000;
}
if (options.onComplate == null) {
options.onComplate = function () {};
}
if (options.onError == null) {
options.onError = function () {};
}
if (options.onSuccess == null) {
options.onSuccess = function () {};
}
if (options.data) {
var formData = new FormData();
for (var key in options.data) {
formData.append(key, options.data[key]);
}
options.data = formData;
}
var xml;
if (typeof ActiveXObject != "undefined") {
var aVersions = [
"Microsoft.XMLHTTP",
"Msxml2.XMLHttp.6.0",
"Msxml2.XMLHttp.5.0",
"Msxml2.XMLHttp.4.0",
"Msxml2.XMLHttp.3.0",
];
for (var i = 0; i < aVersions.length; i++) {
try {
xml = new ActiveXObject(aVersions[i]);
} catch (e) {}
}
} else if (typeof XMLHttpRequest != "undefined") {
xml = new XMLHttpRequest();
}
xml.open(options.type, options.url, true);
var timeoutLength = options.timeout;
var requestDone = false;
setTimeout(function () {
requestDone = true;
}, timeoutLength);
xml.onreadystatechange = function () {
if (xml.readyState == 4 && !requestDone) {
if (httpSuccess(xml)) {
options.onSuccess(httpData(xml));
} else {
options.onError();
}
options.onComplate();
xml = null;
}
};
xml.send(options.data);
function httpSuccess(r) {
try {
return (
(!r.status && location.protocol == "file:") ||
(r.status >= 200 && r.status <= 300) ||
r.status == 304 ||
(navigator.userAgent.indexOf("Safari") >= 0 &&
typeof r.status == "undefined")
);
} catch (e) {}
return false;
}
function httpData(r) {
//var ct = r.getResponseHeader("responseType");
//alert(r.responseXML);
//alert(r.responseText);
var ct = r.getResponseHeader("Content-Type");
//alert(ct);
if (ct) {
if (ct == "script") {
eval.call(window, data);
}
if (ct == "xml") {
return r.responseXML;
}
if (ct == "json") {
return JSON.parse(r.responseText);
}
}
return r.responseText;
}
}
// 紫图服务
var url = "ws://127.0.0.1:8341";
var websocket;
var connected = false;
//初始化WebSocket连接
function ConnectServer(callback, value) {
if ("WebSocket" in window) {
websocket = new WebSocket(url);
} else if (window.WebSocket) {
websocket = new WebSocket(url);
} else if ("MozWebSocket" in window) {
websocket = new MozWebSocket(url);
} else {
alert("浏览器版本太低!请使用Chrome、Firefox、IE10+浏览器!");
}
websocket.onopen = function () {
connected = true;
callback && callback(value);
};
websocket.onclose = function (e) {
connected = false;
onMessage({ data: JSON.stringify({ FuncName: "Connect", result: 0 }) });
};
websocket.onmessage = function (e) {
onMessage(e);
};
websocket.onerror = function (e) {
//if (websocket.readyState != WebSocket.OPEN||websocket.readyState == WebSocket.CLOSED) {
// onMessage({ data: JSON.stringify({ FuncName: 'Connect', result: 0 }) });
//}
};
}
//接收服务器发送的信息
function onMessage(event) {
try {
if (typeof event.data == "string") {
var str = event.data;
var jsonOBJ = JSON.parse(str);
var name = jsonOBJ.FuncName;
var re = jsonOBJ.result;
if (name == "Connect" && re == 1) {
connected = true;
}
produceMessage(name, re);
}
} catch (error) {
// console.log(error)
}
}
//向服务器发送信息的共享方法
function sendMessage(data) {
if (websocket.readyState == 0) {
setTimeout(function () {
var jsData = JSON.stringify(data);
websocket.send(jsData);
}, 50);
} else if (websocket.readyState == 1) {
var jsData = JSON.stringify(data);
websocket.send(jsData);
} else {
alert("未连接websocket服务器,请确保已运行服务端!");
}
}
/*==============以下是扫描仪功能======================================================*/
//设置保存路径
function SetSavePath(savePath) {
var data = { Func: "SetSavePath", arg: savePath };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置文件前缀
function SetFilePre(pre) {
var data = { Func: "SetFilePre", arg: pre };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置Twain源名称
function SetDevice(twainName) {
var data = { Func: "SetDevice", arg: twainName };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//获取所有twain源名称
function GetDeviceList() {
var data = { Func: "GetDeviceList", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置色彩模式
function SetColorType(colorType) {
var data = { Func: "SetColorType", arg: colorType };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置底板颜色
function SetBoardColor(colorType) {
var data = { Func: "SetBoardColor", arg: colorType };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置分辨率
function SetDPI(dpi) {
var data = { Func: "SetDPI", arg: dpi };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置是否弹出twainui
function ShowTwainUI(showUI) {
var data = { Func: "ShowTwainUI", arg: showUI };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置文件类型
function SetFileType(fileType) {
var data = { Func: "SetFileType", arg: fileType };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置单双面
function SetDuplex(duplex) {
var data = { Func: "SetDuplex", arg: duplex };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置是否传输每一张图像的base64
function SetTransPerPageBase64(trans) {
var data = { Func: "SetTransPerPageBase64", arg: trans };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置JPG图片压缩率
function SetJPGQuality(quality) {
var data = { Func: "SetJPGQuality", arg: quality };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//获取扫描仪序列号
function GetScannerSN() {
var data = { Func: "GetScannerSN", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//开始扫描
function StartScan(pageNum) {
var data = { Func: "StartScan", arg: pageNum };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//获取本次扫描的文件列表
function GetFilesList() {
var data = { Func: "GetFilesList", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//图片转BASE64
function ImageToBase64(filePath) {
var data = { Func: "ImageToBase64", arg: filePath };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//文件转BASE64
function FileToBase64(filePath) {
var data = { Func: "FileToBase64", arg: filePath };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//图片http上传
function httpUpload(serverAddress, filePath, del) {
var data = {
Func: "httpUpload",
arg: { serverAddress: serverAddress, filePath: filePath, del: del },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//图片ftp上传
function ftpUpload(
ftpServerIP,
ftpRemotePath,
ftpUserID,
ftpPassword,
filename,
del,
passive
) {
var data = {
Func: "ftpUpload",
arg: {
ftpServerIP: ftpServerIP,
ftpRemotePath: ftpRemotePath,
ftpUserID: ftpUserID,
ftpPassword: ftpPassword,
filename: filename,
del: del,
passive: passive,
},
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//图片转pdf
function ImagesToPDF(imageList, pdfFile) {
var data = {
Func: "ImagesToPDF",
arg: { imageList: imageList, pdfFile: pdfFile },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//图片转pdf base64方式
function ImagesToPDFBase64(base64Str) {
var data = { Func: "ImagesToPDFBase64", arg: base64Str };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//开始活体检测双目,参数为超时时间,单位秒
function StartLiveDetect(outtime) {
var data = { Func: "StartLiveDetect", arg: outtime };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//开始活体检测单目,参数为超时时间,单位秒
function StartLiveDetectSingle(outtime) {
var data = { Func: "StartLiveDetectSingle", arg: outtime };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//获取指定文件夹下的文件列表
function GetFolderFileListJson(folderPath) {
var data = { Func: "GetFolderFileListJson", arg: folderPath };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//删除指定文件夹下的所有文件
function DeleteImagesInFolder(folderPath) {
var data = { Func: "DeleteImagesInFolder", arg: folderPath };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//删除指定文件
function DeleteImage(filePath) {
var data = { Func: "DeleteImage", arg: filePath };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
/*==============以下是读卡\指纹功能======================================================*/
//读身份证
function ReadIDCard() {
var data = { Func: "ReadIDCard", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//读二代社保卡
function Read2thSSCard() {
var data = { Func: "Read2thSSCard", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//读三代社保卡(PSAM)
function Read3thSSCardBasPSAM(type) {
var data = { Func: "Read3thSSCardBasPSAM", arg: type };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//读三代社保卡步骤1(加密机)
function Read3thSSCardBasHSM1(type) {
var data = { Func: "Read3thSSCardBasHSM1", arg: type };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//读三代社保卡步骤2(加密机)
function Read3thSSCardBasHSM2(key) {
var data = { Func: "Read3thSSCardBasHSM2", arg: key };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//读IC银行卡
function ReadICCard() {
var data = { Func: "ReadICCard", arg: 0 };
sendMessage(data);
}
//读磁条银行卡
function ReadMagCard() {
var data = { Func: "ReadMagCard", arg: 0 };
sendMessage(data);
}
//采集指纹-文件方式
function CapFingerFile(fingerPic) {
var data = { Func: "CapFingerFile", arg: fingerPic };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//采集指纹-base64方式
function CapFingerBASE64() {
var data = { Func: "CapFingerBASE64", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//比对指纹-文件方式
function MatchFingerByFile(fingerPic1, fingerPic2) {
var data = {
Func: "MatchFingerByFile",
arg: { fingerPic1: fingerPic1, fingerPic2: fingerPic2 },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//比对指纹-base64方式
function MatchFingerByBASE64(fingerPic1, fingerPic2) {
var data = {
Func: "MatchFingerByBASE64",
arg: { fingerPic1: fingerPic1, fingerPic2: fingerPic2 },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//与身份证比对指纹-文件方式
function MatchCardFingerByFile(fingerPic1) {
var data = { Func: "MatchCardFingerByFile", arg: { fingerPic1: fingerPic1 } };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//与身份证比对指纹-base64方式
function MatchCardFingerByBase64(fingerBase64) {
var data = { Func: "MatchCardFingerByBase64", arg: fingerBase64 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
/*==============以下是手写屏功能======================================================*/
//开始签字
function StartSign(title) {
var data = { Func: "StartSign", arg: title };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//开启评价器
function StartEvalute() {
var data = { Func: "StartEvalute", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//展示工牌
function StartStaff(headPic, staffName, staffNum, staffStar) {
var data = {
Func: "StartStaff",
arg: {
headPic: headPic,
staffName: staffName,
staffNum: staffNum,
staffStar: staffStar,
},
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//关闭工牌
function CloseStaff() {
var data = { Func: "CloseStaff", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//打开PDF
function OpenPDF(filePath, withSign) {
var data = {
Func: "OpenPDF",
arg: { filePath: filePath, withSign: withSign },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//关闭PDF窗口
function ClosePDF() {
var data = { Func: "ClosePDF", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//打开网页
function OpenWebPage(url) {
var data = { Func: "OpenWebPage", arg: url };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//关闭网页
function CloseWebPage() {
var data = { Func: "CloseWebPage", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
/*==============以下是高拍仪功能======================================================*/
function GetVideoDevInfo() {
var a = { Func: "GetVideoDevInfo", arg: 0 };
connected ? sendMessage(a) : ConnectServer(sendMessage, a);
}
function CheckLicense() {
var a = { Func: "CheckLicense", arg: 0 };
connected ? sendMessage(a) : ConnectServer(sendMessage, a);
}
function GetSpecialFolder(index) {
var a = { Func: "GetSpecialFolder", arg: index };
connected ? sendMessage(a) : ConnectServer(sendMessage, a);
}
function GetCurrentResolutionIndex() {
var a = { Func: "GetCurrentResolutionIndex", arg: 0 };
connected ? sendMessage(a) : ConnectServer(sendMessage, a);
}
//打开视频窗口
function StartVideo(camIndex) {
var data = { Func: "StartVideo", arg: camIndex };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//打开主头视频窗口
function StartRunMain() {
var data = { Func: "StartRunMain", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//打开副头视频窗口
function StartRunSub() {
var data = { Func: "StartRunSub", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//按指定PID\VID打开设备
function StartRunByID(vid, pid) {
var data = { Func: "StartRunByID", arg: { VID: vid, PID: pid } };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
function ZoomIn() {
var data = { Func: "ZoomIn", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
function ZoomOut() {
var data = { Func: "ZoomOut", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//左旋转
function RotateLeft() {
var data = { Func: "RotateLeft", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//右旋转
function RotateRight() {
var data = {
Func: "RotateRight",
arg: 0,
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//关闭视频窗口
function StopVideo() {
var data = { Func: "StopVideo", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//获取视频设备列表
function GetVideoDevices() {
var data = { Func: "GetVideoDevices", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//获取音频设备列表
function GetAudioDevices() {
var data = { Func: "GetAudioDevices", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//开始录像
function StartRecord(videoIndex, audioIndex, fileName, resolution, fps) {
var data = {
Func: "StartRecord",
arg: {
videoIndex: videoIndex,
audioIndex: audioIndex,
fileName: fileName,
resolution: resolution,
fps: fps,
},
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//停止录像
function StopRecord() {
var data = { Func: "StopRecord", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//切换视频设备
function ChangeVideoDevice(camIndex) {
var data = { Func: "ChangeVideoDevice", arg: camIndex };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//切换视频分辨率
function ChangeVideoResolution(resIndex) {
var data = { Func: "ChangeVideoResolution", arg: resIndex };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//切换裁剪方式
function ChangeCutType(type) {
var data = { Func: "ChangeCutType", arg: type };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//获取高拍仪序列号
function GetVideoDeviceSN() {
var data = { Func: "GetVideoDeviceSN", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//文件方式拍照
function CaptureFile(fileName) {
var data = { Func: "CaptureFile", arg: fileName };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//base64方式拍照
function CaptureBase64(format) {
var data = { Func: "CaptureBase64", arg: format };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//采集发票二维码
function CaptureTaxQR() {
var data = { Func: "CaptureTaxQR", arg: 0 };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//人脸比对
function VerifyFace(face1, face2) {
var data = { Func: "VerifyFace", arg: { face1: face1, face2: face2 } };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//人脸比对-Base64
function VerifyFaceByBase64(face1, face2) {
var data = {
Func: "VerifyFaceByBase64",
arg: { face1: face1, face2: face2 },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//人脸比对
function VerifyFacePro(face1, face2) {
var data = { Func: "VerifyFacePro", arg: { face1: face1, face2: face2 } };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//人脸比对-Base64
function VerifyFaceByBase64Pro(face1, face2) {
var data = {
Func: "VerifyFaceByBase64Pro",
arg: { face1: face1, face2: face2 },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//OCR识别文件
function OCRImage(fileName) {
var data = { Func: "OCRImage", arg: fileName };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//OCR识别文件Pro
function OCRImagePro(fileName, txt, json, rtf, pdf) {
var data = {
Func: "OCRImagePro",
arg: { fileName: fileName, txt: txt, json: json, rtf: rtf, pdf: pdf },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//打印图片文件
function PrintImage(fileName) {
var data = { Func: "PrintImage", arg: fileName };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//设置水印
function SetWaterMark(
watertext,
waterfont,
position,
fontsize,
rvalue,
gvalue,
bvalue,
sapceing,
Opacity,
open
) {
var data = {
Func: "SetWaterMark",
arg: {
watertext: watertext,
waterfont: waterfont,
position: position,
fontsize: fontsize,
rvalue: rvalue,
gvalue: gvalue,
bvalue: bvalue,
sapceing: sapceing,
Opacity: Opacity,
open: open,
},
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//合并图片
function CombineImages(pic1, pic2, savePic, type) {
var data = {
Func: "CombineImages",
arg: { pic1: pic1, pic2: pic2, savePic: savePic, type: type },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//合并图片
function CombineImagesPro(picList, savePic, type) {
var data = {
Func: "CombineImagesPro",
arg: { picList: picList, savePic: savePic, type: type },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//合并图片-base64
function CombineImagesProByBase64(picList, type) {
var data = {
Func: "CombineImagesProByBase64",
arg: { picList: picList, type: type },
};
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
//识别二维码、一维码
function GetBarCode(fileName) {
var data = { Func: "GetBarCode", arg: fileName };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
function GetBarCodeBase64(base64Str) {
var data = { Func: "GetBarCodeBase64", arg: base64Str };
connected ? sendMessage(data) : ConnectServer(sendMessage, data);
}
...@@ -13,5 +13,6 @@ ...@@ -13,5 +13,6 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<script src="./JSSDK.js"></script>
</body> </body>
</html> </html>
...@@ -107,10 +107,11 @@ export default { ...@@ -107,10 +107,11 @@ export default {
} }
.page-login { .page-login {
width: 100%;
background-image: linear-gradient(45deg, #333, #111); background-image: linear-gradient(45deg, #333, #111);
background-size: 40px 40px; background-size: 40px 40px;
margin: 0; margin: 0;
height: 100%; height: auto;
.el-form { .el-form {
margin: auto; margin: auto;
......
...@@ -12,6 +12,14 @@ ...@@ -12,6 +12,14 @@
<img class="sample-sheet-img" :src="api + materialsPreview" /> <img class="sample-sheet-img" :src="api + materialsPreview" />
</div> </div>
</div> </div>
<div slot="footer" class="tac">
<el-button
type="primary"
:loading="loading"
@click="handlePrint(materialsInfo)"
>打 印</el-button
>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -48,15 +56,38 @@ export default { ...@@ -48,15 +56,38 @@ export default {
data() { data() {
return { return {
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL + "/",
val: "", loading: false,
}; };
}, },
methods: {
handlePrint(info) {
let _this = this;
_this.loading = true;
/* eslint-disable */
device.printer({
papertype: "A4",
printername: "", // 打印机名称 为空则为默认打印机
printertype: "url", // base64 ,normal,url
url: info.fileUrl, // url
success: (res) => {
if (res && res.code == "00000") {
_this.$message.success("打印成功");
_this.loading = false;
}
},
fail: (err) => {
_this.$message.error(err.Message);
_this.loading = false;
},
});
},
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.el-dialog__body { :deep(.el-dialog__body) {
max-height: 86vh; height: 78vh;
overflow-y: auto; overflow-y: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 6px; width: 6px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment