unify-external-plugin-platform 0.0.2-37 → 0.0.2-38
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 +2274 -3
- package/dist/external-plugin.common.js.map +1 -1
- package/dist/external-plugin.css +1 -1
- package/dist/external-plugin.umd.js +2274 -3
- 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
@@ -81799,6 +81799,359 @@ var index = (function () {
|
|
81799
81799
|
/* harmony default export */ __webpack_exports__["default"] = (index);
|
81800
81800
|
|
81801
81801
|
|
81802
|
+
/***/ }),
|
81803
|
+
|
81804
|
+
/***/ 3144:
|
81805
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
81806
|
+
|
81807
|
+
"use strict";
|
81808
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
81809
|
+
/* harmony export */ "g$": function() { return /* binding */ tsToJs; },
|
81810
|
+
/* harmony export */ "oK": function() { return /* binding */ GetIDCardOnly; },
|
81811
|
+
/* harmony export */ "xj": function() { return /* binding */ loadCamera; }
|
81812
|
+
/* harmony export */ });
|
81813
|
+
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7658);
|
81814
|
+
/* 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__);
|
81815
|
+
|
81816
|
+
var tsToJs = {
|
81817
|
+
/**
|
81818
|
+
* @return {any}
|
81819
|
+
*/
|
81820
|
+
getElement: function Stirng(flag, photoId) {
|
81821
|
+
var plugin;
|
81822
|
+
if (flag == 1) {
|
81823
|
+
// 中正人脸识别,但是用不起来,换websocket形式调用了,此处弃用,害!
|
81824
|
+
debugger;
|
81825
|
+
// if (location.href.indexOf('TakePhoto') == -1) {
|
81826
|
+
console.log("人脸识别开始-----");
|
81827
|
+
var plugin = document.getElementById("facePlugin");
|
81828
|
+
console.log("plugin-----", plugin);
|
81829
|
+
var data = "$=Action";
|
81830
|
+
var temp = plugin.SendDataToADB("127.0.0.1", 1352, 15000, data, data.length);
|
81831
|
+
console.log(temp + "-----====");
|
81832
|
+
//处理返回的结果,获取相应的属性
|
81833
|
+
if (typeof temp === "undefined") {
|
81834
|
+
return null;
|
81835
|
+
}
|
81836
|
+
var str = temp.split("$");
|
81837
|
+
var result = str[1].split("=#=")[1];
|
81838
|
+
console.log("result:" + result + "-----++++");
|
81839
|
+
var name = str[2].split("=#=")[1];
|
81840
|
+
var sex = str[3].split("=#=")[1];
|
81841
|
+
var cardNo = str[4].split("=#=")[1];
|
81842
|
+
console.log("cardNo:" + cardNo + "-----++++");
|
81843
|
+
var address = str[5].split("=#=")[1];
|
81844
|
+
var birthday = str[6].split("=#=")[1];
|
81845
|
+
var cardImg = str[8].split("=#=")[1];
|
81846
|
+
var faceImg = str[9].split("=#=")[1];
|
81847
|
+
var race = str[10].split("=#=")[1];
|
81848
|
+
var regOrg = str[11].split("=#=")[1];
|
81849
|
+
var validTime = str[12].split("=#=")[1];
|
81850
|
+
var validTimeStart = validTime.split("-")[0];
|
81851
|
+
var validTimeEnd = validTime.split("-")[1];
|
81852
|
+
//处理身份证信息并赋值
|
81853
|
+
var objSfz = {
|
81854
|
+
"idCard": {
|
81855
|
+
"info": {
|
81856
|
+
"name": name.toString(),
|
81857
|
+
"sex": sex.toString(),
|
81858
|
+
"nation": race.toString(),
|
81859
|
+
"birthday": birthday.toString(),
|
81860
|
+
"address": address.toString(),
|
81861
|
+
"cardId": cardNo.toString(),
|
81862
|
+
"police": regOrg.toString(),
|
81863
|
+
"validStart": validTimeStart.toString(),
|
81864
|
+
"validEnd": validTimeEnd.toString(),
|
81865
|
+
"sexCode": "",
|
81866
|
+
"nationCode": ""
|
81867
|
+
},
|
81868
|
+
"headImage": cardImg.toString()
|
81869
|
+
},
|
81870
|
+
"faceimg": faceImg.toString(),
|
81871
|
+
"zt": ""
|
81872
|
+
};
|
81873
|
+
// objSfz = {
|
81874
|
+
// "zjh": cardNo.toString(),
|
81875
|
+
// "xm": name.toString(),
|
81876
|
+
// "xb": sex.toString(),
|
81877
|
+
// "sr": birthday.toString(),
|
81878
|
+
// "mz": race.toString(),
|
81879
|
+
// "zz": address.toString(),
|
81880
|
+
// "qfjg": regOrg.toString(),
|
81881
|
+
// "yxqx": validTime.toString(),
|
81882
|
+
// "yxqx1": validTimeStart.toString(),
|
81883
|
+
// "yxqx2": validTimeEnd.toString(),
|
81884
|
+
// "zpString": cardImg.toString(),
|
81885
|
+
// "faceImg": faceImg.toString()
|
81886
|
+
// };
|
81887
|
+
console.log('-------------------objSfz成功返回数据---------------------');
|
81888
|
+
console.log('人脸识别结果===>', objSfz);
|
81889
|
+
return objSfz;
|
81890
|
+
// }
|
81891
|
+
} else if (flag == 2) {
|
81892
|
+
// console.log("idcard");
|
81893
|
+
plugin = document.getElementById('plugin');
|
81894
|
+
var temp2 = plugin.On_OpenDevice(1001);
|
81895
|
+
var obj = eval('(' + temp2 + ')');
|
81896
|
+
if (typeof obj['照片'] != "undefined") {
|
81897
|
+
if (photoId && document.getElementById(photoId)) {
|
81898
|
+
document.getElementById(photoId).src = "data:image/jpeg;base64," + obj['照片'];
|
81899
|
+
}
|
81900
|
+
console.log(obj['身份证号2'] + '._____.');
|
81901
|
+
console.log(obj['照片2'] + '._____.-----------');
|
81902
|
+
}
|
81903
|
+
return obj;
|
81904
|
+
} else if (flag == 3) {
|
81905
|
+
console.log("-----开始读取身份证信息-----");
|
81906
|
+
var plugin = document.getElementById('plugin');
|
81907
|
+
var temp2 = plugin.On_OpenDevice(1001);
|
81908
|
+
var obj = eval('(' + temp2 + ')');
|
81909
|
+
var result = {
|
81910
|
+
"info": {
|
81911
|
+
"name": obj['姓名'],
|
81912
|
+
"sex": obj['性别'],
|
81913
|
+
"nation": obj['名族'],
|
81914
|
+
"birthday": obj['出生日期'],
|
81915
|
+
"address": obj['地址'],
|
81916
|
+
"cardId": obj['身份证号'],
|
81917
|
+
"police": obj['发证机关'],
|
81918
|
+
"validStart": obj['有效期开始'],
|
81919
|
+
"validEnd": obj['有效期结束'],
|
81920
|
+
"sexCode": "",
|
81921
|
+
"nationCode": ""
|
81922
|
+
},
|
81923
|
+
"headImage": obj['照片']
|
81924
|
+
};
|
81925
|
+
console.log("-----身份证信息读取结果-----");
|
81926
|
+
console.log(result);
|
81927
|
+
return result;
|
81928
|
+
} else if (flag == 4) {
|
81929
|
+
return GetIDCardAndMatchImage();
|
81930
|
+
}
|
81931
|
+
},
|
81932
|
+
getExportInfo: function Stirng() {
|
81933
|
+
var columNameStr = '';
|
81934
|
+
var captionNameStr = '';
|
81935
|
+
$.ajaxSettings.async = false;
|
81936
|
+
$.get("assets/xml/Export.xml", false, function (d) {
|
81937
|
+
var columNameArray = [];
|
81938
|
+
var captionNameArray = [];
|
81939
|
+
$(d).find('ElementTable').each(function () {
|
81940
|
+
var $book = $(this);
|
81941
|
+
var ColumnName = $book.attr("ColumnName");
|
81942
|
+
var CaptionName = $book.attr("CaptionName");
|
81943
|
+
columNameArray.push(ColumnName);
|
81944
|
+
captionNameArray.push(CaptionName);
|
81945
|
+
// console.log(ColumnName + 'nei');
|
81946
|
+
// console.log(CaptionName + 'nei');
|
81947
|
+
});
|
81948
|
+
|
81949
|
+
columNameStr = columNameArray.join(",");
|
81950
|
+
captionNameStr = captionNameArray.join(",");
|
81951
|
+
xmlxx = {
|
81952
|
+
"columNameStr": columNameStr,
|
81953
|
+
"captionNameStr": captionNameStr
|
81954
|
+
};
|
81955
|
+
// var url = commonPath+"/blacklist/exportExcel?1=1"+queryConfig;
|
81956
|
+
// var iframe = document.createElement('IFRAME');
|
81957
|
+
// iframe.setAttribute("id","testIframe");
|
81958
|
+
// iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
|
81959
|
+
// document.body.appendChild(iframe);
|
81960
|
+
// iframe.src = url;
|
81961
|
+
|
81962
|
+
// console.log(columNameStr+"&&"+captionNameStr);
|
81963
|
+
});
|
81964
|
+
|
81965
|
+
$.ajaxSettings.async = true;
|
81966
|
+
return xmlxx;
|
81967
|
+
},
|
81968
|
+
getAreaData: function Stirng() {
|
81969
|
+
$.ajaxSettings.async = false;
|
81970
|
+
var nameArray = [];
|
81971
|
+
var dataBaseLinkArray = [];
|
81972
|
+
$.get('assets/xml/AreaData.xml', function (d) {
|
81973
|
+
$(d).find('ElementTable').each(function () {
|
81974
|
+
var $book = $(this);
|
81975
|
+
var value = $book.attr("tableName");
|
81976
|
+
var dataBaseLink = $book.children("DataBaseLink").attr("Name");
|
81977
|
+
nameArray.push(value);
|
81978
|
+
dataBaseLinkArray.push(dataBaseLink);
|
81979
|
+
});
|
81980
|
+
// loadTableList(1,true);
|
81981
|
+
});
|
81982
|
+
|
81983
|
+
$.ajaxSettings.async = true;
|
81984
|
+
xmlxx = {
|
81985
|
+
"nameArray": nameArray,
|
81986
|
+
"dataBaseLinkArray": dataBaseLinkArray
|
81987
|
+
};
|
81988
|
+
return xmlxx;
|
81989
|
+
},
|
81990
|
+
getAreaTable: function () {
|
81991
|
+
$.ajaxSettings.async = false;
|
81992
|
+
var areaTable = [];
|
81993
|
+
$.get('assets/xml/AreaData.xml', function (d) {
|
81994
|
+
$(d).find('ElementTable').each(function () {
|
81995
|
+
var $book = $(this);
|
81996
|
+
var value = $book.attr("tableName");
|
81997
|
+
var dataBaseLink = $book.children("DataBaseLink").attr("Name");
|
81998
|
+
xmlxx = {
|
81999
|
+
"tableName": value,
|
82000
|
+
"dataBaseLink": dataBaseLink
|
82001
|
+
};
|
82002
|
+
areaTable.push(xmlxx);
|
82003
|
+
});
|
82004
|
+
// loadTableList(1,true);
|
82005
|
+
});
|
82006
|
+
|
82007
|
+
$.ajaxSettings.async = true;
|
82008
|
+
return areaTable;
|
82009
|
+
},
|
82010
|
+
getPhoto: function (imgBase64, photoId) {
|
82011
|
+
document.getElementById(photoId).src = "data:image/jpeg;base64," + imgBase64;
|
82012
|
+
},
|
82013
|
+
printImg: function (domId) {
|
82014
|
+
$('#' + domId).jqprint();
|
82015
|
+
}
|
82016
|
+
};
|
82017
|
+
(function ($) {
|
82018
|
+
var opt;
|
82019
|
+
$.fn.jqprint = function (options) {
|
82020
|
+
opt = $.extend({}, $.fn.jqprint.defaults, options);
|
82021
|
+
var $element = this instanceof jQuery ? this : $(this);
|
82022
|
+
var $iframe = $("<iframe />");
|
82023
|
+
if (!opt.debug) {
|
82024
|
+
$iframe.css({
|
82025
|
+
position: "absolute",
|
82026
|
+
width: "0px",
|
82027
|
+
height: "0px",
|
82028
|
+
left: "-600px",
|
82029
|
+
top: "-600px"
|
82030
|
+
});
|
82031
|
+
}
|
82032
|
+
$iframe.appendTo("body");
|
82033
|
+
var doc = $iframe[0].contentWindow.document;
|
82034
|
+
if (opt.importCSS) {
|
82035
|
+
if ($("link[media=print]").length > 0) {
|
82036
|
+
$("link[media=print]").each(function () {
|
82037
|
+
doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
|
82038
|
+
});
|
82039
|
+
} else {
|
82040
|
+
$("link").each(function () {
|
82041
|
+
doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
|
82042
|
+
});
|
82043
|
+
}
|
82044
|
+
}
|
82045
|
+
if (opt.printContainer) {
|
82046
|
+
doc.write($element.outer());
|
82047
|
+
} else {
|
82048
|
+
$element.each(function () {
|
82049
|
+
doc.write($(this).html());
|
82050
|
+
});
|
82051
|
+
}
|
82052
|
+
doc.close();
|
82053
|
+
$iframe[0].contentWindow.focus();
|
82054
|
+
setTimeout(function () {
|
82055
|
+
$iframe[0].contentWindow.print();
|
82056
|
+
}, 1000);
|
82057
|
+
};
|
82058
|
+
$.fn.jqprint.defaults = {
|
82059
|
+
debug: false,
|
82060
|
+
importCSS: true,
|
82061
|
+
printContainer: true,
|
82062
|
+
operaSupport: true
|
82063
|
+
};
|
82064
|
+
|
82065
|
+
// Thanks to 9__, found at http://users.livejournal.com/9__/380664.html
|
82066
|
+
jQuery.fn.outer = function () {
|
82067
|
+
return $($('<div></div>').html(this.clone())).html();
|
82068
|
+
};
|
82069
|
+
}); //(jQuery);
|
82070
|
+
|
82071
|
+
function loadCamera() {
|
82072
|
+
// var IDCard = document.getElementById("IDCard_chrome");
|
82073
|
+
// var cameraRow = document.getElementById("camera_row")
|
82074
|
+
// cameraRow.innerHTML = '<embed clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=300 height=180 name="FaceObj" />'
|
82075
|
+
// ;
|
82076
|
+
var IDCard = document.getElementById("IDCard_chrome");
|
82077
|
+
var cameraRow = document.getElementById("camera_row");
|
82078
|
+
cameraRow.innerHTML = '<object clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=320 height=240 name="FaceObj"></object>';
|
82079
|
+
}
|
82080
|
+
function GetIDCardOnly() {
|
82081
|
+
var IDCard = document.getElementById("IDCard_chrome");
|
82082
|
+
var ret = IDCard.OpenDevice();
|
82083
|
+
if (ret != 0) {
|
82084
|
+
debug("一体机启动失败");
|
82085
|
+
return;
|
82086
|
+
}
|
82087
|
+
ret = IDCard.ReadIDCardInfo();
|
82088
|
+
//处理身份证信息并赋值
|
82089
|
+
var objSfz = {
|
82090
|
+
"info": {
|
82091
|
+
"name": IDCard.IDName,
|
82092
|
+
"sex": IDCard.IDSex,
|
82093
|
+
"nation": IDCard.IDFolk,
|
82094
|
+
"birthday": IDCard.IDBirth,
|
82095
|
+
"address": IDCard.IDAddress,
|
82096
|
+
"cardId": IDCard.IDNumber,
|
82097
|
+
"police": IDCard.IDOrgan,
|
82098
|
+
"validStart": IDCard.IDTermBegin.substring(0, 4) + '.' + IDCard.IDTermBegin.substring(4, 6) + '.' + IDCard.IDTermBegin.substring(6, 8),
|
82099
|
+
"validEnd": IDCard.IDTermEnd.substring(0, 4) + '.' + IDCard.IDTermEnd.substring(4, 6) + '.' + IDCard.IDTermEnd.substring(6, 8),
|
82100
|
+
"sexCode": "",
|
82101
|
+
"nationCode": ""
|
82102
|
+
},
|
82103
|
+
"headImage": IDCard.IDPhoto64
|
82104
|
+
};
|
82105
|
+
return objSfz;
|
82106
|
+
}
|
82107
|
+
|
82108
|
+
// 一体机插件 (丽水)
|
82109
|
+
function GetIDCardAndMatchImage() {
|
82110
|
+
console.log("-----开启一体机功能-----");
|
82111
|
+
var IDCard = document.getElementById("IDCard_chrome");
|
82112
|
+
// var cameraRow = document.getElementById("camera_row")
|
82113
|
+
// cameraRow.innerHTML = '<object clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=320 height=240 name="FaceObj"></object>'
|
82114
|
+
// cameraRow.innerHTML = '<embed clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=300 height=180 name="FaceObj" id="FaceObj" />'
|
82115
|
+
var ret = IDCard.OpenDevice();
|
82116
|
+
if (ret != 0) {
|
82117
|
+
debug("一体机启动失败");
|
82118
|
+
return;
|
82119
|
+
}
|
82120
|
+
ret = IDCard.ReadIDCardInfo();
|
82121
|
+
//处理身份证信息并赋值
|
82122
|
+
var objSfz = {
|
82123
|
+
"idCard": {
|
82124
|
+
"info": {
|
82125
|
+
"name": IDCard.IDName,
|
82126
|
+
"sex": IDCard.IDSex,
|
82127
|
+
"nation": IDCard.IDFolk,
|
82128
|
+
"birthday": IDCard.IDBirth,
|
82129
|
+
"address": IDCard.IDAddress,
|
82130
|
+
"cardId": IDCard.IDNumber,
|
82131
|
+
"police": IDCard.IDOrgan,
|
82132
|
+
"validStart": IDCard.IDTermBegin.substring(0, 4) + '.' + IDCard.IDTermBegin.substring(4, 6) + '.' + IDCard.IDTermBegin.substring(6, 8),
|
82133
|
+
"validEnd": IDCard.IDTermEnd.substring(0, 4) + '.' + IDCard.IDTermEnd.substring(4, 6) + '.' + IDCard.IDTermEnd.substring(6, 8),
|
82134
|
+
"sexCode": "",
|
82135
|
+
"nationCode": ""
|
82136
|
+
},
|
82137
|
+
"headImage": IDCard.IDPhoto64
|
82138
|
+
},
|
82139
|
+
"faceimg": "",
|
82140
|
+
"zt": ""
|
82141
|
+
};
|
82142
|
+
return MatchImage(objSfz);
|
82143
|
+
}
|
82144
|
+
function MatchImage(objSfz) {
|
82145
|
+
debugger;
|
82146
|
+
// var FaceObj = document.getElementById("FaceObj");
|
82147
|
+
var ret = FaceObj.MatchFace(objSfz.idCard.headImage);
|
82148
|
+
var obj = JSON.parse(ret);
|
82149
|
+
objSfz.faceimg = obj.image;
|
82150
|
+
objSfz.zt = obj.retinfo;
|
82151
|
+
console.log(objSfz);
|
82152
|
+
return objSfz;
|
82153
|
+
}
|
82154
|
+
|
81802
82155
|
/***/ }),
|
81803
82156
|
|
81804
82157
|
/***/ 2823:
|
@@ -81939,6 +82292,22 @@ module.exports = function ( delay, noTrailing, callback, debounceMode ) {
|
|
81939
82292
|
};
|
81940
82293
|
|
81941
82294
|
|
82295
|
+
/***/ }),
|
82296
|
+
|
82297
|
+
/***/ 2234:
|
82298
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
82299
|
+
|
82300
|
+
"use strict";
|
82301
|
+
module.exports = __webpack_require__.p + "img/idcardbg1.1f8e1fc6.gif";
|
82302
|
+
|
82303
|
+
/***/ }),
|
82304
|
+
|
82305
|
+
/***/ 4923:
|
82306
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
82307
|
+
|
82308
|
+
"use strict";
|
82309
|
+
module.exports = __webpack_require__.p + "img/idcardbg2.2e47b05f.gif";
|
82310
|
+
|
81942
82311
|
/***/ }),
|
81943
82312
|
|
81944
82313
|
/***/ 5053:
|
@@ -83315,7 +83684,7 @@ class ELoamPassService {
|
|
83315
83684
|
validStart,
|
83316
83685
|
validEnd
|
83317
83686
|
},
|
83318
|
-
headImage:
|
83687
|
+
headImage: photoBase64
|
83319
83688
|
};
|
83320
83689
|
return IDCardData;
|
83321
83690
|
}
|
@@ -83697,7 +84066,1909 @@ id_card_reader_eloam.install = Vue => {
|
|
83697
84066
|
Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
|
83698
84067
|
};
|
83699
84068
|
/* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
|
83700
|
-
;// CONCATENATED MODULE: ./
|
84069
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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=7cd25906&scoped=true&
|
84070
|
+
var id_card_reader_buttonvue_type_template_id_7cd25906_scoped_true_render = function render() {
|
84071
|
+
var _vm = this,
|
84072
|
+
_c = _vm._self._c;
|
84073
|
+
return _vm.tip ? _c('el-tooltip', {
|
84074
|
+
staticClass: "id-card-reader-button",
|
84075
|
+
attrs: {
|
84076
|
+
"content": _vm.tip,
|
84077
|
+
"placement": "top"
|
84078
|
+
}
|
84079
|
+
}, [_vm.showIDCardChrome ? _c('embed', {
|
84080
|
+
attrs: {
|
84081
|
+
"clsid": "{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",
|
84082
|
+
"type": "application/x-itst-activex",
|
84083
|
+
"width": "0",
|
84084
|
+
"height": "0",
|
84085
|
+
"name": "IDCard_chrome",
|
84086
|
+
"id": "IDCard_chrome"
|
84087
|
+
}
|
84088
|
+
}) : _vm._e(), _c('el-button', _vm._b({
|
84089
|
+
on: {
|
84090
|
+
"click": _vm.handleClick
|
84091
|
+
}
|
84092
|
+
}, 'el-button', {
|
84093
|
+
disabled: _vm.disabled,
|
84094
|
+
icon: _vm.icon,
|
84095
|
+
loading: _vm.loading,
|
84096
|
+
plain: _vm.plain,
|
84097
|
+
round: _vm.round,
|
84098
|
+
size: _vm.size,
|
84099
|
+
type: _vm.type,
|
84100
|
+
class: _vm._className
|
84101
|
+
}, false), [_vm._t("default", function () {
|
84102
|
+
return [_vm._v(_vm._s(_vm.label))];
|
84103
|
+
})], 2)], 1) : _c('el-button', _vm._b({
|
84104
|
+
on: {
|
84105
|
+
"click": _vm.handleClick
|
84106
|
+
}
|
84107
|
+
}, 'el-button', {
|
84108
|
+
disabled: _vm.disabled,
|
84109
|
+
icon: _vm.icon,
|
84110
|
+
loading: _vm.loading,
|
84111
|
+
plain: _vm.plain,
|
84112
|
+
round: _vm.round,
|
84113
|
+
size: _vm.size,
|
84114
|
+
type: _vm.type,
|
84115
|
+
class: _vm._className
|
84116
|
+
}, false), [_vm.showIDCardChrome ? _c('embed', {
|
84117
|
+
attrs: {
|
84118
|
+
"clsid": "{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",
|
84119
|
+
"type": "application/x-itst-activex",
|
84120
|
+
"width": "0",
|
84121
|
+
"height": "0",
|
84122
|
+
"name": "IDCard_chrome",
|
84123
|
+
"id": "IDCard_chrome"
|
84124
|
+
}
|
84125
|
+
}) : _vm._e(), _vm._t("default", function () {
|
84126
|
+
return [_vm._v(_vm._s(_vm.label))];
|
84127
|
+
})], 2);
|
84128
|
+
};
|
84129
|
+
var id_card_reader_buttonvue_type_template_id_7cd25906_scoped_true_staticRenderFns = [];
|
84130
|
+
|
84131
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
|
84132
|
+
|
84133
|
+
|
84134
|
+
/**
|
84135
|
+
* 默认设备
|
84136
|
+
* 读卡器:普天、精伦
|
84137
|
+
* 签字版:有为签字、汉王签字
|
84138
|
+
* */
|
84139
|
+
var PluginApiType;
|
84140
|
+
(function (PluginApiType) {
|
84141
|
+
/**读取二代身份证信息 */
|
84142
|
+
PluginApiType["idcard"] = "sfz";
|
84143
|
+
/**精伦身份证*/
|
84144
|
+
PluginApiType["jlsfz"] = "jlsfz";
|
84145
|
+
/**读取人脸识别信息 */
|
84146
|
+
PluginApiType["camera"] = "sxt";
|
84147
|
+
/**有为签字 */
|
84148
|
+
PluginApiType["ywSign"] = "yw";
|
84149
|
+
/**汉王签字 */
|
84150
|
+
PluginApiType["hwSign"] = "hwsign";
|
84151
|
+
})(PluginApiType || (PluginApiType = {}));
|
84152
|
+
class IdCardReadService {
|
84153
|
+
// 精伦身份证 JLSFZManage
|
84154
|
+
// 之前 SFZManage
|
84155
|
+
|
84156
|
+
static startConnect(type = PluginApiType.idcard) {
|
84157
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84158
|
+
return this;
|
84159
|
+
}
|
84160
|
+
let webSocketUrl = this.idcardWebSocketUrl;
|
84161
|
+
switch (type) {
|
84162
|
+
case PluginApiType.idcard:
|
84163
|
+
webSocketUrl = this.idcardWebSocketUrl;
|
84164
|
+
break;
|
84165
|
+
case PluginApiType.jlsfz:
|
84166
|
+
webSocketUrl = this.jlsfzWebSocketUrl;
|
84167
|
+
}
|
84168
|
+
const ws = new WebSocket(webSocketUrl);
|
84169
|
+
let resolved;
|
84170
|
+
const onConnect = new Promise(resolve => {
|
84171
|
+
resolved = resolve;
|
84172
|
+
});
|
84173
|
+
ws.onopen = () => {
|
84174
|
+
resolved(true);
|
84175
|
+
};
|
84176
|
+
ws.onmessage = event => this.handleMessage(event);
|
84177
|
+
ws.onclose = () => this.handleClose();
|
84178
|
+
ws.onerror = () => this.handleError();
|
84179
|
+
this.ws = ws;
|
84180
|
+
return onConnect;
|
84181
|
+
}
|
84182
|
+
static handleError() {
|
84183
|
+
for (const type in this.requestStore) {
|
84184
|
+
this.requestStore.forEach(({
|
84185
|
+
reject
|
84186
|
+
}) => {
|
84187
|
+
reject('handleError');
|
84188
|
+
});
|
84189
|
+
}
|
84190
|
+
throw Error('读取身份证功能加载失败');
|
84191
|
+
}
|
84192
|
+
static handleClose() {
|
84193
|
+
for (const type in this.requestStore) {
|
84194
|
+
this.requestStore.forEach(({
|
84195
|
+
reject
|
84196
|
+
}) => {
|
84197
|
+
reject('close');
|
84198
|
+
});
|
84199
|
+
}
|
84200
|
+
}
|
84201
|
+
static handleMessage(msg) {
|
84202
|
+
let data = '';
|
84203
|
+
try {
|
84204
|
+
data = JSON.parse(msg.data);
|
84205
|
+
} catch (e) {
|
84206
|
+
data = '';
|
84207
|
+
}
|
84208
|
+
this.requestStore.forEach(({
|
84209
|
+
resolve
|
84210
|
+
}) => {
|
84211
|
+
resolve(data);
|
84212
|
+
});
|
84213
|
+
this.requestStore = [];
|
84214
|
+
this.ws.close();
|
84215
|
+
}
|
84216
|
+
static async read(type = PluginApiType.idcard) {
|
84217
|
+
await this.startConnect(type);
|
84218
|
+
if (this.ws.readyState === 1) {
|
84219
|
+
this.ws.send(type);
|
84220
|
+
return new Promise((resolve, reject) => {
|
84221
|
+
if (!this.requestStore) {
|
84222
|
+
this.requestStore = [];
|
84223
|
+
}
|
84224
|
+
this.requestStore.push({
|
84225
|
+
resolve,
|
84226
|
+
reject
|
84227
|
+
});
|
84228
|
+
});
|
84229
|
+
} else {
|
84230
|
+
throw Error('读取身份证未准备完成');
|
84231
|
+
}
|
84232
|
+
}
|
84233
|
+
static async idCardCommonRead() {
|
84234
|
+
let idcardInfo;
|
84235
|
+
// 顺序不要调整,先连接精伦读卡器,最后连接普通读卡器(也就是PluginApiType.idcard,因为该项读卡失败不会返回消息)
|
84236
|
+
for (const t of [PluginApiType.jlsfz, PluginApiType.idcard]) {
|
84237
|
+
const readData = await IdCardReadService.read(t);
|
84238
|
+
if (readData && readData.hasOwnProperty('info')) {
|
84239
|
+
idcardInfo = readData;
|
84240
|
+
break;
|
84241
|
+
}
|
84242
|
+
}
|
84243
|
+
if (idcardInfo) {
|
84244
|
+
return idcardInfo;
|
84245
|
+
} else {
|
84246
|
+
throw Error('未匹配可用的读卡器');
|
84247
|
+
}
|
84248
|
+
}
|
84249
|
+
}
|
84250
|
+
_defineProperty(IdCardReadService, "idcardWebSocketUrl", 'ws://127.0.0.1:8152/SFZManage');
|
84251
|
+
_defineProperty(IdCardReadService, "jlsfzWebSocketUrl", 'ws://127.0.0.1:8152/JLSFZManage');
|
84252
|
+
_defineProperty(IdCardReadService, "ws", void 0);
|
84253
|
+
_defineProperty(IdCardReadService, "requestStore", []);
|
84254
|
+
class default_plugin_socket_service_CameraReadService {
|
84255
|
+
static startConnect() {
|
84256
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84257
|
+
return this;
|
84258
|
+
}
|
84259
|
+
let webSocketUrl = this.cameraWebSocketUrl;
|
84260
|
+
const ws = new WebSocket(webSocketUrl);
|
84261
|
+
let resolved;
|
84262
|
+
const onConnect = new Promise(resolve => {
|
84263
|
+
resolved = resolve;
|
84264
|
+
});
|
84265
|
+
ws.onopen = () => {
|
84266
|
+
resolved(true);
|
84267
|
+
};
|
84268
|
+
ws.onmessage = event => this.handleMessage(event);
|
84269
|
+
ws.onclose = () => this.handleClose();
|
84270
|
+
ws.onerror = () => this.handleError();
|
84271
|
+
this.ws = ws;
|
84272
|
+
return onConnect;
|
84273
|
+
}
|
84274
|
+
static handleError() {
|
84275
|
+
for (const type in this.requestStore) {
|
84276
|
+
this.requestStore.forEach(({
|
84277
|
+
reject
|
84278
|
+
}) => {
|
84279
|
+
reject('handleError');
|
84280
|
+
});
|
84281
|
+
}
|
84282
|
+
throw Error('读取拍照功能加载失败');
|
84283
|
+
}
|
84284
|
+
static handleClose() {
|
84285
|
+
for (const type in this.requestStore) {
|
84286
|
+
this.requestStore.forEach(({
|
84287
|
+
reject
|
84288
|
+
}) => {
|
84289
|
+
reject('close');
|
84290
|
+
});
|
84291
|
+
}
|
84292
|
+
}
|
84293
|
+
static handleMessage(msg) {
|
84294
|
+
let data = msg.data;
|
84295
|
+
this.requestStore.forEach(({
|
84296
|
+
resolve
|
84297
|
+
}) => {
|
84298
|
+
resolve(data);
|
84299
|
+
});
|
84300
|
+
this.requestStore = [];
|
84301
|
+
this.ws.close();
|
84302
|
+
// this.ws = null;
|
84303
|
+
}
|
84304
|
+
|
84305
|
+
static async read() {
|
84306
|
+
await this.startConnect();
|
84307
|
+
if (this.ws.readyState === 1) {
|
84308
|
+
this.ws.send(PluginApiType.camera);
|
84309
|
+
return new Promise((resolve, reject) => {
|
84310
|
+
if (!this.requestStore) {
|
84311
|
+
this.requestStore = [];
|
84312
|
+
}
|
84313
|
+
this.requestStore.push({
|
84314
|
+
resolve,
|
84315
|
+
reject
|
84316
|
+
});
|
84317
|
+
});
|
84318
|
+
} else {
|
84319
|
+
throw Error('读取拍照未准备完成');
|
84320
|
+
}
|
84321
|
+
}
|
84322
|
+
}
|
84323
|
+
_defineProperty(default_plugin_socket_service_CameraReadService, "cameraWebSocketUrl", 'ws://127.0.0.1:8152/SXTManage');
|
84324
|
+
_defineProperty(default_plugin_socket_service_CameraReadService, "ws", void 0);
|
84325
|
+
_defineProperty(default_plugin_socket_service_CameraReadService, "requestStore", []);
|
84326
|
+
class SignReadService {
|
84327
|
+
static startConnect(signMode) {
|
84328
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84329
|
+
return this;
|
84330
|
+
}
|
84331
|
+
let webSocketUrl = this.signWebSocketUrl;
|
84332
|
+
if (signMode === PluginApiType.hwSign) {
|
84333
|
+
webSocketUrl = this.hwSignWebSocketUrl;
|
84334
|
+
}
|
84335
|
+
const ws = new WebSocket(webSocketUrl);
|
84336
|
+
let resolved;
|
84337
|
+
const onConnect = new Promise(resolve => {
|
84338
|
+
resolved = resolve;
|
84339
|
+
});
|
84340
|
+
ws.onopen = () => {
|
84341
|
+
resolved(true);
|
84342
|
+
};
|
84343
|
+
ws.onmessage = event => this.handleMessage(event);
|
84344
|
+
ws.onclose = () => this.handleClose();
|
84345
|
+
ws.onerror = () => this.handleError();
|
84346
|
+
this.ws = ws;
|
84347
|
+
return onConnect;
|
84348
|
+
}
|
84349
|
+
static handleError() {
|
84350
|
+
for (const type in this.requestStore) {
|
84351
|
+
this.requestStore.forEach(({
|
84352
|
+
reject
|
84353
|
+
}) => {
|
84354
|
+
reject('handleError');
|
84355
|
+
});
|
84356
|
+
}
|
84357
|
+
throw Error('签字板加载失败');
|
84358
|
+
}
|
84359
|
+
static handleClose() {
|
84360
|
+
for (const type in this.requestStore) {
|
84361
|
+
this.requestStore.forEach(({
|
84362
|
+
reject
|
84363
|
+
}) => {
|
84364
|
+
reject('close');
|
84365
|
+
});
|
84366
|
+
}
|
84367
|
+
}
|
84368
|
+
static handleMessage(msg) {
|
84369
|
+
let data = msg.data;
|
84370
|
+
this.requestStore.forEach(({
|
84371
|
+
resolve
|
84372
|
+
}) => {
|
84373
|
+
resolve(data);
|
84374
|
+
});
|
84375
|
+
this.requestStore = [];
|
84376
|
+
this.ws.close();
|
84377
|
+
}
|
84378
|
+
static async read(signMode = PluginApiType.ywSign) {
|
84379
|
+
await this.startConnect(signMode);
|
84380
|
+
if (this.ws.readyState === 1) {
|
84381
|
+
console.log('签字板连接成功');
|
84382
|
+
this.ws.send(signMode);
|
84383
|
+
return new Promise((resolve, reject) => {
|
84384
|
+
if (!this.requestStore) {
|
84385
|
+
this.requestStore = [];
|
84386
|
+
}
|
84387
|
+
this.requestStore.push({
|
84388
|
+
resolve,
|
84389
|
+
reject
|
84390
|
+
});
|
84391
|
+
});
|
84392
|
+
} else {
|
84393
|
+
throw Error('签字板未准备完成');
|
84394
|
+
}
|
84395
|
+
}
|
84396
|
+
}
|
84397
|
+
_defineProperty(SignReadService, "signWebSocketUrl", 'ws://127.0.0.1:8152/chromeManage');
|
84398
|
+
_defineProperty(SignReadService, "hwSignWebSocketUrl", 'ws://127.0.0.1:8152/HWSIGNManage');
|
84399
|
+
_defineProperty(SignReadService, "ws", void 0);
|
84400
|
+
_defineProperty(SignReadService, "requestStore", []);
|
84401
|
+
;// CONCATENATED MODULE: ./packages/utils/idCard-common-utils.ts
|
84402
|
+
/**
|
84403
|
+
* 根据身份证号码获取指定数据
|
84404
|
+
*/
|
84405
|
+
class IdCardCommonUtils {
|
84406
|
+
/**
|
84407
|
+
* 按身份证号码获取性别
|
84408
|
+
* @param idNumber 身份证号码
|
84409
|
+
* @returns 男;女;异常(身份证号码为空或长度、格式错误)
|
84410
|
+
*/
|
84411
|
+
static getGenderByIdNumber(idNumber) {
|
84412
|
+
if (idNumber) {
|
84413
|
+
let genderCode; // 性别代码
|
84414
|
+
if (idNumber.length == 18) {
|
84415
|
+
// 二代身份证号码长度为18位(第17位为性别代码)
|
84416
|
+
genderCode = idNumber.charAt(16);
|
84417
|
+
} else if (idNumber.length == 15) {
|
84418
|
+
// 一代身份证号码长度为15位(第15位为性别代码)
|
84419
|
+
genderCode = idNumber.charAt(14);
|
84420
|
+
}
|
84421
|
+
if (genderCode && !isNaN(genderCode)) {
|
84422
|
+
// 两代身份证号码的性别代码都为男奇女偶
|
84423
|
+
if (parseInt(genderCode) % 2 == 0) {
|
84424
|
+
return '女';
|
84425
|
+
}
|
84426
|
+
return '男';
|
84427
|
+
}
|
84428
|
+
}
|
84429
|
+
return '';
|
84430
|
+
}
|
84431
|
+
/**
|
84432
|
+
* 按身份证号码获取出生年月
|
84433
|
+
* @param idNumber
|
84434
|
+
* @returns
|
84435
|
+
*/
|
84436
|
+
static getBirthdayByIdNumber(idNumber) {
|
84437
|
+
if (idNumber && idNumber && idNumber.length > 13) {
|
84438
|
+
const year = idNumber.substring(6, 10);
|
84439
|
+
const month = idNumber.substring(10, 12);
|
84440
|
+
const day = idNumber.substring(12, 14);
|
84441
|
+
return year + '-' + month + '-' + day;
|
84442
|
+
}
|
84443
|
+
return '';
|
84444
|
+
}
|
84445
|
+
/**
|
84446
|
+
* 按身份证号码获取年龄
|
84447
|
+
* @param idNumber
|
84448
|
+
* @returns
|
84449
|
+
*/
|
84450
|
+
static getAgeByIdNumber(idNumber) {
|
84451
|
+
if (idNumber) {
|
84452
|
+
const ageDate = new Date();
|
84453
|
+
const month = ageDate.getMonth() + 1;
|
84454
|
+
const day = ageDate.getDate();
|
84455
|
+
let age = ageDate.getFullYear() - idNumber.substring(6, 10) - 1;
|
84456
|
+
if (idNumber.substring(10, 12) < month || idNumber.substring(10, 12) === month && idNumber.substring(12, 14) <= day) {
|
84457
|
+
age++;
|
84458
|
+
}
|
84459
|
+
if (age <= 0) {
|
84460
|
+
age = 1;
|
84461
|
+
}
|
84462
|
+
return age;
|
84463
|
+
}
|
84464
|
+
return '';
|
84465
|
+
}
|
84466
|
+
}
|
84467
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/ewp-plugin-socket.service.ts
|
84468
|
+
|
84469
|
+
|
84470
|
+
/**
|
84471
|
+
* 沃斯德人证交互终端
|
84472
|
+
* E窗通WEBSOCKET服务
|
84473
|
+
*
|
84474
|
+
* */
|
84475
|
+
|
84476
|
+
var EWindowPassMethodCode;
|
84477
|
+
(function (EWindowPassMethodCode) {
|
84478
|
+
/** 读取社保卡 */
|
84479
|
+
EWindowPassMethodCode["iReadCardBas"] = "iReadCardBas";
|
84480
|
+
/** 获取签名*/
|
84481
|
+
EWindowPassMethodCode["GetSignName_Base64"] = "GetSignName_Base64";
|
84482
|
+
/** 读取二代身份证 */
|
84483
|
+
EWindowPassMethodCode["ReadIDCard_Base64"] = "ReadIDCard_Base64";
|
84484
|
+
/** 人证比对 */
|
84485
|
+
EWindowPassMethodCode["FaceValidateWithIdCard_Base64"] = "FaceValidateWithIdCard_Base64";
|
84486
|
+
/** 获取指纹 */
|
84487
|
+
EWindowPassMethodCode["FingerPrint_Base64"] = "FingerPrint_Base64";
|
84488
|
+
})(EWindowPassMethodCode || (EWindowPassMethodCode = {}));
|
84489
|
+
const EWindowPassMethodDesc = {
|
84490
|
+
[EWindowPassMethodCode.iReadCardBas]: '读取社保卡',
|
84491
|
+
[EWindowPassMethodCode.GetSignName_Base64]: '获取签名',
|
84492
|
+
[EWindowPassMethodCode.ReadIDCard_Base64]: '读取二代身份证',
|
84493
|
+
[EWindowPassMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
84494
|
+
[EWindowPassMethodCode.FingerPrint_Base64]: '获取指纹'
|
84495
|
+
};
|
84496
|
+
class EWindowPassService {
|
84497
|
+
static startConnect(method) {
|
84498
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84499
|
+
return this;
|
84500
|
+
}
|
84501
|
+
let webSocketUrl = '';
|
84502
|
+
switch (method) {
|
84503
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
84504
|
+
webSocketUrl = this.fingerPrintBasWebSocketUrl;
|
84505
|
+
break;
|
84506
|
+
default:
|
84507
|
+
webSocketUrl = this.iReadCardBasWebSocketUrl;
|
84508
|
+
break;
|
84509
|
+
}
|
84510
|
+
const ws = new WebSocket(webSocketUrl);
|
84511
|
+
let resolved;
|
84512
|
+
const onConnect = new Promise(resolve => {
|
84513
|
+
resolved = resolve;
|
84514
|
+
});
|
84515
|
+
ws.onopen = () => {
|
84516
|
+
resolved(true);
|
84517
|
+
};
|
84518
|
+
ws.onmessage = event => {
|
84519
|
+
if (method === EWindowPassMethodCode.FingerPrint_Base64) {
|
84520
|
+
// 指纹后端返回的是string
|
84521
|
+
event = {
|
84522
|
+
...event,
|
84523
|
+
data: JSON.stringify({
|
84524
|
+
fingerPrintInfo: event.data
|
84525
|
+
})
|
84526
|
+
};
|
84527
|
+
}
|
84528
|
+
this.handleMessage(event);
|
84529
|
+
};
|
84530
|
+
ws.onclose = () => this.handleClose();
|
84531
|
+
ws.onerror = () => this.handleError();
|
84532
|
+
this.ws = ws;
|
84533
|
+
return onConnect;
|
84534
|
+
}
|
84535
|
+
static handleError() {
|
84536
|
+
for (const type in this.requestStore) {
|
84537
|
+
this.requestStore.forEach(({
|
84538
|
+
reject
|
84539
|
+
}) => {
|
84540
|
+
reject('handleError');
|
84541
|
+
});
|
84542
|
+
}
|
84543
|
+
throw Error('E窗通设备功能加载失败');
|
84544
|
+
}
|
84545
|
+
static handleClose() {
|
84546
|
+
for (const type in this.requestStore) {
|
84547
|
+
this.requestStore.forEach(({
|
84548
|
+
reject
|
84549
|
+
}) => {
|
84550
|
+
reject('close');
|
84551
|
+
});
|
84552
|
+
}
|
84553
|
+
}
|
84554
|
+
static handleMessage(msg) {
|
84555
|
+
let data = '';
|
84556
|
+
try {
|
84557
|
+
data = JSON.parse(msg.data);
|
84558
|
+
} catch (e) {
|
84559
|
+
data = '';
|
84560
|
+
}
|
84561
|
+
this.requestStore.forEach(({
|
84562
|
+
resolve
|
84563
|
+
}) => {
|
84564
|
+
resolve(data);
|
84565
|
+
});
|
84566
|
+
this.requestStore = [];
|
84567
|
+
this.ws.close();
|
84568
|
+
}
|
84569
|
+
static async read(method) {
|
84570
|
+
await this.startConnect(method);
|
84571
|
+
const methodDesc = EWindowPassMethodDesc[method];
|
84572
|
+
if (this.ws.readyState === 1) {
|
84573
|
+
if (method !== EWindowPassMethodCode.FingerPrint_Base64) console.log(methodDesc + '连接成功');
|
84574
|
+
let jsonString;
|
84575
|
+
// outTimes:超时时间(秒)
|
84576
|
+
switch (method) {
|
84577
|
+
case EWindowPassMethodCode.ReadIDCard_Base64:
|
84578
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
84579
|
+
jsonString = JSON.stringify({
|
84580
|
+
method,
|
84581
|
+
args: {
|
84582
|
+
outTimes: 30,
|
84583
|
+
cardReader: 1
|
84584
|
+
}
|
84585
|
+
});
|
84586
|
+
break;
|
84587
|
+
case EWindowPassMethodCode.FaceValidateWithIdCard_Base64:
|
84588
|
+
// cardReader:0 读卡器-USB;1 读卡器-COM
|
84589
|
+
jsonString = JSON.stringify({
|
84590
|
+
method,
|
84591
|
+
args: {
|
84592
|
+
outTimes: 30,
|
84593
|
+
cardReader: 1,
|
84594
|
+
cameraType: 0
|
84595
|
+
}
|
84596
|
+
});
|
84597
|
+
break;
|
84598
|
+
case EWindowPassMethodCode.iReadCardBas:
|
84599
|
+
// icType:1接触卡;2非接触卡;3自动(接触优先);4自动(非接优先)
|
84600
|
+
jsonString = JSON.stringify({
|
84601
|
+
method,
|
84602
|
+
args: {
|
84603
|
+
icType: '1'
|
84604
|
+
}
|
84605
|
+
});
|
84606
|
+
break;
|
84607
|
+
case EWindowPassMethodCode.FingerPrint_Base64:
|
84608
|
+
// 获取指纹:getimgae,颜色(0黑色 1红色), 质量(默认0), 图像大小(288,360),类型(0民用,1公安)
|
84609
|
+
jsonString = 'getimgae,1,0,288,0';
|
84610
|
+
break;
|
84611
|
+
default:
|
84612
|
+
jsonString = JSON.stringify({
|
84613
|
+
method,
|
84614
|
+
args: {
|
84615
|
+
outTimes: 30
|
84616
|
+
}
|
84617
|
+
});
|
84618
|
+
break;
|
84619
|
+
}
|
84620
|
+
this.ws.send(jsonString);
|
84621
|
+
return new Promise((resolve, reject) => {
|
84622
|
+
if (!this.requestStore) {
|
84623
|
+
this.requestStore = [];
|
84624
|
+
}
|
84625
|
+
this.requestStore.push({
|
84626
|
+
resolve,
|
84627
|
+
reject
|
84628
|
+
});
|
84629
|
+
});
|
84630
|
+
} else {
|
84631
|
+
throw Error(methodDesc + '未准备完成');
|
84632
|
+
}
|
84633
|
+
}
|
84634
|
+
/**
|
84635
|
+
* 读取二代身份证
|
84636
|
+
* */
|
84637
|
+
static async idCardRead(method = EWindowPassMethodCode.ReadIDCard_Base64) {
|
84638
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.ReadIDCard_Base64);
|
84639
|
+
console.log('读取二代身份证==>', readData);
|
84640
|
+
if (!readData) {
|
84641
|
+
throw Error('未匹配可用的E窗通读取设备');
|
84642
|
+
}
|
84643
|
+
if (readData.retVal !== 0) {
|
84644
|
+
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
84645
|
+
}
|
84646
|
+
const idInfo = readData.idInfo.data;
|
84647
|
+
const {
|
84648
|
+
name,
|
84649
|
+
sex,
|
84650
|
+
birthday,
|
84651
|
+
address,
|
84652
|
+
id_num,
|
84653
|
+
nations
|
84654
|
+
} = idInfo;
|
84655
|
+
const IDCardData = {
|
84656
|
+
info: {
|
84657
|
+
name,
|
84658
|
+
sex,
|
84659
|
+
birthday: birthday.replace('-', '').replace('-', ''),
|
84660
|
+
address,
|
84661
|
+
cardId: id_num,
|
84662
|
+
nation: nations
|
84663
|
+
},
|
84664
|
+
headImage: readData.idPhotoPicBase64
|
84665
|
+
};
|
84666
|
+
console.log('读取二代身份证结果==>', IDCardData);
|
84667
|
+
return IDCardData;
|
84668
|
+
}
|
84669
|
+
/**
|
84670
|
+
* 人证比对
|
84671
|
+
*/
|
84672
|
+
static async faceValidateWithIdCardRead() {
|
84673
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FaceValidateWithIdCard_Base64);
|
84674
|
+
console.log('人证比对==>', readData);
|
84675
|
+
if (!readData) {
|
84676
|
+
throw Error('未匹配可用的E窗通读取设备');
|
84677
|
+
}
|
84678
|
+
if (readData.retVal !== 0) {
|
84679
|
+
throw Error("人证比对失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
84680
|
+
}
|
84681
|
+
const idInfo = readData.idInfo.data;
|
84682
|
+
const {
|
84683
|
+
name,
|
84684
|
+
sex,
|
84685
|
+
birth,
|
84686
|
+
address,
|
84687
|
+
idNo,
|
84688
|
+
nation
|
84689
|
+
} = idInfo;
|
84690
|
+
const IDCardData = {
|
84691
|
+
idCard: {
|
84692
|
+
info: {
|
84693
|
+
name,
|
84694
|
+
sex,
|
84695
|
+
birthday: birth.replace('-', '').replace('-', ''),
|
84696
|
+
address,
|
84697
|
+
cardId: idNo,
|
84698
|
+
nation
|
84699
|
+
},
|
84700
|
+
headImage: readData.idPhotoBase64
|
84701
|
+
},
|
84702
|
+
faceimg: readData.scenceBase64
|
84703
|
+
};
|
84704
|
+
console.log('人证比对结果==>', IDCardData);
|
84705
|
+
return IDCardData;
|
84706
|
+
}
|
84707
|
+
/** 读取社保卡 */
|
84708
|
+
static async socialSecurityCardRead() {
|
84709
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.iReadCardBas);
|
84710
|
+
if (!readData) {
|
84711
|
+
throw Error('未匹配可用的E窗通读取设备');
|
84712
|
+
}
|
84713
|
+
if (readData.retVal !== 0) {
|
84714
|
+
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.outInfo);
|
84715
|
+
}
|
84716
|
+
// 返回数据:330100|350781196403072943|W57681892|331100D10600000300657BCF88899F8E|张三|3B6D000000815444368660330100286BCF|1.00|2020-08-12|2030-08-12|1|SN00000000|(邮编|身份证号|卡号|社会保障号码|姓名|...不知道是什么信息了)
|
84717
|
+
const outInfo = readData.outInfo;
|
84718
|
+
const outInfoArray = outInfo.split('|');
|
84719
|
+
const cardId = outInfoArray[1];
|
84720
|
+
const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
|
84721
|
+
const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
|
84722
|
+
const IDCardData = {
|
84723
|
+
info: {
|
84724
|
+
name: outInfoArray[4],
|
84725
|
+
sex,
|
84726
|
+
birthday,
|
84727
|
+
address: '',
|
84728
|
+
cardId
|
84729
|
+
},
|
84730
|
+
headImage: ''
|
84731
|
+
};
|
84732
|
+
console.log('读取社保卡==>', readData);
|
84733
|
+
return IDCardData;
|
84734
|
+
}
|
84735
|
+
/** 获取签名-base64 */
|
84736
|
+
static async signNameRead() {
|
84737
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.GetSignName_Base64);
|
84738
|
+
if (!readData) {
|
84739
|
+
throw Error('未匹配可用的E窗通读取设备');
|
84740
|
+
}
|
84741
|
+
if (readData.retVal !== 0) {
|
84742
|
+
throw Error("读取签名失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
84743
|
+
}
|
84744
|
+
console.log('获取签名==>', readData);
|
84745
|
+
return readData.signPicBase64;
|
84746
|
+
}
|
84747
|
+
/** 获取指纹*/
|
84748
|
+
static async fingerPrintRead() {
|
84749
|
+
let timeOver = 30;
|
84750
|
+
async function readFingerPrint() {
|
84751
|
+
const readData = await EWindowPassService.read(EWindowPassMethodCode.FingerPrint_Base64);
|
84752
|
+
if (!readData) {
|
84753
|
+
throw Error('未匹配可用的E窗通读取设备');
|
84754
|
+
}
|
84755
|
+
let list = readData.fingerPrintInfo.split("|");
|
84756
|
+
console.log(list);
|
84757
|
+
let ret = Number(list[1]);
|
84758
|
+
if (ret > 1) {
|
84759
|
+
if (timeOver > 0) {
|
84760
|
+
timeOver--;
|
84761
|
+
return await readFingerPrint();
|
84762
|
+
} else {
|
84763
|
+
return {
|
84764
|
+
status: 'error',
|
84765
|
+
data: '已超时,请重新操作,按压指纹'
|
84766
|
+
};
|
84767
|
+
}
|
84768
|
+
} else {
|
84769
|
+
return {
|
84770
|
+
status: 'success',
|
84771
|
+
data: readData.fingerPrintInfo
|
84772
|
+
};
|
84773
|
+
}
|
84774
|
+
}
|
84775
|
+
let {
|
84776
|
+
status,
|
84777
|
+
data
|
84778
|
+
} = await readFingerPrint();
|
84779
|
+
if (status === 'error') {
|
84780
|
+
throw Error(data);
|
84781
|
+
} else {
|
84782
|
+
let [method, result, quality, image, featureCode] = data.split('|');
|
84783
|
+
// getimgae|1|68|......|......
|
84784
|
+
// method:方法,result:返回的状态,quality:指纹图片质量,image:图片base64,featureCode:指纹特征码
|
84785
|
+
return {
|
84786
|
+
method,
|
84787
|
+
result,
|
84788
|
+
quality,
|
84789
|
+
image,
|
84790
|
+
featureCode
|
84791
|
+
};
|
84792
|
+
}
|
84793
|
+
}
|
84794
|
+
}
|
84795
|
+
_defineProperty(EWindowPassService, "iReadCardBasWebSocketUrl", 'ws://127.0.0.1:5847');
|
84796
|
+
_defineProperty(EWindowPassService, "fingerPrintBasWebSocketUrl", 'ws://127.0.0.1:9000');
|
84797
|
+
_defineProperty(EWindowPassService, "ws", void 0);
|
84798
|
+
_defineProperty(EWindowPassService, "requestStore", []);
|
84799
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/huada-plugin-socket.service.ts
|
84800
|
+
|
84801
|
+
|
84802
|
+
/**
|
84803
|
+
* 华大读卡器
|
84804
|
+
*
|
84805
|
+
* */
|
84806
|
+
|
84807
|
+
var HuaDaCardReadMode;
|
84808
|
+
(function (HuaDaCardReadMode) {
|
84809
|
+
/** 读取社保卡 */
|
84810
|
+
HuaDaCardReadMode[HuaDaCardReadMode["ReadSocialSecurityCard"] = 1002] = "ReadSocialSecurityCard";
|
84811
|
+
/** 读取二代身份证 */
|
84812
|
+
HuaDaCardReadMode[HuaDaCardReadMode["ReadIDCard"] = 1003] = "ReadIDCard";
|
84813
|
+
})(HuaDaCardReadMode || (HuaDaCardReadMode = {}));
|
84814
|
+
/**
|
84815
|
+
* 广东华大读卡器
|
84816
|
+
*/
|
84817
|
+
class HuzReadService {
|
84818
|
+
/**
|
84819
|
+
* 开启连接
|
84820
|
+
*/
|
84821
|
+
static startConnect() {
|
84822
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84823
|
+
return this;
|
84824
|
+
}
|
84825
|
+
const webSocketUrl = this.HaDWebSocketUrl;
|
84826
|
+
const ws = new WebSocket(webSocketUrl);
|
84827
|
+
let resolved;
|
84828
|
+
const onConnect = new Promise(resolve => {
|
84829
|
+
resolved = resolve;
|
84830
|
+
});
|
84831
|
+
ws.onopen = () => {
|
84832
|
+
resolved(true);
|
84833
|
+
};
|
84834
|
+
ws.onmessage = event => this.handleMessage(event);
|
84835
|
+
ws.onclose = () => this.handleClose();
|
84836
|
+
ws.onerror = () => this.handleError();
|
84837
|
+
this.ws = ws;
|
84838
|
+
return onConnect;
|
84839
|
+
}
|
84840
|
+
/**
|
84841
|
+
* 错误回调
|
84842
|
+
*/
|
84843
|
+
static handleError() {
|
84844
|
+
for (const type in this.requestStore) {
|
84845
|
+
this.requestStore.forEach(({
|
84846
|
+
reject
|
84847
|
+
}) => {
|
84848
|
+
reject('handleError');
|
84849
|
+
});
|
84850
|
+
}
|
84851
|
+
}
|
84852
|
+
/**
|
84853
|
+
* 关闭请求
|
84854
|
+
*/
|
84855
|
+
static handleClose() {
|
84856
|
+
for (const type in this.requestStore) {
|
84857
|
+
this.requestStore.forEach(({
|
84858
|
+
reject
|
84859
|
+
}) => {
|
84860
|
+
reject('close');
|
84861
|
+
});
|
84862
|
+
}
|
84863
|
+
}
|
84864
|
+
/**
|
84865
|
+
* 回调数据
|
84866
|
+
* @param msg
|
84867
|
+
*/
|
84868
|
+
static handleMessage(msg) {
|
84869
|
+
debugger;
|
84870
|
+
// 返回参数格式
|
84871
|
+
// tsCode 入参返回数据码
|
84872
|
+
// code 状态码
|
84873
|
+
// message 返回信息
|
84874
|
+
// cardInfo 身份证信息
|
84875
|
+
// base64_ID 人像照片
|
84876
|
+
// base64_IDPDF ""
|
84877
|
+
// base64_PhotoPDF ""
|
84878
|
+
// birth 生日,格式:1996年06月10日
|
84879
|
+
// depart 签发机关
|
84880
|
+
// id_num 身份证号码
|
84881
|
+
// name 姓名
|
84882
|
+
// nation 民族
|
84883
|
+
// passFlag 是否成功,true,false(type=5的额外参数)
|
84884
|
+
// score 成绩,90.0(type=5的额外参数)
|
84885
|
+
// sex 性别:男,女
|
84886
|
+
// time 认证耗时,ms(type=5的额外参数)
|
84887
|
+
// type 接口类型
|
84888
|
+
// validityTime 有限期限,格式:2014.06.09-2024.06.09
|
84889
|
+
const data = JSON.parse(msg.data);
|
84890
|
+
this.requestStore.forEach(({
|
84891
|
+
resolve
|
84892
|
+
}) => {
|
84893
|
+
resolve(data);
|
84894
|
+
});
|
84895
|
+
this.requestStore = [];
|
84896
|
+
this.ws.close();
|
84897
|
+
}
|
84898
|
+
/**
|
84899
|
+
* 发送请求,开启签字版
|
84900
|
+
* @param type 接口类型,3:指定位置签名或点击电子签名;54:关键字签名(对接时未返回数据,不建议用)4:读取身份证信息;5:人脸识别; 2:关闭设备
|
84901
|
+
* @param pdf pdf或图片的base64,不能带地址前缀
|
84902
|
+
* @param location 捷宇签字版签字时坐标(必传,不然接口调用会失败),非指定位置时该坐标也需要传,但不会起作用
|
84903
|
+
* @param timeout 签字版签字超时时间,秒
|
84904
|
+
* @param retain 是否按传入坐标签名,传入任意字符【如test】时签名会展示在传入的坐标上,
|
84905
|
+
* 传入空字符则在屏幕点击的位置上签名---接口类型3依据此字段区分是否为指定位置签名
|
84906
|
+
*/
|
84907
|
+
static async read(tsCode) {
|
84908
|
+
await this.startConnect();
|
84909
|
+
if (this.ws.readyState === 1) {
|
84910
|
+
debugger;
|
84911
|
+
let jsonPattern;
|
84912
|
+
// 签名和指纹
|
84913
|
+
if (tsCode === 1003 || tsCode === 1002) {
|
84914
|
+
jsonPattern = {
|
84915
|
+
'tsCode': tsCode.toString(),
|
84916
|
+
'picFilePath': 'd:\\zp.bmp'
|
84917
|
+
};
|
84918
|
+
}
|
84919
|
+
const jsonStr = JSON.stringify(jsonPattern);
|
84920
|
+
this.ws.send(jsonStr);
|
84921
|
+
return new Promise((resolve, reject) => {
|
84922
|
+
if (!this.requestStore) {
|
84923
|
+
this.requestStore = [];
|
84924
|
+
}
|
84925
|
+
this.requestStore.push({
|
84926
|
+
resolve,
|
84927
|
+
reject
|
84928
|
+
});
|
84929
|
+
});
|
84930
|
+
} else {
|
84931
|
+
throw Error('设备未准备完成');
|
84932
|
+
}
|
84933
|
+
}
|
84934
|
+
/**
|
84935
|
+
* 读取二代身份证
|
84936
|
+
* */
|
84937
|
+
static async idCardRead() {
|
84938
|
+
const readData = await HuzReadService.read(HuaDaCardReadMode.ReadIDCard);
|
84939
|
+
console.log('读取二代身份证==>', readData);
|
84940
|
+
if (!readData) {
|
84941
|
+
throw Error('未匹配可用的读取设备');
|
84942
|
+
}
|
84943
|
+
const name = readData.cardInfo.split('|')[1];
|
84944
|
+
const sex = readData.cardInfo.split('|')[2];
|
84945
|
+
const nation = readData.cardInfo.split('|')[3];
|
84946
|
+
const birthday = readData.cardInfo.split('|')[4];
|
84947
|
+
const address = readData.cardInfo.split('|')[5];
|
84948
|
+
const cardId = readData.cardInfo.split('|')[6];
|
84949
|
+
const police = readData.cardInfo.split('|')[7];
|
84950
|
+
const yxqx1 = readData.cardInfo.split('|')[8];
|
84951
|
+
const yxqx2 = readData.cardInfo.split('|')[9];
|
84952
|
+
const zpString = readData.cardInfo.split('|')[10];
|
84953
|
+
const IDCardData = {
|
84954
|
+
info: {
|
84955
|
+
name,
|
84956
|
+
sex,
|
84957
|
+
birthday,
|
84958
|
+
address,
|
84959
|
+
cardId,
|
84960
|
+
nation
|
84961
|
+
},
|
84962
|
+
headImage: zpString
|
84963
|
+
};
|
84964
|
+
console.log('读取二代身份证结果==>', IDCardData);
|
84965
|
+
return IDCardData;
|
84966
|
+
}
|
84967
|
+
/** 读取社保卡 */
|
84968
|
+
static async socialSecurityCardRead() {
|
84969
|
+
const readData = await HuzReadService.read(HuaDaCardReadMode.ReadSocialSecurityCard);
|
84970
|
+
if (!readData) {
|
84971
|
+
throw Error('未匹配可用的读取设备');
|
84972
|
+
}
|
84973
|
+
const cardId = readData.cardInfo.split('|')[1];
|
84974
|
+
const name = readData.cardInfo.split('|')[2];
|
84975
|
+
const birthday = IdCardCommonUtils.getBirthdayByIdNumber(cardId).replace('-', '').replace('-', '');
|
84976
|
+
const sex = IdCardCommonUtils.getGenderByIdNumber(cardId);
|
84977
|
+
const IDCardData = {
|
84978
|
+
info: {
|
84979
|
+
name,
|
84980
|
+
sex,
|
84981
|
+
birthday,
|
84982
|
+
address: '',
|
84983
|
+
cardId
|
84984
|
+
},
|
84985
|
+
headImage: ''
|
84986
|
+
};
|
84987
|
+
console.log('读取社保卡==>', readData);
|
84988
|
+
return IDCardData;
|
84989
|
+
}
|
84990
|
+
}
|
84991
|
+
_defineProperty(HuzReadService, "HaDWebSocketUrl", 'ws://127.0.0.1:36669/');
|
84992
|
+
_defineProperty(HuzReadService, "ws", void 0);
|
84993
|
+
_defineProperty(HuzReadService, "requestStore", []);
|
84994
|
+
;// CONCATENATED MODULE: ./packages/utils/js/BASE64.js
|
84995
|
+
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
84996
|
+
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);
|
84997
|
+
//������
|
84998
|
+
function base64encode(str) {
|
84999
|
+
var out, i, len;
|
85000
|
+
var c1, c2, c3;
|
85001
|
+
len = str.length;
|
85002
|
+
i = 0;
|
85003
|
+
out = "";
|
85004
|
+
while (i < len) {
|
85005
|
+
c1 = str.charCodeAt(i++) & 0xff;
|
85006
|
+
if (i == len) {
|
85007
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
85008
|
+
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
|
85009
|
+
out += "==";
|
85010
|
+
break;
|
85011
|
+
}
|
85012
|
+
c2 = str.charCodeAt(i++);
|
85013
|
+
if (i == len) {
|
85014
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
85015
|
+
out += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
|
85016
|
+
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
|
85017
|
+
out += "=";
|
85018
|
+
break;
|
85019
|
+
}
|
85020
|
+
c3 = str.charCodeAt(i++);
|
85021
|
+
out += base64EncodeChars.charAt(c1 >> 2);
|
85022
|
+
out += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
|
85023
|
+
out += base64EncodeChars.charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6);
|
85024
|
+
out += base64EncodeChars.charAt(c3 & 0x3F);
|
85025
|
+
}
|
85026
|
+
return out;
|
85027
|
+
}
|
85028
|
+
//������
|
85029
|
+
function base64decode(str) {
|
85030
|
+
var c1, c2, c3, c4;
|
85031
|
+
var i, len, out;
|
85032
|
+
len = str.length;
|
85033
|
+
i = 0;
|
85034
|
+
out = "";
|
85035
|
+
while (i < len) {
|
85036
|
+
do {
|
85037
|
+
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
|
85038
|
+
} while (i < len && c1 == -1);
|
85039
|
+
if (c1 == -1) break;
|
85040
|
+
do {
|
85041
|
+
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
|
85042
|
+
} while (i < len && c2 == -1);
|
85043
|
+
if (c2 == -1) break;
|
85044
|
+
out += String.fromCharCode(c1 << 2 | (c2 & 0x30) >> 4);
|
85045
|
+
do {
|
85046
|
+
c3 = str.charCodeAt(i++) & 0xff;
|
85047
|
+
if (c3 == 61) return out;
|
85048
|
+
c3 = base64DecodeChars[c3];
|
85049
|
+
} while (i < len && c3 == -1);
|
85050
|
+
if (c3 == -1) break;
|
85051
|
+
out += String.fromCharCode((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
|
85052
|
+
do {
|
85053
|
+
c4 = str.charCodeAt(i++) & 0xff;
|
85054
|
+
if (c4 == 61) return out;
|
85055
|
+
c4 = base64DecodeChars[c4];
|
85056
|
+
} while (i < len && c4 == -1);
|
85057
|
+
if (c4 == -1) break;
|
85058
|
+
out += String.fromCharCode((c3 & 0x03) << 6 | c4);
|
85059
|
+
}
|
85060
|
+
return out;
|
85061
|
+
}
|
85062
|
+
function utf16to8(str) {
|
85063
|
+
var out, i, len, c;
|
85064
|
+
out = "";
|
85065
|
+
len = str.length;
|
85066
|
+
for (i = 0; i < len; i++) {
|
85067
|
+
c = str.charCodeAt(i);
|
85068
|
+
if (c >= 0x0001 && c <= 0x007F) {
|
85069
|
+
out += str.charAt(i);
|
85070
|
+
} else if (c > 0x07FF) {
|
85071
|
+
out += String.fromCharCode(0xE0 | c >> 12 & 0x0F);
|
85072
|
+
out += String.fromCharCode(0x80 | c >> 6 & 0x3F);
|
85073
|
+
out += String.fromCharCode(0x80 | c >> 0 & 0x3F);
|
85074
|
+
} else {
|
85075
|
+
out += String.fromCharCode(0xC0 | c >> 6 & 0x1F);
|
85076
|
+
out += String.fromCharCode(0x80 | c >> 0 & 0x3F);
|
85077
|
+
}
|
85078
|
+
}
|
85079
|
+
return out;
|
85080
|
+
}
|
85081
|
+
function utf8to16(str) {
|
85082
|
+
var out, i, len, c;
|
85083
|
+
var char2, char3;
|
85084
|
+
out = "";
|
85085
|
+
len = str.length;
|
85086
|
+
i = 0;
|
85087
|
+
while (i < len) {
|
85088
|
+
c = str.charCodeAt(i++);
|
85089
|
+
switch (c >> 4) {
|
85090
|
+
case 0:
|
85091
|
+
case 1:
|
85092
|
+
case 2:
|
85093
|
+
case 3:
|
85094
|
+
case 4:
|
85095
|
+
case 5:
|
85096
|
+
case 6:
|
85097
|
+
case 7:
|
85098
|
+
// 0xxxxxxx
|
85099
|
+
out += str.charAt(i - 1);
|
85100
|
+
break;
|
85101
|
+
case 12:
|
85102
|
+
case 13:
|
85103
|
+
// 110x xxxx 10xx xxxx
|
85104
|
+
char2 = str.charCodeAt(i++);
|
85105
|
+
out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);
|
85106
|
+
break;
|
85107
|
+
case 14:
|
85108
|
+
// 1110 xxxx 10xx xxxx 10xx xxxx
|
85109
|
+
char2 = str.charCodeAt(i++);
|
85110
|
+
char3 = str.charCodeAt(i++);
|
85111
|
+
out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);
|
85112
|
+
break;
|
85113
|
+
}
|
85114
|
+
}
|
85115
|
+
return out;
|
85116
|
+
}
|
85117
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/mr-adb-plugin-socket.service.ts
|
85118
|
+
|
85119
|
+
|
85120
|
+
/**
|
85121
|
+
* 中正智能人证核验一体机 MR860 Websocket v1.0.2
|
85122
|
+
*
|
85123
|
+
* */
|
85124
|
+
|
85125
|
+
var MRAdbReadMode;
|
85126
|
+
(function (MRAdbReadMode) {
|
85127
|
+
/** 人证核验:读取二代身份证、人脸识别 */
|
85128
|
+
MRAdbReadMode["ReadIDCard"] = "$=Action|127.0.0.1|1352";
|
85129
|
+
})(MRAdbReadMode || (MRAdbReadMode = {}));
|
85130
|
+
/**
|
85131
|
+
* 中正智能人证核验一体机
|
85132
|
+
*/
|
85133
|
+
class MRAdbReadService {
|
85134
|
+
/**
|
85135
|
+
* 开启连接
|
85136
|
+
*/
|
85137
|
+
static startConnect(command) {
|
85138
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
85139
|
+
return this;
|
85140
|
+
}
|
85141
|
+
const webSocketUrl = this.MRAdbWebSocketUrl;
|
85142
|
+
const ws = new WebSocket(webSocketUrl);
|
85143
|
+
let resolved;
|
85144
|
+
const onConnect = new Promise(resolve => {
|
85145
|
+
resolved = resolve;
|
85146
|
+
});
|
85147
|
+
ws.onopen = () => {
|
85148
|
+
ws.send(command);
|
85149
|
+
resolved(true);
|
85150
|
+
};
|
85151
|
+
ws.onmessage = event => this.handleMessage(event);
|
85152
|
+
ws.onclose = () => this.handleClose();
|
85153
|
+
ws.onerror = () => this.handleError();
|
85154
|
+
this.ws = ws;
|
85155
|
+
return onConnect;
|
85156
|
+
}
|
85157
|
+
/**
|
85158
|
+
* 错误回调
|
85159
|
+
*/
|
85160
|
+
static handleError() {
|
85161
|
+
for (const type in this.requestStore) {
|
85162
|
+
this.requestStore.forEach(({
|
85163
|
+
reject
|
85164
|
+
}) => {
|
85165
|
+
reject('handleError');
|
85166
|
+
});
|
85167
|
+
}
|
85168
|
+
}
|
85169
|
+
/**
|
85170
|
+
* 关闭请求
|
85171
|
+
*/
|
85172
|
+
static handleClose() {
|
85173
|
+
for (const type in this.requestStore) {
|
85174
|
+
this.requestStore.forEach(({
|
85175
|
+
reject
|
85176
|
+
}) => {
|
85177
|
+
reject('close');
|
85178
|
+
});
|
85179
|
+
}
|
85180
|
+
}
|
85181
|
+
/**
|
85182
|
+
* 回调数据
|
85183
|
+
* @param msg
|
85184
|
+
*/
|
85185
|
+
static handleMessage(msg) {
|
85186
|
+
const data = JSON.parse(msg.data);
|
85187
|
+
this.requestStore.forEach(({
|
85188
|
+
resolve
|
85189
|
+
}) => {
|
85190
|
+
resolve(data);
|
85191
|
+
});
|
85192
|
+
this.requestStore = [];
|
85193
|
+
this.ws.close();
|
85194
|
+
}
|
85195
|
+
static async read(command) {
|
85196
|
+
await this.startConnect(command);
|
85197
|
+
return new Promise((resolve, reject) => {
|
85198
|
+
if (!this.requestStore) {
|
85199
|
+
this.requestStore = [];
|
85200
|
+
}
|
85201
|
+
this.requestStore.push({
|
85202
|
+
resolve,
|
85203
|
+
reject
|
85204
|
+
});
|
85205
|
+
});
|
85206
|
+
}
|
85207
|
+
/**
|
85208
|
+
* 人证核验
|
85209
|
+
* */
|
85210
|
+
static async idCardRead() {
|
85211
|
+
const returnData = await MRAdbReadService.read(MRAdbReadMode.ReadIDCard);
|
85212
|
+
console.log('中正智能人证核验返回==>', returnData);
|
85213
|
+
if (!returnData) {
|
85214
|
+
throw Error('未匹配可用的读取设备');
|
85215
|
+
}
|
85216
|
+
// result: 0 - 成功;其他 - 失败
|
85217
|
+
// data: if(result==0) 返回值Base64字符串格式,进行base64解码,再进行数据解析
|
85218
|
+
const {
|
85219
|
+
result,
|
85220
|
+
data
|
85221
|
+
} = returnData;
|
85222
|
+
switch (result) {
|
85223
|
+
case -1:
|
85224
|
+
throw Error('服务器IP地址或者服务端口错误');
|
85225
|
+
case -2:
|
85226
|
+
throw Error('输入的发送数据参数非法');
|
85227
|
+
case -3:
|
85228
|
+
throw Error('连接服务器失败');
|
85229
|
+
case -4:
|
85230
|
+
throw Error('发送数据失败');
|
85231
|
+
case -5:
|
85232
|
+
throw Error('接收应答数据超时');
|
85233
|
+
case -6:
|
85234
|
+
throw Error('接收应答数据失败');
|
85235
|
+
case -7:
|
85236
|
+
throw Error('输出应答数据参数非法');
|
85237
|
+
case -8:
|
85238
|
+
throw Error('Websocket无法识别命令字');
|
85239
|
+
case -9:
|
85240
|
+
throw Error('Websocket解析命令字错误');
|
85241
|
+
case -10:
|
85242
|
+
throw Error('Websocket base64编码失败');
|
85243
|
+
case -11:
|
85244
|
+
throw Error('指纹驱动未安装或者未启动');
|
85245
|
+
case 0:
|
85246
|
+
{
|
85247
|
+
const deData = utf8to16(base64decode(data));
|
85248
|
+
console.log('中正智能人证核验结果==>', deData);
|
85249
|
+
const reStrs = deData.split("\$");
|
85250
|
+
const name = reStrs[2].split("=#=")[1];
|
85251
|
+
const sex = reStrs[3].split("=#=")[1];
|
85252
|
+
const nation = reStrs[10].split("=#=")[1];
|
85253
|
+
const birthday = reStrs[6].split("=#=")[1];
|
85254
|
+
const address = reStrs[5].split("=#=")[1];
|
85255
|
+
const cardId = reStrs[4].split("=#=")[1];
|
85256
|
+
const police = reStrs[11].split("=#=")[1];
|
85257
|
+
const headImage = reStrs[8].split("=#=")[1];
|
85258
|
+
const faceimg = reStrs[9].split("=#=")[1];
|
85259
|
+
const IDCardData = {
|
85260
|
+
idCard: {
|
85261
|
+
info: {
|
85262
|
+
name,
|
85263
|
+
sex,
|
85264
|
+
birthday,
|
85265
|
+
address,
|
85266
|
+
cardId,
|
85267
|
+
nation
|
85268
|
+
},
|
85269
|
+
headImage
|
85270
|
+
},
|
85271
|
+
faceimg
|
85272
|
+
};
|
85273
|
+
console.log('中正智能人证核验结果转换==>', {
|
85274
|
+
name,
|
85275
|
+
sex,
|
85276
|
+
birthday,
|
85277
|
+
address,
|
85278
|
+
cardId,
|
85279
|
+
nation
|
85280
|
+
});
|
85281
|
+
return IDCardData;
|
85282
|
+
}
|
85283
|
+
}
|
85284
|
+
return '';
|
85285
|
+
}
|
85286
|
+
}
|
85287
|
+
_defineProperty(MRAdbReadService, "MRAdbWebSocketUrl", 'ws://127.0.0.1:8003/finger');
|
85288
|
+
_defineProperty(MRAdbReadService, "ws", void 0);
|
85289
|
+
_defineProperty(MRAdbReadService, "requestStore", []);
|
85290
|
+
// EXTERNAL MODULE: ./packages/utils/js/tsToJs.js
|
85291
|
+
var tsToJs = __webpack_require__(3144);
|
85292
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
85293
|
+
var face_auth_dialogvue_type_template_id_370e03c8_render = function render() {
|
85294
|
+
var _vm = this,
|
85295
|
+
_c = _vm._self._c;
|
85296
|
+
return _vm.visibility ? _c('el-dialog', {
|
85297
|
+
staticClass: "face-auth-dialog",
|
85298
|
+
attrs: {
|
85299
|
+
"title": "人脸识别",
|
85300
|
+
"top": '5vh',
|
85301
|
+
"width": "1280px",
|
85302
|
+
"visible": _vm.visibility,
|
85303
|
+
"close-on-click-modal": false
|
85304
|
+
},
|
85305
|
+
on: {
|
85306
|
+
"update:visible": function ($event) {
|
85307
|
+
_vm.visibility = $event;
|
85308
|
+
}
|
85309
|
+
}
|
85310
|
+
}, [_c('el-container', [_c('el-aside', {
|
85311
|
+
attrs: {
|
85312
|
+
"width": "900px"
|
85313
|
+
}
|
85314
|
+
}, [_c('zs-card', {
|
85315
|
+
attrs: {
|
85316
|
+
"title": "身份证信息读取"
|
85317
|
+
}
|
85318
|
+
}, [_c('div', {
|
85319
|
+
staticClass: "idcard-photo"
|
85320
|
+
}, [_c('div', {
|
85321
|
+
staticClass: "flex-1"
|
85322
|
+
}, [_c('img', {
|
85323
|
+
staticStyle: {
|
85324
|
+
"width": "433px",
|
85325
|
+
"height": "278px"
|
85326
|
+
},
|
85327
|
+
attrs: {
|
85328
|
+
"src": __webpack_require__(2234)
|
85329
|
+
}
|
85330
|
+
}), _c('span', {
|
85331
|
+
staticClass: "idcard-info name"
|
85332
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.name))]), _c('span', {
|
85333
|
+
staticClass: "idcard-info sex"
|
85334
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.sex))]), _c('span', {
|
85335
|
+
staticClass: "idcard-info nation"
|
85336
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.nation))]), _c('span', {
|
85337
|
+
staticClass: "idcard-info year"
|
85338
|
+
}, [_vm._v(_vm._s(_vm.birthYear))]), _c('span', {
|
85339
|
+
staticClass: "idcard-info month"
|
85340
|
+
}, [_vm._v(_vm._s(_vm.birthMonth))]), _c('span', {
|
85341
|
+
staticClass: "idcard-info day"
|
85342
|
+
}, [_vm._v(_vm._s(_vm.birthDay))]), _c('span', {
|
85343
|
+
staticClass: "idcard-info address"
|
85344
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.address))]), _c('span', {
|
85345
|
+
staticClass: "idcard-info idnumber"
|
85346
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.cardId))])]), _c('div', [_c('img', {
|
85347
|
+
staticStyle: {
|
85348
|
+
"width": "433px",
|
85349
|
+
"height": "278px"
|
85350
|
+
},
|
85351
|
+
attrs: {
|
85352
|
+
"src": __webpack_require__(4923)
|
85353
|
+
}
|
85354
|
+
}), _c('span', {
|
85355
|
+
staticClass: "idcard-info qfjg"
|
85356
|
+
}, [_vm._v(_vm._s(_vm.IDInfo.police))]), _c('span', {
|
85357
|
+
staticClass: "idcard-info yxrq"
|
85358
|
+
}, [_vm._v(_vm._s(_vm.validDate))])])])])], 1), _c('el-main', [_c('zs-card', {
|
85359
|
+
staticClass: "camera",
|
85360
|
+
attrs: {
|
85361
|
+
"title": "摄像头"
|
85362
|
+
},
|
85363
|
+
scopedSlots: _vm._u([{
|
85364
|
+
key: "extra",
|
85365
|
+
fn: function () {
|
85366
|
+
return [_c('el-button', {
|
85367
|
+
attrs: {
|
85368
|
+
"type": "primary",
|
85369
|
+
"size": "mini"
|
85370
|
+
},
|
85371
|
+
on: {
|
85372
|
+
"click": _vm.veriface
|
85373
|
+
}
|
85374
|
+
}, [_vm._v("开始识别")])];
|
85375
|
+
},
|
85376
|
+
proxy: true
|
85377
|
+
}], null, false, 3429989024)
|
85378
|
+
}, [_c('div', {
|
85379
|
+
staticStyle: {
|
85380
|
+
"width": "320px",
|
85381
|
+
"height": "240px"
|
85382
|
+
},
|
85383
|
+
attrs: {
|
85384
|
+
"id": "camera_row"
|
85385
|
+
}
|
85386
|
+
})])], 1)], 1), _c('span', {
|
85387
|
+
staticClass: "dialog-footer",
|
85388
|
+
attrs: {
|
85389
|
+
"slot": "footer"
|
85390
|
+
},
|
85391
|
+
slot: "footer"
|
85392
|
+
}, _vm._l(_vm.buttonList, function (button) {
|
85393
|
+
return _c('el-button', _vm._b({
|
85394
|
+
key: button.name,
|
85395
|
+
on: {
|
85396
|
+
"click": function ($event) {
|
85397
|
+
return _vm.buttonClickEvent(button.name);
|
85398
|
+
}
|
85399
|
+
}
|
85400
|
+
}, 'el-button', button, false), [_vm._v(_vm._s(button.label) + " ")]);
|
85401
|
+
}), 1)], 1) : _vm._e();
|
85402
|
+
};
|
85403
|
+
var face_auth_dialogvue_type_template_id_370e03c8_staticRenderFns = [];
|
85404
|
+
|
85405
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=template&id=370e03c8&
|
85406
|
+
|
85407
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
85408
|
+
|
85409
|
+
/* harmony default export */ var face_auth_dialogvue_type_script_lang_js_ = ({
|
85410
|
+
name: 'face-auth-dialog',
|
85411
|
+
data: () => {
|
85412
|
+
return {
|
85413
|
+
visibility: true,
|
85414
|
+
buttonList: [{
|
85415
|
+
name: 'cancel',
|
85416
|
+
label: '取消',
|
85417
|
+
size: 'small'
|
85418
|
+
}, {
|
85419
|
+
name: 'sure',
|
85420
|
+
label: '确定',
|
85421
|
+
type: 'primary',
|
85422
|
+
size: 'small',
|
85423
|
+
icon: 'el-icon-success'
|
85424
|
+
}],
|
85425
|
+
idCardInfo: {
|
85426
|
+
info: {
|
85427
|
+
name: '',
|
85428
|
+
sex: '',
|
85429
|
+
nation: '',
|
85430
|
+
birthday: '',
|
85431
|
+
address: '',
|
85432
|
+
cardId: '',
|
85433
|
+
police: '',
|
85434
|
+
validStart: '',
|
85435
|
+
validEnd: '',
|
85436
|
+
sexCode: '',
|
85437
|
+
nationCode: ''
|
85438
|
+
},
|
85439
|
+
headImage: undefined
|
85440
|
+
},
|
85441
|
+
verifaceData
|
85442
|
+
};
|
85443
|
+
},
|
85444
|
+
computed: {
|
85445
|
+
IDInfo() {
|
85446
|
+
return this.idCardInfo.info;
|
85447
|
+
},
|
85448
|
+
birthYear() {
|
85449
|
+
return this.idCardInfo.info.birthday ? this.idCardInfo.info.birthday.slice(0, 4) : '';
|
85450
|
+
},
|
85451
|
+
birthMonth() {
|
85452
|
+
return this.idCardInfo.info.birthday ? this.idCardInfo.info.birthday.slice(4, 6) : '';
|
85453
|
+
},
|
85454
|
+
birthDay() {
|
85455
|
+
return this.idCardInfo.info.birthday ? this.idCardInfo.info.birthday.slice(6, 8) : '';
|
85456
|
+
},
|
85457
|
+
validDate() {
|
85458
|
+
return this.idCardInfo.info.validStart && this.idCardInfo.info.validEnd ? this.idCardInfo.info.validStart + '-' + this.idCardInfo.info.validEnd : '';
|
85459
|
+
}
|
85460
|
+
},
|
85461
|
+
mounted() {
|
85462
|
+
this.$nextTick(() => {
|
85463
|
+
(0,tsToJs/* loadCamera */.xj)();
|
85464
|
+
});
|
85465
|
+
},
|
85466
|
+
methods: {
|
85467
|
+
async veriface() {
|
85468
|
+
const data = await tsToJs/* tsToJs.getElement */.g$.getElement(4);
|
85469
|
+
this.idCardInfo = data.idCard;
|
85470
|
+
this.verifaceData = data;
|
85471
|
+
},
|
85472
|
+
buttonClickEvent(name) {
|
85473
|
+
switch (name) {
|
85474
|
+
case 'cancel':
|
85475
|
+
this.visibility = false;
|
85476
|
+
break;
|
85477
|
+
case 'sure':
|
85478
|
+
this.$emit('close', this.verifaceData);
|
85479
|
+
this.visibility = false;
|
85480
|
+
break;
|
85481
|
+
}
|
85482
|
+
}
|
85483
|
+
}
|
85484
|
+
});
|
85485
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue?vue&type=script&lang=js&
|
85486
|
+
/* harmony default export */ var dialog_face_auth_dialogvue_type_script_lang_js_ = (face_auth_dialogvue_type_script_lang_js_);
|
85487
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.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-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.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&
|
85488
|
+
// extracted by mini-css-extract-plugin
|
85489
|
+
|
85490
|
+
;// 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&
|
85491
|
+
|
85492
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/face-auth-dialog.vue
|
85493
|
+
|
85494
|
+
|
85495
|
+
|
85496
|
+
;
|
85497
|
+
|
85498
|
+
|
85499
|
+
/* normalize component */
|
85500
|
+
|
85501
|
+
var face_auth_dialog_component = normalizeComponent(
|
85502
|
+
dialog_face_auth_dialogvue_type_script_lang_js_,
|
85503
|
+
face_auth_dialogvue_type_template_id_370e03c8_render,
|
85504
|
+
face_auth_dialogvue_type_template_id_370e03c8_staticRenderFns,
|
85505
|
+
false,
|
85506
|
+
null,
|
85507
|
+
null,
|
85508
|
+
null
|
85509
|
+
|
85510
|
+
)
|
85511
|
+
|
85512
|
+
/* harmony default export */ var face_auth_dialog = (face_auth_dialog_component.exports);
|
85513
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
85514
|
+
var eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_render = function render() {
|
85515
|
+
var _vm = this,
|
85516
|
+
_c = _vm._self._c;
|
85517
|
+
return _vm.visibility ? _c('el-dialog', {
|
85518
|
+
staticClass: "face-auth-dialog",
|
85519
|
+
attrs: {
|
85520
|
+
"title": "拍照",
|
85521
|
+
"top": '5vh',
|
85522
|
+
"width": '620px',
|
85523
|
+
"visible": _vm.visibility,
|
85524
|
+
"close-on-click-modal": false
|
85525
|
+
},
|
85526
|
+
on: {
|
85527
|
+
"update:visible": function ($event) {
|
85528
|
+
_vm.visibility = $event;
|
85529
|
+
}
|
85530
|
+
}
|
85531
|
+
}, [_c('div', {
|
85532
|
+
staticClass: "image-container"
|
85533
|
+
}, [_c('img', {
|
85534
|
+
directives: [{
|
85535
|
+
name: "show",
|
85536
|
+
rawName: "v-show",
|
85537
|
+
value: !_vm.scannerPhotoSrc,
|
85538
|
+
expression: "!scannerPhotoSrc"
|
85539
|
+
}],
|
85540
|
+
staticStyle: {
|
85541
|
+
"width": "600px",
|
85542
|
+
"height": "450px"
|
85543
|
+
},
|
85544
|
+
attrs: {
|
85545
|
+
"id": "photo",
|
85546
|
+
"src": _vm.scannerVideoSrc
|
85547
|
+
}
|
85548
|
+
}), _c('img', {
|
85549
|
+
directives: [{
|
85550
|
+
name: "show",
|
85551
|
+
rawName: "v-show",
|
85552
|
+
value: _vm.scannerPhotoSrc,
|
85553
|
+
expression: "scannerPhotoSrc"
|
85554
|
+
}],
|
85555
|
+
staticStyle: {
|
85556
|
+
"width": "600px",
|
85557
|
+
"height": "450px"
|
85558
|
+
},
|
85559
|
+
attrs: {
|
85560
|
+
"id": "photo",
|
85561
|
+
"src": 'data:image/jpg;base64,' + _vm.scannerPhotoSrc
|
85562
|
+
}
|
85563
|
+
})]), _c('span', {
|
85564
|
+
staticClass: "dialog-footer",
|
85565
|
+
attrs: {
|
85566
|
+
"slot": "footer"
|
85567
|
+
},
|
85568
|
+
slot: "footer"
|
85569
|
+
}, [_vm._l(_vm.buttonList, function (button) {
|
85570
|
+
return [_vm.isShowButton(button.name) ? _c('el-button', _vm._b({
|
85571
|
+
key: button.name,
|
85572
|
+
on: {
|
85573
|
+
"click": function ($event) {
|
85574
|
+
return _vm.buttonClickEvent(button.name);
|
85575
|
+
}
|
85576
|
+
}
|
85577
|
+
}, 'el-button', button, false), [_vm._v(_vm._s(button.label) + " ")]) : _vm._e()];
|
85578
|
+
})], 2)]) : _vm._e();
|
85579
|
+
};
|
85580
|
+
var eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_staticRenderFns = [];
|
85581
|
+
|
85582
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
85583
|
+
|
85584
|
+
/* harmony default export */ var eloam_take_photo_dialogvue_type_script_lang_js_ = ({
|
85585
|
+
name: 'eloam-take-photo-dialog',
|
85586
|
+
data: () => {
|
85587
|
+
return {
|
85588
|
+
visibility: true,
|
85589
|
+
scannerVideoSrc: ELoamPassService.secondaryCameraUrl,
|
85590
|
+
scannerPhotoSrc: '',
|
85591
|
+
buttonList: [{
|
85592
|
+
name: 'cancel',
|
85593
|
+
label: '取消',
|
85594
|
+
size: 'small'
|
85595
|
+
}, {
|
85596
|
+
name: 'take-photo',
|
85597
|
+
label: '拍照',
|
85598
|
+
type: 'primary',
|
85599
|
+
size: 'small'
|
85600
|
+
}, {
|
85601
|
+
name: 'retake-photo',
|
85602
|
+
label: '重拍',
|
85603
|
+
type: 'primary',
|
85604
|
+
size: 'small'
|
85605
|
+
}, {
|
85606
|
+
name: 'sure',
|
85607
|
+
label: '确定',
|
85608
|
+
type: 'primary',
|
85609
|
+
size: 'small'
|
85610
|
+
}]
|
85611
|
+
};
|
85612
|
+
},
|
85613
|
+
methods: {
|
85614
|
+
isShowButton(name) {
|
85615
|
+
switch (name) {
|
85616
|
+
case 'take-photo':
|
85617
|
+
return !this.scannerPhotoSrc;
|
85618
|
+
case 'retake-photo':
|
85619
|
+
return this.scannerPhotoSrc;
|
85620
|
+
default:
|
85621
|
+
return true;
|
85622
|
+
}
|
85623
|
+
},
|
85624
|
+
async buttonClickEvent(name) {
|
85625
|
+
switch (name) {
|
85626
|
+
case 'cancel':
|
85627
|
+
this.visibility = false;
|
85628
|
+
break;
|
85629
|
+
case 'take-photo':
|
85630
|
+
const res = await ELoamPassService.scanBySecondaryCamera();
|
85631
|
+
this.scannerPhotoSrc = res;
|
85632
|
+
break;
|
85633
|
+
case 'retake-photo':
|
85634
|
+
this.scannerPhotoSrc = '';
|
85635
|
+
break;
|
85636
|
+
case 'sure':
|
85637
|
+
let data = {
|
85638
|
+
faceimg: this.scannerPhotoSrc
|
85639
|
+
};
|
85640
|
+
this.$emit('close', data);
|
85641
|
+
this.visibility = false;
|
85642
|
+
break;
|
85643
|
+
}
|
85644
|
+
}
|
85645
|
+
}
|
85646
|
+
});
|
85647
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/eloam-take-photo-dialog.vue?vue&type=script&lang=js&
|
85648
|
+
/* harmony default export */ var dialog_eloam_take_photo_dialogvue_type_script_lang_js_ = (eloam_take_photo_dialogvue_type_script_lang_js_);
|
85649
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/eloam-take-photo-dialog.vue
|
85650
|
+
|
85651
|
+
|
85652
|
+
|
85653
|
+
|
85654
|
+
|
85655
|
+
/* normalize component */
|
85656
|
+
;
|
85657
|
+
var eloam_take_photo_dialog_component = normalizeComponent(
|
85658
|
+
dialog_eloam_take_photo_dialogvue_type_script_lang_js_,
|
85659
|
+
eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_render,
|
85660
|
+
eloam_take_photo_dialogvue_type_template_id_6e18b4de_scoped_true_staticRenderFns,
|
85661
|
+
false,
|
85662
|
+
null,
|
85663
|
+
"6e18b4de",
|
85664
|
+
null
|
85665
|
+
|
85666
|
+
)
|
85667
|
+
|
85668
|
+
/* harmony default export */ var eloam_take_photo_dialog = (eloam_take_photo_dialog_component.exports);
|
85669
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
85670
|
+
|
85671
|
+
|
85672
|
+
|
85673
|
+
|
85674
|
+
|
85675
|
+
|
85676
|
+
|
85677
|
+
|
85678
|
+
|
85679
|
+
/* harmony default export */ var id_card_reader_buttonvue_type_script_lang_js_ = ({
|
85680
|
+
name: 'id-card-reader-button',
|
85681
|
+
props: {
|
85682
|
+
label: {
|
85683
|
+
default: '',
|
85684
|
+
type: String
|
85685
|
+
},
|
85686
|
+
tip: {
|
85687
|
+
default: '',
|
85688
|
+
type: String
|
85689
|
+
},
|
85690
|
+
className: {
|
85691
|
+
default: '',
|
85692
|
+
type: String
|
85693
|
+
},
|
85694
|
+
size: {
|
85695
|
+
default: 'mini',
|
85696
|
+
type: String
|
85697
|
+
},
|
85698
|
+
type: {
|
85699
|
+
default: 'primary',
|
85700
|
+
type: String
|
85701
|
+
},
|
85702
|
+
plain: {
|
85703
|
+
default: false,
|
85704
|
+
type: Boolean
|
85705
|
+
},
|
85706
|
+
/** Determine whether it's a round button */
|
85707
|
+
round: {
|
85708
|
+
default: false,
|
85709
|
+
type: Boolean
|
85710
|
+
},
|
85711
|
+
/** Determine whether it's loading */
|
85712
|
+
loading: {
|
85713
|
+
default: false,
|
85714
|
+
type: Boolean
|
85715
|
+
},
|
85716
|
+
/** Button icon, accepts an icon name of Element icon component */
|
85717
|
+
icon: {
|
85718
|
+
default: 'el-icon-postcard',
|
85719
|
+
type: String
|
85720
|
+
},
|
85721
|
+
disabled: {
|
85722
|
+
default: false,
|
85723
|
+
type: Boolean
|
85724
|
+
},
|
85725
|
+
/**
|
85726
|
+
* 读卡器:0-默认读卡器及精伦读卡器;1-丽水一体机;2-沃斯德人证交互终端;3-中正人脸识别;4-华大读卡器;5-良田
|
85727
|
+
* 人脸识别:0-默认人脸识别(拍照);1-丽水一体机 2-沃斯德人证交互终端;3-中正人脸识别;5-良田
|
85728
|
+
* 读取社保卡:2-沃斯德人证交互终端;4-华大读卡器
|
85729
|
+
* 签字版:0-有为签字版;1-汉王签字版;2-沃斯德人证交互终端签字
|
85730
|
+
*/
|
85731
|
+
readMachineType: {
|
85732
|
+
default: 0,
|
85733
|
+
type: Number
|
85734
|
+
},
|
85735
|
+
/**
|
85736
|
+
* 读取模式:idCard-读取二代身份证;veriface-人证核验;socialSecurityCard-读取社保卡;sign-签字
|
85737
|
+
*/
|
85738
|
+
readerMode: {
|
85739
|
+
default: 'idCard',
|
85740
|
+
type: String
|
85741
|
+
}
|
85742
|
+
},
|
85743
|
+
data: () => {
|
85744
|
+
return {
|
85745
|
+
showIDCardChrome: false
|
85746
|
+
};
|
85747
|
+
},
|
85748
|
+
computed: {
|
85749
|
+
_className() {
|
85750
|
+
const classBase = ['z-button'];
|
85751
|
+
if (this.type === 'text') {
|
85752
|
+
classBase.push('i-font-size');
|
85753
|
+
}
|
85754
|
+
if (!this.className) {
|
85755
|
+
return classBase;
|
85756
|
+
} else if (typeof this.className === 'string') {
|
85757
|
+
classBase.push(this.className);
|
85758
|
+
} else {
|
85759
|
+
classBase.push(...this.className);
|
85760
|
+
}
|
85761
|
+
return classBase;
|
85762
|
+
}
|
85763
|
+
},
|
85764
|
+
methods: {
|
85765
|
+
handleClick() {
|
85766
|
+
switch (this.readerMode) {
|
85767
|
+
case 'idCard':
|
85768
|
+
return this.idCardRReaderEvent();
|
85769
|
+
case 'veriface':
|
85770
|
+
return this.faceReaderEvent();
|
85771
|
+
}
|
85772
|
+
},
|
85773
|
+
/**
|
85774
|
+
* 读取二代身份证
|
85775
|
+
*/
|
85776
|
+
async idCardRReaderEvent() {
|
85777
|
+
let idcardInfo;
|
85778
|
+
switch (this.readMachineType) {
|
85779
|
+
case 0:
|
85780
|
+
idcardInfo = await IdCardReadService.idCardCommonRead();
|
85781
|
+
this.$emit('click', idcardInfo);
|
85782
|
+
break;
|
85783
|
+
case 2:
|
85784
|
+
idcardInfo = await EWindowPassService.idCardRead();
|
85785
|
+
this.$emit('click', idcardInfo);
|
85786
|
+
break;
|
85787
|
+
case 3:
|
85788
|
+
const data = await MRAdbReadService.idCardRead();
|
85789
|
+
if (data) idcardInfo = data.idCard;
|
85790
|
+
this.$emit('click', idcardInfo);
|
85791
|
+
break;
|
85792
|
+
case 4:
|
85793
|
+
idcardInfo = await HuzReadService.idCardRead();
|
85794
|
+
this.$emit('click', idcardInfo);
|
85795
|
+
break;
|
85796
|
+
case 1:
|
85797
|
+
return this.readLSIDCard();
|
85798
|
+
case 5:
|
85799
|
+
idcardInfo = await ELoamPassService.idCardRead();
|
85800
|
+
this.$emit('click', idcardInfo);
|
85801
|
+
break;
|
85802
|
+
}
|
85803
|
+
},
|
85804
|
+
/**
|
85805
|
+
* 人证核验
|
85806
|
+
*/
|
85807
|
+
async faceReaderEvent() {
|
85808
|
+
switch (this.readMachineType) {
|
85809
|
+
case 0:
|
85810
|
+
{
|
85811
|
+
const realPicture = await CameraReadService.read();
|
85812
|
+
this.$emit('click', {
|
85813
|
+
faceimg: realPicture
|
85814
|
+
});
|
85815
|
+
break;
|
85816
|
+
}
|
85817
|
+
case 1:
|
85818
|
+
this.readLSIDCardAndMatchFace();
|
85819
|
+
break;
|
85820
|
+
case 2:
|
85821
|
+
{
|
85822
|
+
const data = await EWindowPassService.faceValidateWithIdCardRead();
|
85823
|
+
this.$emit('click', data);
|
85824
|
+
break;
|
85825
|
+
}
|
85826
|
+
case 3:
|
85827
|
+
{
|
85828
|
+
const data = await MRAdbReadService.idCardRead();
|
85829
|
+
this.$emit('click', data);
|
85830
|
+
break;
|
85831
|
+
}
|
85832
|
+
case 5:
|
85833
|
+
this.readFacePhotoByELoam();
|
85834
|
+
}
|
85835
|
+
},
|
85836
|
+
/**
|
85837
|
+
* 读取社保卡
|
85838
|
+
*/
|
85839
|
+
async socialSecurityCardReaderEvent() {
|
85840
|
+
try {
|
85841
|
+
let idcardInfo;
|
85842
|
+
switch (this.readMachineType) {
|
85843
|
+
case 2:
|
85844
|
+
idcardInfo = await EWindowPassService.socialSecurityCardRead();
|
85845
|
+
break;
|
85846
|
+
case 4:
|
85847
|
+
idcardInfo = await HuzReadService.socialSecurityCardRead();
|
85848
|
+
break;
|
85849
|
+
}
|
85850
|
+
this.$emit('click', idcardInfo);
|
85851
|
+
} catch (e) {
|
85852
|
+
throw Error('读取社保卡失败');
|
85853
|
+
}
|
85854
|
+
},
|
85855
|
+
/**
|
85856
|
+
* 签字
|
85857
|
+
*/
|
85858
|
+
async signEvent() {
|
85859
|
+
let userSignature = '';
|
85860
|
+
switch (this.signFlag) {
|
85861
|
+
case 0:
|
85862
|
+
userSignature = await SignReadService.read();
|
85863
|
+
break;
|
85864
|
+
case 1:
|
85865
|
+
userSignature = await SignReadService.read(PluginApiType.hwSign);
|
85866
|
+
break;
|
85867
|
+
case 2:
|
85868
|
+
userSignature = await EWindowPassService.signNameRead();
|
85869
|
+
break;
|
85870
|
+
}
|
85871
|
+
// 返回base64编码内容,无前缀
|
85872
|
+
this.$emit('click', userSignature);
|
85873
|
+
},
|
85874
|
+
async readLSIDCardAndMatchFace() {
|
85875
|
+
this.showIDCardChrome = true;
|
85876
|
+
debugger;
|
85877
|
+
const modalNode = document.createElement('div');
|
85878
|
+
document.body.appendChild(modalNode);
|
85879
|
+
const vm = new Vue({
|
85880
|
+
render: h => {
|
85881
|
+
return h(face_auth_dialog, {
|
85882
|
+
props: {},
|
85883
|
+
on: {
|
85884
|
+
close: data => {
|
85885
|
+
console.log('destroy data=>', data);
|
85886
|
+
if (data.zt !== '比对成功') {
|
85887
|
+
throw Error('认证失败');
|
85888
|
+
} else {
|
85889
|
+
this.$message.success('认证成功');
|
85890
|
+
this.$emit('click', data);
|
85891
|
+
}
|
85892
|
+
this.showIDCardChrome = false;
|
85893
|
+
vm.$destroy();
|
85894
|
+
vm.$el.remove();
|
85895
|
+
}
|
85896
|
+
}
|
85897
|
+
});
|
85898
|
+
},
|
85899
|
+
parent: this
|
85900
|
+
}).$mount(modalNode);
|
85901
|
+
},
|
85902
|
+
/** 良田拍照*/
|
85903
|
+
readFacePhotoByELoam() {
|
85904
|
+
const modalNode = document.createElement('div');
|
85905
|
+
document.body.appendChild(modalNode);
|
85906
|
+
const vm = new Vue({
|
85907
|
+
render: h => {
|
85908
|
+
return h(eloam_take_photo_dialog, {
|
85909
|
+
props: {},
|
85910
|
+
on: {
|
85911
|
+
close: data => {
|
85912
|
+
this.$emit('photo-change', data);
|
85913
|
+
vm.$destroy();
|
85914
|
+
vm.$el.remove();
|
85915
|
+
}
|
85916
|
+
}
|
85917
|
+
});
|
85918
|
+
},
|
85919
|
+
parent: this
|
85920
|
+
}).$mount(modalNode);
|
85921
|
+
},
|
85922
|
+
readLSIDCard() {
|
85923
|
+
this.showIDCardChrome = true;
|
85924
|
+
this.$nextTick(async () => {
|
85925
|
+
try {
|
85926
|
+
debugger;
|
85927
|
+
const idcardInfo = await (0,tsToJs/* GetIDCardOnly */.oK)();
|
85928
|
+
console.log('丽水一体机读取身份证信息=>', idcardInfo);
|
85929
|
+
this.$emit('click', idcardInfo);
|
85930
|
+
} catch (e) {
|
85931
|
+
throw Error('读取身份证信息失败');
|
85932
|
+
} finally {
|
85933
|
+
this.showIDCardChrome = false;
|
85934
|
+
}
|
85935
|
+
});
|
85936
|
+
}
|
85937
|
+
}
|
85938
|
+
});
|
85939
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=script&lang=js&
|
85940
|
+
/* harmony default export */ var src_id_card_reader_buttonvue_type_script_lang_js_ = (id_card_reader_buttonvue_type_script_lang_js_);
|
85941
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue
|
85942
|
+
|
85943
|
+
|
85944
|
+
|
85945
|
+
|
85946
|
+
|
85947
|
+
/* normalize component */
|
85948
|
+
;
|
85949
|
+
var id_card_reader_button_component = normalizeComponent(
|
85950
|
+
src_id_card_reader_buttonvue_type_script_lang_js_,
|
85951
|
+
id_card_reader_buttonvue_type_template_id_7cd25906_scoped_true_render,
|
85952
|
+
id_card_reader_buttonvue_type_template_id_7cd25906_scoped_true_staticRenderFns,
|
85953
|
+
false,
|
85954
|
+
null,
|
85955
|
+
"7cd25906",
|
85956
|
+
null
|
85957
|
+
|
85958
|
+
)
|
85959
|
+
|
85960
|
+
/* harmony default export */ var id_card_reader_button = (id_card_reader_button_component.exports);
|
85961
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/index.js
|
85962
|
+
|
85963
|
+
|
85964
|
+
// 组件的install方法用于按需引入
|
85965
|
+
// @ts-ignore
|
85966
|
+
id_card_reader_button.install = Vue => {
|
85967
|
+
Vue.component(id_card_reader_button.name, id_card_reader_button);
|
85968
|
+
};
|
85969
|
+
/* harmony default export */ var id_card_reader_id_card_reader_button = (id_card_reader_button);
|
85970
|
+
;// CONCATENATED MODULE: ./packages/index.js
|
85971
|
+
|
83701
85972
|
|
83702
85973
|
|
83703
85974
|
|
@@ -83720,7 +85991,7 @@ id_card_reader_eloam.install = Vue => {
|
|
83720
85991
|
// Dialog
|
83721
85992
|
// ]
|
83722
85993
|
// 组件列表
|
83723
|
-
const components = [packages_zs_empty, id_card_reader_id_card_reader_demo, scanner_scanner_high_camera_jieyu, scanner_scanner_eloam, id_card_reader_id_card_reader_eloam];
|
85994
|
+
const components = [packages_zs_empty, id_card_reader_id_card_reader_demo, scanner_scanner_high_camera_jieyu, scanner_scanner_eloam, id_card_reader_id_card_reader_eloam, id_card_reader_id_card_reader_button];
|
83724
85995
|
|
83725
85996
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,那么所有的组件都会被注册
|
83726
85997
|
const install = Vue => {
|