unify-external-plugin-platform 0.0.2-37 → 0.0.2-39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/external-plugin.common.js +3128 -82
- package/dist/external-plugin.common.js.map +1 -1
- package/dist/external-plugin.css +1 -1
- package/dist/external-plugin.umd.js +3128 -82
- package/dist/external-plugin.umd.js.map +1 -1
- package/dist/external-plugin.umd.min.js +3 -3
- package/dist/external-plugin.umd.min.js.map +1 -1
- package/dist/img/idcardbg1.1f8e1fc6.gif +0 -0
- package/dist/img/idcardbg2.2e47b05f.gif +0 -0
- package/package.json +1 -1
@@ -81789,6 +81789,359 @@ var index = (function () {
|
|
81789
81789
|
/* harmony default export */ __webpack_exports__["default"] = (index);
|
81790
81790
|
|
81791
81791
|
|
81792
|
+
/***/ }),
|
81793
|
+
|
81794
|
+
/***/ 8601:
|
81795
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
81796
|
+
|
81797
|
+
"use strict";
|
81798
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
81799
|
+
/* harmony export */ "g$": function() { return /* binding */ tsToJs; },
|
81800
|
+
/* harmony export */ "oK": function() { return /* binding */ GetIDCardOnly; },
|
81801
|
+
/* harmony export */ "xj": function() { return /* binding */ loadCamera; }
|
81802
|
+
/* harmony export */ });
|
81803
|
+
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7658);
|
81804
|
+
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);
|
81805
|
+
|
81806
|
+
var tsToJs = {
|
81807
|
+
/**
|
81808
|
+
* @return {any}
|
81809
|
+
*/
|
81810
|
+
getElement: function Stirng(flag, photoId) {
|
81811
|
+
var plugin;
|
81812
|
+
if (flag == 1) {
|
81813
|
+
// 中正人脸识别,但是用不起来,换websocket形式调用了,此处弃用,害!
|
81814
|
+
debugger;
|
81815
|
+
// if (location.href.indexOf('TakePhoto') == -1) {
|
81816
|
+
console.log("人脸识别开始-----");
|
81817
|
+
var plugin = document.getElementById("facePlugin");
|
81818
|
+
console.log("plugin-----", plugin);
|
81819
|
+
var data = "$=Action";
|
81820
|
+
var temp = plugin.SendDataToADB("127.0.0.1", 1352, 15000, data, data.length);
|
81821
|
+
console.log(temp + "-----====");
|
81822
|
+
//处理返回的结果,获取相应的属性
|
81823
|
+
if (typeof temp === "undefined") {
|
81824
|
+
return null;
|
81825
|
+
}
|
81826
|
+
var str = temp.split("$");
|
81827
|
+
var result = str[1].split("=#=")[1];
|
81828
|
+
console.log("result:" + result + "-----++++");
|
81829
|
+
var name = str[2].split("=#=")[1];
|
81830
|
+
var sex = str[3].split("=#=")[1];
|
81831
|
+
var cardNo = str[4].split("=#=")[1];
|
81832
|
+
console.log("cardNo:" + cardNo + "-----++++");
|
81833
|
+
var address = str[5].split("=#=")[1];
|
81834
|
+
var birthday = str[6].split("=#=")[1];
|
81835
|
+
var cardImg = str[8].split("=#=")[1];
|
81836
|
+
var faceImg = str[9].split("=#=")[1];
|
81837
|
+
var race = str[10].split("=#=")[1];
|
81838
|
+
var regOrg = str[11].split("=#=")[1];
|
81839
|
+
var validTime = str[12].split("=#=")[1];
|
81840
|
+
var validTimeStart = validTime.split("-")[0];
|
81841
|
+
var validTimeEnd = validTime.split("-")[1];
|
81842
|
+
//处理身份证信息并赋值
|
81843
|
+
var objSfz = {
|
81844
|
+
"idCard": {
|
81845
|
+
"info": {
|
81846
|
+
"name": name.toString(),
|
81847
|
+
"sex": sex.toString(),
|
81848
|
+
"nation": race.toString(),
|
81849
|
+
"birthday": birthday.toString(),
|
81850
|
+
"address": address.toString(),
|
81851
|
+
"cardId": cardNo.toString(),
|
81852
|
+
"police": regOrg.toString(),
|
81853
|
+
"validStart": validTimeStart.toString(),
|
81854
|
+
"validEnd": validTimeEnd.toString(),
|
81855
|
+
"sexCode": "",
|
81856
|
+
"nationCode": ""
|
81857
|
+
},
|
81858
|
+
"headImage": cardImg.toString()
|
81859
|
+
},
|
81860
|
+
"faceimg": faceImg.toString(),
|
81861
|
+
"zt": ""
|
81862
|
+
};
|
81863
|
+
// objSfz = {
|
81864
|
+
// "zjh": cardNo.toString(),
|
81865
|
+
// "xm": name.toString(),
|
81866
|
+
// "xb": sex.toString(),
|
81867
|
+
// "sr": birthday.toString(),
|
81868
|
+
// "mz": race.toString(),
|
81869
|
+
// "zz": address.toString(),
|
81870
|
+
// "qfjg": regOrg.toString(),
|
81871
|
+
// "yxqx": validTime.toString(),
|
81872
|
+
// "yxqx1": validTimeStart.toString(),
|
81873
|
+
// "yxqx2": validTimeEnd.toString(),
|
81874
|
+
// "zpString": cardImg.toString(),
|
81875
|
+
// "faceImg": faceImg.toString()
|
81876
|
+
// };
|
81877
|
+
console.log('-------------------objSfz成功返回数据---------------------');
|
81878
|
+
console.log('人脸识别结果===>', objSfz);
|
81879
|
+
return objSfz;
|
81880
|
+
// }
|
81881
|
+
} else if (flag == 2) {
|
81882
|
+
// console.log("idcard");
|
81883
|
+
plugin = document.getElementById('plugin');
|
81884
|
+
var temp2 = plugin.On_OpenDevice(1001);
|
81885
|
+
var obj = eval('(' + temp2 + ')');
|
81886
|
+
if (typeof obj['照片'] != "undefined") {
|
81887
|
+
if (photoId && document.getElementById(photoId)) {
|
81888
|
+
document.getElementById(photoId).src = "data:image/jpeg;base64," + obj['照片'];
|
81889
|
+
}
|
81890
|
+
console.log(obj['身份证号2'] + '._____.');
|
81891
|
+
console.log(obj['照片2'] + '._____.-----------');
|
81892
|
+
}
|
81893
|
+
return obj;
|
81894
|
+
} else if (flag == 3) {
|
81895
|
+
console.log("-----开始读取身份证信息-----");
|
81896
|
+
var plugin = document.getElementById('plugin');
|
81897
|
+
var temp2 = plugin.On_OpenDevice(1001);
|
81898
|
+
var obj = eval('(' + temp2 + ')');
|
81899
|
+
var result = {
|
81900
|
+
"info": {
|
81901
|
+
"name": obj['姓名'],
|
81902
|
+
"sex": obj['性别'],
|
81903
|
+
"nation": obj['名族'],
|
81904
|
+
"birthday": obj['出生日期'],
|
81905
|
+
"address": obj['地址'],
|
81906
|
+
"cardId": obj['身份证号'],
|
81907
|
+
"police": obj['发证机关'],
|
81908
|
+
"validStart": obj['有效期开始'],
|
81909
|
+
"validEnd": obj['有效期结束'],
|
81910
|
+
"sexCode": "",
|
81911
|
+
"nationCode": ""
|
81912
|
+
},
|
81913
|
+
"headImage": obj['照片']
|
81914
|
+
};
|
81915
|
+
console.log("-----身份证信息读取结果-----");
|
81916
|
+
console.log(result);
|
81917
|
+
return result;
|
81918
|
+
} else if (flag == 4) {
|
81919
|
+
return GetIDCardAndMatchImage();
|
81920
|
+
}
|
81921
|
+
},
|
81922
|
+
getExportInfo: function Stirng() {
|
81923
|
+
var columNameStr = '';
|
81924
|
+
var captionNameStr = '';
|
81925
|
+
$.ajaxSettings.async = false;
|
81926
|
+
$.get("assets/xml/Export.xml", false, function (d) {
|
81927
|
+
var columNameArray = [];
|
81928
|
+
var captionNameArray = [];
|
81929
|
+
$(d).find('ElementTable').each(function () {
|
81930
|
+
var $book = $(this);
|
81931
|
+
var ColumnName = $book.attr("ColumnName");
|
81932
|
+
var CaptionName = $book.attr("CaptionName");
|
81933
|
+
columNameArray.push(ColumnName);
|
81934
|
+
captionNameArray.push(CaptionName);
|
81935
|
+
// console.log(ColumnName + 'nei');
|
81936
|
+
// console.log(CaptionName + 'nei');
|
81937
|
+
});
|
81938
|
+
|
81939
|
+
columNameStr = columNameArray.join(",");
|
81940
|
+
captionNameStr = captionNameArray.join(",");
|
81941
|
+
xmlxx = {
|
81942
|
+
"columNameStr": columNameStr,
|
81943
|
+
"captionNameStr": captionNameStr
|
81944
|
+
};
|
81945
|
+
// var url = commonPath+"/blacklist/exportExcel?1=1"+queryConfig;
|
81946
|
+
// var iframe = document.createElement('IFRAME');
|
81947
|
+
// iframe.setAttribute("id","testIframe");
|
81948
|
+
// iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
|
81949
|
+
// document.body.appendChild(iframe);
|
81950
|
+
// iframe.src = url;
|
81951
|
+
|
81952
|
+
// console.log(columNameStr+"&&"+captionNameStr);
|
81953
|
+
});
|
81954
|
+
|
81955
|
+
$.ajaxSettings.async = true;
|
81956
|
+
return xmlxx;
|
81957
|
+
},
|
81958
|
+
getAreaData: function Stirng() {
|
81959
|
+
$.ajaxSettings.async = false;
|
81960
|
+
var nameArray = [];
|
81961
|
+
var dataBaseLinkArray = [];
|
81962
|
+
$.get('assets/xml/AreaData.xml', function (d) {
|
81963
|
+
$(d).find('ElementTable').each(function () {
|
81964
|
+
var $book = $(this);
|
81965
|
+
var value = $book.attr("tableName");
|
81966
|
+
var dataBaseLink = $book.children("DataBaseLink").attr("Name");
|
81967
|
+
nameArray.push(value);
|
81968
|
+
dataBaseLinkArray.push(dataBaseLink);
|
81969
|
+
});
|
81970
|
+
// loadTableList(1,true);
|
81971
|
+
});
|
81972
|
+
|
81973
|
+
$.ajaxSettings.async = true;
|
81974
|
+
xmlxx = {
|
81975
|
+
"nameArray": nameArray,
|
81976
|
+
"dataBaseLinkArray": dataBaseLinkArray
|
81977
|
+
};
|
81978
|
+
return xmlxx;
|
81979
|
+
},
|
81980
|
+
getAreaTable: function () {
|
81981
|
+
$.ajaxSettings.async = false;
|
81982
|
+
var areaTable = [];
|
81983
|
+
$.get('assets/xml/AreaData.xml', function (d) {
|
81984
|
+
$(d).find('ElementTable').each(function () {
|
81985
|
+
var $book = $(this);
|
81986
|
+
var value = $book.attr("tableName");
|
81987
|
+
var dataBaseLink = $book.children("DataBaseLink").attr("Name");
|
81988
|
+
xmlxx = {
|
81989
|
+
"tableName": value,
|
81990
|
+
"dataBaseLink": dataBaseLink
|
81991
|
+
};
|
81992
|
+
areaTable.push(xmlxx);
|
81993
|
+
});
|
81994
|
+
// loadTableList(1,true);
|
81995
|
+
});
|
81996
|
+
|
81997
|
+
$.ajaxSettings.async = true;
|
81998
|
+
return areaTable;
|
81999
|
+
},
|
82000
|
+
getPhoto: function (imgBase64, photoId) {
|
82001
|
+
document.getElementById(photoId).src = "data:image/jpeg;base64," + imgBase64;
|
82002
|
+
},
|
82003
|
+
printImg: function (domId) {
|
82004
|
+
$('#' + domId).jqprint();
|
82005
|
+
}
|
82006
|
+
};
|
82007
|
+
(function ($) {
|
82008
|
+
var opt;
|
82009
|
+
$.fn.jqprint = function (options) {
|
82010
|
+
opt = $.extend({}, $.fn.jqprint.defaults, options);
|
82011
|
+
var $element = this instanceof jQuery ? this : $(this);
|
82012
|
+
var $iframe = $("<iframe />");
|
82013
|
+
if (!opt.debug) {
|
82014
|
+
$iframe.css({
|
82015
|
+
position: "absolute",
|
82016
|
+
width: "0px",
|
82017
|
+
height: "0px",
|
82018
|
+
left: "-600px",
|
82019
|
+
top: "-600px"
|
82020
|
+
});
|
82021
|
+
}
|
82022
|
+
$iframe.appendTo("body");
|
82023
|
+
var doc = $iframe[0].contentWindow.document;
|
82024
|
+
if (opt.importCSS) {
|
82025
|
+
if ($("link[media=print]").length > 0) {
|
82026
|
+
$("link[media=print]").each(function () {
|
82027
|
+
doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
|
82028
|
+
});
|
82029
|
+
} else {
|
82030
|
+
$("link").each(function () {
|
82031
|
+
doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
|
82032
|
+
});
|
82033
|
+
}
|
82034
|
+
}
|
82035
|
+
if (opt.printContainer) {
|
82036
|
+
doc.write($element.outer());
|
82037
|
+
} else {
|
82038
|
+
$element.each(function () {
|
82039
|
+
doc.write($(this).html());
|
82040
|
+
});
|
82041
|
+
}
|
82042
|
+
doc.close();
|
82043
|
+
$iframe[0].contentWindow.focus();
|
82044
|
+
setTimeout(function () {
|
82045
|
+
$iframe[0].contentWindow.print();
|
82046
|
+
}, 1000);
|
82047
|
+
};
|
82048
|
+
$.fn.jqprint.defaults = {
|
82049
|
+
debug: false,
|
82050
|
+
importCSS: true,
|
82051
|
+
printContainer: true,
|
82052
|
+
operaSupport: true
|
82053
|
+
};
|
82054
|
+
|
82055
|
+
// Thanks to 9__, found at http://users.livejournal.com/9__/380664.html
|
82056
|
+
jQuery.fn.outer = function () {
|
82057
|
+
return $($('<div></div>').html(this.clone())).html();
|
82058
|
+
};
|
82059
|
+
}); //(jQuery);
|
82060
|
+
|
82061
|
+
function loadCamera() {
|
82062
|
+
// var IDCard = document.getElementById("IDCard_chrome");
|
82063
|
+
// var cameraRow = document.getElementById("camera_row")
|
82064
|
+
// cameraRow.innerHTML = '<embed clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=300 height=180 name="FaceObj" />'
|
82065
|
+
// ;
|
82066
|
+
var IDCard = document.getElementById("IDCard_chrome");
|
82067
|
+
var cameraRow = document.getElementById("camera_row");
|
82068
|
+
cameraRow.innerHTML = '<object clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=320 height=240 name="FaceObj"></object>';
|
82069
|
+
}
|
82070
|
+
function GetIDCardOnly() {
|
82071
|
+
var IDCard = document.getElementById("IDCard_chrome");
|
82072
|
+
var ret = IDCard.OpenDevice();
|
82073
|
+
if (ret != 0) {
|
82074
|
+
debug("一体机启动失败");
|
82075
|
+
return;
|
82076
|
+
}
|
82077
|
+
ret = IDCard.ReadIDCardInfo();
|
82078
|
+
//处理身份证信息并赋值
|
82079
|
+
var objSfz = {
|
82080
|
+
"info": {
|
82081
|
+
"name": IDCard.IDName,
|
82082
|
+
"sex": IDCard.IDSex,
|
82083
|
+
"nation": IDCard.IDFolk,
|
82084
|
+
"birthday": IDCard.IDBirth,
|
82085
|
+
"address": IDCard.IDAddress,
|
82086
|
+
"cardId": IDCard.IDNumber,
|
82087
|
+
"police": IDCard.IDOrgan,
|
82088
|
+
"validStart": IDCard.IDTermBegin.substring(0, 4) + '.' + IDCard.IDTermBegin.substring(4, 6) + '.' + IDCard.IDTermBegin.substring(6, 8),
|
82089
|
+
"validEnd": IDCard.IDTermEnd.substring(0, 4) + '.' + IDCard.IDTermEnd.substring(4, 6) + '.' + IDCard.IDTermEnd.substring(6, 8),
|
82090
|
+
"sexCode": "",
|
82091
|
+
"nationCode": ""
|
82092
|
+
},
|
82093
|
+
"headImage": IDCard.IDPhoto64
|
82094
|
+
};
|
82095
|
+
return objSfz;
|
82096
|
+
}
|
82097
|
+
|
82098
|
+
// 一体机插件 (丽水)
|
82099
|
+
function GetIDCardAndMatchImage() {
|
82100
|
+
console.log("-----开启一体机功能-----");
|
82101
|
+
var IDCard = document.getElementById("IDCard_chrome");
|
82102
|
+
// var cameraRow = document.getElementById("camera_row")
|
82103
|
+
// cameraRow.innerHTML = '<object clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=320 height=240 name="FaceObj"></object>'
|
82104
|
+
// cameraRow.innerHTML = '<embed clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=300 height=180 name="FaceObj" id="FaceObj" />'
|
82105
|
+
var ret = IDCard.OpenDevice();
|
82106
|
+
if (ret != 0) {
|
82107
|
+
debug("一体机启动失败");
|
82108
|
+
return;
|
82109
|
+
}
|
82110
|
+
ret = IDCard.ReadIDCardInfo();
|
82111
|
+
//处理身份证信息并赋值
|
82112
|
+
var objSfz = {
|
82113
|
+
"idCard": {
|
82114
|
+
"info": {
|
82115
|
+
"name": IDCard.IDName,
|
82116
|
+
"sex": IDCard.IDSex,
|
82117
|
+
"nation": IDCard.IDFolk,
|
82118
|
+
"birthday": IDCard.IDBirth,
|
82119
|
+
"address": IDCard.IDAddress,
|
82120
|
+
"cardId": IDCard.IDNumber,
|
82121
|
+
"police": IDCard.IDOrgan,
|
82122
|
+
"validStart": IDCard.IDTermBegin.substring(0, 4) + '.' + IDCard.IDTermBegin.substring(4, 6) + '.' + IDCard.IDTermBegin.substring(6, 8),
|
82123
|
+
"validEnd": IDCard.IDTermEnd.substring(0, 4) + '.' + IDCard.IDTermEnd.substring(4, 6) + '.' + IDCard.IDTermEnd.substring(6, 8),
|
82124
|
+
"sexCode": "",
|
82125
|
+
"nationCode": ""
|
82126
|
+
},
|
82127
|
+
"headImage": IDCard.IDPhoto64
|
82128
|
+
},
|
82129
|
+
"faceimg": "",
|
82130
|
+
"zt": ""
|
82131
|
+
};
|
82132
|
+
return MatchImage(objSfz);
|
82133
|
+
}
|
82134
|
+
function MatchImage(objSfz) {
|
82135
|
+
debugger;
|
82136
|
+
// var FaceObj = document.getElementById("FaceObj");
|
82137
|
+
var ret = FaceObj.MatchFace(objSfz.idCard.headImage);
|
82138
|
+
var obj = JSON.parse(ret);
|
82139
|
+
objSfz.faceimg = obj.image;
|
82140
|
+
objSfz.zt = obj.retinfo;
|
82141
|
+
console.log(objSfz);
|
82142
|
+
return objSfz;
|
82143
|
+
}
|
82144
|
+
|
81792
82145
|
/***/ }),
|
81793
82146
|
|
81794
82147
|
/***/ 2823:
|
@@ -81929,6 +82282,22 @@ module.exports = function ( delay, noTrailing, callback, debounceMode ) {
|
|
81929
82282
|
};
|
81930
82283
|
|
81931
82284
|
|
82285
|
+
/***/ }),
|
82286
|
+
|
82287
|
+
/***/ 2234:
|
82288
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
82289
|
+
|
82290
|
+
"use strict";
|
82291
|
+
module.exports = __webpack_require__.p + "img/idcardbg1.1f8e1fc6.gif";
|
82292
|
+
|
82293
|
+
/***/ }),
|
82294
|
+
|
82295
|
+
/***/ 4923:
|
82296
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
82297
|
+
|
82298
|
+
"use strict";
|
82299
|
+
module.exports = __webpack_require__.p + "img/idcardbg2.2e47b05f.gif";
|
82300
|
+
|
81932
82301
|
/***/ }),
|
81933
82302
|
|
81934
82303
|
/***/ 5053:
|
@@ -83305,7 +83674,7 @@ class ELoamPassService {
|
|
83305
83674
|
validStart,
|
83306
83675
|
validEnd
|
83307
83676
|
},
|
83308
|
-
headImage:
|
83677
|
+
headImage: photoBase64
|
83309
83678
|
};
|
83310
83679
|
return IDCardData;
|
83311
83680
|
}
|
@@ -83539,19 +83908,23 @@ scanner_eloam.install = Vue => {
|
|
83539
83908
|
Vue.component(scanner_eloam.name, scanner_eloam);
|
83540
83909
|
};
|
83541
83910
|
/* harmony default export */ var scanner_scanner_eloam = (scanner_eloam);
|
83542
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/
|
83543
|
-
var
|
83911
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/scanner-camera.vue?vue&type=template&id=00e9072f&scoped=true&
|
83912
|
+
var scanner_cameravue_type_template_id_00e9072f_scoped_true_render = function render() {
|
83544
83913
|
var _vm = this,
|
83545
83914
|
_c = _vm._self._c;
|
83546
|
-
return
|
83547
|
-
staticClass: "
|
83915
|
+
return _c('div', {
|
83916
|
+
staticClass: "scanner-camera-container"
|
83917
|
+
}, [_vm.openMode === 'dialog' ? _c('div', {
|
83918
|
+
staticClass: "scanner-camera-button"
|
83919
|
+
}, [_vm.tip ? _c('el-tooltip', {
|
83920
|
+
staticClass: "id-card-reader-demo",
|
83548
83921
|
attrs: {
|
83549
83922
|
"content": _vm.tip,
|
83550
83923
|
"placement": "top"
|
83551
83924
|
}
|
83552
83925
|
}, [_c('el-button', _vm._b({
|
83553
83926
|
on: {
|
83554
|
-
"click": _vm.
|
83927
|
+
"click": _vm.openScanDialog
|
83555
83928
|
}
|
83556
83929
|
}, 'el-button', {
|
83557
83930
|
disabled: _vm.disabled,
|
@@ -83566,7 +83939,7 @@ var id_card_reader_eloamvue_type_template_id_5b7ce781_scoped_true_render = funct
|
|
83566
83939
|
return [_vm._v(_vm._s(_vm.label))];
|
83567
83940
|
})], 2)], 1) : _c('el-button', _vm._b({
|
83568
83941
|
on: {
|
83569
|
-
"click": _vm.
|
83942
|
+
"click": _vm.openScanDialog
|
83570
83943
|
}
|
83571
83944
|
}, 'el-button', {
|
83572
83945
|
disabled: _vm.disabled,
|
@@ -83579,86 +83952,2461 @@ var id_card_reader_eloamvue_type_template_id_5b7ce781_scoped_true_render = funct
|
|
83579
83952
|
class: _vm._className
|
83580
83953
|
}, false), [_vm._t("default", function () {
|
83581
83954
|
return [_vm._v(_vm._s(_vm.label))];
|
83582
|
-
})], 2)
|
83583
|
-
|
83584
|
-
|
83585
|
-
|
83586
|
-
|
83587
|
-
|
83588
|
-
|
83589
|
-
/* harmony default export */ var id_card_reader_eloamvue_type_script_lang_js_ = ({
|
83590
|
-
name: 'id-card-reader-eloam',
|
83591
|
-
props: {
|
83592
|
-
label: {
|
83593
|
-
default: '',
|
83594
|
-
type: String
|
83955
|
+
})], 2), _c('el-dialog', {
|
83956
|
+
staticClass: "scanner-camera-dialog",
|
83957
|
+
attrs: {
|
83958
|
+
"title": "影像扫描",
|
83959
|
+
"visible": _vm.dialogVisible,
|
83960
|
+
"width": "60%"
|
83595
83961
|
},
|
83596
|
-
|
83597
|
-
|
83598
|
-
|
83962
|
+
on: {
|
83963
|
+
"update:visible": function ($event) {
|
83964
|
+
_vm.dialogVisible = $event;
|
83965
|
+
}
|
83966
|
+
}
|
83967
|
+
}, [_vm.dialogVisible ? _c('scanner-camera-component', {
|
83968
|
+
attrs: {
|
83969
|
+
"machine-type": _vm.machineType
|
83599
83970
|
},
|
83600
|
-
|
83601
|
-
|
83602
|
-
type: String
|
83971
|
+
on: {
|
83972
|
+
"send-scanner-result": _vm.setScannerResult
|
83603
83973
|
},
|
83604
|
-
|
83605
|
-
|
83606
|
-
|
83974
|
+
scopedSlots: _vm._u([{
|
83975
|
+
key: "action",
|
83976
|
+
fn: function () {
|
83977
|
+
return [_vm._t("right-action")];
|
83978
|
+
},
|
83979
|
+
proxy: true
|
83980
|
+
}], null, true)
|
83981
|
+
}) : _vm._e(), _c('span', {
|
83982
|
+
staticClass: "dialog-footer",
|
83983
|
+
attrs: {
|
83984
|
+
"slot": "footer"
|
83607
83985
|
},
|
83608
|
-
|
83609
|
-
|
83610
|
-
|
83986
|
+
slot: "footer"
|
83987
|
+
}, [_c('el-button', {
|
83988
|
+
attrs: {
|
83989
|
+
"size": "small"
|
83611
83990
|
},
|
83612
|
-
|
83613
|
-
|
83614
|
-
|
83991
|
+
on: {
|
83992
|
+
"click": function ($event) {
|
83993
|
+
_vm.dialogVisible = false;
|
83994
|
+
}
|
83995
|
+
}
|
83996
|
+
}, [_vm._v("取 消")]), _c('el-button', {
|
83997
|
+
attrs: {
|
83998
|
+
"size": "small",
|
83999
|
+
"type": "primary"
|
83615
84000
|
},
|
83616
|
-
|
83617
|
-
|
83618
|
-
|
83619
|
-
|
84001
|
+
on: {
|
84002
|
+
"click": _vm.sendScannerResult
|
84003
|
+
}
|
84004
|
+
}, [_vm._v("确 定")])], 1)], 1)], 1) : _c('scanner-camera-component', {
|
84005
|
+
attrs: {
|
84006
|
+
"machine-type": _vm.machineType
|
83620
84007
|
},
|
83621
|
-
|
83622
|
-
|
83623
|
-
default: false,
|
83624
|
-
type: Boolean
|
84008
|
+
on: {
|
84009
|
+
"send-scanner-result": _vm.setScannerResult
|
83625
84010
|
},
|
83626
|
-
|
83627
|
-
|
83628
|
-
|
83629
|
-
|
84011
|
+
scopedSlots: _vm._u([{
|
84012
|
+
key: "action",
|
84013
|
+
fn: function () {
|
84014
|
+
return [_vm._t("right-action")];
|
84015
|
+
},
|
84016
|
+
proxy: true
|
84017
|
+
}], null, true)
|
84018
|
+
})], 1);
|
84019
|
+
};
|
84020
|
+
var scanner_cameravue_type_template_id_00e9072f_scoped_true_staticRenderFns = [];
|
84021
|
+
|
84022
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=5be6f09e&scoped=true&
|
84023
|
+
var scanner_camera_componentvue_type_template_id_5be6f09e_scoped_true_render = function render() {
|
84024
|
+
var _vm = this,
|
84025
|
+
_c = _vm._self._c;
|
84026
|
+
return _c('div', {
|
84027
|
+
staticClass: "scanner-high-camera-component"
|
84028
|
+
}, [_c('div', {
|
84029
|
+
staticClass: "scanner-result-content"
|
84030
|
+
}, [_c('div', {
|
84031
|
+
staticClass: "content-main flex-1"
|
84032
|
+
}, [_vm.loadSuccess ? _c('div', {
|
84033
|
+
staticClass: "load-success"
|
84034
|
+
}, [_c('img', {
|
84035
|
+
staticStyle: {
|
84036
|
+
"width": "800px",
|
84037
|
+
"height": "600px"
|
83630
84038
|
},
|
83631
|
-
|
83632
|
-
|
83633
|
-
|
84039
|
+
attrs: {
|
84040
|
+
"id": "photo",
|
84041
|
+
"src": _vm.scannerVideoSrc
|
83634
84042
|
}
|
83635
|
-
},
|
83636
|
-
|
83637
|
-
|
83638
|
-
|
83639
|
-
|
83640
|
-
|
84043
|
+
})]) : _c('div', {
|
84044
|
+
staticClass: "load-error"
|
84045
|
+
}, [_c('i', {
|
84046
|
+
staticClass: "el-icon-s-cooperation"
|
84047
|
+
}), _c('p', [_vm._v("请先安装插件")])])]), _c('div', {
|
84048
|
+
staticClass: "handle-action"
|
84049
|
+
}, [_c('el-select', {
|
84050
|
+
staticClass: "select",
|
84051
|
+
attrs: {
|
84052
|
+
"size": "small"
|
84053
|
+
},
|
84054
|
+
on: {
|
84055
|
+
"change": _vm.selectChange
|
84056
|
+
},
|
84057
|
+
model: {
|
84058
|
+
value: _vm.camera,
|
84059
|
+
callback: function ($$v) {
|
84060
|
+
_vm.camera = $$v;
|
84061
|
+
},
|
84062
|
+
expression: "camera"
|
84063
|
+
}
|
84064
|
+
}, _vm._l(_vm.cameras, function (item) {
|
84065
|
+
return _c('el-option', {
|
84066
|
+
key: item.value,
|
84067
|
+
attrs: {
|
84068
|
+
"label": item.name,
|
84069
|
+
"value": item.value
|
83641
84070
|
}
|
83642
|
-
|
83643
|
-
|
83644
|
-
|
83645
|
-
|
83646
|
-
|
83647
|
-
|
84071
|
+
});
|
84072
|
+
}), 1), _vm._l(_vm.buttonList, function (item) {
|
84073
|
+
return [_c('el-button', {
|
84074
|
+
key: item.name,
|
84075
|
+
attrs: {
|
84076
|
+
"type": "primary",
|
84077
|
+
"size": "small"
|
84078
|
+
},
|
84079
|
+
on: {
|
84080
|
+
"click": function ($event) {
|
84081
|
+
return _vm.handleAction(item.name);
|
84082
|
+
}
|
83648
84083
|
}
|
83649
|
-
|
83650
|
-
|
83651
|
-
|
83652
|
-
|
83653
|
-
|
83654
|
-
|
84084
|
+
}, [_vm._v(_vm._s(item.label))]), _vm._t("action")];
|
84085
|
+
})], 2)])]);
|
84086
|
+
};
|
84087
|
+
var scanner_camera_componentvue_type_template_id_5be6f09e_scoped_true_staticRenderFns = [];
|
84088
|
+
|
84089
|
+
;// CONCATENATED MODULE: ./packages/utils/custom-axios.ts
|
84090
|
+
/**
|
84091
|
+
* @author: lvcy
|
84092
|
+
* @date: 2023-06-21
|
84093
|
+
* @description:custom-axios
|
84094
|
+
*/
|
84095
|
+
class custom_axios_CustomAxios {
|
84096
|
+
static startConnect(method, url, data = {}) {
|
84097
|
+
return new Promise((resolve, reject) => {
|
84098
|
+
let xhr = new XMLHttpRequest();
|
84099
|
+
method = method.toUpperCase();
|
84100
|
+
if (method == 'GET') {
|
84101
|
+
let param = ''; //数据拼接字符串
|
84102
|
+
Object.keys(data).forEach(key => {
|
84103
|
+
param += `${key}=${data[key]}&`;
|
84104
|
+
});
|
84105
|
+
param = param.substring(0, param.lastIndexOf('&'));
|
84106
|
+
url = url + '?' + param;
|
84107
|
+
} else if (method == 'POST') {} else {
|
84108
|
+
reject('error method: Currently only supported GET or POST method!');
|
84109
|
+
}
|
84110
|
+
xhr.open(method, url, true);
|
84111
|
+
xhr.setRequestHeader('Accept', 'application/json');
|
84112
|
+
if (method === 'GET') {
|
84113
|
+
xhr.send();
|
84114
|
+
} else {
|
84115
|
+
xhr.send(JSON.stringify(data));
|
84116
|
+
}
|
84117
|
+
xhr.onreadystatechange = function () {
|
84118
|
+
if (this.readyState !== 4) {
|
84119
|
+
return;
|
84120
|
+
}
|
84121
|
+
if (this.status === 200) {
|
84122
|
+
let obj = this.response;
|
84123
|
+
if (typeof obj !== 'object') {
|
84124
|
+
obj = JSON.parse(obj);
|
84125
|
+
}
|
84126
|
+
resolve(obj);
|
84127
|
+
} else {
|
84128
|
+
reject(xhr);
|
84129
|
+
}
|
84130
|
+
};
|
84131
|
+
});
|
84132
|
+
}
|
84133
|
+
static async get(url) {
|
84134
|
+
let res = await custom_axios_CustomAxios.startConnect('GET', url);
|
84135
|
+
return res;
|
84136
|
+
}
|
84137
|
+
static async post(url, data) {
|
84138
|
+
let res = await custom_axios_CustomAxios.startConnect('POST', url, data);
|
84139
|
+
return res;
|
84140
|
+
}
|
84141
|
+
}
|
84142
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/eloam-plugin.service.ts
|
84143
|
+
|
84144
|
+
/**
|
84145
|
+
* @author: lvcy
|
84146
|
+
* @date: 2023-06-21
|
84147
|
+
* @description:良田高拍仪
|
84148
|
+
*/
|
84149
|
+
|
84150
|
+
var eloam_plugin_service_ELoamMethodCode;
|
84151
|
+
(function (ELoamMethodCode) {
|
84152
|
+
/** 扫描-主摄像头 */
|
84153
|
+
ELoamMethodCode["ScannerMainCamera_Base64"] = "ScannerMainCamera_Base64";
|
84154
|
+
/** 扫描-副摄像头 */
|
84155
|
+
ELoamMethodCode["ScannerSecondaryCamera_Base64"] = "ScannerSecondaryCamera_Base64";
|
84156
|
+
/** 读取二代身份证 */
|
84157
|
+
ELoamMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
84158
|
+
})(eloam_plugin_service_ELoamMethodCode || (eloam_plugin_service_ELoamMethodCode = {}));
|
84159
|
+
const eloam_plugin_service_ELoamMethodDesc = {
|
84160
|
+
[eloam_plugin_service_ELoamMethodCode.ScannerMainCamera_Base64]: '扫描',
|
84161
|
+
[eloam_plugin_service_ELoamMethodCode.ScannerSecondaryCamera_Base64]: '拍照',
|
84162
|
+
[eloam_plugin_service_ELoamMethodCode.ReadIDCard_Base64]: '读取二代身份证'
|
84163
|
+
};
|
84164
|
+
class eloam_plugin_service_ELoamPassService {
|
84165
|
+
/** 主摄像头地址 */
|
84166
|
+
static get mainCameraUrl() {
|
84167
|
+
return this.baseServiceUrl + '/video=stream&camidx=0';
|
84168
|
+
}
|
84169
|
+
/** 副摄像头地址 */
|
84170
|
+
static get secondaryCameraUrl() {
|
84171
|
+
return this.baseServiceUrl + '/video=stream&camidx=1';
|
84172
|
+
}
|
84173
|
+
static async read(method) {
|
84174
|
+
let param = {},
|
84175
|
+
url = '';
|
84176
|
+
switch (method) {
|
84177
|
+
case eloam_plugin_service_ELoamMethodCode.ScannerMainCamera_Base64:
|
84178
|
+
// rotate: 旋转角度;deskew:纠偏,主摄像头1,副摄像头0 camidx:主摄像头0,副摄像头1;ColorMode:quality
|
84179
|
+
url = this.baseServiceUrl + '/video=grabimage';
|
84180
|
+
param = {
|
84181
|
+
filepath: "base64",
|
84182
|
+
rotate: "0",
|
84183
|
+
deskew: "1",
|
84184
|
+
camidx: "0",
|
84185
|
+
ColorMode: "0",
|
84186
|
+
quality: "0"
|
84187
|
+
};
|
84188
|
+
break;
|
84189
|
+
case eloam_plugin_service_ELoamMethodCode.ScannerSecondaryCamera_Base64:
|
84190
|
+
// rotate: 旋转角度,;deskew:纠偏,主摄像头1,副摄像头0 camidx:主摄像头0,副摄像头1;ColorMode:quality
|
84191
|
+
url = this.baseServiceUrl + '/video=grabimage';
|
84192
|
+
param = {
|
84193
|
+
filepath: "base64",
|
84194
|
+
rotate: "0",
|
84195
|
+
deskew: "0",
|
84196
|
+
camidx: "1",
|
84197
|
+
ColorMode: "0",
|
84198
|
+
quality: "0"
|
84199
|
+
};
|
84200
|
+
break;
|
84201
|
+
case eloam_plugin_service_ELoamMethodCode.ReadIDCard_Base64:
|
84202
|
+
url = this.baseServiceUrl + '/card=idcard';
|
84203
|
+
break;
|
84204
|
+
}
|
84205
|
+
let res = await custom_axios_CustomAxios.post(url, param);
|
84206
|
+
return res;
|
84207
|
+
}
|
84208
|
+
/** 主摄像头拍照 */
|
84209
|
+
static async scanByMainCamera() {
|
84210
|
+
const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerMainCamera_Base64);
|
84211
|
+
return res.photoBase64;
|
84212
|
+
}
|
84213
|
+
/** 副摄像头拍照 */
|
84214
|
+
static async scanBySecondaryCamera() {
|
84215
|
+
const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerSecondaryCamera_Base64);
|
84216
|
+
return res.photoBase64;
|
84217
|
+
}
|
84218
|
+
static async scanByCamera(type) {
|
84219
|
+
switch (type) {
|
84220
|
+
case "main":
|
84221
|
+
return this.scanByMainCamera();
|
84222
|
+
case 'vice':
|
84223
|
+
return this.scanBySecondaryCamera();
|
84224
|
+
}
|
84225
|
+
}
|
84226
|
+
/** 读取身份证 */
|
84227
|
+
static async idCardRead() {
|
84228
|
+
const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ReadIDCard_Base64);
|
84229
|
+
let {
|
84230
|
+
name,
|
84231
|
+
sex,
|
84232
|
+
birthday,
|
84233
|
+
address,
|
84234
|
+
cardID,
|
84235
|
+
nationCode,
|
84236
|
+
photoBase64,
|
84237
|
+
issueOrgan,
|
84238
|
+
validStart,
|
84239
|
+
validEnd
|
84240
|
+
} = res.IDCardInfo;
|
84241
|
+
const IDCardData = {
|
84242
|
+
info: {
|
84243
|
+
name,
|
84244
|
+
sex,
|
84245
|
+
birthday: birthday.replace('-', '').replace('-', ''),
|
84246
|
+
address,
|
84247
|
+
cardId: cardID,
|
84248
|
+
nation: nationCode,
|
84249
|
+
police: issueOrgan,
|
84250
|
+
validStart,
|
84251
|
+
validEnd
|
84252
|
+
},
|
84253
|
+
headImage: photoBase64
|
84254
|
+
};
|
84255
|
+
return IDCardData;
|
84256
|
+
}
|
84257
|
+
}
|
84258
|
+
_defineProperty(eloam_plugin_service_ELoamPassService, "baseServiceUrl", 'http://127.0.0.1:38088');
|
84259
|
+
;// CONCATENATED MODULE: ./packages/model/common-message.ts
|
84260
|
+
|
84261
|
+
/**
|
84262
|
+
* @author: lvcy
|
84263
|
+
* @date: 2023-07-25
|
84264
|
+
* @description:common-message
|
84265
|
+
*/
|
84266
|
+
const SCANNER_CAMERA_REFRESH_PHOTO_EVENT = 'scanner-camera-refresh-photo-event';
|
84267
|
+
class ScannerCameraRefreshPhotoEvent extends Event {
|
84268
|
+
constructor(url) {
|
84269
|
+
super(SCANNER_CAMERA_REFRESH_PHOTO_EVENT);
|
84270
|
+
_defineProperty(this, "scannerResultUrl", '');
|
84271
|
+
this.scannerResultUrl = url;
|
84272
|
+
}
|
84273
|
+
}
|
84274
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/jie-yu-plugin.service.ts
|
84275
|
+
|
84276
|
+
|
84277
|
+
|
84278
|
+
/**
|
84279
|
+
* @author: lvcy
|
84280
|
+
* @date: 2023-07-24
|
84281
|
+
* @description:捷宇高拍仪
|
84282
|
+
*/
|
84283
|
+
var JieYuMethodCode;
|
84284
|
+
(function (JieYuMethodCode) {
|
84285
|
+
/** 扫描-主摄像头 */
|
84286
|
+
JieYuMethodCode["ScannerMainCamera_Base64"] = "vSetResolution(8)";
|
84287
|
+
/** 扫描-副摄像头 */
|
84288
|
+
JieYuMethodCode["ScannerSecondaryCamera_Base64"] = "bStartPlay2";
|
84289
|
+
JieYuMethodCode["TakePhoto_Base64"] = "bSaveJPG(D:\\,Photo)";
|
84290
|
+
})(JieYuMethodCode || (JieYuMethodCode = {}));
|
84291
|
+
const JieYuMethodDesc = {
|
84292
|
+
[JieYuMethodCode.ScannerMainCamera_Base64]: '扫描',
|
84293
|
+
[JieYuMethodCode.ScannerSecondaryCamera_Base64]: '拍照'
|
84294
|
+
};
|
84295
|
+
class JieYueService {
|
84296
|
+
static startConnect() {
|
84297
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84298
|
+
return this;
|
84299
|
+
}
|
84300
|
+
const ws = new WebSocket(this.scannerCameraUrl);
|
84301
|
+
let resolved;
|
84302
|
+
const onConnect = new Promise(resolve => {
|
84303
|
+
resolved = resolve;
|
84304
|
+
});
|
84305
|
+
ws.onopen = () => {
|
84306
|
+
resolved(true);
|
84307
|
+
};
|
84308
|
+
ws.onmessage = event => {
|
84309
|
+
this.handleMessage(event);
|
84310
|
+
};
|
84311
|
+
ws.onclose = () => this.handleClose();
|
84312
|
+
ws.onerror = () => this.handleError();
|
84313
|
+
this.ws = ws;
|
84314
|
+
return onConnect;
|
84315
|
+
}
|
84316
|
+
static handleError() {
|
84317
|
+
for (const type in this.requestStore) {
|
84318
|
+
this.requestStore.forEach(({
|
84319
|
+
reject
|
84320
|
+
}) => {
|
84321
|
+
reject('handleError');
|
84322
|
+
});
|
84323
|
+
}
|
84324
|
+
throw Error('捷宇高拍仪设备功能加载失败');
|
84325
|
+
}
|
84326
|
+
static handleClose() {
|
84327
|
+
for (const type in this.requestStore) {
|
84328
|
+
this.requestStore.forEach(({
|
84329
|
+
reject
|
84330
|
+
}) => {
|
84331
|
+
reject('close');
|
84332
|
+
});
|
84333
|
+
}
|
84334
|
+
}
|
84335
|
+
static handleMessage(msg) {
|
84336
|
+
let data = msg.data;
|
84337
|
+
if (!data.startsWith('BarCode') && !data.startsWith('Begin')) {
|
84338
|
+
const event = new ScannerCameraRefreshPhotoEvent(data);
|
84339
|
+
return window.dispatchEvent(event);
|
84340
|
+
}
|
84341
|
+
//
|
84342
|
+
//
|
84343
|
+
// this.requestStore.forEach(({ resolve }: PromiseStore) => {
|
84344
|
+
// resolve(data)
|
84345
|
+
// });
|
84346
|
+
// this.requestStore = [];
|
84347
|
+
}
|
84348
|
+
/**
|
84349
|
+
* 发送请求
|
84350
|
+
*/
|
84351
|
+
static async read(type) {
|
84352
|
+
await this.startConnect();
|
84353
|
+
if (this.ws.readyState === 1) {
|
84354
|
+
let method = '';
|
84355
|
+
switch (type) {
|
84356
|
+
case 'main':
|
84357
|
+
this.ws.send('bStartPlay()');
|
84358
|
+
method = JieYuMethodCode.ScannerMainCamera_Base64;
|
84359
|
+
break;
|
84360
|
+
case 'vice':
|
84361
|
+
method = JieYuMethodCode.ScannerSecondaryCamera_Base64;
|
84362
|
+
break;
|
84363
|
+
case 'takePhoto':
|
84364
|
+
method = JieYuMethodCode.TakePhoto_Base64;
|
84365
|
+
}
|
84366
|
+
this.ws.send(method);
|
84367
|
+
return new Promise((resolve, reject) => {
|
84368
|
+
if (!this.requestStore) {
|
84369
|
+
this.requestStore = [];
|
84370
|
+
}
|
84371
|
+
this.requestStore.push({
|
84372
|
+
resolve,
|
84373
|
+
reject
|
84374
|
+
});
|
84375
|
+
});
|
84376
|
+
} else {
|
84377
|
+
throw Error('设备未准备完成');
|
84378
|
+
}
|
84379
|
+
}
|
84380
|
+
static async turnOnTheCamera(type) {
|
84381
|
+
if (this.ws) this.ws.close();
|
84382
|
+
await JieYueService.read(type);
|
84383
|
+
}
|
84384
|
+
static async scanByCamera() {
|
84385
|
+
console.log(this.ws);
|
84386
|
+
if (this.ws) this.ws.close();
|
84387
|
+
await JieYueService.read('takePhoto');
|
84388
|
+
}
|
84389
|
+
}
|
84390
|
+
_defineProperty(JieYueService, "scannerCameraUrl", 'ws://127.0.0.1:1818');
|
84391
|
+
_defineProperty(JieYueService, "ws", void 0);
|
84392
|
+
_defineProperty(JieYueService, "requestStore", []);
|
84393
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
84394
|
+
|
84395
|
+
|
84396
|
+
|
84397
|
+
const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/jpg;base64,';
|
84398
|
+
/* harmony default export */ var scanner_camera_componentvue_type_script_lang_js_ = ({
|
84399
|
+
name: "scanner-camera-component",
|
84400
|
+
props: {
|
84401
|
+
/**
|
84402
|
+
* 0-捷宇;5-良田
|
84403
|
+
*/
|
84404
|
+
machineType: {
|
84405
|
+
//
|
84406
|
+
default: 0,
|
84407
|
+
type: Number
|
84408
|
+
}
|
84409
|
+
},
|
84410
|
+
data: () => {
|
84411
|
+
return {
|
84412
|
+
scannerVideoSrc: '',
|
84413
|
+
scannerResultSrc: '',
|
84414
|
+
loadSuccess: true,
|
84415
|
+
camera: 0,
|
84416
|
+
cameras: [{
|
84417
|
+
name: '文档',
|
84418
|
+
value: 0
|
84419
|
+
}, {
|
84420
|
+
name: '照片',
|
84421
|
+
value: 1
|
84422
|
+
}],
|
84423
|
+
buttonList: [{
|
84424
|
+
label: '拍照',
|
84425
|
+
name: 'take-pictures'
|
84426
|
+
}]
|
84427
|
+
};
|
84428
|
+
},
|
84429
|
+
watch: {
|
84430
|
+
'machineType': function () {
|
84431
|
+
let handleName = this.camera === 1 ? 'start-vice' : 'start-main';
|
84432
|
+
this.handleAction(handleName);
|
84433
|
+
}
|
84434
|
+
},
|
84435
|
+
created() {
|
84436
|
+
this.handleAction('start-main');
|
84437
|
+
window.addEventListener(SCANNER_CAMERA_REFRESH_PHOTO_EVENT, message => {
|
84438
|
+
if (message.type === SCANNER_CAMERA_REFRESH_PHOTO_EVENT) {
|
84439
|
+
this.scannerVideoSrc = `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${message.scannerResultUrl}`;
|
84440
|
+
}
|
84441
|
+
});
|
84442
|
+
},
|
84443
|
+
methods: {
|
84444
|
+
/**
|
84445
|
+
* 切换扫描、拍照
|
84446
|
+
* @param val
|
84447
|
+
*/
|
84448
|
+
selectChange(val) {
|
84449
|
+
let handleName = val === 1 ? 'start-vice' : 'start-main';
|
84450
|
+
this.handleAction(handleName);
|
84451
|
+
},
|
84452
|
+
/**
|
84453
|
+
* 拍照
|
84454
|
+
*/
|
84455
|
+
async takePictures() {
|
84456
|
+
switch (this.machineType) {
|
84457
|
+
case 0:
|
84458
|
+
{
|
84459
|
+
await JieYueService.scanByCamera();
|
84460
|
+
console.log('拍照');
|
84461
|
+
this.$emit('send-scanner-result', this.scannerVideoSrc);
|
84462
|
+
}
|
84463
|
+
break;
|
84464
|
+
case 5:
|
84465
|
+
{
|
84466
|
+
let type = this.camera === 0 ? 'main' : 'vice';
|
84467
|
+
const res = await eloam_plugin_service_ELoamPassService.scanByCamera(type);
|
84468
|
+
this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res}`);
|
84469
|
+
}
|
84470
|
+
}
|
84471
|
+
},
|
84472
|
+
/**
|
84473
|
+
* 主摄像头
|
84474
|
+
*/
|
84475
|
+
async handleStartMain() {
|
84476
|
+
switch (this.machineType) {
|
84477
|
+
case 0:
|
84478
|
+
await JieYueService.turnOnTheCamera('main');
|
84479
|
+
break;
|
84480
|
+
case 5:
|
84481
|
+
// 良田
|
84482
|
+
this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.mainCameraUrl;
|
84483
|
+
break;
|
84484
|
+
}
|
84485
|
+
},
|
84486
|
+
/**
|
84487
|
+
* 副摄像头
|
84488
|
+
*/
|
84489
|
+
async handleStartVice() {
|
84490
|
+
switch (this.machineType) {
|
84491
|
+
case 0:
|
84492
|
+
await JieYueService.turnOnTheCamera('vice');
|
84493
|
+
break;
|
84494
|
+
case 5:
|
84495
|
+
// 良田
|
84496
|
+
this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.secondaryCameraUrl;
|
84497
|
+
break;
|
84498
|
+
}
|
84499
|
+
},
|
84500
|
+
handleAction(name) {
|
84501
|
+
switch (name) {
|
84502
|
+
case 'start-main':
|
84503
|
+
// 主摄像头
|
84504
|
+
this.handleStartMain();
|
84505
|
+
break;
|
84506
|
+
case 'start-vice':
|
84507
|
+
// 副摄像头
|
84508
|
+
this.handleStartVice();
|
84509
|
+
break;
|
84510
|
+
case 'take-pictures':
|
84511
|
+
// 拍照
|
84512
|
+
this.takePictures();
|
84513
|
+
break;
|
84514
|
+
}
|
84515
|
+
}
|
84516
|
+
}
|
84517
|
+
});
|
84518
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
84519
|
+
/* harmony default export */ var component_scanner_camera_componentvue_type_script_lang_js_ = (scanner_camera_componentvue_type_script_lang_js_);
|
84520
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue
|
84521
|
+
|
84522
|
+
|
84523
|
+
|
84524
|
+
|
84525
|
+
|
84526
|
+
/* normalize component */
|
84527
|
+
;
|
84528
|
+
var scanner_camera_component_component = normalizeComponent(
|
84529
|
+
component_scanner_camera_componentvue_type_script_lang_js_,
|
84530
|
+
scanner_camera_componentvue_type_template_id_5be6f09e_scoped_true_render,
|
84531
|
+
scanner_camera_componentvue_type_template_id_5be6f09e_scoped_true_staticRenderFns,
|
84532
|
+
false,
|
84533
|
+
null,
|
84534
|
+
"5be6f09e",
|
84535
|
+
null
|
84536
|
+
|
84537
|
+
)
|
84538
|
+
|
84539
|
+
/* harmony default export */ var scanner_camera_component = (scanner_camera_component_component.exports);
|
84540
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/scanner-camera.vue?vue&type=script&lang=js&
|
84541
|
+
|
84542
|
+
|
84543
|
+
/* harmony default export */ var scanner_cameravue_type_script_lang_js_ = ({
|
84544
|
+
name: "scanner-camera",
|
84545
|
+
components: {
|
84546
|
+
ScannerCameraComponent: scanner_camera_component
|
84547
|
+
},
|
84548
|
+
props: {
|
84549
|
+
/**
|
84550
|
+
* 0-捷宇;5-良田
|
84551
|
+
*/
|
84552
|
+
machineType: {
|
84553
|
+
//
|
84554
|
+
default: 0,
|
84555
|
+
type: Number
|
84556
|
+
},
|
84557
|
+
openMode: {
|
84558
|
+
default: '',
|
84559
|
+
type: String
|
84560
|
+
},
|
84561
|
+
label: {
|
84562
|
+
default: '',
|
84563
|
+
type: String
|
84564
|
+
},
|
84565
|
+
tip: {
|
84566
|
+
default: '',
|
84567
|
+
type: String
|
84568
|
+
},
|
84569
|
+
className: {
|
84570
|
+
default: '',
|
84571
|
+
type: String
|
84572
|
+
},
|
84573
|
+
size: {
|
84574
|
+
default: '',
|
84575
|
+
type: String
|
84576
|
+
},
|
84577
|
+
type: {
|
84578
|
+
default: '',
|
84579
|
+
type: String
|
84580
|
+
},
|
84581
|
+
plain: {
|
84582
|
+
default: false,
|
84583
|
+
type: Boolean
|
84584
|
+
},
|
84585
|
+
round: {
|
84586
|
+
default: false,
|
84587
|
+
type: Boolean
|
84588
|
+
},
|
84589
|
+
loading: {
|
84590
|
+
default: false,
|
84591
|
+
type: Boolean
|
84592
|
+
},
|
84593
|
+
icon: {
|
84594
|
+
default: '',
|
84595
|
+
type: String
|
84596
|
+
},
|
84597
|
+
disabled: {
|
84598
|
+
default: false,
|
84599
|
+
type: Boolean
|
84600
|
+
}
|
84601
|
+
},
|
84602
|
+
data: () => {
|
84603
|
+
return {
|
84604
|
+
dialogVisible: false,
|
84605
|
+
scannerResult: ''
|
84606
|
+
};
|
84607
|
+
},
|
84608
|
+
computed: {
|
84609
|
+
_className() {
|
84610
|
+
const classBase = ['z-button'];
|
84611
|
+
if (this.type === 'text') {
|
84612
|
+
classBase.push('i-font-size');
|
84613
|
+
}
|
84614
|
+
if (!this.className) {
|
84615
|
+
return classBase;
|
84616
|
+
} else if (typeof this.className === 'string') {
|
84617
|
+
classBase.push(this.className);
|
84618
|
+
} else {
|
84619
|
+
classBase.push(...this.className);
|
84620
|
+
}
|
84621
|
+
return classBase;
|
84622
|
+
}
|
84623
|
+
},
|
84624
|
+
methods: {
|
84625
|
+
openScanDialog() {
|
84626
|
+
this.dialogVisible = true;
|
84627
|
+
},
|
84628
|
+
setScannerResult(src) {
|
84629
|
+
this.scannerResult = src;
|
84630
|
+
if (this.openMode !== 'dialog') {
|
84631
|
+
this.$emit('send-scanner-result', this.scannerResult);
|
84632
|
+
}
|
84633
|
+
},
|
84634
|
+
sendScannerResult() {
|
84635
|
+
if (this.scannerResult) {
|
84636
|
+
this.$emit('send-scanner-result', this.scannerResult);
|
84637
|
+
this.dialogVisible = false;
|
84638
|
+
}
|
84639
|
+
}
|
84640
|
+
}
|
84641
|
+
});
|
84642
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/scanner-camera.vue?vue&type=script&lang=js&
|
84643
|
+
/* harmony default export */ var src_scanner_cameravue_type_script_lang_js_ = (scanner_cameravue_type_script_lang_js_);
|
84644
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/scanner-camera.vue?vue&type=style&index=0&id=00e9072f&prod&scoped=true&lang=scss&
|
84645
|
+
// extracted by mini-css-extract-plugin
|
84646
|
+
|
84647
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/scanner-camera.vue?vue&type=style&index=0&id=00e9072f&prod&scoped=true&lang=scss&
|
84648
|
+
|
84649
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/scanner-camera.vue
|
84650
|
+
|
84651
|
+
|
84652
|
+
|
84653
|
+
;
|
84654
|
+
|
84655
|
+
|
84656
|
+
/* normalize component */
|
84657
|
+
|
84658
|
+
var src_scanner_camera_component = normalizeComponent(
|
84659
|
+
src_scanner_cameravue_type_script_lang_js_,
|
84660
|
+
scanner_cameravue_type_template_id_00e9072f_scoped_true_render,
|
84661
|
+
scanner_cameravue_type_template_id_00e9072f_scoped_true_staticRenderFns,
|
84662
|
+
false,
|
84663
|
+
null,
|
84664
|
+
"00e9072f",
|
84665
|
+
null
|
84666
|
+
|
84667
|
+
)
|
84668
|
+
|
84669
|
+
/* harmony default export */ var scanner_camera = (src_scanner_camera_component.exports);
|
84670
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/index.js
|
84671
|
+
/**
|
84672
|
+
* @author: lvcy
|
84673
|
+
* @date: 2023-07-24
|
84674
|
+
* @description:index
|
84675
|
+
*/
|
84676
|
+
|
84677
|
+
scanner_camera.install = Vue => {
|
84678
|
+
Vue.component(scanner_camera.name, scanner_camera);
|
84679
|
+
};
|
84680
|
+
/* harmony default export */ var scanner_scanner_camera = (scanner_camera);
|
84681
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-eloam/src/id-card-reader-eloam.vue?vue&type=template&id=5b7ce781&scoped=true&
|
84682
|
+
var id_card_reader_eloamvue_type_template_id_5b7ce781_scoped_true_render = function render() {
|
84683
|
+
var _vm = this,
|
84684
|
+
_c = _vm._self._c;
|
84685
|
+
return _vm.tip ? _c('el-tooltip', {
|
84686
|
+
staticClass: "id-card-reader-eloam",
|
84687
|
+
attrs: {
|
84688
|
+
"content": _vm.tip,
|
84689
|
+
"placement": "top"
|
84690
|
+
}
|
84691
|
+
}, [_c('el-button', _vm._b({
|
84692
|
+
on: {
|
84693
|
+
"click": _vm.handleClick
|
84694
|
+
}
|
84695
|
+
}, 'el-button', {
|
84696
|
+
disabled: _vm.disabled,
|
84697
|
+
icon: _vm.icon,
|
84698
|
+
loading: _vm.loading,
|
84699
|
+
plain: _vm.plain,
|
84700
|
+
round: _vm.round,
|
84701
|
+
size: _vm.size,
|
84702
|
+
type: _vm.type,
|
84703
|
+
class: _vm._className
|
84704
|
+
}, false), [_vm._t("default", function () {
|
84705
|
+
return [_vm._v(_vm._s(_vm.label))];
|
84706
|
+
})], 2)], 1) : _c('el-button', _vm._b({
|
84707
|
+
on: {
|
84708
|
+
"click": _vm.handleClick
|
84709
|
+
}
|
84710
|
+
}, 'el-button', {
|
84711
|
+
disabled: _vm.disabled,
|
84712
|
+
icon: _vm.icon,
|
84713
|
+
loading: _vm.loading,
|
84714
|
+
plain: _vm.plain,
|
84715
|
+
round: _vm.round,
|
84716
|
+
size: _vm.size,
|
84717
|
+
type: _vm.type,
|
84718
|
+
class: _vm._className
|
84719
|
+
}, false), [_vm._t("default", function () {
|
84720
|
+
return [_vm._v(_vm._s(_vm.label))];
|
84721
|
+
})], 2);
|
84722
|
+
};
|
84723
|
+
var id_card_reader_eloamvue_type_template_id_5b7ce781_scoped_true_staticRenderFns = [];
|
84724
|
+
|
84725
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-eloam/src/id-card-reader-eloam.vue?vue&type=script&lang=js&
|
84726
|
+
|
84727
|
+
|
84728
|
+
/* harmony default export */ var id_card_reader_eloamvue_type_script_lang_js_ = ({
|
84729
|
+
name: 'id-card-reader-eloam',
|
84730
|
+
props: {
|
84731
|
+
label: {
|
84732
|
+
default: '',
|
84733
|
+
type: String
|
84734
|
+
},
|
84735
|
+
tip: {
|
84736
|
+
default: '',
|
84737
|
+
type: String
|
84738
|
+
},
|
84739
|
+
className: {
|
84740
|
+
default: '',
|
84741
|
+
type: String
|
84742
|
+
},
|
84743
|
+
size: {
|
84744
|
+
default: 'mini',
|
84745
|
+
type: String
|
84746
|
+
},
|
84747
|
+
type: {
|
84748
|
+
default: 'primary',
|
84749
|
+
type: String
|
84750
|
+
},
|
84751
|
+
plain: {
|
84752
|
+
default: false,
|
84753
|
+
type: Boolean
|
84754
|
+
},
|
84755
|
+
/** Determine whether it's a round button */
|
84756
|
+
round: {
|
84757
|
+
default: false,
|
84758
|
+
type: Boolean
|
84759
|
+
},
|
84760
|
+
/** Determine whether it's loading */
|
84761
|
+
loading: {
|
84762
|
+
default: false,
|
84763
|
+
type: Boolean
|
84764
|
+
},
|
84765
|
+
/** Button icon, accepts an icon name of Element icon component */
|
84766
|
+
icon: {
|
84767
|
+
default: 'el-icon-postcard',
|
84768
|
+
type: String
|
84769
|
+
},
|
84770
|
+
disabled: {
|
84771
|
+
default: false,
|
84772
|
+
type: Boolean
|
84773
|
+
}
|
84774
|
+
},
|
84775
|
+
computed: {
|
84776
|
+
_className() {
|
84777
|
+
const classBase = ['z-button'];
|
84778
|
+
if (this.type === 'text') {
|
84779
|
+
classBase.push('i-font-size');
|
84780
|
+
}
|
84781
|
+
if (!this.className) {
|
84782
|
+
return classBase;
|
84783
|
+
} else if (typeof this.className === 'string') {
|
84784
|
+
classBase.push(this.className);
|
84785
|
+
} else {
|
84786
|
+
classBase.push(...this.className);
|
84787
|
+
}
|
84788
|
+
return classBase;
|
84789
|
+
}
|
84790
|
+
},
|
84791
|
+
methods: {
|
84792
|
+
async handleClick() {
|
84793
|
+
let res = await ELoamPassService.idCardRead();
|
83655
84794
|
this.$emit('click', res);
|
83656
84795
|
}
|
83657
84796
|
}
|
83658
84797
|
});
|
83659
|
-
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-eloam/src/id-card-reader-eloam.vue?vue&type=script&lang=js&
|
83660
|
-
/* harmony default export */ var src_id_card_reader_eloamvue_type_script_lang_js_ = (id_card_reader_eloamvue_type_script_lang_js_);
|
83661
|
-
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-eloam/src/id-card-reader-eloam.vue
|
84798
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-eloam/src/id-card-reader-eloam.vue?vue&type=script&lang=js&
|
84799
|
+
/* harmony default export */ var src_id_card_reader_eloamvue_type_script_lang_js_ = (id_card_reader_eloamvue_type_script_lang_js_);
|
84800
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-eloam/src/id-card-reader-eloam.vue
|
84801
|
+
|
84802
|
+
|
84803
|
+
|
84804
|
+
|
84805
|
+
|
84806
|
+
/* normalize component */
|
84807
|
+
;
|
84808
|
+
var id_card_reader_eloam_component = normalizeComponent(
|
84809
|
+
src_id_card_reader_eloamvue_type_script_lang_js_,
|
84810
|
+
id_card_reader_eloamvue_type_template_id_5b7ce781_scoped_true_render,
|
84811
|
+
id_card_reader_eloamvue_type_template_id_5b7ce781_scoped_true_staticRenderFns,
|
84812
|
+
false,
|
84813
|
+
null,
|
84814
|
+
"5b7ce781",
|
84815
|
+
null
|
84816
|
+
|
84817
|
+
)
|
84818
|
+
|
84819
|
+
/* harmony default export */ var id_card_reader_eloam = (id_card_reader_eloam_component.exports);
|
84820
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-eloam/index.js
|
84821
|
+
|
84822
|
+
|
84823
|
+
// 组件的install方法用于按需引入
|
84824
|
+
// @ts-ignore
|
84825
|
+
id_card_reader_eloam.install = Vue => {
|
84826
|
+
Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
|
84827
|
+
};
|
84828
|
+
/* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
|
84829
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=template&id=6bdb0354&scoped=true&
|
84830
|
+
var id_card_reader_buttonvue_type_template_id_6bdb0354_scoped_true_render = function render() {
|
84831
|
+
var _vm = this,
|
84832
|
+
_c = _vm._self._c;
|
84833
|
+
return _vm.tip ? _c('el-tooltip', {
|
84834
|
+
staticClass: "id-card-reader-button",
|
84835
|
+
attrs: {
|
84836
|
+
"content": _vm.tip,
|
84837
|
+
"placement": "top"
|
84838
|
+
}
|
84839
|
+
}, [_vm.showIDCardChrome ? _c('embed', {
|
84840
|
+
attrs: {
|
84841
|
+
"clsid": "{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",
|
84842
|
+
"type": "application/x-itst-activex",
|
84843
|
+
"width": "0",
|
84844
|
+
"height": "0",
|
84845
|
+
"name": "IDCard_chrome",
|
84846
|
+
"id": "IDCard_chrome"
|
84847
|
+
}
|
84848
|
+
}) : _vm._e(), _c('el-button', _vm._b({
|
84849
|
+
on: {
|
84850
|
+
"click": _vm.handleClick
|
84851
|
+
}
|
84852
|
+
}, 'el-button', {
|
84853
|
+
disabled: _vm.disabled,
|
84854
|
+
icon: _vm.icon,
|
84855
|
+
loading: _vm.loading,
|
84856
|
+
plain: _vm.plain,
|
84857
|
+
round: _vm.round,
|
84858
|
+
size: _vm.size,
|
84859
|
+
type: _vm.type,
|
84860
|
+
class: _vm._className
|
84861
|
+
}, false), [_vm._t("default", function () {
|
84862
|
+
return [_vm._v(_vm._s(_vm.label))];
|
84863
|
+
})], 2)], 1) : _c('el-button', _vm._b({
|
84864
|
+
on: {
|
84865
|
+
"click": _vm.handleClick
|
84866
|
+
}
|
84867
|
+
}, 'el-button', {
|
84868
|
+
disabled: _vm.disabled,
|
84869
|
+
icon: _vm.icon,
|
84870
|
+
loading: _vm.loading,
|
84871
|
+
plain: _vm.plain,
|
84872
|
+
round: _vm.round,
|
84873
|
+
size: _vm.size,
|
84874
|
+
type: _vm.type,
|
84875
|
+
class: _vm._className
|
84876
|
+
}, false), [_vm.showIDCardChrome ? _c('embed', {
|
84877
|
+
attrs: {
|
84878
|
+
"clsid": "{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",
|
84879
|
+
"type": "application/x-itst-activex",
|
84880
|
+
"width": "0",
|
84881
|
+
"height": "0",
|
84882
|
+
"name": "IDCard_chrome",
|
84883
|
+
"id": "IDCard_chrome"
|
84884
|
+
}
|
84885
|
+
}) : _vm._e(), _vm._t("default", function () {
|
84886
|
+
return [_vm._v(_vm._s(_vm.label))];
|
84887
|
+
})], 2);
|
84888
|
+
};
|
84889
|
+
var id_card_reader_buttonvue_type_template_id_6bdb0354_scoped_true_staticRenderFns = [];
|
84890
|
+
|
84891
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
|
84892
|
+
|
84893
|
+
|
84894
|
+
/**
|
84895
|
+
* 默认设备
|
84896
|
+
* 读卡器:普天、精伦
|
84897
|
+
* 签字版:有为签字、汉王签字
|
84898
|
+
* */
|
84899
|
+
var PluginApiType;
|
84900
|
+
(function (PluginApiType) {
|
84901
|
+
/**读取二代身份证信息 */
|
84902
|
+
PluginApiType["idcard"] = "sfz";
|
84903
|
+
/**精伦身份证*/
|
84904
|
+
PluginApiType["jlsfz"] = "jlsfz";
|
84905
|
+
/**读取人脸识别信息 */
|
84906
|
+
PluginApiType["camera"] = "sxt";
|
84907
|
+
/**有为签字 */
|
84908
|
+
PluginApiType["ywSign"] = "yw";
|
84909
|
+
/**汉王签字 */
|
84910
|
+
PluginApiType["hwSign"] = "hwsign";
|
84911
|
+
})(PluginApiType || (PluginApiType = {}));
|
84912
|
+
class IdCardReadService {
|
84913
|
+
// 精伦身份证 JLSFZManage
|
84914
|
+
// 之前 SFZManage
|
84915
|
+
|
84916
|
+
static startConnect(type = PluginApiType.idcard) {
|
84917
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84918
|
+
return this;
|
84919
|
+
}
|
84920
|
+
let webSocketUrl = this.idcardWebSocketUrl;
|
84921
|
+
switch (type) {
|
84922
|
+
case PluginApiType.idcard:
|
84923
|
+
webSocketUrl = this.idcardWebSocketUrl;
|
84924
|
+
break;
|
84925
|
+
case PluginApiType.jlsfz:
|
84926
|
+
webSocketUrl = this.jlsfzWebSocketUrl;
|
84927
|
+
}
|
84928
|
+
const ws = new WebSocket(webSocketUrl);
|
84929
|
+
let resolved;
|
84930
|
+
const onConnect = new Promise(resolve => {
|
84931
|
+
resolved = resolve;
|
84932
|
+
});
|
84933
|
+
ws.onopen = () => {
|
84934
|
+
resolved(true);
|
84935
|
+
};
|
84936
|
+
ws.onmessage = event => this.handleMessage(event);
|
84937
|
+
ws.onclose = () => this.handleClose();
|
84938
|
+
ws.onerror = () => this.handleError();
|
84939
|
+
this.ws = ws;
|
84940
|
+
return onConnect;
|
84941
|
+
}
|
84942
|
+
static handleError() {
|
84943
|
+
for (const type in this.requestStore) {
|
84944
|
+
this.requestStore.forEach(({
|
84945
|
+
reject
|
84946
|
+
}) => {
|
84947
|
+
reject('handleError');
|
84948
|
+
});
|
84949
|
+
}
|
84950
|
+
throw Error('读取身份证功能加载失败');
|
84951
|
+
}
|
84952
|
+
static handleClose() {
|
84953
|
+
for (const type in this.requestStore) {
|
84954
|
+
this.requestStore.forEach(({
|
84955
|
+
reject
|
84956
|
+
}) => {
|
84957
|
+
reject('close');
|
84958
|
+
});
|
84959
|
+
}
|
84960
|
+
}
|
84961
|
+
static handleMessage(msg) {
|
84962
|
+
let data = '';
|
84963
|
+
try {
|
84964
|
+
data = JSON.parse(msg.data);
|
84965
|
+
} catch (e) {
|
84966
|
+
data = '';
|
84967
|
+
}
|
84968
|
+
this.requestStore.forEach(({
|
84969
|
+
resolve
|
84970
|
+
}) => {
|
84971
|
+
resolve(data);
|
84972
|
+
});
|
84973
|
+
this.requestStore = [];
|
84974
|
+
this.ws.close();
|
84975
|
+
}
|
84976
|
+
static async read(type = PluginApiType.idcard) {
|
84977
|
+
await this.startConnect(type);
|
84978
|
+
if (this.ws.readyState === 1) {
|
84979
|
+
this.ws.send(type);
|
84980
|
+
return new Promise((resolve, reject) => {
|
84981
|
+
if (!this.requestStore) {
|
84982
|
+
this.requestStore = [];
|
84983
|
+
}
|
84984
|
+
this.requestStore.push({
|
84985
|
+
resolve,
|
84986
|
+
reject
|
84987
|
+
});
|
84988
|
+
});
|
84989
|
+
} else {
|
84990
|
+
throw Error('读取身份证未准备完成');
|
84991
|
+
}
|
84992
|
+
}
|
84993
|
+
static async idCardCommonRead() {
|
84994
|
+
let idcardInfo;
|
84995
|
+
// 顺序不要调整,先连接精伦读卡器,最后连接普通读卡器(也就是PluginApiType.idcard,因为该项读卡失败不会返回消息)
|
84996
|
+
for (const t of [PluginApiType.jlsfz, PluginApiType.idcard]) {
|
84997
|
+
const readData = await IdCardReadService.read(t);
|
84998
|
+
if (readData && readData.hasOwnProperty('info')) {
|
84999
|
+
idcardInfo = readData;
|
85000
|
+
break;
|
85001
|
+
}
|
85002
|
+
}
|
85003
|
+
if (idcardInfo) {
|
85004
|
+
return idcardInfo;
|
85005
|
+
} else {
|
85006
|
+
throw Error('未匹配可用的读卡器');
|
85007
|
+
}
|
85008
|
+
}
|
85009
|
+
}
|
85010
|
+
_defineProperty(IdCardReadService, "idcardWebSocketUrl", 'ws://127.0.0.1:8152/SFZManage');
|
85011
|
+
_defineProperty(IdCardReadService, "jlsfzWebSocketUrl", 'ws://127.0.0.1:8152/JLSFZManage');
|
85012
|
+
_defineProperty(IdCardReadService, "ws", void 0);
|
85013
|
+
_defineProperty(IdCardReadService, "requestStore", []);
|
85014
|
+
class default_plugin_socket_service_CameraReadService {
|
85015
|
+
static startConnect() {
|
85016
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85017
|
+
return this;
|
85018
|
+
}
|
85019
|
+
let webSocketUrl = this.cameraWebSocketUrl;
|
85020
|
+
const ws = new WebSocket(webSocketUrl);
|
85021
|
+
let resolved;
|
85022
|
+
const onConnect = new Promise(resolve => {
|
85023
|
+
resolved = resolve;
|
85024
|
+
});
|
85025
|
+
ws.onopen = () => {
|
85026
|
+
resolved(true);
|
85027
|
+
};
|
85028
|
+
ws.onmessage = event => this.handleMessage(event);
|
85029
|
+
ws.onclose = () => this.handleClose();
|
85030
|
+
ws.onerror = () => this.handleError();
|
85031
|
+
this.ws = ws;
|
85032
|
+
return onConnect;
|
85033
|
+
}
|
85034
|
+
static handleError() {
|
85035
|
+
for (const type in this.requestStore) {
|
85036
|
+
this.requestStore.forEach(({
|
85037
|
+
reject
|
85038
|
+
}) => {
|
85039
|
+
reject('handleError');
|
85040
|
+
});
|
85041
|
+
}
|
85042
|
+
throw Error('读取拍照功能加载失败');
|
85043
|
+
}
|
85044
|
+
static handleClose() {
|
85045
|
+
for (const type in this.requestStore) {
|
85046
|
+
this.requestStore.forEach(({
|
85047
|
+
reject
|
85048
|
+
}) => {
|
85049
|
+
reject('close');
|
85050
|
+
});
|
85051
|
+
}
|
85052
|
+
}
|
85053
|
+
static handleMessage(msg) {
|
85054
|
+
let data = msg.data;
|
85055
|
+
this.requestStore.forEach(({
|
85056
|
+
resolve
|
85057
|
+
}) => {
|
85058
|
+
resolve(data);
|
85059
|
+
});
|
85060
|
+
this.requestStore = [];
|
85061
|
+
this.ws.close();
|
85062
|
+
// this.ws = null;
|
85063
|
+
}
|
85064
|
+
|
85065
|
+
static async read() {
|
85066
|
+
await this.startConnect();
|
85067
|
+
if (this.ws.readyState === 1) {
|
85068
|
+
this.ws.send(PluginApiType.camera);
|
85069
|
+
return new Promise((resolve, reject) => {
|
85070
|
+
if (!this.requestStore) {
|
85071
|
+
this.requestStore = [];
|
85072
|
+
}
|
85073
|
+
this.requestStore.push({
|
85074
|
+
resolve,
|
85075
|
+
reject
|
85076
|
+
});
|
85077
|
+
});
|
85078
|
+
} else {
|
85079
|
+
throw Error('读取拍照未准备完成');
|
85080
|
+
}
|
85081
|
+
}
|
85082
|
+
}
|
85083
|
+
_defineProperty(default_plugin_socket_service_CameraReadService, "cameraWebSocketUrl", 'ws://127.0.0.1:8152/SXTManage');
|
85084
|
+
_defineProperty(default_plugin_socket_service_CameraReadService, "ws", void 0);
|
85085
|
+
_defineProperty(default_plugin_socket_service_CameraReadService, "requestStore", []);
|
85086
|
+
class SignReadService {
|
85087
|
+
static startConnect(signMode) {
|
85088
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85089
|
+
return this;
|
85090
|
+
}
|
85091
|
+
let webSocketUrl = this.signWebSocketUrl;
|
85092
|
+
if (signMode === PluginApiType.hwSign) {
|
85093
|
+
webSocketUrl = this.hwSignWebSocketUrl;
|
85094
|
+
}
|
85095
|
+
const ws = new WebSocket(webSocketUrl);
|
85096
|
+
let resolved;
|
85097
|
+
const onConnect = new Promise(resolve => {
|
85098
|
+
resolved = resolve;
|
85099
|
+
});
|
85100
|
+
ws.onopen = () => {
|
85101
|
+
resolved(true);
|
85102
|
+
};
|
85103
|
+
ws.onmessage = event => this.handleMessage(event);
|
85104
|
+
ws.onclose = () => this.handleClose();
|
85105
|
+
ws.onerror = () => this.handleError();
|
85106
|
+
this.ws = ws;
|
85107
|
+
return onConnect;
|
85108
|
+
}
|
85109
|
+
static handleError() {
|
85110
|
+
for (const type in this.requestStore) {
|
85111
|
+
this.requestStore.forEach(({
|
85112
|
+
reject
|
85113
|
+
}) => {
|
85114
|
+
reject('handleError');
|
85115
|
+
});
|
85116
|
+
}
|
85117
|
+
throw Error('签字板加载失败');
|
85118
|
+
}
|
85119
|
+
static handleClose() {
|
85120
|
+
for (const type in this.requestStore) {
|
85121
|
+
this.requestStore.forEach(({
|
85122
|
+
reject
|
85123
|
+
}) => {
|
85124
|
+
reject('close');
|
85125
|
+
});
|
85126
|
+
}
|
85127
|
+
}
|
85128
|
+
static handleMessage(msg) {
|
85129
|
+
let data = msg.data;
|
85130
|
+
this.requestStore.forEach(({
|
85131
|
+
resolve
|
85132
|
+
}) => {
|
85133
|
+
resolve(data);
|
85134
|
+
});
|
85135
|
+
this.requestStore = [];
|
85136
|
+
this.ws.close();
|
85137
|
+
}
|
85138
|
+
static async read(signMode = PluginApiType.ywSign) {
|
85139
|
+
await this.startConnect(signMode);
|
85140
|
+
if (this.ws.readyState === 1) {
|
85141
|
+
console.log('签字板连接成功');
|
85142
|
+
this.ws.send(signMode);
|
85143
|
+
return new Promise((resolve, reject) => {
|
85144
|
+
if (!this.requestStore) {
|
85145
|
+
this.requestStore = [];
|
85146
|
+
}
|
85147
|
+
this.requestStore.push({
|
85148
|
+
resolve,
|
85149
|
+
reject
|
85150
|
+
});
|
85151
|
+
});
|
85152
|
+
} else {
|
85153
|
+
throw Error('签字板未准备完成');
|
85154
|
+
}
|
85155
|
+
}
|
85156
|
+
}
|
85157
|
+
_defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chromeManage');
|
85158
|
+
_defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
|
85159
|
+
_defineProperty(SignReadService, "ws", void 0);
|
85160
|
+
_defineProperty(SignReadService, "requestStore", []);
|
85161
|
+
;// CONCATENATED MODULE: ./packages/utils/idCard-common-utils.ts
|
85162
|
+
/**
|
85163
|
+
* 根据身份证号码获取指定数据
|
85164
|
+
*/
|
85165
|
+
class IdCardCommonUtils {
|
85166
|
+
/**
|
85167
|
+
* 按身份证号码获取性别
|
85168
|
+
* @param idNumber 身份证号码
|
85169
|
+
* @returns 男;女;异常(身份证号码为空或长度、格式错误)
|
85170
|
+
*/
|
85171
|
+
static getGenderByIdNumber(idNumber) {
|
85172
|
+
if (idNumber) {
|
85173
|
+
let genderCode; // 性别代码
|
85174
|
+
if (idNumber.length == 18) {
|
85175
|
+
// 二代身份证号码长度为18位(第17位为性别代码)
|
85176
|
+
genderCode = idNumber.charAt(16);
|
85177
|
+
} else if (idNumber.length == 15) {
|
85178
|
+
// 一代身份证号码长度为15位(第15位为性别代码)
|
85179
|
+
genderCode = idNumber.charAt(14);
|
85180
|
+
}
|
85181
|
+
if (genderCode && !isNaN(genderCode)) {
|
85182
|
+
// 两代身份证号码的性别代码都为男奇女偶
|
85183
|
+
if (parseInt(genderCode) % 2 == 0) {
|
85184
|
+
return '女';
|
85185
|
+
}
|
85186
|
+
return '男';
|
85187
|
+
}
|
85188
|
+
}
|
85189
|
+
return '';
|
85190
|
+
}
|
85191
|
+
/**
|
85192
|
+
* 按身份证号码获取出生年月
|
85193
|
+
* @param idNumber
|
85194
|
+
* @returns
|
85195
|
+
*/
|
85196
|
+
static getBirthdayByIdNumber(idNumber) {
|
85197
|
+
if (idNumber && idNumber && idNumber.length > 13) {
|
85198
|
+
const year = idNumber.substring(6, 10);
|
85199
|
+
const month = idNumber.substring(10, 12);
|
85200
|
+
const day = idNumber.substring(12, 14);
|
85201
|
+
return year + '-' + month + '-' + day;
|
85202
|
+
}
|
85203
|
+
return '';
|
85204
|
+
}
|
85205
|
+
/**
|
85206
|
+
* 按身份证号码获取年龄
|
85207
|
+
* @param idNumber
|
85208
|
+
* @returns
|
85209
|
+
*/
|
85210
|
+
static getAgeByIdNumber(idNumber) {
|
85211
|
+
if (idNumber) {
|
85212
|
+
const ageDate = new Date();
|
85213
|
+
const month = ageDate.getMonth() + 1;
|
85214
|
+
const day = ageDate.getDate();
|
85215
|
+
let age = ageDate.getFullYear() - idNumber.substring(6, 10) - 1;
|
85216
|
+
if (idNumber.substring(10, 12) < month || idNumber.substring(10, 12) === month && idNumber.substring(12, 14) <= day) {
|
85217
|
+
age++;
|
85218
|
+
}
|
85219
|
+
if (age <= 0) {
|
85220
|
+
age = 1;
|
85221
|
+
}
|
85222
|
+
return age;
|
85223
|
+
}
|
85224
|
+
return '';
|
85225
|
+
}
|
85226
|
+
}
|
85227
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
|
85228
|
+
|
85229
|
+
|
85230
|
+
/**
|
85231
|
+
* 沃斯德人证交互终端
|
85232
|
+
* E窗通WEBSOCKET服务
|
85233
|
+
*
|
85234
|
+
* */
|
85235
|
+
|
85236
|
+
var EWindowPassMethodCode;
|
85237
|
+
(function (EWindowPassMethodCode) {
|
85238
|
+
/** 读取社保卡 */
|
85239
|
+
EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
|
85240
|
+
/** 获取签名*/
|
85241
|
+
EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
85242
|
+
/** 读取二代身份证 */
|
85243
|
+
EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
85244
|
+
/** 人证比对 */
|
85245
|
+
EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
85246
|
+
/** 获取指纹 */
|
85247
|
+
EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
|
85248
|
+
})(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
|
85249
|
+
const EWindowPassMethodDesc = {
|
85250
|
+
[EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
|
85251
|
+
[EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
|
85252
|
+
[EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
|
85253
|
+
[EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
85254
|
+
[EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
|
85255
|
+
};
|
85256
|
+
class EWindowPassService {
|
85257
|
+
static startConnect(method) {
|
85258
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85259
|
+
return this;
|
85260
|
+
}
|
85261
|
+
let webSocketUrl = '';
|
85262
|
+
switch (method) {
|
85263
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
85264
|
+
webSocketUrl = this.fingerPrintBasWebSocketUrl;
|
85265
|
+
break;
|
85266
|
+
default:
|
85267
|
+
webSocketUrl = this.iReadCardBasWebSocketUrl;
|
85268
|
+
break;
|
85269
|
+
}
|
85270
|
+
const ws = new WebSocket(webSocketUrl);
|
85271
|
+
let resolved;
|
85272
|
+
const onConnect = new Promise(resolve => {
|
85273
|
+
resolved = resolve;
|
85274
|
+
});
|
85275
|
+
ws.onopen = () => {
|
85276
|
+
resolved(true);
|
85277
|
+
};
|
85278
|
+
ws.onmessage = event => {
|
85279
|
+
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
85280
|
+
// 指纹后端返回的是string
|
85281
|
+
event = {
|
85282
|
+
...event,
|
85283
|
+
data: JSON.stringify({
|
85284
|
+
fingerPrintInfo: event.data
|
85285
|
+
})
|
85286
|
+
};
|
85287
|
+
}
|
85288
|
+
this.handleMessage(event);
|
85289
|
+
};
|
85290
|
+
ws.onclose = () => this.handleClose();
|
85291
|
+
ws.onerror = () => this.handleError();
|
85292
|
+
this.ws = ws;
|
85293
|
+
return onConnect;
|
85294
|
+
}
|
85295
|
+
static handleError() {
|
85296
|
+
for (const type in this.requestStore) {
|
85297
|
+
this.requestStore.forEach(({
|
85298
|
+
reject
|
85299
|
+
}) => {
|
85300
|
+
reject('handleError');
|
85301
|
+
});
|
85302
|
+
}
|
85303
|
+
throw Error('E窗通设备功能加载失败');
|
85304
|
+
}
|
85305
|
+
static handleClose() {
|
85306
|
+
for (const type in this.requestStore) {
|
85307
|
+
this.requestStore.forEach(({
|
85308
|
+
reject
|
85309
|
+
}) => {
|
85310
|
+
reject('close');
|
85311
|
+
});
|
85312
|
+
}
|
85313
|
+
}
|
85314
|
+
static handleMessage(msg) {
|
85315
|
+
let data = '';
|
85316
|
+
try {
|
85317
|
+
data = JSON.parse(msg.data);
|
85318
|
+
} catch (e) {
|
85319
|
+
data = '';
|
85320
|
+
}
|
85321
|
+
this.requestStore.forEach(({
|
85322
|
+
resolve
|
85323
|
+
}) => {
|
85324
|
+
resolve(data);
|
85325
|
+
});
|
85326
|
+
this.requestStore = [];
|
85327
|
+
this.ws.close();
|
85328
|
+
}
|
85329
|
+
static async read(method) {
|
85330
|
+
await this.startConnect(method);
|
85331
|
+
const methodDesc = EWindowPassMethodDesc[method];
|
85332
|
+
if (this.ws.readyState === 1) {
|
85333
|
+
if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
|
85334
|
+
let jsonString;
|
85335
|
+
// outTimes:超时时间(秒)
|
85336
|
+
switch (method) {
|
85337
|
+
case EWindowPassMethodCode.ReadIDCard_Base64:
|
85338
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85339
|
+
jsonString = JSON.stringify({
|
85340
|
+
method,
|
85341
|
+
args: {
|
85342
|
+
outTimes: 30,
|
85343
|
+
cardReader: 1
|
85344
|
+
}
|
85345
|
+
});
|
85346
|
+
break;
|
85347
|
+
case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
|
85348
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
85349
|
+
jsonString = JSON.stringify({
|
85350
|
+
method,
|
85351
|
+
args: {
|
85352
|
+
outTimes: 30,
|
85353
|
+
cardReader: 1,
|
85354
|
+
cameraType: 0
|
85355
|
+
}
|
85356
|
+
});
|
85357
|
+
break;
|
85358
|
+
case EWindowPassMethodCode.iReadCardBas:
|
85359
|
+
// icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
|
85360
|
+
jsonString = JSON.stringify({
|
85361
|
+
method,
|
85362
|
+
args: {
|
85363
|
+
icType: '1'
|
85364
|
+
}
|
85365
|
+
});
|
85366
|
+
break;
|
85367
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
85368
|
+
// 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
|
85369
|
+
jsonString = 'getimgae,1,0,288,0';
|
85370
|
+
break;
|
85371
|
+
default:
|
85372
|
+
jsonString = JSON.stringify({
|
85373
|
+
method,
|
85374
|
+
args: {
|
85375
|
+
outTimes: 30
|
85376
|
+
}
|
85377
|
+
});
|
85378
|
+
break;
|
85379
|
+
}
|
85380
|
+
this.ws.send(jsonString);
|
85381
|
+
return new Promise((resolve, reject) => {
|
85382
|
+
if (!this.requestStore) {
|
85383
|
+
this.requestStore = [];
|
85384
|
+
}
|
85385
|
+
this.requestStore.push({
|
85386
|
+
resolve,
|
85387
|
+
reject
|
85388
|
+
});
|
85389
|
+
});
|
85390
|
+
} else {
|
85391
|
+
throw Error(methodDesc + '未准备完成');
|
85392
|
+
}
|
85393
|
+
}
|
85394
|
+
/**
|
85395
|
+
* 读取二代身份证
|
85396
|
+
* */
|
85397
|
+
static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
|
85398
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
|
85399
|
+
console.log('读取二代身份证==>', readData);
|
85400
|
+
if (!readData) {
|
85401
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85402
|
+
}
|
85403
|
+
if (readData.retVal !== 0) {
|
85404
|
+
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85405
|
+
}
|
85406
|
+
const idInfo = readData.idInfo.data;
|
85407
|
+
const {
|
85408
|
+
name,
|
85409
|
+
sex,
|
85410
|
+
birthday,
|
85411
|
+
address,
|
85412
|
+
id_num,
|
85413
|
+
nations
|
85414
|
+
} = idInfo;
|
85415
|
+
const IDCardData = {
|
85416
|
+
info: {
|
85417
|
+
name,
|
85418
|
+
sex,
|
85419
|
+
birthday: birthday.replace('-', '').replace('-', ''),
|
85420
|
+
address,
|
85421
|
+
cardId: id_num,
|
85422
|
+
nation: nations
|
85423
|
+
},
|
85424
|
+
headImage: readData.idPhotoPicBase64
|
85425
|
+
};
|
85426
|
+
console.log('读取二代身份证结果==>', IDCardData);
|
85427
|
+
return IDCardData;
|
85428
|
+
}
|
85429
|
+
/**
|
85430
|
+
* 人证比对
|
85431
|
+
*/
|
85432
|
+
static async faceValidateWithIdCardRead() {
|
85433
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
|
85434
|
+
console.log('人证比对==>', readData);
|
85435
|
+
if (!readData) {
|
85436
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85437
|
+
}
|
85438
|
+
if (readData.retVal !== 0) {
|
85439
|
+
throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85440
|
+
}
|
85441
|
+
const idInfo = readData.idInfo.data;
|
85442
|
+
const {
|
85443
|
+
name,
|
85444
|
+
sex,
|
85445
|
+
birth,
|
85446
|
+
address,
|
85447
|
+
idNo,
|
85448
|
+
nation
|
85449
|
+
} = idInfo;
|
85450
|
+
const IDCardData = {
|
85451
|
+
idCard: {
|
85452
|
+
info: {
|
85453
|
+
name,
|
85454
|
+
sex,
|
85455
|
+
birthday: birth.replace('-', '').replace('-', ''),
|
85456
|
+
address,
|
85457
|
+
cardId: idNo,
|
85458
|
+
nation
|
85459
|
+
},
|
85460
|
+
headImage: readData.idPhotoBase64
|
85461
|
+
},
|
85462
|
+
faceimg: readData.scenceBase64
|
85463
|
+
};
|
85464
|
+
console.log('人证比对结果==>', IDCardData);
|
85465
|
+
return IDCardData;
|
85466
|
+
}
|
85467
|
+
/** 读取社保卡 */
|
85468
|
+
static async socialSecurityCardRead() {
|
85469
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
|
85470
|
+
if (!readData) {
|
85471
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85472
|
+
}
|
85473
|
+
if (readData.retVal !== 0) {
|
85474
|
+
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
|
85475
|
+
}
|
85476
|
+
// 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
|
85477
|
+
const outInfo = readData.outInfo;
|
85478
|
+
const outInfoArray = outInfo.split('|');
|
85479
|
+
const cardId = outInfoArray[1];
|
85480
|
+
const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
|
85481
|
+
const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
|
85482
|
+
const IDCardData = {
|
85483
|
+
info: {
|
85484
|
+
name: outInfoArray[4],
|
85485
|
+
sex,
|
85486
|
+
birthday,
|
85487
|
+
address: '',
|
85488
|
+
cardId
|
85489
|
+
},
|
85490
|
+
headImage: ''
|
85491
|
+
};
|
85492
|
+
console.log('读取社保卡==>', readData);
|
85493
|
+
return IDCardData;
|
85494
|
+
}
|
85495
|
+
/** 获取签名-base64 */
|
85496
|
+
static async signNameRead() {
|
85497
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
|
85498
|
+
if (!readData) {
|
85499
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85500
|
+
}
|
85501
|
+
if (readData.retVal !== 0) {
|
85502
|
+
throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85503
|
+
}
|
85504
|
+
console.log('获取签名==>', readData);
|
85505
|
+
return readData.signPicBase64;
|
85506
|
+
}
|
85507
|
+
/** 获取指纹*/
|
85508
|
+
static async fingerPrintRead() {
|
85509
|
+
let timeOver = 30;
|
85510
|
+
async function readFingerPrint() {
|
85511
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
|
85512
|
+
if (!readData) {
|
85513
|
+
throw Error('未匹配可用的E窗通读取设备');
|
85514
|
+
}
|
85515
|
+
let list = readData.fingerPrintInfo.split("|");
|
85516
|
+
console.log(list);
|
85517
|
+
let ret = Number(list[1]);
|
85518
|
+
if (ret > 1) {
|
85519
|
+
if (timeOver > 0) {
|
85520
|
+
timeOver--;
|
85521
|
+
return await readFingerPrint();
|
85522
|
+
} else {
|
85523
|
+
return {
|
85524
|
+
status: 'error',
|
85525
|
+
data: '已超时,请重新操作,按压指纹'
|
85526
|
+
};
|
85527
|
+
}
|
85528
|
+
} else {
|
85529
|
+
return {
|
85530
|
+
status: 'success',
|
85531
|
+
data: readData.fingerPrintInfo
|
85532
|
+
};
|
85533
|
+
}
|
85534
|
+
}
|
85535
|
+
let {
|
85536
|
+
status,
|
85537
|
+
data
|
85538
|
+
} = await readFingerPrint();
|
85539
|
+
if (status === 'error') {
|
85540
|
+
throw Error(data);
|
85541
|
+
} else {
|
85542
|
+
let [method, result, quality, image, featureCode] = data.split('|');
|
85543
|
+
// getimgae|1|68|......|......
|
85544
|
+
// method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
|
85545
|
+
return {
|
85546
|
+
method,
|
85547
|
+
result,
|
85548
|
+
quality,
|
85549
|
+
image,
|
85550
|
+
featureCode
|
85551
|
+
};
|
85552
|
+
}
|
85553
|
+
}
|
85554
|
+
}
|
85555
|
+
_defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
|
85556
|
+
_defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
|
85557
|
+
_defineProperty(EWindowPassService, "ws", void 0);
|
85558
|
+
_defineProperty(EWindowPassService, "requestStore", []);
|
85559
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
|
85560
|
+
|
85561
|
+
|
85562
|
+
/**
|
85563
|
+
* 华大读卡器
|
85564
|
+
*
|
85565
|
+
* */
|
85566
|
+
|
85567
|
+
var HuaDaCardReadMode;
|
85568
|
+
(function (HuaDaCardReadMode) {
|
85569
|
+
/** 读取社保卡 */
|
85570
|
+
HuaDaCardReadMode[HuaDaCardReadMode["ReadSocialSecurityCard"] = 1002] = "ReadSocialSecurityCard";
|
85571
|
+
/** 读取二代身份证 */
|
85572
|
+
HuaDaCardReadMode[HuaDaCardReadMode["ReadIDCard"] = 1003] = "ReadIDCard";
|
85573
|
+
})(HuaDaCardReadMode || (HuaDaCardReadMode = {}));
|
85574
|
+
/**
|
85575
|
+
* 广东华大读卡器
|
85576
|
+
*/
|
85577
|
+
class HuzReadService {
|
85578
|
+
/**
|
85579
|
+
* 开启连接
|
85580
|
+
*/
|
85581
|
+
static startConnect() {
|
85582
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85583
|
+
return this;
|
85584
|
+
}
|
85585
|
+
const webSocketUrl = this.HaDWebSocketUrl;
|
85586
|
+
const ws = new WebSocket(webSocketUrl);
|
85587
|
+
let resolved;
|
85588
|
+
const onConnect = new Promise(resolve => {
|
85589
|
+
resolved = resolve;
|
85590
|
+
});
|
85591
|
+
ws.onopen = () => {
|
85592
|
+
resolved(true);
|
85593
|
+
};
|
85594
|
+
ws.onmessage = event => this.handleMessage(event);
|
85595
|
+
ws.onclose = () => this.handleClose();
|
85596
|
+
ws.onerror = () => this.handleError();
|
85597
|
+
this.ws = ws;
|
85598
|
+
return onConnect;
|
85599
|
+
}
|
85600
|
+
/**
|
85601
|
+
* 错误回调
|
85602
|
+
*/
|
85603
|
+
static handleError() {
|
85604
|
+
for (const type in this.requestStore) {
|
85605
|
+
this.requestStore.forEach(({
|
85606
|
+
reject
|
85607
|
+
}) => {
|
85608
|
+
reject('handleError');
|
85609
|
+
});
|
85610
|
+
}
|
85611
|
+
}
|
85612
|
+
/**
|
85613
|
+
* 关闭请求
|
85614
|
+
*/
|
85615
|
+
static handleClose() {
|
85616
|
+
for (const type in this.requestStore) {
|
85617
|
+
this.requestStore.forEach(({
|
85618
|
+
reject
|
85619
|
+
}) => {
|
85620
|
+
reject('close');
|
85621
|
+
});
|
85622
|
+
}
|
85623
|
+
}
|
85624
|
+
/**
|
85625
|
+
* 回调数据
|
85626
|
+
* @param msg
|
85627
|
+
*/
|
85628
|
+
static handleMessage(msg) {
|
85629
|
+
debugger;
|
85630
|
+
// 返回参数格式
|
85631
|
+
// tsCode 入参返回数据码
|
85632
|
+
// code 状态码
|
85633
|
+
// message 返回信息
|
85634
|
+
// cardInfo 身份证信息
|
85635
|
+
// base64_ID 人像照片
|
85636
|
+
// base64_IDPDF ""
|
85637
|
+
// base64_PhotoPDF ""
|
85638
|
+
// birth 生日,格式:1996年06月10日
|
85639
|
+
// depart 签发机关
|
85640
|
+
// id_num 身份证号码
|
85641
|
+
// name 姓名
|
85642
|
+
// nation 民族
|
85643
|
+
// passFlag 是否成功,true,false(type=5的额外参数)
|
85644
|
+
// score 成绩,90.0(type=5的额外参数)
|
85645
|
+
// sex 性别:男,女
|
85646
|
+
// time 认证耗时,ms(type=5的额外参数)
|
85647
|
+
// type 接口类型
|
85648
|
+
// validityTime 有限期限,格式:2014.06.09-2024.06.09
|
85649
|
+
const data = JSON.parse(msg.data);
|
85650
|
+
this.requestStore.forEach(({
|
85651
|
+
resolve
|
85652
|
+
}) => {
|
85653
|
+
resolve(data);
|
85654
|
+
});
|
85655
|
+
this.requestStore = [];
|
85656
|
+
this.ws.close();
|
85657
|
+
}
|
85658
|
+
/**
|
85659
|
+
* 发送请求,开启签字版
|
85660
|
+
* @param type 接口类型,3:指定位置签名或点击电子签名;54:关键字签名(对接时未返回数据,不建议用)4:读取身份证信息;5:人脸识别; 2:关闭设备
|
85661
|
+
* @param pdf pdf或图片的base64,不能带地址前缀
|
85662
|
+
* @param location 捷宇签字版签字时坐标(必传,不然接口调用会失败),非指定位置时该坐标也需要传,但不会起作用
|
85663
|
+
* @param timeout 签字版签字超时时间,秒
|
85664
|
+
* @param retain 是否按传入坐标签名,传入任意字符【如test】时签名会展示在传入的坐标上,
|
85665
|
+
* 传入空字符则在屏幕点击的位置上签名---接口类型3依据此字段区分是否为指定位置签名
|
85666
|
+
*/
|
85667
|
+
static async read(tsCode) {
|
85668
|
+
await this.startConnect();
|
85669
|
+
if (this.ws.readyState === 1) {
|
85670
|
+
debugger;
|
85671
|
+
let jsonPattern;
|
85672
|
+
// 签名和指纹
|
85673
|
+
if (tsCode === 1003 || tsCode === 1002) {
|
85674
|
+
jsonPattern = {
|
85675
|
+
'tsCode': tsCode.toString(),
|
85676
|
+
'picFilePath': 'd:\\zp.bmp'
|
85677
|
+
};
|
85678
|
+
}
|
85679
|
+
const jsonStr = JSON.stringify(jsonPattern);
|
85680
|
+
this.ws.send(jsonStr);
|
85681
|
+
return new Promise((resolve, reject) => {
|
85682
|
+
if (!this.requestStore) {
|
85683
|
+
this.requestStore = [];
|
85684
|
+
}
|
85685
|
+
this.requestStore.push({
|
85686
|
+
resolve,
|
85687
|
+
reject
|
85688
|
+
});
|
85689
|
+
});
|
85690
|
+
} else {
|
85691
|
+
throw Error('设备未准备完成');
|
85692
|
+
}
|
85693
|
+
}
|
85694
|
+
/**
|
85695
|
+
* 读取二代身份证
|
85696
|
+
* */
|
85697
|
+
static async idCardRead() {
|
85698
|
+
const readData = await HuzReadService.read(HuaDaCardReadMode.ReadIDCard);
|
85699
|
+
console.log('读取二代身份证==>', readData);
|
85700
|
+
if (!readData) {
|
85701
|
+
throw Error('未匹配可用的读取设备');
|
85702
|
+
}
|
85703
|
+
const name = readData.cardInfo.split('|')[1];
|
85704
|
+
const sex = readData.cardInfo.split('|')[2];
|
85705
|
+
const nation = readData.cardInfo.split('|')[3];
|
85706
|
+
const birthday = readData.cardInfo.split('|')[4];
|
85707
|
+
const address = readData.cardInfo.split('|')[5];
|
85708
|
+
const cardId = readData.cardInfo.split('|')[6];
|
85709
|
+
const police = readData.cardInfo.split('|')[7];
|
85710
|
+
const yxqx1 = readData.cardInfo.split('|')[8];
|
85711
|
+
const yxqx2 = readData.cardInfo.split('|')[9];
|
85712
|
+
const zpString = readData.cardInfo.split('|')[10];
|
85713
|
+
const IDCardData = {
|
85714
|
+
info: {
|
85715
|
+
name,
|
85716
|
+
sex,
|
85717
|
+
birthday,
|
85718
|
+
address,
|
85719
|
+
cardId,
|
85720
|
+
nation
|
85721
|
+
},
|
85722
|
+
headImage: zpString
|
85723
|
+
};
|
85724
|
+
console.log('读取二代身份证结果==>', IDCardData);
|
85725
|
+
return IDCardData;
|
85726
|
+
}
|
85727
|
+
/** 读取社保卡 */
|
85728
|
+
static async socialSecurityCardRead() {
|
85729
|
+
const readData = await HuzReadService.read(HuaDaCardReadMode.ReadSocialSecurityCard);
|
85730
|
+
if (!readData) {
|
85731
|
+
throw Error('未匹配可用的读取设备');
|
85732
|
+
}
|
85733
|
+
const cardId = readData.cardInfo.split('|')[1];
|
85734
|
+
const name = readData.cardInfo.split('|')[2];
|
85735
|
+
const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
|
85736
|
+
const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
|
85737
|
+
const IDCardData = {
|
85738
|
+
info: {
|
85739
|
+
name,
|
85740
|
+
sex,
|
85741
|
+
birthday,
|
85742
|
+
address: '',
|
85743
|
+
cardId
|
85744
|
+
},
|
85745
|
+
headImage: ''
|
85746
|
+
};
|
85747
|
+
console.log('读取社保卡==>', readData);
|
85748
|
+
return IDCardData;
|
85749
|
+
}
|
85750
|
+
}
|
85751
|
+
_defineProperty(HuzReadService, "HaDWebSocketUrl", 'ws://127.0.0.1:36669/');
|
85752
|
+
_defineProperty(HuzReadService, "ws", void 0);
|
85753
|
+
_defineProperty(HuzReadService, "requestStore", []);
|
85754
|
+
;// CONCATENATED MODULE: ./packages/utils/js/BASE64.js
|
85755
|
+
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
85756
|
+
var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
|
85757
|
+
//������
|
85758
|
+
function base64encode(str) {
|
85759
|
+
var out, i, len;
|
85760
|
+
var c1, c2, c3;
|
85761
|
+
len = str.length;
|
85762
|
+
i = 0;
|
85763
|
+
out = "";
|
85764
|
+
while (i < len) {
|
85765
|
+
c1 = str.charCodeAt(i++) & 0xff;
|
85766
|
+
if (i == len) {
|
85767
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
85768
|
+
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
|
85769
|
+
out += "==";
|
85770
|
+
break;
|
85771
|
+
}
|
85772
|
+
c2 = str.charCodeAt(i++);
|
85773
|
+
if (i == len) {
|
85774
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
85775
|
+
out += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
|
85776
|
+
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
|
85777
|
+
out += "=";
|
85778
|
+
break;
|
85779
|
+
}
|
85780
|
+
c3 = str.charCodeAt(i++);
|
85781
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
85782
|
+
out += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
|
85783
|
+
out += base64EncodeChars.charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6);
|
85784
|
+
out += base64EncodeChars.charAt(c3 & 0x3F);
|
85785
|
+
}
|
85786
|
+
return out;
|
85787
|
+
}
|
85788
|
+
//������
|
85789
|
+
function base64decode(str) {
|
85790
|
+
var c1, c2, c3, c4;
|
85791
|
+
var i, len, out;
|
85792
|
+
len = str.length;
|
85793
|
+
i = 0;
|
85794
|
+
out = "";
|
85795
|
+
while (i < len) {
|
85796
|
+
do {
|
85797
|
+
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
|
85798
|
+
} while (i < len && c1 == -1);
|
85799
|
+
if (c1 == -1) break;
|
85800
|
+
do {
|
85801
|
+
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
|
85802
|
+
} while (i < len && c2 == -1);
|
85803
|
+
if (c2 == -1) break;
|
85804
|
+
out += String.fromCharCode(c1 << 2 | (c2 & 0x30) >> 4);
|
85805
|
+
do {
|
85806
|
+
c3 = str.charCodeAt(i++) & 0xff;
|
85807
|
+
if (c3 == 61) return out;
|
85808
|
+
c3 = base64DecodeChars[c3];
|
85809
|
+
} while (i < len && c3 == -1);
|
85810
|
+
if (c3 == -1) break;
|
85811
|
+
out += String.fromCharCode((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
|
85812
|
+
do {
|
85813
|
+
c4 = str.charCodeAt(i++) & 0xff;
|
85814
|
+
if (c4 == 61) return out;
|
85815
|
+
c4 = base64DecodeChars[c4];
|
85816
|
+
} while (i < len && c4 == -1);
|
85817
|
+
if (c4 == -1) break;
|
85818
|
+
out += String.fromCharCode((c3 & 0x03) << 6 | c4);
|
85819
|
+
}
|
85820
|
+
return out;
|
85821
|
+
}
|
85822
|
+
function utf16to8(str) {
|
85823
|
+
var out, i, len, c;
|
85824
|
+
out = "";
|
85825
|
+
len = str.length;
|
85826
|
+
for (i = 0; i < len; i++) {
|
85827
|
+
c = str.charCodeAt(i);
|
85828
|
+
if (c >= 0x0001 && c <= 0x007F) {
|
85829
|
+
out += str.charAt(i);
|
85830
|
+
} else if (c > 0x07FF) {
|
85831
|
+
out += String.fromCharCode(0xE0 | c >> 12 & 0x0F);
|
85832
|
+
out += String.fromCharCode(0x80 | c >> 6 & 0x3F);
|
85833
|
+
out += String.fromCharCode(0x80 | c >> 0 & 0x3F);
|
85834
|
+
} else {
|
85835
|
+
out += String.fromCharCode(0xC0 | c >> 6 & 0x1F);
|
85836
|
+
out += String.fromCharCode(0x80 | c >> 0 & 0x3F);
|
85837
|
+
}
|
85838
|
+
}
|
85839
|
+
return out;
|
85840
|
+
}
|
85841
|
+
function utf8to16(str) {
|
85842
|
+
var out, i, len, c;
|
85843
|
+
var char2, char3;
|
85844
|
+
out = "";
|
85845
|
+
len = str.length;
|
85846
|
+
i = 0;
|
85847
|
+
while (i < len) {
|
85848
|
+
c = str.charCodeAt(i++);
|
85849
|
+
switch (c >> 4) {
|
85850
|
+
case 0:
|
85851
|
+
case 1:
|
85852
|
+
case 2:
|
85853
|
+
case 3:
|
85854
|
+
case 4:
|
85855
|
+
case 5:
|
85856
|
+
case 6:
|
85857
|
+
case 7:
|
85858
|
+
// 0xxxxxxx
|
85859
|
+
out += str.charAt(i - 1);
|
85860
|
+
break;
|
85861
|
+
case 12:
|
85862
|
+
case 13:
|
85863
|
+
// 110x xxxx 10xx xxxx
|
85864
|
+
char2 = str.charCodeAt(i++);
|
85865
|
+
out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);
|
85866
|
+
break;
|
85867
|
+
case 14:
|
85868
|
+
// 1110 xxxx 10xx xxxx 10xx xxxx
|
85869
|
+
char2 = str.charCodeAt(i++);
|
85870
|
+
char3 = str.charCodeAt(i++);
|
85871
|
+
out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);
|
85872
|
+
break;
|
85873
|
+
}
|
85874
|
+
}
|
85875
|
+
return out;
|
85876
|
+
}
|
85877
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/mr-adb-plugin-socket.service.ts
|
85878
|
+
|
85879
|
+
|
85880
|
+
/**
|
85881
|
+
* 中正智能人证核验一体机 MR860 Websocket v1.0.2
|
85882
|
+
*
|
85883
|
+
* */
|
85884
|
+
|
85885
|
+
var MRAdbReadMode;
|
85886
|
+
(function (MRAdbReadMode) {
|
85887
|
+
/** 人证核验:读取二代身份证、人脸识别 */
|
85888
|
+
MRAdbReadMode["ReadIDCard"] = "$=Action|127.0.0.1|1352";
|
85889
|
+
})(MRAdbReadMode || (MRAdbReadMode = {}));
|
85890
|
+
/**
|
85891
|
+
* 中正智能人证核验一体机
|
85892
|
+
*/
|
85893
|
+
class MRAdbReadService {
|
85894
|
+
/**
|
85895
|
+
* 开启连接
|
85896
|
+
*/
|
85897
|
+
static startConnect(command) {
|
85898
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85899
|
+
return this;
|
85900
|
+
}
|
85901
|
+
const webSocketUrl = this.MRAdbWebSocketUrl;
|
85902
|
+
const ws = new WebSocket(webSocketUrl);
|
85903
|
+
let resolved;
|
85904
|
+
const onConnect = new Promise(resolve => {
|
85905
|
+
resolved = resolve;
|
85906
|
+
});
|
85907
|
+
ws.onopen = () => {
|
85908
|
+
ws.send(command);
|
85909
|
+
resolved(true);
|
85910
|
+
};
|
85911
|
+
ws.onmessage = event => this.handleMessage(event);
|
85912
|
+
ws.onclose = () => this.handleClose();
|
85913
|
+
ws.onerror = () => this.handleError();
|
85914
|
+
this.ws = ws;
|
85915
|
+
return onConnect;
|
85916
|
+
}
|
85917
|
+
/**
|
85918
|
+
* 错误回调
|
85919
|
+
*/
|
85920
|
+
static handleError() {
|
85921
|
+
for (const type in this.requestStore) {
|
85922
|
+
this.requestStore.forEach(({
|
85923
|
+
reject
|
85924
|
+
}) => {
|
85925
|
+
reject('handleError');
|
85926
|
+
});
|
85927
|
+
}
|
85928
|
+
}
|
85929
|
+
/**
|
85930
|
+
* 关闭请求
|
85931
|
+
*/
|
85932
|
+
static handleClose() {
|
85933
|
+
for (const type in this.requestStore) {
|
85934
|
+
this.requestStore.forEach(({
|
85935
|
+
reject
|
85936
|
+
}) => {
|
85937
|
+
reject('close');
|
85938
|
+
});
|
85939
|
+
}
|
85940
|
+
}
|
85941
|
+
/**
|
85942
|
+
* 回调数据
|
85943
|
+
* @param msg
|
85944
|
+
*/
|
85945
|
+
static handleMessage(msg) {
|
85946
|
+
const data = JSON.parse(msg.data);
|
85947
|
+
this.requestStore.forEach(({
|
85948
|
+
resolve
|
85949
|
+
}) => {
|
85950
|
+
resolve(data);
|
85951
|
+
});
|
85952
|
+
this.requestStore = [];
|
85953
|
+
this.ws.close();
|
85954
|
+
}
|
85955
|
+
static async read(command) {
|
85956
|
+
await this.startConnect(command);
|
85957
|
+
return new Promise((resolve, reject) => {
|
85958
|
+
if (!this.requestStore) {
|
85959
|
+
this.requestStore = [];
|
85960
|
+
}
|
85961
|
+
this.requestStore.push({
|
85962
|
+
resolve,
|
85963
|
+
reject
|
85964
|
+
});
|
85965
|
+
});
|
85966
|
+
}
|
85967
|
+
/**
|
85968
|
+
* 人证核验
|
85969
|
+
* */
|
85970
|
+
static async idCardRead() {
|
85971
|
+
const returnData = await MRAdbReadService.read(MRAdbReadMode.ReadIDCard);
|
85972
|
+
console.log('中正智能人证核验返回==>', returnData);
|
85973
|
+
if (!returnData) {
|
85974
|
+
throw Error('未匹配可用的读取设备');
|
85975
|
+
}
|
85976
|
+
// result: 0 - 成功;其他 - 失败
|
85977
|
+
// data: if(result==0) 返回值Base64字符串格式,进行base64解码,再进行数据解析
|
85978
|
+
const {
|
85979
|
+
result,
|
85980
|
+
data
|
85981
|
+
} = returnData;
|
85982
|
+
switch (result) {
|
85983
|
+
case -1:
|
85984
|
+
throw Error('服务器IP地址或者服务端口错误');
|
85985
|
+
case -2:
|
85986
|
+
throw Error('输入的发送数据参数非法');
|
85987
|
+
case -3:
|
85988
|
+
throw Error('连接服务器失败');
|
85989
|
+
case -4:
|
85990
|
+
throw Error('发送数据失败');
|
85991
|
+
case -5:
|
85992
|
+
throw Error('接收应答数据超时');
|
85993
|
+
case -6:
|
85994
|
+
throw Error('接收应答数据失败');
|
85995
|
+
case -7:
|
85996
|
+
throw Error('输出应答数据参数非法');
|
85997
|
+
case -8:
|
85998
|
+
throw Error('Websocket无法识别命令字');
|
85999
|
+
case -9:
|
86000
|
+
throw Error('Websocket解析命令字错误');
|
86001
|
+
case -10:
|
86002
|
+
throw Error('Websocket base64编码失败');
|
86003
|
+
case -11:
|
86004
|
+
throw Error('指纹驱动未安装或者未启动');
|
86005
|
+
case 0:
|
86006
|
+
{
|
86007
|
+
const deData = utf8to16(base64decode(data));
|
86008
|
+
console.log('中正智能人证核验结果==>', deData);
|
86009
|
+
const reStrs = deData.split("\$");
|
86010
|
+
const name = reStrs[2].split("=#=")[1];
|
86011
|
+
const sex = reStrs[3].split("=#=")[1];
|
86012
|
+
const nation = reStrs[10].split("=#=")[1];
|
86013
|
+
const birthday = reStrs[6].split("=#=")[1];
|
86014
|
+
const address = reStrs[5].split("=#=")[1];
|
86015
|
+
const cardId = reStrs[4].split("=#=")[1];
|
86016
|
+
const police = reStrs[11].split("=#=")[1];
|
86017
|
+
const headImage = reStrs[8].split("=#=")[1];
|
86018
|
+
const faceimg = reStrs[9].split("=#=")[1];
|
86019
|
+
const IDCardData = {
|
86020
|
+
idCard: {
|
86021
|
+
info: {
|
86022
|
+
name,
|
86023
|
+
sex,
|
86024
|
+
birthday,
|
86025
|
+
address,
|
86026
|
+
cardId,
|
86027
|
+
nation
|
86028
|
+
},
|
86029
|
+
headImage
|
86030
|
+
},
|
86031
|
+
faceimg
|
86032
|
+
};
|
86033
|
+
console.log('中正智能人证核验结果转换==>', {
|
86034
|
+
name,
|
86035
|
+
sex,
|
86036
|
+
birthday,
|
86037
|
+
address,
|
86038
|
+
cardId,
|
86039
|
+
nation
|
86040
|
+
});
|
86041
|
+
return IDCardData;
|
86042
|
+
}
|
86043
|
+
}
|
86044
|
+
return '';
|
86045
|
+
}
|
86046
|
+
}
|
86047
|
+
_defineProperty(MRAdbReadService, "MRAdbWebSocketUrl", 'ws://127.0.0.1:8003/finger');
|
86048
|
+
_defineProperty(MRAdbReadService, "ws", void 0);
|
86049
|
+
_defineProperty(MRAdbReadService, "requestStore", []);
|
86050
|
+
// EXTERNAL MODULE: ./packages/utils/js/tsToJs.js
|
86051
|
+
var tsToJs = __webpack_require__(8601);
|
86052
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=template&id=370e03c8&
|
86053
|
+
var face_auth_dialogvue_type_template_id_370e03c8_render = function render() {
|
86054
|
+
var _vm = this,
|
86055
|
+
_c = _vm._self._c;
|
86056
|
+
return _vm.visibility ? _c('el-dialog', {
|
86057
|
+
staticClass: "face-auth-dialog",
|
86058
|
+
attrs: {
|
86059
|
+
"title": "人脸识别",
|
86060
|
+
"top": '5vh',
|
86061
|
+
"width": "1280px",
|
86062
|
+
"visible": _vm.visibility,
|
86063
|
+
"close-on-click-modal": false
|
86064
|
+
},
|
86065
|
+
on: {
|
86066
|
+
"update:visible": function ($event) {
|
86067
|
+
_vm.visibility = $event;
|
86068
|
+
}
|
86069
|
+
}
|
86070
|
+
}, [_c('el-container', [_c('el-aside', {
|
86071
|
+
attrs: {
|
86072
|
+
"width": "900px"
|
86073
|
+
}
|
86074
|
+
}, [_c('zs-card', {
|
86075
|
+
attrs: {
|
86076
|
+
"title": "身份证信息读取"
|
86077
|
+
}
|
86078
|
+
}, [_c('div', {
|
86079
|
+
staticClass: "idcard-photo"
|
86080
|
+
}, [_c('div', {
|
86081
|
+
staticClass: "flex-1"
|
86082
|
+
}, [_c('img', {
|
86083
|
+
staticStyle: {
|
86084
|
+
"width": "433px",
|
86085
|
+
"height": "278px"
|
86086
|
+
},
|
86087
|
+
attrs: {
|
86088
|
+
"src": __webpack_require__(2234)
|
86089
|
+
}
|
86090
|
+
}), _c('span', {
|
86091
|
+
staticClass: "idcard-info name"
|
86092
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.name))]), _c('span', {
|
86093
|
+
staticClass: "idcard-info sex"
|
86094
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.sex))]), _c('span', {
|
86095
|
+
staticClass: "idcard-info nation"
|
86096
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.nation))]), _c('span', {
|
86097
|
+
staticClass: "idcard-info year"
|
86098
|
+
}, [_vm._v(_vm._s(_vm.birthYear))]), _c('span', {
|
86099
|
+
staticClass: "idcard-info month"
|
86100
|
+
}, [_vm._v(_vm._s(_vm.birthMonth))]), _c('span', {
|
86101
|
+
staticClass: "idcard-info day"
|
86102
|
+
}, [_vm._v(_vm._s(_vm.birthDay))]), _c('span', {
|
86103
|
+
staticClass: "idcard-info address"
|
86104
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.address))]), _c('span', {
|
86105
|
+
staticClass: "idcard-info idnumber"
|
86106
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.cardId))])]), _c('div', [_c('img', {
|
86107
|
+
staticStyle: {
|
86108
|
+
"width": "433px",
|
86109
|
+
"height": "278px"
|
86110
|
+
},
|
86111
|
+
attrs: {
|
86112
|
+
"src": __webpack_require__(4923)
|
86113
|
+
}
|
86114
|
+
}), _c('span', {
|
86115
|
+
staticClass: "idcard-info qfjg"
|
86116
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.police))]), _c('span', {
|
86117
|
+
staticClass: "idcard-info yxrq"
|
86118
|
+
}, [_vm._v(_vm._s(_vm.validDate))])])])])], 1), _c('el-main', [_c('zs-card', {
|
86119
|
+
staticClass: "camera",
|
86120
|
+
attrs: {
|
86121
|
+
"title": "摄像头"
|
86122
|
+
},
|
86123
|
+
scopedSlots: _vm._u([{
|
86124
|
+
key: "extra",
|
86125
|
+
fn: function () {
|
86126
|
+
return [_c('el-button', {
|
86127
|
+
attrs: {
|
86128
|
+
"type": "primary",
|
86129
|
+
"size": "mini"
|
86130
|
+
},
|
86131
|
+
on: {
|
86132
|
+
"click": _vm.veriface
|
86133
|
+
}
|
86134
|
+
}, [_vm._v("开始识别")])];
|
86135
|
+
},
|
86136
|
+
proxy: true
|
86137
|
+
}], null, false, 3429989024)
|
86138
|
+
}, [_c('div', {
|
86139
|
+
staticStyle: {
|
86140
|
+
"width": "320px",
|
86141
|
+
"height": "240px"
|
86142
|
+
},
|
86143
|
+
attrs: {
|
86144
|
+
"id": "camera_row"
|
86145
|
+
}
|
86146
|
+
})])], 1)], 1), _c('span', {
|
86147
|
+
staticClass: "dialog-footer",
|
86148
|
+
attrs: {
|
86149
|
+
"slot": "footer"
|
86150
|
+
},
|
86151
|
+
slot: "footer"
|
86152
|
+
}, _vm._l(_vm.buttonList, function (button) {
|
86153
|
+
return _c('el-button', _vm._b({
|
86154
|
+
key: button.name,
|
86155
|
+
on: {
|
86156
|
+
"click": function ($event) {
|
86157
|
+
return _vm.buttonClickEvent(button.name);
|
86158
|
+
}
|
86159
|
+
}
|
86160
|
+
}, 'el-button', button, false), [_vm._v(_vm._s(button.label) + " ")]);
|
86161
|
+
}), 1)], 1) : _vm._e();
|
86162
|
+
};
|
86163
|
+
var face_auth_dialogvue_type_template_id_370e03c8_staticRenderFns = [];
|
86164
|
+
|
86165
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=template&id=370e03c8&
|
86166
|
+
|
86167
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=script&lang=js&
|
86168
|
+
|
86169
|
+
/* harmony default export */ var face_auth_dialogvue_type_script_lang_js_ = ({
|
86170
|
+
name: 'face-auth-dialog',
|
86171
|
+
data: () => {
|
86172
|
+
return {
|
86173
|
+
visibility: true,
|
86174
|
+
buttonList: [{
|
86175
|
+
name: 'cancel',
|
86176
|
+
label: '取消',
|
86177
|
+
size: 'small'
|
86178
|
+
}, {
|
86179
|
+
name: 'sure',
|
86180
|
+
label: '确定',
|
86181
|
+
type: 'primary',
|
86182
|
+
size: 'small',
|
86183
|
+
icon: 'el-icon-success'
|
86184
|
+
}],
|
86185
|
+
idCardInfo: {
|
86186
|
+
info: {
|
86187
|
+
name: '',
|
86188
|
+
sex: '',
|
86189
|
+
nation: '',
|
86190
|
+
birthday: '',
|
86191
|
+
address: '',
|
86192
|
+
cardId: '',
|
86193
|
+
police: '',
|
86194
|
+
validStart: '',
|
86195
|
+
validEnd: '',
|
86196
|
+
sexCode: '',
|
86197
|
+
nationCode: ''
|
86198
|
+
},
|
86199
|
+
headImage: undefined
|
86200
|
+
},
|
86201
|
+
verifaceData
|
86202
|
+
};
|
86203
|
+
},
|
86204
|
+
computed: {
|
86205
|
+
IDInfo() {
|
86206
|
+
return this.idCardInfo.info;
|
86207
|
+
},
|
86208
|
+
birthYear() {
|
86209
|
+
return this.idCardInfo.info.birthday ? this.idCardInfo.info.birthday.slice(0, 4) : '';
|
86210
|
+
},
|
86211
|
+
birthMonth() {
|
86212
|
+
return this.idCardInfo.info.birthday ? this.idCardInfo.info.birthday.slice(4, 6) : '';
|
86213
|
+
},
|
86214
|
+
birthDay() {
|
86215
|
+
return this.idCardInfo.info.birthday ? this.idCardInfo.info.birthday.slice(6, 8) : '';
|
86216
|
+
},
|
86217
|
+
validDate() {
|
86218
|
+
return this.idCardInfo.info.validStart && this.idCardInfo.info.validEnd ? this.idCardInfo.info.validStart + '-' + this.idCardInfo.info.validEnd : '';
|
86219
|
+
}
|
86220
|
+
},
|
86221
|
+
mounted() {
|
86222
|
+
this.$nextTick(() => {
|
86223
|
+
(0,tsToJs/* loadCamera */.xj)();
|
86224
|
+
});
|
86225
|
+
},
|
86226
|
+
methods: {
|
86227
|
+
async veriface() {
|
86228
|
+
const data = await tsToJs/* tsToJs.getElement */.g$.getElement(4);
|
86229
|
+
this.idCardInfo = data.idCard;
|
86230
|
+
this.verifaceData = data;
|
86231
|
+
},
|
86232
|
+
buttonClickEvent(name) {
|
86233
|
+
switch (name) {
|
86234
|
+
case 'cancel':
|
86235
|
+
this.visibility = false;
|
86236
|
+
break;
|
86237
|
+
case 'sure':
|
86238
|
+
this.$emit('close', this.verifaceData);
|
86239
|
+
this.visibility = false;
|
86240
|
+
break;
|
86241
|
+
}
|
86242
|
+
}
|
86243
|
+
}
|
86244
|
+
});
|
86245
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=script&lang=js&
|
86246
|
+
/* harmony default export */ var dialog_face_auth_dialogvue_type_script_lang_js_ = (face_auth_dialogvue_type_script_lang_js_);
|
86247
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=style&index=0&id=370e03c8&prod&lang=scss&
|
86248
|
+
// extracted by mini-css-extract-plugin
|
86249
|
+
|
86250
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=style&index=0&id=370e03c8&prod&lang=scss&
|
86251
|
+
|
86252
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue
|
86253
|
+
|
86254
|
+
|
86255
|
+
|
86256
|
+
;
|
86257
|
+
|
86258
|
+
|
86259
|
+
/* normalize component */
|
86260
|
+
|
86261
|
+
var face_auth_dialog_component = normalizeComponent(
|
86262
|
+
dialog_face_auth_dialogvue_type_script_lang_js_,
|
86263
|
+
face_auth_dialogvue_type_template_id_370e03c8_render,
|
86264
|
+
face_auth_dialogvue_type_template_id_370e03c8_staticRenderFns,
|
86265
|
+
false,
|
86266
|
+
null,
|
86267
|
+
null,
|
86268
|
+
null
|
86269
|
+
|
86270
|
+
)
|
86271
|
+
|
86272
|
+
/* harmony default export */ var face_auth_dialog = (face_auth_dialog_component.exports);
|
86273
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/eloam-take-photo-dialog.vue?vue&type=template&id=6e18b4de&scoped=true&
|
86274
|
+
var eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_render = function render() {
|
86275
|
+
var _vm = this,
|
86276
|
+
_c = _vm._self._c;
|
86277
|
+
return _vm.visibility ? _c('el-dialog', {
|
86278
|
+
staticClass: "face-auth-dialog",
|
86279
|
+
attrs: {
|
86280
|
+
"title": "拍照",
|
86281
|
+
"top": '5vh',
|
86282
|
+
"width": '620px',
|
86283
|
+
"visible": _vm.visibility,
|
86284
|
+
"close-on-click-modal": false
|
86285
|
+
},
|
86286
|
+
on: {
|
86287
|
+
"update:visible": function ($event) {
|
86288
|
+
_vm.visibility = $event;
|
86289
|
+
}
|
86290
|
+
}
|
86291
|
+
}, [_c('div', {
|
86292
|
+
staticClass: "image-container"
|
86293
|
+
}, [_c('img', {
|
86294
|
+
directives: [{
|
86295
|
+
name: "show",
|
86296
|
+
rawName: "v-show",
|
86297
|
+
value: !_vm.scannerPhotoSrc,
|
86298
|
+
expression: "!scannerPhotoSrc"
|
86299
|
+
}],
|
86300
|
+
staticStyle: {
|
86301
|
+
"width": "600px",
|
86302
|
+
"height": "450px"
|
86303
|
+
},
|
86304
|
+
attrs: {
|
86305
|
+
"id": "photo",
|
86306
|
+
"src": _vm.scannerVideoSrc
|
86307
|
+
}
|
86308
|
+
}), _c('img', {
|
86309
|
+
directives: [{
|
86310
|
+
name: "show",
|
86311
|
+
rawName: "v-show",
|
86312
|
+
value: _vm.scannerPhotoSrc,
|
86313
|
+
expression: "scannerPhotoSrc"
|
86314
|
+
}],
|
86315
|
+
staticStyle: {
|
86316
|
+
"width": "600px",
|
86317
|
+
"height": "450px"
|
86318
|
+
},
|
86319
|
+
attrs: {
|
86320
|
+
"id": "photo",
|
86321
|
+
"src": 'data:image/jpg;base64,' + _vm.scannerPhotoSrc
|
86322
|
+
}
|
86323
|
+
})]), _c('span', {
|
86324
|
+
staticClass: "dialog-footer",
|
86325
|
+
attrs: {
|
86326
|
+
"slot": "footer"
|
86327
|
+
},
|
86328
|
+
slot: "footer"
|
86329
|
+
}, [_vm._l(_vm.buttonList, function (button) {
|
86330
|
+
return [_vm.isShowButton(button.name) ? _c('el-button', _vm._b({
|
86331
|
+
key: button.name,
|
86332
|
+
on: {
|
86333
|
+
"click": function ($event) {
|
86334
|
+
return _vm.buttonClickEvent(button.name);
|
86335
|
+
}
|
86336
|
+
}
|
86337
|
+
}, 'el-button', button, false), [_vm._v(_vm._s(button.label) + " ")]) : _vm._e()];
|
86338
|
+
})], 2)]) : _vm._e();
|
86339
|
+
};
|
86340
|
+
var eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_staticRenderFns = [];
|
86341
|
+
|
86342
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/eloam-take-photo-dialog.vue?vue&type=script&lang=js&
|
86343
|
+
|
86344
|
+
/* harmony default export */ var eloam_take_photo_dialogvue_type_script_lang_js_ = ({
|
86345
|
+
name: 'eloam-take-photo-dialog',
|
86346
|
+
data: () => {
|
86347
|
+
return {
|
86348
|
+
visibility: true,
|
86349
|
+
scannerVideoSrc: ELoamPassService.secondaryCameraUrl,
|
86350
|
+
scannerPhotoSrc: '',
|
86351
|
+
buttonList: [{
|
86352
|
+
name: 'cancel',
|
86353
|
+
label: '取消',
|
86354
|
+
size: 'small'
|
86355
|
+
}, {
|
86356
|
+
name: 'take-photo',
|
86357
|
+
label: '拍照',
|
86358
|
+
type: 'primary',
|
86359
|
+
size: 'small'
|
86360
|
+
}, {
|
86361
|
+
name: 'retake-photo',
|
86362
|
+
label: '重拍',
|
86363
|
+
type: 'primary',
|
86364
|
+
size: 'small'
|
86365
|
+
}, {
|
86366
|
+
name: 'sure',
|
86367
|
+
label: '确定',
|
86368
|
+
type: 'primary',
|
86369
|
+
size: 'small'
|
86370
|
+
}]
|
86371
|
+
};
|
86372
|
+
},
|
86373
|
+
methods: {
|
86374
|
+
isShowButton(name) {
|
86375
|
+
switch (name) {
|
86376
|
+
case 'take-photo':
|
86377
|
+
return !this.scannerPhotoSrc;
|
86378
|
+
case 'retake-photo':
|
86379
|
+
return this.scannerPhotoSrc;
|
86380
|
+
default:
|
86381
|
+
return true;
|
86382
|
+
}
|
86383
|
+
},
|
86384
|
+
async buttonClickEvent(name) {
|
86385
|
+
switch (name) {
|
86386
|
+
case 'cancel':
|
86387
|
+
this.visibility = false;
|
86388
|
+
break;
|
86389
|
+
case 'take-photo':
|
86390
|
+
const res = await ELoamPassService.scanBySecondaryCamera();
|
86391
|
+
this.scannerPhotoSrc = res;
|
86392
|
+
break;
|
86393
|
+
case 'retake-photo':
|
86394
|
+
this.scannerPhotoSrc = '';
|
86395
|
+
break;
|
86396
|
+
case 'sure':
|
86397
|
+
let data = {
|
86398
|
+
faceimg: this.scannerPhotoSrc
|
86399
|
+
};
|
86400
|
+
this.$emit('close', data);
|
86401
|
+
this.visibility = false;
|
86402
|
+
break;
|
86403
|
+
}
|
86404
|
+
}
|
86405
|
+
}
|
86406
|
+
});
|
86407
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/eloam-take-photo-dialog.vue?vue&type=script&lang=js&
|
86408
|
+
/* harmony default export */ var dialog_eloam_take_photo_dialogvue_type_script_lang_js_ = (eloam_take_photo_dialogvue_type_script_lang_js_);
|
86409
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/eloam-take-photo-dialog.vue
|
83662
86410
|
|
83663
86411
|
|
83664
86412
|
|
@@ -83666,27 +86414,323 @@ var id_card_reader_eloamvue_type_template_id_5b7ce781_scoped_true_staticRenderFn
|
|
83666
86414
|
|
83667
86415
|
/* normalize component */
|
83668
86416
|
;
|
83669
|
-
var
|
83670
|
-
|
83671
|
-
|
83672
|
-
|
86417
|
+
var eloam_take_photo_dialog_component = normalizeComponent(
|
86418
|
+
dialog_eloam_take_photo_dialogvue_type_script_lang_js_,
|
86419
|
+
eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_render,
|
86420
|
+
eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_staticRenderFns,
|
83673
86421
|
false,
|
83674
86422
|
null,
|
83675
|
-
"
|
86423
|
+
"6e18b4de",
|
83676
86424
|
null
|
83677
86425
|
|
83678
86426
|
)
|
83679
86427
|
|
83680
|
-
/* harmony default export */ var
|
83681
|
-
|
86428
|
+
/* harmony default export */ var eloam_take_photo_dialog = (eloam_take_photo_dialog_component.exports);
|
86429
|
+
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
86430
|
+
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(3797);
|
86431
|
+
var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
|
86432
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=script&lang=js&
|
86433
|
+
|
86434
|
+
|
86435
|
+
|
86436
|
+
|
86437
|
+
|
86438
|
+
|
86439
|
+
|
86440
|
+
|
86441
|
+
|
86442
|
+
|
86443
|
+
/* harmony default export */ var id_card_reader_buttonvue_type_script_lang_js_ = ({
|
86444
|
+
name: 'id-card-reader-button',
|
86445
|
+
props: {
|
86446
|
+
label: {
|
86447
|
+
default: '',
|
86448
|
+
type: String
|
86449
|
+
},
|
86450
|
+
tip: {
|
86451
|
+
default: '',
|
86452
|
+
type: String
|
86453
|
+
},
|
86454
|
+
className: {
|
86455
|
+
default: '',
|
86456
|
+
type: String
|
86457
|
+
},
|
86458
|
+
size: {
|
86459
|
+
default: 'mini',
|
86460
|
+
type: String
|
86461
|
+
},
|
86462
|
+
type: {
|
86463
|
+
default: 'primary',
|
86464
|
+
type: String
|
86465
|
+
},
|
86466
|
+
plain: {
|
86467
|
+
default: false,
|
86468
|
+
type: Boolean
|
86469
|
+
},
|
86470
|
+
/** Determine whether it's a round button */
|
86471
|
+
round: {
|
86472
|
+
default: false,
|
86473
|
+
type: Boolean
|
86474
|
+
},
|
86475
|
+
/** Determine whether it's loading */
|
86476
|
+
loading: {
|
86477
|
+
default: false,
|
86478
|
+
type: Boolean
|
86479
|
+
},
|
86480
|
+
/** Button icon, accepts an icon name of Element icon component */
|
86481
|
+
icon: {
|
86482
|
+
default: 'el-icon-postcard',
|
86483
|
+
type: String
|
86484
|
+
},
|
86485
|
+
disabled: {
|
86486
|
+
default: false,
|
86487
|
+
type: Boolean
|
86488
|
+
},
|
86489
|
+
/**
|
86490
|
+
* 读卡器:0-默认读卡器及精伦读卡器;1-丽水一体机;2-沃斯德人证交互终端;3-中正人脸识别;4-华大读卡器;5-良田
|
86491
|
+
* 人脸识别:0-默认人脸识别(拍照);1-丽水一体机 2-沃斯德人证交互终端;3-中正人脸识别;5-良田
|
86492
|
+
* 读取社保卡:2-沃斯德人证交互终端;4-华大读卡器
|
86493
|
+
* 签字版:0-有为签字版;1-汉王签字版;2-沃斯德人证交互终端签字
|
86494
|
+
*/
|
86495
|
+
readMachineType: {
|
86496
|
+
default: 0,
|
86497
|
+
type: Number
|
86498
|
+
},
|
86499
|
+
/**
|
86500
|
+
* 读取模式:idCard-读取二代身份证;veriface-人证核验;socialSecurityCard-读取社保卡;sign-签字
|
86501
|
+
*/
|
86502
|
+
readerMode: {
|
86503
|
+
default: 'idCard',
|
86504
|
+
type: String
|
86505
|
+
}
|
86506
|
+
},
|
86507
|
+
data: () => {
|
86508
|
+
return {
|
86509
|
+
showIDCardChrome: false
|
86510
|
+
};
|
86511
|
+
},
|
86512
|
+
computed: {
|
86513
|
+
_className() {
|
86514
|
+
const classBase = ['z-button'];
|
86515
|
+
if (this.type === 'text') {
|
86516
|
+
classBase.push('i-font-size');
|
86517
|
+
}
|
86518
|
+
if (!this.className) {
|
86519
|
+
return classBase;
|
86520
|
+
} else if (typeof this.className === 'string') {
|
86521
|
+
classBase.push(this.className);
|
86522
|
+
} else {
|
86523
|
+
classBase.push(...this.className);
|
86524
|
+
}
|
86525
|
+
return classBase;
|
86526
|
+
}
|
86527
|
+
},
|
86528
|
+
methods: {
|
86529
|
+
handleClick() {
|
86530
|
+
switch (this.readerMode) {
|
86531
|
+
case 'idCard':
|
86532
|
+
return this.idCardRReaderEvent();
|
86533
|
+
case 'veriface':
|
86534
|
+
return this.faceReaderEvent();
|
86535
|
+
}
|
86536
|
+
},
|
86537
|
+
/**
|
86538
|
+
* 读取二代身份证
|
86539
|
+
*/
|
86540
|
+
async idCardRReaderEvent() {
|
86541
|
+
let idcardInfo;
|
86542
|
+
switch (this.readMachineType) {
|
86543
|
+
case 0:
|
86544
|
+
idcardInfo = await IdCardReadService.idCardCommonRead();
|
86545
|
+
this.$emit('click', idcardInfo);
|
86546
|
+
break;
|
86547
|
+
case 2:
|
86548
|
+
idcardInfo = await EWindowPassService.idCardRead();
|
86549
|
+
this.$emit('click', idcardInfo);
|
86550
|
+
break;
|
86551
|
+
case 3:
|
86552
|
+
const data = await MRAdbReadService.idCardRead();
|
86553
|
+
if (data) idcardInfo = data.idCard;
|
86554
|
+
this.$emit('click', idcardInfo);
|
86555
|
+
break;
|
86556
|
+
case 4:
|
86557
|
+
idcardInfo = await HuzReadService.idCardRead();
|
86558
|
+
this.$emit('click', idcardInfo);
|
86559
|
+
break;
|
86560
|
+
case 1:
|
86561
|
+
return this.readLSIDCard();
|
86562
|
+
case 5:
|
86563
|
+
idcardInfo = await ELoamPassService.idCardRead();
|
86564
|
+
this.$emit('click', idcardInfo);
|
86565
|
+
break;
|
86566
|
+
}
|
86567
|
+
},
|
86568
|
+
/**
|
86569
|
+
* 人证核验
|
86570
|
+
*/
|
86571
|
+
async faceReaderEvent() {
|
86572
|
+
switch (this.readMachineType) {
|
86573
|
+
case 0:
|
86574
|
+
{
|
86575
|
+
const realPicture = await CameraReadService.read();
|
86576
|
+
this.$emit('click', {
|
86577
|
+
faceimg: realPicture
|
86578
|
+
});
|
86579
|
+
break;
|
86580
|
+
}
|
86581
|
+
case 1:
|
86582
|
+
this.readLSIDCardAndMatchFace();
|
86583
|
+
break;
|
86584
|
+
case 2:
|
86585
|
+
{
|
86586
|
+
const data = await EWindowPassService.faceValidateWithIdCardRead();
|
86587
|
+
this.$emit('click', data);
|
86588
|
+
break;
|
86589
|
+
}
|
86590
|
+
case 3:
|
86591
|
+
{
|
86592
|
+
const data = await MRAdbReadService.idCardRead();
|
86593
|
+
this.$emit('click', data);
|
86594
|
+
break;
|
86595
|
+
}
|
86596
|
+
case 5:
|
86597
|
+
this.readFacePhotoByELoam();
|
86598
|
+
}
|
86599
|
+
},
|
86600
|
+
/**
|
86601
|
+
* 读取社保卡
|
86602
|
+
*/
|
86603
|
+
async socialSecurityCardReaderEvent() {
|
86604
|
+
try {
|
86605
|
+
let idcardInfo;
|
86606
|
+
switch (this.readMachineType) {
|
86607
|
+
case 2:
|
86608
|
+
idcardInfo = await EWindowPassService.socialSecurityCardRead();
|
86609
|
+
break;
|
86610
|
+
case 4:
|
86611
|
+
idcardInfo = await HuzReadService.socialSecurityCardRead();
|
86612
|
+
break;
|
86613
|
+
}
|
86614
|
+
this.$emit('click', idcardInfo);
|
86615
|
+
} catch (e) {
|
86616
|
+
throw Error('读取社保卡失败');
|
86617
|
+
}
|
86618
|
+
},
|
86619
|
+
/**
|
86620
|
+
* 签字
|
86621
|
+
*/
|
86622
|
+
async signEvent() {
|
86623
|
+
let userSignature = '';
|
86624
|
+
switch (this.readMachineType) {
|
86625
|
+
case 0:
|
86626
|
+
userSignature = await SignReadService.read();
|
86627
|
+
break;
|
86628
|
+
case 1:
|
86629
|
+
userSignature = await SignReadService.read(PluginApiType.hwSign);
|
86630
|
+
break;
|
86631
|
+
case 2:
|
86632
|
+
userSignature = await EWindowPassService.signNameRead();
|
86633
|
+
break;
|
86634
|
+
}
|
86635
|
+
// 返回base64编码内容,无前缀
|
86636
|
+
this.$emit('click', userSignature);
|
86637
|
+
},
|
86638
|
+
async readLSIDCardAndMatchFace() {
|
86639
|
+
this.showIDCardChrome = true;
|
86640
|
+
debugger;
|
86641
|
+
const modalNode = document.createElement('div');
|
86642
|
+
document.body.appendChild(modalNode);
|
86643
|
+
const vm = new (external_commonjs_vue_commonjs2_vue_root_Vue_default())({
|
86644
|
+
render: h => {
|
86645
|
+
return h(face_auth_dialog, {
|
86646
|
+
props: {},
|
86647
|
+
on: {
|
86648
|
+
close: data => {
|
86649
|
+
console.log('destroy data=>', data);
|
86650
|
+
if (data.zt !== '比对成功') {
|
86651
|
+
throw Error('认证失败');
|
86652
|
+
} else {
|
86653
|
+
this.$message.success('认证成功');
|
86654
|
+
this.$emit('click', data);
|
86655
|
+
}
|
86656
|
+
this.showIDCardChrome = false;
|
86657
|
+
vm.$destroy();
|
86658
|
+
vm.$el.remove();
|
86659
|
+
}
|
86660
|
+
}
|
86661
|
+
});
|
86662
|
+
},
|
86663
|
+
parent: this
|
86664
|
+
}).$mount(modalNode);
|
86665
|
+
},
|
86666
|
+
/** 良田拍照*/
|
86667
|
+
readFacePhotoByELoam() {
|
86668
|
+
const modalNode = document.createElement('div');
|
86669
|
+
document.body.appendChild(modalNode);
|
86670
|
+
const vm = new (external_commonjs_vue_commonjs2_vue_root_Vue_default())({
|
86671
|
+
render: h => {
|
86672
|
+
return h(eloam_take_photo_dialog, {
|
86673
|
+
props: {},
|
86674
|
+
on: {
|
86675
|
+
close: data => {
|
86676
|
+
this.$emit('photo-change', data);
|
86677
|
+
vm.$destroy();
|
86678
|
+
vm.$el.remove();
|
86679
|
+
}
|
86680
|
+
}
|
86681
|
+
});
|
86682
|
+
},
|
86683
|
+
parent: this
|
86684
|
+
}).$mount(modalNode);
|
86685
|
+
},
|
86686
|
+
readLSIDCard() {
|
86687
|
+
this.showIDCardChrome = true;
|
86688
|
+
this.$nextTick(async () => {
|
86689
|
+
try {
|
86690
|
+
debugger;
|
86691
|
+
const idcardInfo = await (0,tsToJs/* GetIDCardOnly */.oK)();
|
86692
|
+
console.log('丽水一体机读取身份证信息=>', idcardInfo);
|
86693
|
+
this.$emit('click', idcardInfo);
|
86694
|
+
} catch (e) {
|
86695
|
+
throw Error('读取身份证信息失败');
|
86696
|
+
} finally {
|
86697
|
+
this.showIDCardChrome = false;
|
86698
|
+
}
|
86699
|
+
});
|
86700
|
+
}
|
86701
|
+
}
|
86702
|
+
});
|
86703
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=script&lang=js&
|
86704
|
+
/* harmony default export */ var src_id_card_reader_buttonvue_type_script_lang_js_ = (id_card_reader_buttonvue_type_script_lang_js_);
|
86705
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue
|
86706
|
+
|
86707
|
+
|
86708
|
+
|
86709
|
+
|
86710
|
+
|
86711
|
+
/* normalize component */
|
86712
|
+
;
|
86713
|
+
var id_card_reader_button_component = normalizeComponent(
|
86714
|
+
src_id_card_reader_buttonvue_type_script_lang_js_,
|
86715
|
+
id_card_reader_buttonvue_type_template_id_6bdb0354_scoped_true_render,
|
86716
|
+
id_card_reader_buttonvue_type_template_id_6bdb0354_scoped_true_staticRenderFns,
|
86717
|
+
false,
|
86718
|
+
null,
|
86719
|
+
"6bdb0354",
|
86720
|
+
null
|
86721
|
+
|
86722
|
+
)
|
86723
|
+
|
86724
|
+
/* harmony default export */ var id_card_reader_button = (id_card_reader_button_component.exports);
|
86725
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/index.js
|
83682
86726
|
|
83683
86727
|
|
83684
86728
|
// 组件的install方法用于按需引入
|
83685
86729
|
// @ts-ignore
|
83686
|
-
|
83687
|
-
Vue.component(
|
86730
|
+
id_card_reader_button.install = Vue => {
|
86731
|
+
Vue.component(id_card_reader_button.name, id_card_reader_button);
|
83688
86732
|
};
|
83689
|
-
/* harmony default export */ var
|
86733
|
+
/* harmony default export */ var id_card_reader_id_card_reader_button = (id_card_reader_button);
|
83690
86734
|
;// CONCATENATED MODULE: ./packages/index.js
|
83691
86735
|
|
83692
86736
|
|
@@ -83695,6 +86739,8 @@ id_card_reader_eloam.install = Vue => {
|
|
83695
86739
|
|
83696
86740
|
|
83697
86741
|
|
86742
|
+
|
86743
|
+
|
83698
86744
|
// import {
|
83699
86745
|
// Button,
|
83700
86746
|
// Tooltip,
|
@@ -83710,7 +86756,7 @@ id_card_reader_eloam.install = Vue => {
|
|
83710
86756
|
// Dialog
|
83711
86757
|
// ]
|
83712
86758
|
// 组件列表
|
83713
|
-
const components = [packages_zs_empty, id_card_reader_id_card_reader_demo, scanner_scanner_high_camera_jieyu, scanner_scanner_eloam,
|
86759
|
+
const components = [packages_zs_empty, id_card_reader_id_card_reader_demo, id_card_reader_id_card_reader_eloam, id_card_reader_id_card_reader_button, scanner_scanner_high_camera_jieyu, scanner_scanner_eloam, scanner_scanner_camera];
|
83714
86760
|
|
83715
86761
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,那么所有的组件都会被注册
|
83716
86762
|
const install = Vue => {
|