unify-external-plugin-platform 0.0.2-75 → 0.0.2-77
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.
@@ -84997,12 +84997,12 @@ _defineProperty(UdsPluginSocketService, "requestStore", []);
|
|
84997
84997
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
|
84998
84998
|
|
84999
84999
|
|
85000
|
-
|
85001
85000
|
/**
|
85002
85001
|
* @author: lvcy
|
85003
85002
|
* @date: 2024-03-22
|
85004
85003
|
* @description:国产客户端,硬件对接
|
85005
85004
|
*/
|
85005
|
+
|
85006
85006
|
var WEIRONGMethodCode;
|
85007
85007
|
(function (WEIRONGMethodCode) {
|
85008
85008
|
/** 读卡 */
|
@@ -85022,16 +85022,18 @@ var WEIRONGMethodCode;
|
|
85022
85022
|
})(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
|
85023
85023
|
const WEIRONGMethodDesc = {
|
85024
85024
|
[WEIRONGMethodCode.ReadCard_Base64]: '读卡',
|
85025
|
+
[WEIRONGMethodCode.StartSignName]: '开始签名',
|
85026
|
+
[WEIRONGMethodCode.GetSignNameStatus]: '获取签名状态',
|
85025
85027
|
[WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
|
85026
|
-
[WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
|
85028
|
+
[WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
85029
|
+
[WEIRONGMethodCode.TurnOnTheCamera]: '打开高拍仪',
|
85030
|
+
[WEIRONGMethodCode.ScannerCamera]: '拍照'
|
85027
85031
|
};
|
85028
85032
|
class WeiRongPluginService {
|
85029
85033
|
static startConnect(method) {
|
85030
|
-
console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
|
85031
85034
|
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
85032
85035
|
return this;
|
85033
85036
|
}
|
85034
|
-
console.log('重新链接');
|
85035
85037
|
const ws = new WebSocket(this.webSocketUrl);
|
85036
85038
|
let resolved;
|
85037
85039
|
const onConnect = new Promise(resolve => {
|
@@ -85068,15 +85070,15 @@ class WeiRongPluginService {
|
|
85068
85070
|
}
|
85069
85071
|
}
|
85070
85072
|
static handleMessage(msg) {
|
85071
|
-
let data =
|
85073
|
+
let data = {};
|
85072
85074
|
try {
|
85073
85075
|
data = JSON.parse(msg.data);
|
85074
85076
|
} catch (e) {
|
85075
|
-
data =
|
85077
|
+
data = {};
|
85076
85078
|
}
|
85077
85079
|
if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
|
85078
85080
|
const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
|
85079
|
-
|
85081
|
+
window.dispatchEvent(event);
|
85080
85082
|
} else {
|
85081
85083
|
this.requestStore.forEach(({
|
85082
85084
|
resolve
|
@@ -85088,7 +85090,7 @@ class WeiRongPluginService {
|
|
85088
85090
|
}
|
85089
85091
|
static async read(method) {
|
85090
85092
|
await this.startConnect(method);
|
85091
|
-
const methodDesc = WEIRONGMethodDesc[method];
|
85093
|
+
// const methodDesc = WEIRONGMethodDesc[method];
|
85092
85094
|
if (this.ws.readyState === 1) {
|
85093
85095
|
let jsonString;
|
85094
85096
|
switch (method) {
|
@@ -85156,7 +85158,7 @@ class WeiRongPluginService {
|
|
85156
85158
|
});
|
85157
85159
|
});
|
85158
85160
|
} else {
|
85159
|
-
throw Error(
|
85161
|
+
throw Error('设备未准备完成');
|
85160
85162
|
}
|
85161
85163
|
}
|
85162
85164
|
/** 读取身份证和永居证*/
|
@@ -85165,7 +85167,7 @@ class WeiRongPluginService {
|
|
85165
85167
|
if (!readData) {
|
85166
85168
|
throw Error('未匹配到可用的读取设备');
|
85167
85169
|
}
|
85168
|
-
if (readData.retVal
|
85170
|
+
if (readData.retVal != 0) {
|
85169
85171
|
this.ws?.close();
|
85170
85172
|
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85171
85173
|
}
|
@@ -85330,10 +85332,11 @@ class WeiRongPluginService {
|
|
85330
85332
|
return IDCardData;
|
85331
85333
|
} else {
|
85332
85334
|
this.ws?.close();
|
85335
|
+
throw new Error('人证对比失败');
|
85333
85336
|
}
|
85334
85337
|
}
|
85335
85338
|
/** 签字*/
|
85336
|
-
static
|
85339
|
+
static signNameRead() {
|
85337
85340
|
return new Promise(async (resolve, reject) => {
|
85338
85341
|
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
|
85339
85342
|
console.log('开始签名=>', readData);
|
@@ -85374,6 +85377,9 @@ class WeiRongPluginService {
|
|
85374
85377
|
if (res.method === 'GetCameraImage' && res.retVal == 0) {
|
85375
85378
|
this.ws?.close();
|
85376
85379
|
return res.cameraImgBase64;
|
85380
|
+
} else {
|
85381
|
+
this.ws?.close();
|
85382
|
+
throw new Error('拍照失败');
|
85377
85383
|
}
|
85378
85384
|
}
|
85379
85385
|
}
|
@@ -85007,12 +85007,12 @@ _defineProperty(UdsPluginSocketService, "requestStore", []);
|
|
85007
85007
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/wei-rong-plugin-socket.service.ts
|
85008
85008
|
|
85009
85009
|
|
85010
|
-
|
85011
85010
|
/**
|
85012
85011
|
* @author: lvcy
|
85013
85012
|
* @date: 2024-03-22
|
85014
85013
|
* @description:国产客户端,硬件对接
|
85015
85014
|
*/
|
85015
|
+
|
85016
85016
|
var WEIRONGMethodCode;
|
85017
85017
|
(function (WEIRONGMethodCode) {
|
85018
85018
|
/** 读卡 */
|
@@ -85032,16 +85032,18 @@ var WEIRONGMethodCode;
|
|
85032
85032
|
})(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
|
85033
85033
|
const WEIRONGMethodDesc = {
|
85034
85034
|
[WEIRONGMethodCode.ReadCard_Base64]: '读卡',
|
85035
|
+
[WEIRONGMethodCode.StartSignName]: '开始签名',
|
85036
|
+
[WEIRONGMethodCode.GetSignNameStatus]: '获取签名状态',
|
85035
85037
|
[WEIRONGMethodCode.GetSignName_Base64]: '获取签名',
|
85036
|
-
[WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对'
|
85038
|
+
[WEIRONGMethodCode.FaceValidateWithIdCard_Base64]: '人证比对',
|
85039
|
+
[WEIRONGMethodCode.TurnOnTheCamera]: '打开高拍仪',
|
85040
|
+
[WEIRONGMethodCode.ScannerCamera]: '拍照'
|
85037
85041
|
};
|
85038
85042
|
class WeiRongPluginService {
|
85039
85043
|
static startConnect(method) {
|
85040
|
-
console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
|
85041
85044
|
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
85042
85045
|
return this;
|
85043
85046
|
}
|
85044
|
-
console.log('重新链接');
|
85045
85047
|
const ws = new WebSocket(this.webSocketUrl);
|
85046
85048
|
let resolved;
|
85047
85049
|
const onConnect = new Promise(resolve => {
|
@@ -85078,15 +85080,15 @@ class WeiRongPluginService {
|
|
85078
85080
|
}
|
85079
85081
|
}
|
85080
85082
|
static handleMessage(msg) {
|
85081
|
-
let data =
|
85083
|
+
let data = {};
|
85082
85084
|
try {
|
85083
85085
|
data = JSON.parse(msg.data);
|
85084
85086
|
} catch (e) {
|
85085
|
-
data =
|
85087
|
+
data = {};
|
85086
85088
|
}
|
85087
85089
|
if (data.method === 'FaceScreenStream' || data.method === 'VideoStream') {
|
85088
85090
|
const event = new ScannerCameraRefreshPhotoEvent(data.imgBase64);
|
85089
|
-
|
85091
|
+
window.dispatchEvent(event);
|
85090
85092
|
} else {
|
85091
85093
|
this.requestStore.forEach(({
|
85092
85094
|
resolve
|
@@ -85098,7 +85100,7 @@ class WeiRongPluginService {
|
|
85098
85100
|
}
|
85099
85101
|
static async read(method) {
|
85100
85102
|
await this.startConnect(method);
|
85101
|
-
const methodDesc = WEIRONGMethodDesc[method];
|
85103
|
+
// const methodDesc = WEIRONGMethodDesc[method];
|
85102
85104
|
if (this.ws.readyState === 1) {
|
85103
85105
|
let jsonString;
|
85104
85106
|
switch (method) {
|
@@ -85166,7 +85168,7 @@ class WeiRongPluginService {
|
|
85166
85168
|
});
|
85167
85169
|
});
|
85168
85170
|
} else {
|
85169
|
-
throw Error(
|
85171
|
+
throw Error('设备未准备完成');
|
85170
85172
|
}
|
85171
85173
|
}
|
85172
85174
|
/** 读取身份证和永居证*/
|
@@ -85175,7 +85177,7 @@ class WeiRongPluginService {
|
|
85175
85177
|
if (!readData) {
|
85176
85178
|
throw Error('未匹配到可用的读取设备');
|
85177
85179
|
}
|
85178
|
-
if (readData.retVal
|
85180
|
+
if (readData.retVal != 0) {
|
85179
85181
|
this.ws?.close();
|
85180
85182
|
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85181
85183
|
}
|
@@ -85340,10 +85342,11 @@ class WeiRongPluginService {
|
|
85340
85342
|
return IDCardData;
|
85341
85343
|
} else {
|
85342
85344
|
this.ws?.close();
|
85345
|
+
throw new Error('人证对比失败');
|
85343
85346
|
}
|
85344
85347
|
}
|
85345
85348
|
/** 签字*/
|
85346
|
-
static
|
85349
|
+
static signNameRead() {
|
85347
85350
|
return new Promise(async (resolve, reject) => {
|
85348
85351
|
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
|
85349
85352
|
console.log('开始签名=>', readData);
|
@@ -85384,6 +85387,9 @@ class WeiRongPluginService {
|
|
85384
85387
|
if (res.method === 'GetCameraImage' && res.retVal == 0) {
|
85385
85388
|
this.ws?.close();
|
85386
85389
|
return res.cameraImgBase64;
|
85390
|
+
} else {
|
85391
|
+
this.ws?.close();
|
85392
|
+
throw new Error('拍照失败');
|
85387
85393
|
}
|
85388
85394
|
}
|
85389
85395
|
}
|
@@ -21,4 +21,4 @@
|
|
21
21
|
* @internal
|
22
22
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
23
23
|
*/
|
24
|
-
function a(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,a=n in document;if(!a){var s=document.createElement("div");s.setAttribute(n,"return;"),a="function"===typeof s[n]}return!a&&i&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}r.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=a},643:function(e,t,n){"use strict";var i=n(4518),r=n(6534),a=10,s=40,o=800;function l(e){var t=0,n=0,i=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*a,r=n*a,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||r)&&e.deltaMode&&(1==e.deltaMode?(i*=s,r*=s):(i*=o,r*=o)),i&&!t&&(t=i<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:r}}l.getEventType=function(){return i.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},1033:function(e,t,n){"use strict";n.r(t);var i=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];e.call(t,r[1],r[0])}},t}()}(),r="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,a=function(){return"undefined"!==typeof n.g&&n.g.Math===Math?n.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")()}(),s=function(){return"function"===typeof requestAnimationFrame?requestAnimationFrame.bind(a):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)}}(),o=2;function l(e,t){var n=!1,i=!1,r=0;function a(){n&&(n=!1,e()),i&&c()}function l(){s(a)}function c(){var e=Date.now();if(n){if(e-r<o)return;i=!0}else n=!0,i=!1,setTimeout(l,t);r=e}return c}var c=20,u=["top","right","bottom","left","width","height","size","weight"],h="undefined"!==typeof MutationObserver,d=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=l(this.refresh.bind(this),c)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,i=u.some((function(e){return!!~n.indexOf(e)}));i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),f=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},p=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||a},m=S(0,0,0,0);function v(e){return parseFloat(e)||0}function g(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){var i=e["border-"+n+"-width"];return t+v(i)}),0)}function b(e){for(var t=["top","right","bottom","left"],n={},i=0,r=t;i<r.length;i++){var a=r[i],s=e["padding-"+a];n[a]=v(s)}return n}function y(e){var t=e.getBBox();return S(0,0,t.width,t.height)}function _(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return m;var i=p(e).getComputedStyle(e),r=b(i),a=r.left+r.right,s=r.top+r.bottom,o=v(i.width),l=v(i.height);if("border-box"===i.boxSizing&&(Math.round(o+a)!==t&&(o-=g(i,"left","right")+a),Math.round(l+s)!==n&&(l-=g(i,"top","bottom")+s)),!x(e)){var c=Math.round(o+a)-t,u=Math.round(l+s)-n;1!==Math.abs(c)&&(o-=c),1!==Math.abs(u)&&(l-=u)}return S(r.left,r.top,o,l)}var w=function(){return"undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof p(e).SVGGraphicsElement}:function(e){return e instanceof p(e).SVGElement&&"function"===typeof e.getBBox}}();function x(e){return e===p(e).document.documentElement}function C(e){return r?w(e)?y(e):_(e):m}function k(e){var t=e.x,n=e.y,i=e.width,r=e.height,a="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(a.prototype);return f(s,{x:t,y:n,width:i,height:r,top:n,right:t+i,bottom:r+n,left:t}),s}function S(e,t,n,i){return{x:e,y:t,width:n,height:i}}var E=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=S(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=C(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),O=function(){function e(e,t){var n=k(t);f(this,{target:e,contentRect:n})}return e}(),D=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new i,"function"!==typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new E(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new O(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$="undefined"!==typeof WeakMap?new WeakMap:new i,T=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=d.getInstance(),i=new D(t,n,this);$.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach((function(e){T.prototype[e]=function(){var t;return(t=$.get(this))[e].apply(t,arguments)}}));var I=function(){return"undefined"!==typeof a.ResizeObserver?a.ResizeObserver:T}();t["default"]=I},1478:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{g$:function(){return tsToJs},oK:function(){return GetIDCardOnly},xj:function(){return loadCamera}});var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7658),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__),tsToJs={getElement:function Stirng(flag,photoId){var plugin;if(1==flag){console.log("人脸识别开始-----");var plugin=document.getElementById("facePlugin");console.log("plugin-----",plugin);var data="$=Action",temp=plugin.SendDataToADB("127.0.0.1",1352,15e3,data,data.length);if(console.log(temp+"-----===="),"undefined"===typeof temp)return null;var str=temp.split("$"),result=str[1].split("=#=")[1];console.log("result:"+result+"-----++++");var name=str[2].split("=#=")[1],sex=str[3].split("=#=")[1],cardNo=str[4].split("=#=")[1];console.log("cardNo:"+cardNo+"-----++++");var address=str[5].split("=#=")[1],birthday=str[6].split("=#=")[1],cardImg=str[8].split("=#=")[1],faceImg=str[9].split("=#=")[1],race=str[10].split("=#=")[1],regOrg=str[11].split("=#=")[1],validTime=str[12].split("=#=")[1],validTimeStart=validTime.split("-")[0],validTimeEnd=validTime.split("-")[1],objSfz={idCard:{info:{name:name.toString(),sex:sex.toString(),nation:race.toString(),birthday:birthday.toString(),address:address.toString(),cardId:cardNo.toString(),police:regOrg.toString(),validStart:validTimeStart.toString(),validEnd:validTimeEnd.toString(),sexCode:"",nationCode:""},headImage:cardImg.toString()},faceimg:faceImg.toString(),zt:""};return console.log("-------------------objSfz成功返回数据---------------------"),console.log("人脸识别结果===>",objSfz),objSfz}if(2==flag){plugin=document.getElementById("plugin");var temp2=plugin.On_OpenDevice(1001),obj=eval("("+temp2+")");return"undefined"!=typeof obj["照片"]&&(photoId&&document.getElementById(photoId)&&(document.getElementById(photoId).src="data:image/jpeg;base64,"+obj["照片"]),console.log(obj["身份证号2"]+"._____."),console.log(obj["照片2"]+"._____.-----------")),obj}if(3==flag){console.log("-----开始读取身份证信息-----");var plugin=document.getElementById("plugin"),temp2=plugin.On_OpenDevice(1001),obj=eval("("+temp2+")"),result={info:{name:obj["姓名"],sex:obj["性别"],nation:obj["名族"],birthday:obj["出生日期"],address:obj["地址"],cardId:obj["身份证号"],police:obj["发证机关"],validStart:obj["有效期开始"],validEnd:obj["有效期结束"],sexCode:"",nationCode:""},headImage:obj["照片"]};return console.log("-----身份证信息读取结果-----"),console.log(result),result}if(4==flag)return GetIDCardAndMatchImage()},getExportInfo:function(){var e="",t="";return $.ajaxSettings.async=!1,$.get("assets/xml/Export.xml",!1,(function(n){var i=[],r=[];$(n).find("ElementTable").each((function(){var e=$(this),t=e.attr("ColumnName"),n=e.attr("CaptionName");i.push(t),r.push(n)})),e=i.join(","),t=r.join(","),xmlxx={columNameStr:e,captionNameStr:t}})),$.ajaxSettings.async=!0,xmlxx},getAreaData:function(){$.ajaxSettings.async=!1;var e=[],t=[];return $.get("assets/xml/AreaData.xml",(function(n){$(n).find("ElementTable").each((function(){var n=$(this),i=n.attr("tableName"),r=n.children("DataBaseLink").attr("Name");e.push(i),t.push(r)}))})),$.ajaxSettings.async=!0,xmlxx={nameArray:e,dataBaseLinkArray:t},xmlxx},getAreaTable:function(){$.ajaxSettings.async=!1;var e=[];return $.get("assets/xml/AreaData.xml",(function(t){$(t).find("ElementTable").each((function(){var t=$(this),n=t.attr("tableName"),i=t.children("DataBaseLink").attr("Name");xmlxx={tableName:n,dataBaseLink:i},e.push(xmlxx)}))})),$.ajaxSettings.async=!0,e},getPhoto:function(e,t){document.getElementById(t).src="data:image/jpeg;base64,"+e},printImg:function(e){$("#"+e).jqprint()}};function loadCamera(){document.getElementById("IDCard_chrome");var e=document.getElementById("camera_row");e.innerHTML='<object clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=320 height=240 name="FaceObj"></object>'}function GetIDCardOnly(){var e=document.getElementById("IDCard_chrome"),t=e.OpenDevice();if(0==t){t=e.ReadIDCardInfo();var n={info:{name:e.IDName,sex:e.IDSex,nation:e.IDFolk,birthday:e.IDBirth,address:e.IDAddress,cardId:e.IDNumber,police:e.IDOrgan,validStart:e.IDTermBegin.substring(0,4)+"."+e.IDTermBegin.substring(4,6)+"."+e.IDTermBegin.substring(6,8),validEnd:e.IDTermEnd.substring(0,4)+"."+e.IDTermEnd.substring(4,6)+"."+e.IDTermEnd.substring(6,8),sexCode:"",nationCode:""},headImage:e.IDPhoto64};return n}debug("一体机启动失败")}function GetIDCardAndMatchImage(){console.log("-----开启一体机功能-----");var e=document.getElementById("IDCard_chrome"),t=e.OpenDevice();if(0==t){t=e.ReadIDCardInfo();var n={idCard:{info:{name:e.IDName,sex:e.IDSex,nation:e.IDFolk,birthday:e.IDBirth,address:e.IDAddress,cardId:e.IDNumber,police:e.IDOrgan,validStart:e.IDTermBegin.substring(0,4)+"."+e.IDTermBegin.substring(4,6)+"."+e.IDTermBegin.substring(6,8),validEnd:e.IDTermEnd.substring(0,4)+"."+e.IDTermEnd.substring(4,6)+"."+e.IDTermEnd.substring(6,8),sexCode:"",nationCode:""},headImage:e.IDPhoto64},faceimg:"",zt:""};return MatchImage(n)}debug("一体机启动失败")}function MatchImage(e){var t=FaceObj.MatchFace(e.idCard.headImage),n=JSON.parse(t);return e.faceimg=n.image,e.zt=n.retinfo,console.log(e),e}},2823:function(e,t,n){var i=n(8563);e.exports=function(e,t,n){return void 0===n?i(e,t,!1):i(e,n,!1!==t)}},4592:function(e,t,n){var i=n(8563),r=n(2823);e.exports={throttle:i,debounce:r}},8563:function(e){e.exports=function(e,t,n,i){var r,a=0;function s(){var s=this,o=Number(new Date)-a,l=arguments;function c(){a=Number(new Date),n.apply(s,l)}function u(){r=void 0}i&&!r&&c(),r&&clearTimeout(r),void 0===i&&o>e?c():!0!==t&&(r=setTimeout(i?u:c,void 0===i?e-o:e))}return"boolean"!==typeof t&&(i=n,n=t,t=void 0),s}},2234:function(e,t,n){"use strict";e.exports=n.p+"img/idcardbg1.1f8e1fc6.gif"},4923:function(e,t,n){"use strict";e.exports=n.p+"img/idcardbg2.2e47b05f.gif"},5053:function(e,t,n){"use strict";e.exports=n.p+"img/img_blank_empty.92ddadbb.png"},7203:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__7203__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}!function(){__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return __webpack_require__.d(t,{a:t}),t}}(),function(){__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){__webpack_require__.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){__webpack_require__.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){__webpack_require__.p=""}();var __webpack_exports__={};return function(){"use strict";if(__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:function(){return jt}}),"undefined"!==typeof window){var e=window.document.currentScript,t=e&&e.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);t&&(__webpack_require__.p=t[1])}var n=__webpack_require__(4720),i=__webpack_require__.n(n),r=function(){var e=this;e._self._c;return e._m(0)},a=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"zs-empty"},[t("img",{attrs:{src:__webpack_require__(5053)}})])}],s={name:"zs-empty",props:{emptyTip:{default:"暂无数据",type:String}},methods:{}},o=s;function l(e,t,n,i,r,a,s,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),s?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):r&&(l=o?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}var c=l(o,r,a,!1,null,"88c40896",null),u=c.exports;u.install=e=>{e.component(u.name,u)};var h=u,d=function(){var e=this,t=e._self._c;return e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)},f=[],p=(__webpack_require__(7658),{name:"id-card-reader-demo",props:{label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"mini",type:String},type:{default:"primary",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"el-icon-postcard",type:String},disabled:{default:!1,type:Boolean}},computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{handleClick(){const e={info:{name:"",sex:"",nation:"",birthday:"",address:"",cardId:"",police:"",validStart:"",validEnd:""},headImage:""};this.$emit("click",e)}}}),m=p,v=l(m,d,f,!1,null,"3d89866c",null),g=v.exports;g.install=e=>{e.component(g.name,g)};var b=g,y=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-container"},["dialog"===e.openMode?t("div",{staticClass:"scanner-high-camera-button"},[e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("el-dialog",{staticClass:"scanner-high-camera-dialog",attrs:{title:"影像扫描",visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[e.dialogVisible?t("scanner-high-camera-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)}):e._e(),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.sendScannerResult}},[e._v("确 定")])],1)],1)],1):t("scanner-high-camera-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)})],1)},_=[],w=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-component"},[t("div",{staticClass:"scanner-result-content"},[t("div",{staticClass:"content-main flex-1"},[e.loadSuccess?t("div",{staticClass:"load-success"},[t("img",{attrs:{id:"photo",src:e.scannerResultSrc}})]):t("div",{staticClass:"load-error"},[t("i",{staticClass:"el-icon-s-cooperation"}),t("p",[e._v("请先安装插件")])])]),t("div",{staticClass:"handle-action"},[t("el-select",{staticClass:"select",attrs:{size:"small"},on:{change:e.selectChange},model:{value:e.camera,callback:function(t){e.camera=t},expression:"camera"}},e._l(e.cameras,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1),e._l(e.buttonList,(function(n){return[t("el-button",{key:n.name,attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleAction(n.name)}}},[e._v(e._s(n.label))]),e._t("action")]}))],2)])])},x=[];const C="data:image/jpeg;base64,";var k={name:"scanner-high-camera-component",data:()=>({totalTimeLength:0,timeLength:"",timer:0,str1:"",str2:"",webSocket:{},scannerResultSrc:"",loadSuccess:!0,camera:0,cameras:[{name:"文档",value:0},{name:"照片",value:1}],buttonList:[{label:"拍照",name:"take-pictures"}]}),mounted(){this.webSocket=new WebSocket("ws://127.0.0.1:1818"),window.onbeforeunload=()=>{this.webSocket.send("bStopPlay()"),this.webSocket.send("bStopPlay4()")},this.webSocket.onerror=e=>{this.onError(e)},this.webSocket.onopen=e=>{this.onOpen(e)},this.webSocket.onclose=e=>{this.onClose(e),this.webSocket.send("bStopPlay()")},this.webSocket.onmessage=e=>{this.onMessage(e)},setTimeout((()=>{this.handleAction("start-main")}),800)},destroyed(){this.handleAction("stop"),this.webSocket.close()},methods:{selectChange(e){let t=1===e?"start-vice":"start-main";this.handleAction(t)},handleAction(e){switch(e){case"start-main":this.StartPlay_onclick();break;case"rotation":this.start("bStartPlayRotate(90)");break;case"start-vice":this.start("bStartPlay2");break;case"stop":this.start("bStopPlay");break;case"autofocus":this.start("AutoFocus");break;case"Black edge":this.start("vSetDelHBFlag(true)");break;case"base64":this.start("sGetBase64");break;case"start-record":this.start("bStartRec(d:\\test.avi)");break;case"stop-record":this.start("bStopRec");break;case"take-pictures":this.start("bSaveJPG(D:\\,Photo)"),this.$emit("send-scanner-result",this.scannerResultSrc);break}},timeGo(){this.totalTimeLength++;let e=0,t=0,n=0;e=Math.floor(this.totalTimeLength/3600),t=Math.floor(this.totalTimeLength/60%60),n=Math.floor(this.totalTimeLength%60),this.timeLength=e+"时"+t+"分"+n+"秒"},onMessage(e){e.data.indexOf("BarCodeTransferBegin")>=0?console.log(e.data.replace("BarCodeTransferBegin","").replace("BarCodeTransferEnd","")):e.data.indexOf("BeginbSaveJPG")>=0?(this.str1=e.data.replace("BeginbSaveJPG","").replace("EndbSaveJPG",""),console.log(this.str1)):e.data.indexOf("BeginbStopPlay")>=0?(console.log(e.data),console.log(e.data.replace("BeginbStopPlay","").replace("EndbStopPlay",""))):e.data.indexOf("BeginvSetResolution")>=0?console.log(e.data.replace("BeginvSetResolution","").replace("EndvSetResolution","")):e.data.indexOf("BeginvSetRemoveGBFlag")>=0?console.log(e.data.replace("BeginvSetRemoveGBFlag","").replace("EndvSetRemoveGBFlag","")):e.data.indexOf("BeginbFileExist")>=0?console.log(e.data.replace("BeginbFileExist","").replace("EndbFileExist","")):e.data.indexOf("BeginbStartPlay2")>=0?console.log(e.data.replace("BeginbStartPlay2","").replace("EndbStartPlay2","")):e.data.indexOf("BeginbStartPlay")>=0?console.log(e.data.replace("BeginbStartPlay","").replace("EndbStartPlay","")):e.data.indexOf("BeginbSetMode")>=0?console.log(e.data.replace("BeginbSetMode","").replace("EndbSetMode","")):this.scannerResultSrc=`${C}${e.data}`},onError(e){console.log("error",e.data),this.loadSuccess=!1},onClose(e){this.webSocket.send("bStopPlay()"),this.webSocket.send("bStopPlay4()")},onOpen(e){},start(e){return"bStartRec(d:\\test.avi)"==e&&(this.timer=window.setInterval(this.timeGo,1e3)),"bStopRec"==e&&(window.clearInterval(this.timer),this.totalTimeLength=0,console.log("录屏结束")),this.webSocket.send(e),!1},vout_OnClick(){},Stop_onclick(){this.webSocket.send("bStopPlay()")},StartPlay_onclick(){this.webSocket.send("vSetResolution(8)"),this.webSocket.send("bStartPlay()")}}},S=k,E=l(S,w,x,!1,null,"e24dd0c8",null),O=E.exports,D={name:"scanner-high-camera-jieyu",components:{ScannerHighCameraComponent:O},props:{openMode:{default:"",type:String},label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"",type:String},type:{default:"",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"",type:String},disabled:{default:!1,type:Boolean}},data:()=>({dialogVisible:!1,scannerResult:""}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{openScanDialog(){this.dialogVisible=!0},setScannerResult(e){this.scannerResult=e,"dialog"!==this.openMode&&this.$emit("send-scanner-result",this.scannerResult)},sendScannerResult(){this.scannerResult&&(this.$emit("send-scanner-result",this.scannerResult),this.dialogVisible=!1)}}},$=D,T=l($,y,_,!1,null,"ffa79d1e",null),I=T.exports;I.install=e=>{e.component(I.name,I)};var M,P=I,N=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-container"},["dialog"===e.openMode?t("div",{staticClass:"scanner-high-camera-button"},[e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("el-dialog",{staticClass:"scanner-high-camera-dialog",attrs:{title:"影像扫描",visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[e.dialogVisible?t("scanner-eloam-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)}):e._e(),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.sendScannerResult}},[e._v("确 定")])],1)],1)],1):t("scanner-eloam-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)})],1)},j=[],A=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-component"},[t("div",{staticClass:"scanner-result-content"},[t("div",{staticClass:"content-main flex-1"},[e.loadSuccess?t("div",{staticClass:"load-success"},[t("img",{staticStyle:{width:"800px",height:"600px"},attrs:{id:"photo",src:e.scannerVideoSrc}})]):t("div",{staticClass:"load-error"},[t("i",{staticClass:"el-icon-s-cooperation"}),t("p",[e._v("请先安装插件")])])]),t("div",{staticClass:"handle-action"},[t("el-select",{staticClass:"select",attrs:{size:"small"},on:{change:e.selectChange},model:{value:e.camera,callback:function(t){e.camera=t},expression:"camera"}},e._l(e.cameras,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1),e._l(e.buttonList,(function(n){return[t("el-button",{key:n.name,attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleAction(n.name)}}},[e._v(e._s(n.label))]),e._t("action")]}))],2)])])},F=[];function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function L(e,t){if("object"!==B(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==B(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function V(e){var t=L(e,"string");return"symbol"===B(t)?t:String(t)}function z(e,t,n){return t=V(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class R{static startConnect(e,t,n={}){return new Promise(((i,r)=>{let a=new XMLHttpRequest;if(e=e.toUpperCase(),"GET"==e){let e="";Object.keys(n).forEach((t=>{e+=`${t}=${n[t]}&`})),e=e.substring(0,e.lastIndexOf("&")),t=t+"?"+e}else"POST"==e||r("error method: Currently only supported GET or POST method!");a.open(e,t,!0),a.setRequestHeader("Accept","application/json"),"GET"===e?a.send():a.send(JSON.stringify(n)),a.onreadystatechange=function(){if(4===this.readyState)if(200===this.status){let e=this.response;"object"!==typeof e&&(e=JSON.parse(e)),i(e)}else r(a)}}))}static async get(e){let t=await R.startConnect("GET",e);return t}static async post(e,t){let n=await R.startConnect("POST",e,t);return n}}(function(e){e["ScannerMainCamera_Base64"]="ScannerMainCamera_Base64",e["ScannerSecondaryCamera_Base64"]="ScannerSecondaryCamera_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64"})(M||(M={}));M.ScannerMainCamera_Base64,M.ScannerSecondaryCamera_Base64,M.ReadIDCard_Base64;class W{static get mainCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=0"}static get secondaryCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=1"}static async read(e){let t={},n="";switch(e){case M.ScannerMainCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"base64",rotate:"0",deskew:"1",camidx:"0",ColorMode:"0",quality:"0"};break;case M.ScannerSecondaryCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"base64",rotate:"0",deskew:"0",camidx:"1",ColorMode:"0",quality:"0"};break;case M.ReadIDCard_Base64:n=this.baseServiceUrl+"/card=idcard";break}let i=await R.post(n,t);return i}static async scanByMainCamera(){const e=await W.read(M.ScannerMainCamera_Base64);return e.photoBase64}static async scanBySecondaryCamera(){const e=await W.read(M.ScannerSecondaryCamera_Base64);return e.photoBase64}static async idCardRead(){const e=await W.read(M.ReadIDCard_Base64);let{name:t,sex:n,birthday:i,address:r,cardID:a,nationCode:s,photoBase64:o,issueOrgan:l,validStart:c,validEnd:u}=e.IDCardInfo;const h={info:{name:t,sex:n,birthday:i.replace("-","").replace("-",""),address:r,cardId:a,nation:s,police:l,validStart:c,validEnd:u},headImage:o};return h}}z(W,"baseServiceUrl","http://127.0.0.1:38088");const H="data:image/jpg;base64,";var q={name:"scanner-eloam-component",data:()=>({totalTimeLength:0,timeLength:"",timer:0,str1:"",str2:"",webSocket:{},scannerVideoSrc:"",scannerResultSrc:"",loadSuccess:!0,camera:0,cameras:[{name:"文档",value:0},{name:"照片",value:1}],buttonList:[{label:"拍照",name:"take-pictures"}]}),created(){this.scannerVideoSrc=W.mainCameraUrl},methods:{selectChange(e){let t=1===e?"start-vice":"start-main";this.handleAction(t)},handleAction(e){switch(e){case"start-main":this.scannerVideoSrc=W.mainCameraUrl;break;case"start-vice":this.scannerVideoSrc=W.secondaryCameraUrl;break;case"take-pictures":this.takePictures();break}},async takePictures(){if(0===this.camera){const e=await W.scanByMainCamera();this.$emit("send-scanner-result",`${H}${e}`)}else{const e=await W.scanBySecondaryCamera();this.$emit("send-scanner-result",`${H}${e}`)}}}},U=q,Y=l(U,A,F,!1,null,"428304e7",null),G=Y.exports,K={name:"scanner-eloam",components:{ScannerEloamComponent:G},props:{openMode:{default:"",type:String},label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"",type:String},type:{default:"",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"",type:String},disabled:{default:!1,type:Boolean}},data:()=>({dialogVisible:!1,scannerResult:""}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{openScanDialog(){this.dialogVisible=!0},setScannerResult(e){this.scannerResult=e,"dialog"!==this.openMode&&this.$emit("send-scanner-result",this.scannerResult)},sendScannerResult(){this.scannerResult&&(this.$emit("send-scanner-result",this.scannerResult),this.dialogVisible=!1)}}},X=K,J=l(X,N,j,!1,null,"a80d3a26",null),Z=J.exports;Z.install=e=>{e.component(Z.name,Z)};var Q,ee=Z,te=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-camera-container"},["dialog"===e.openMode?t("div",{staticClass:"scanner-camera-button"},[e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("el-dialog",{staticClass:"scanner-camera-dialog",attrs:{title:"影像扫描",visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[e.dialogVisible?t("scanner-camera-component",{attrs:{"machine-type":e.machineType},on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)}):e._e(),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.sendScannerResult}},[e._v("确 定")])],1)],1)],1):t("scanner-camera-component",{attrs:{"machine-type":e.machineType},on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)})],1)},ne=[],ie=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-component"},[t("div",{staticClass:"scanner-result-content"},[t("div",{staticClass:"content-main flex-1"},[e.loadSuccess?t("div",{staticClass:"load-success"},[t("img",{staticStyle:{width:"800px",height:"600px"},attrs:{id:"photo",src:e.scannerVideoSrc}})]):t("div",{staticClass:"load-error"},[t("i",{staticClass:"el-icon-s-cooperation"}),t("p",[e._v("请先安装插件")])])]),t("div",{staticClass:"handle-action"},[t("el-select",{staticClass:"select",attrs:{size:"small"},on:{change:e.selectChange},model:{value:e.camera,callback:function(t){e.camera=t},expression:"camera"}},e._l(e.cameras,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1),e._l(e.buttonList,(function(n){return[t("el-button",{key:n.name,attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleAction(n.name)}}},[e._v(e._s(n.label))]),e._t("action")]}))],2)])])},re=[];class ae{static startConnect(e,t,n={}){return new Promise(((i,r)=>{let a=new XMLHttpRequest;if(e=e.toUpperCase(),"GET"==e){let e="";Object.keys(n).forEach((t=>{e+=`${t}=${n[t]}&`})),e=e.substring(0,e.lastIndexOf("&")),t=t+"?"+e}else"POST"==e||r("error method: Currently only supported GET or POST method!");a.open(e,t,!0),a.setRequestHeader("Accept","application/json"),"GET"===e?a.send():a.send(JSON.stringify(n)),a.onreadystatechange=function(){if(4===this.readyState)if(200===this.status){let e=this.response;"object"!==typeof e&&(e=JSON.parse(e)),i(e)}else r(a)}}))}static async get(e){let t=await ae.startConnect("GET",e);return t}static async post(e,t){let n=await ae.startConnect("POST",e,t);return n}}(function(e){e["ScannerMainCamera_Base64"]="ScannerMainCamera_Base64",e["ScannerSecondaryCamera_Base64"]="ScannerSecondaryCamera_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64"})(Q||(Q={}));Q.ScannerMainCamera_Base64,Q.ScannerSecondaryCamera_Base64,Q.ReadIDCard_Base64;class se{static get mainCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=0"}static get secondaryCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=1"}static async read(e){let t={},n="";switch(e){case Q.ScannerMainCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"",rotate:"0",deskew:"0",deskewval:"0",camidx:"0",ColorMode:"0",quality:"0",bIsPrint1to1:"0"};break;case Q.ScannerSecondaryCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"",rotate:"0",deskew:"0",deskewval:"0",camidx:"1",ColorMode:"0",quality:"0",bIsPrint1to1:"0"};break;case Q.ReadIDCard_Base64:n=this.baseServiceUrl+"/card=idcard";break}let i=await ae.post(n,t);return i}static async scanByMainCamera(){const e=await se.read(Q.ScannerMainCamera_Base64);return e.photoBase64}static async scanBySecondaryCamera(){const e=await se.read(Q.ScannerSecondaryCamera_Base64);return e.photoBase64}static async scanByCamera(e){switch(e){case"main":return this.scanByMainCamera();case"vice":return this.scanBySecondaryCamera()}}static async turnOnTheCamera(){}static async idCardRead(){const e=await se.read(Q.ReadIDCard_Base64);let{name:t,sex:n,birthday:i,address:r,cardID:a,nationCode:s,photoBase64:o,issueOrgan:l,validStart:c,validEnd:u}=e.IDCardInfo;const h={info:{name:t,sex:n,birthday:i.replace("-","").replace("-",""),address:r,cardId:a,nation:s,police:l,validStart:c,validEnd:u},headImage:o};return h}}z(se,"baseServiceUrl","http://127.0.0.1:38088");const oe="scanner-camera-refresh-photo-event";class le extends Event{constructor(e){super(oe),z(this,"scannerResultUrl",""),this.scannerResultUrl=e}}class ce{static getGenderByIdNumber(e){if(e){let t;if(18==e.length?t=e.charAt(16):15==e.length&&(t=e.charAt(14)),t&&!isNaN(t))return parseInt(t)%2==0?"女":"男"}return""}static getBirthdayByIdNumber(e){if(e&&e&&e.length>13){const t=e.substring(6,10),n=e.substring(10,12),i=e.substring(12,14);return t+"-"+n+"-"+i}return""}static getAgeByIdNumber(e){if(e){const t=new Date,n=t.getMonth()+1,i=t.getDate();let r=t.getFullYear()-e.substring(6,10)-1;return(e.substring(10,12)<n||e.substring(10,12)===n&&e.substring(12,14)<=i)&&r++,r<=0&&(r=1),r}return""}static isForeignersIdCard(e){let t=/^[a-zA-Z]{3}[0-9]{12}$/;return t.test(e)||e.startsWith("9")}}var ue,he,de,fe;(function(e){e["ScannerCamera"]="scannerCamera",e["InteractiveTerminal"]="interactiveTerminal"})(ue||(ue={})),function(e){e["ScannerMainCamera_Base64"]="main",e["ScannerSecondaryCamera_Base64"]="vice",e["TakePhoto_Base64"]="takePhoto",e["ScannerReadCard"]="ScannerReadCard",e["InitParams"]="InitParams",e["GetSignName_Base64"]="GetSignName_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64",e["FaceValidateWithIdCard_Base64"]="FaceValidateWithIdCard_Base64",e["FingerPrint_Base64"]="FingerPrint_Base64",e["ScanQRCode"]="ScanQRCode",e["Evaluate"]="Evaluate",e["StartProjection"]="StartProjection",e["EndProjection"]="EndProjection"}(he||(he={}));class pe{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t="";switch(e){case ue.InteractiveTerminal:t=this.interactiveTerminalUrl;break;case ue.ScannerCamera:t=this.scannerCameraUrl;break}const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=e=>{this.handleMessage(e)},n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("捷宇高拍仪设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";if(e.origin===this.interactiveTerminalUrl){try{t=JSON.parse(e.data)}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}else{if(t=e.data,!t.startsWith("BarCode")&&!t.startsWith("Begin")){const e=new le(t);return window.dispatchEvent(e)}(t.indexOf("BeginbSaveJPGEx")>=0||t.indexOf("BeginReadCard")>=0)&&(this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[])}}static async read(e,t,n){if(await this.startConnect(e),1===this.ws.readyState){let e="";switch(t){case he.ScannerMainCamera_Base64:this.ws.send("vSetResolution(7)"),this.ws.send("bStopPlay()"),this.ws.send("bStartPlay()"),this.ws.send("bSetMode(3)"),e="vSetOpenInpain(1)";break;case he.ScannerSecondaryCamera_Base64:e="bStartPlay2";break;case he.TakePhoto_Base64:e="bSaveJPGEx";break;case he.ScannerReadCard:e="ReadCard(1001, C:Doccamera)";break;case he.InitParams:e=JSON.stringify({projectCode:n.projectCode,type:181});break;case he.GetSignName_Base64:e=JSON.stringify({type:3,Timeout:60,Location:"0,1,450,500|1,1,450,500",PDFPath:n.PDFPath,Retain:"test",XmlPath:""});break;case he.ReadIDCard_Base64:e=JSON.stringify({type:4});break;case he.FaceValidateWithIdCard_Base64:e=JSON.stringify({type:5});break;case he.FingerPrint_Base64:e=JSON.stringify({FileFullName:"d:\\Fingerprint.png",TimeOut:60,type:12});break;case he.ScanQRCode:e=JSON.stringify({type:61});break;case he.StartProjection:e=JSON.stringify({type:82});break;case he.EndProjection:e=JSON.stringify({type:83});break;case he.Evaluate:e=JSON.stringify({type:90,URL:n.URL});break}return this.ws.send(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error("设备未准备完成")}static async turnOnTheCamera(e){this.ws&&this.ws.close(),await pe.read(ue.ScannerCamera,e)}static async scanByCamera(){let e=await pe.read(ue.ScannerCamera,he.TakePhoto_Base64);return e.replace("BeginbSaveJPGEx","").replace("EndbSaveJPGEx","")}static async initParams(){this.ws&&this.ws.close();let e="ls8t1IYtBhOg5kwajaZsmeim/GIw0PY6NEoJ2cbNoptx678YKIqWaRVe0XPy1u5/cXLuXKW/Vufptwgo8Gc/lHMHbqiOHj7ySAqb9VCvP9KI1HAoqzPMpueyQhJskyfGk+L8/9dKK5/rySTLDuT4Un0W1o/1p9D41EDPwkAm2YY=";await pe.read(ue.InteractiveTerminal,he.InitParams,{projectCode:e})}static async signNameRead(e){let t=await pe.read(ue.InteractiveTerminal,he.GetSignName_Base64,{PDFPath:e});if(!t)throw Error("未匹配可用的捷宇信息交互终端设备");if(0!==t.ret)throw Error("读取二代身份证失败,返回值:"+t.ret+",错误信息:"+t.errMsg);return t}static async idCardReadByScanner(){let e=await pe.read(ue.ScannerCamera,he.ScannerReadCard);if(!e)throw Error("未匹配可用的捷宇高拍仪设备");let t=JSON.parse(e.replace("BeginReadCard","").replace("EndReadCard",""));if(1!==t.result)throw Error("读取二代身份证失败,返回值:"+t.ret+",错误信息:"+t.errMsg);console.log(t);let{Name:n,EnglishName:i,Sex:r,BirthDate:a,Address:s,IdNo:o,Folk:l,Agency:c,Valid:u,PhotoB64:h}=t,[d,f]=u.split("-"),p="",m="1",v="中国",g=ce.isForeignersIdCard(o);g&&(m="9",p=n,n="无中文姓名"===n?i:n,c="中华人民共和国国家移民管理局",v=l,l="");const b={info:{cardType:m,nationality:v,name:n,chineseName:p,englishName:i,sex:r,birthday:a,address:s,cardId:o,nation:l,police:c,validStart:d,validEnd:f},headImage:h};return console.log(b),b}static async idCardRead(){let e=await pe.read(ue.InteractiveTerminal,he.ReadIDCard_Base64);if(!e)throw Error("未匹配可用的捷宇信息交互终端设备");if(0!==e.ret)throw Error("读取二代身份证失败,返回值:"+e.ret+",错误信息:"+e.errMsg);let{name:t,sex:n,birth:i,addr:r,id_num:a,nation:s,base64_ID:o,depart:l,validityTime:c}=e,[u,h]=c.split("-");const d={info:{name:t,sex:n,birthday:i.replace("年","").replace("月","").replace("日",""),address:r,cardId:a,nation:s,police:l,validStart:u,validEnd:h},headImage:o};return console.log("读取二代身份证结果==>",d),d}static async faceValidateWithIdCardRead(){let e=await pe.read(ue.InteractiveTerminal,he.FaceValidateWithIdCard_Base64);if(!e)throw Error("未匹配可用的捷宇信息交互终端设备");if(0!==e.ret)throw Error("读取二代身份证失败,返回值:"+e.ret+",错误信息:"+e.errMsg);let{name:t,sex:n,birth:i,addr:r,id_num:a,nation:s,base64_ID:o,depart:l,validityTime:c,base64_Face:u}=e,[h,d]=c.split("-");const f={idCard:{info:{name:t,sex:n,birthday:i.replace("年","").replace("月","").replace("日",""),address:r,cardId:a,nation:s,police:l,validStart:h,validEnd:d},headImage:o},faceimg:e.base64_Face};return console.log("读取二代身份证结果==>",f),f}static async mergeImage(e,t){return new Promise(((n,i)=>{let r=document.createElement("canvas");r.width=600,r.height=360;let a=r.getContext("2d");a.rect(0,0,r.width,r.height),a.fillStyle="#fff",a.fill();let s=new Image;s.src="data:image/png;base64,"+e,s.crossOrigin="Anonymous",s.onload=function(){a.drawImage(s,0,0,500,360);let e=new Image;e.src="data:image/png;base64,"+t,e.crossOrigin="Anonymous",e.onload=function(){a.drawImage(e,320,0,256,360);let t=r.toDataURL("image/png");t=t.replace("data:image/png;base64,",""),n(t)}}}))}}z(pe,"scannerCameraUrl","ws://127.0.0.1:1818"),z(pe,"interactiveTerminalUrl","ws://127.0.0.1:1919"),z(pe,"ws",void 0),z(pe,"requestStore",[]);class me{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const e=new WebSocket(this.scannerCameraUrl);let t;const n=new Promise((e=>{t=e}));return e.onopen=()=>{t(!0)},e.onmessage=e=>{this.handleMessage(e)},e.onclose=()=>this.handleClose(),e.onerror=()=>this.handleError(),this.ws=e,n}static handleError(){throw Error("方正高影仪设备功能加载失败")}static handleClose(){this.ws&&this.ws.close()}static handleMessage(e){let t=e.data?JSON.parse(e.data):{};if("video_stream"===t.function){const e=new le(t.image_base64);return window.dispatchEvent(e)}}static async read(e){if(await this.startConnect(),1!==this.ws.readyState)throw Error("设备未准备完成");this.ws.send(JSON.stringify({function:"open_camera",camidx:"0"})),this.ws.send(JSON.stringify(e))}static async turnOnTheCamera(){let e={function:"set_cutpage",params:{cutpage:"false"}};await me.read(e)}}z(me,"scannerCameraUrl","ws://127.0.0.1:38088"),z(me,"ws",void 0),function(e){e["TurnOnCamera"]="turnOnCamera",e["TakePhoto_Base64"]="TakePhoto_Base64"}(de||(de={}));class ve{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const e=new WebSocket(this.scannerCameraUrl);let t;const n=new Promise((e=>{t=e}));return e.onopen=()=>{t(!0)},e.onmessage=e=>{this.handleMessage(e)},e.onclose=()=>this.handleClose(),e.onerror=()=>this.handleError(),this.ws=e,n}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("紫图速拍仪设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}));this.ws&&this.ws.close()}static handleMessage(e){let t=e.data?JSON.parse(e.data):{};if("ShowVideo"===t.FuncName){const e=new le(t.result);return window.dispatchEvent(e)}"CaptureBase64"!==t.FuncName&&"CaptureDualBase64"!==t.FuncName||(this.requestStore.forEach((({resolve:e})=>{e(t.result)})),this.requestStore=[])}static async read(e,t){if(await this.startConnect(),1===this.ws.readyState){let t="";switch(e){case de.TurnOnCamera:this.ws.send(JSON.stringify({Func:"StartRunMain",arg:0})),t=JSON.stringify({Func:"ChangeCutType",arg:0});break;case de.TakePhoto_Base64:this.ws.send(JSON.stringify({Func:"SetJPGQuality",arg:70})),this.ws.send(JSON.stringify({Func:"SetColorType",arg:"彩色"})),this.ws.send(JSON.stringify({Func:"SetBoardColor",arg:0})),this.ws.send(JSON.stringify({Func:"SetCamDPI",arg:720})),t=JSON.stringify({Func:"CaptureBase64",arg:0})}return this.ws.send(t),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error("设备未准备完成")}static async turnOnTheCamera(){await ve.read(de.TurnOnCamera)}static async scanByCamera(){const e=await ve.read(de.TakePhoto_Base64);return e}}z(ve,"scannerCameraUrl","ws://127.0.0.1:8341"),z(ve,"ws",void 0),z(ve,"requestStore",[]),function(e){e["ReadCard_Base64"]="ReadCard_Base64",e["StartSignName"]="StartSignName",e["GetSignNameStatus"]="GetSignNameStatus",e["GetSignName_Base64"]="GetSignName_Base64",e["FaceValidateWithIdCard_Base64"]="FaceValidateWithIdCard_Base64",e["TurnOnTheCamera"]="TurnOnTheCamera",e["ScannerCamera"]="ScannerCamera"}(fe||(fe={}));const ge={[fe.ReadCard_Base64]:"读卡",[fe.GetSignName_Base64]:"获取签名",[fe.FaceValidateWithIdCard_Base64]:"人证比对"};class be{static startConnect(e){if(console.log("startConnect",e,this.ws?.readyState,WebSocket.CONNECTING),this.ws&&this.ws.readyState===WebSocket.OPEN)return this;console.log("重新链接");const t=new WebSocket(this.webSocketUrl);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>{this.handleMessage(e)},t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";try{t=JSON.parse(e.data)}catch(n){t=""}if("FaceScreenStream"===t.method||"VideoStream"===t.method){const e=new le(t.imgBase64);return window.dispatchEvent(e)}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[]}static async read(e){await this.startConnect(e);const t=ge[e];if(1===this.ws.readyState){let t;switch(e){case fe.ReadCard_Base64:t=JSON.stringify({method:"ReadIDCard_Base64",args:{outTimes:30,cardReader:0}});break;case fe.FaceValidateWithIdCard_Base64:t=JSON.stringify({method:"FaceValidateWithIdCard_Base64",args:{outTimes:30,score:75}});break;case fe.StartSignName:t=JSON.stringify({method:"SignNameScreen_Start",args:{outTimes:30}});break;case fe.GetSignNameStatus:t=JSON.stringify({method:"SignNameScreen_Status",args:{}});break;case fe.GetSignName_Base64:t=JSON.stringify({method:"SignNameScreen_Get",args:{}});break;case fe.TurnOnTheCamera:t=JSON.stringify({method:"VideoStart",args:{}});break;case fe.ScannerCamera:t=JSON.stringify({method:"GetCameraImage",args:{imagePath:""}});break}return this.ws.send(t),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error(t+"未准备完成")}static async idCardRead(){const e=await be.read(fe.ReadCard_Base64);if(!e)throw Error("未匹配到可用的读取设备");if(0!==e.retVal)throw this.ws?.close(),Error("读取二代身份证失败,返回值:"+e.retVal+",错误信息:"+e.errMsg);let t=e.idInfo,{name:n,ENfullname:i,Nationality:r,sex:a,birthday:s,address:o,number:l,nation:c,organs:u,signdate:h,validterm:d}=t,f="",p="1",m="中国";1==e.cardType||2==e.cardType?(p="9",f=n,n=n||i,u=u||"中华人民共和国国家移民管理局",m=r,c=""):p="1";const v={info:{cardType:p,nationality:m,name:n,chineseName:f,englishName:i,sex:a,birthday:s.replace("-","").replace("-",""),address:o,cardId:l,nation:c,police:u,validStart:h,validEnd:d},headImage:e.idPhotoBase64};return this.ws?.close(),v}static async socialSecurityCardRead(){const e=await be.read(fe.ReadCard_Base64);if(!e)throw Error("未匹配可用的读取设备");if(0!==e.retVal)throw this.ws?.close(),Error("读取社保卡基本信息失败,返回值:"+e.retVal+",错误信息:"+e.idInfo);const t=e.idInfo;let{name:n,sex:i,birthday:r,number:a,cardnumber:s}=t;const o={info:{name:n,sex:i,birthday:r,address:"",cardId:a,cardnumber:s},headImage:""};return this.ws?.close(),o}static async faceValidateWithIdCardRead(){const e=await be.read(fe.FaceValidateWithIdCard_Base64);if("FaceValidateWithIdCard_Base64"===e.method&&"0"==e.retVal){console.log("认证成功=>",e);const t=e.idInfo;let{name:n,ENfullname:i,Nationality:r,sex:a,birthday:s,address:o,number:l,nation:c,organs:u,signdate:h,validterm:d}=t,f="",p="1",m="中国";1==e.cardType||2==e.cardType?(p="9",f=n,n=n||i,u=u||"中华人民共和国国家移民管理局",m=r,c=""):p="1";const v={idCard:{info:{cardType:p,nationality:m,name:n,chineseName:f,englishName:i,sex:a,birthday:s.replace("-","").replace("-",""),address:o,cardId:l,nation:c,police:u,validStart:h,validEnd:d},headImage:e.idPhotoBase64},faceimg:e.scenceBase64,score:e.score};return this.ws?.close(),v}this.ws?.close()}static async signNameRead(){return new Promise((async(e,t)=>{const n=await be.read(fe.StartSignName);console.log("开始签名=>",n),"SignNameScreen_Start"===n.method&&(0!==n.retVal?(this.ws?.close(),t(`开始签名失败,返回值:${n.retVal},错误信息:${n.errMsg}`)):this.timer||(this.timer=setInterval((async()=>{let n=await be.read(fe.GetSignNameStatus);if(2==n.signScreenStatus){clearInterval(this.timer),this.timer=null;let t=await be.read(fe.GetSignName_Base64);this.ws?.close(),e(t.signPicBase64)}else 3==n.retVal&&(clearInterval(this.timer),this.timer=null,this.ws?.close(),t("签字结果=>签字失败,或意外中断!"))}),2e3)))}))}static async turnOnTheCamera(){await be.read(fe.TurnOnTheCamera)}static async scanByCamera(){let e=await be.read(fe.ScannerCamera);if("GetCameraImage"===e.method&&0==e.retVal)return this.ws?.close(),e.cameraImgBase64}}z(be,"webSocketUrl","ws://127.0.0.1:5847"),z(be,"ws",void 0),z(be,"requestStore",[]),z(be,"timer",null);const ye="data:image/jpg;base64,";var _e={name:"scanner-camera-component",props:{machineType:{default:0,type:Number}},data:()=>({scannerVideoSrc:"",scannerResultSrc:"",loadSuccess:!0,camera:0,cameras:[{name:"文档",value:0},{name:"照片",value:1}],buttonList:[{label:"拍照",name:"take-pictures"}]}),watch:{machineType:function(){let e=1===this.camera?"start-vice":"start-main";this.handleAction(e)}},created(){this.handleAction("start-main"),window.addEventListener(oe,(e=>{e.type===oe&&(this.scannerVideoSrc=`${ye}${e.scannerResultUrl}`)}))},methods:{selectChange(e){let t=1===e?"start-vice":"start-main";this.handleAction(t)},async takePictures(){switch(this.machineType){case 0:let e=await pe.scanByCamera();this.$emit("send-scanner-result",`${ye}${e}`);break;case 3:this.$emit("send-scanner-result",this.scannerVideoSrc);break;case 4:{let e=await ve.scanByCamera();this.$emit("send-scanner-result",`${ye}${e}`);break}case 5:{let e=0===this.camera?"main":"vice";const t=await se.scanByCamera(e);this.$emit("send-scanner-result",`${ye}${t}`);break}case 6:{let e=await be.scanByCamera();this.$emit("send-scanner-result",`${ye}${e}`);break}}},async handleStartMain(){switch(this.machineType){case 0:await pe.turnOnTheCamera("main");break;case 3:await me.turnOnTheCamera();break;case 4:await ve.turnOnTheCamera();break;case 5:this.scannerVideoSrc=se.mainCameraUrl;break;case 6:await be.turnOnTheCamera();break}},async handleStartVice(){switch(this.machineType){case 0:await pe.turnOnTheCamera("vice");break;case 3:await me.turnOnTheCamera();break;case 4:await ve.turnOnTheCamera();break;case 5:this.scannerVideoSrc=se.secondaryCameraUrl;break;case 6:await be.turnOnTheCamera();break}},handleAction(e){switch(e){case"start-main":this.handleStartMain();break;case"start-vice":this.handleStartVice();break;case"take-pictures":this.takePictures();break}}}},we=_e,xe=l(we,ie,re,!1,null,"bc9cce92",null),Ce=xe.exports,ke={name:"scanner-camera",components:{ScannerCameraComponent:Ce},props:{machineType:{default:0,type:Number},openMode:{default:"",type:String},label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"",type:String},type:{default:"",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"",type:String},disabled:{default:!1,type:Boolean}},data:()=>({dialogVisible:!1,scannerResult:""}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{openScanDialog(){this.dialogVisible=!0},setScannerResult(e){this.scannerResult=e,"dialog"!==this.openMode&&this.$emit("send-scanner-result",this.scannerResult)},sendScannerResult(){this.scannerResult&&(this.$emit("send-scanner-result",this.scannerResult),this.dialogVisible=!1)}}},Se=ke,Ee=l(Se,te,ne,!1,null,"00e9072f",null),Oe=Ee.exports;Oe.install=e=>{e.component(Oe.name,Oe)};var De=Oe,$e=function(){var e=this,t=e._self._c;return e.tip?t("el-tooltip",{staticClass:"id-card-reader-eloam",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)},Te=[],Ie={name:"id-card-reader-eloam",props:{label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"mini",type:String},type:{default:"primary",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"el-icon-postcard",type:String},disabled:{default:!1,type:Boolean}},computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{async handleClick(){let e=await W.idCardRead();this.$emit("click",e)}}},Me=Ie,Pe=l(Me,$e,Te,!1,null,"5b7ce781",null),Ne=Pe.exports;Ne.install=e=>{e.component(Ne.name,Ne)};var je,Ae,Fe=Ne,Be=function(){var e=this,t=e._self._c;return e.tip?t("el-tooltip",{staticClass:"id-card-reader-button",attrs:{content:e.tip,placement:"top"}},[e.showIDCardChrome?t("embed",{attrs:{clsid:"{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",type:"application/x-itst-activex",width:"0",height:"0",name:"IDCard_chrome",id:"IDCard_chrome"}}):e._e(),t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("canvas",{staticStyle:{display:"none"},attrs:{id:"canvas",width:"500",height:"360"}})],1):t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e.showIDCardChrome?t("embed",{attrs:{clsid:"{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",type:"application/x-itst-activex",width:"0",height:"0",name:"IDCard_chrome",id:"IDCard_chrome"}}):e._e(),e._t("default",(function(){return[e._v(e._s(e.label))]})),t("canvas",{staticStyle:{display:"none"},attrs:{id:"canvas",width:"500",height:"360"}})],2)},Le=[];(function(e){e["idcard"]="sfz",e["jlsfz"]="jlsfz",e["camera"]="sxt",e["ywSign"]="yw",e["hwSign"]="hwsign"})(je||(je={}));class Ve{static startConnect(e=je.idcard){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t=this.idcardWebSocketUrl;switch(e){case je.idcard:t=this.idcardWebSocketUrl;break;case je.jlsfz:t=this.jlsfzWebSocketUrl}const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=e=>this.handleMessage(e),n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("读取身份证功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";try{t=JSON.parse(e.data)}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e=je.idcard){if(await this.startConnect(e),1===this.ws.readyState)return this.ws.send(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("读取身份证未准备完成")}static async idCardCommonRead(){let e;for(const t of[je.jlsfz,je.idcard]){const n=await Ve.read(t);if(n&&n.hasOwnProperty("info")){e=n;break}}if(e)return e;throw Error("未匹配可用的读卡器")}}z(Ve,"idcardWebSocketUrl","ws://127.0.0.1:8152/SFZManage"),z(Ve,"jlsfzWebSocketUrl","ws://127.0.0.1:8152/JLSFZManage"),z(Ve,"ws",void 0),z(Ve,"requestStore",[]);class ze{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let e=this.cameraWebSocketUrl;const t=new WebSocket(e);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>this.handleMessage(e),t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("读取拍照功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t=e.data;this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(){if(await this.startConnect(),1===this.ws.readyState)return this.ws.send(je.camera),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("读取拍照未准备完成")}}z(ze,"cameraWebSocketUrl","ws://127.0.0.1:8152/SXTManage"),z(ze,"ws",void 0),z(ze,"requestStore",[]);class Re{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t=this.signWebSocketUrl;e===je.hwSign&&(t=this.hwSignWebSocketUrl);const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=e=>this.handleMessage(e),n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("签字板加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t=e.data;this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e=je.ywSign){if(await this.startConnect(e),1===this.ws.readyState)return console.log("签字板连接成功"),this.ws.send(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("签字板未准备完成")}}z(Re,"signWebSocketUrl","ws://127.0.0.1:8152/chromeManage"),z(Re,"hwSignWebSocketUrl","ws://127.0.0.1:8152/HWSIGNManage"),z(Re,"ws",void 0),z(Re,"requestStore",[]),function(e){e["iReadCardBas"]="iReadCardBas",e["GetSignName_Base64"]="GetSignName_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64",e["FaceValidateWithIdCard_Base64"]="FaceValidateWithIdCard_Base64",e["FingerPrint_Base64"]="FingerPrint_Base64"}(Ae||(Ae={}));const We={[Ae.iReadCardBas]:"读取社保卡",[Ae.GetSignName_Base64]:"获取签名",[Ae.ReadIDCard_Base64]:"读取二代身份证",[Ae.FaceValidateWithIdCard_Base64]:"人证比对",[Ae.FingerPrint_Base64]:"获取指纹"};class He{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t="";switch(e){case Ae.FingerPrint_Base64:t=this.fingerPrintBasWebSocketUrl;break;default:t=this.iReadCardBasWebSocketUrl;break}const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=t=>{e===Ae.FingerPrint_Base64&&(t={...t,data:JSON.stringify({fingerPrintInfo:t.data})}),this.handleMessage(t)},n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("E窗通设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";try{t=JSON.parse(e.data)}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e){await this.startConnect(e);const t=We[e];if(1===this.ws.readyState){let n;switch(e!==Ae.FingerPrint_Base64&&console.log(t+"连接成功"),e){case Ae.ReadIDCard_Base64:n=JSON.stringify({method:e,args:{outTimes:30,cardReader:1}});break;case Ae.FaceValidateWithIdCard_Base64:n=JSON.stringify({method:e,args:{outTimes:30,cardReader:1,cameraType:0}});break;case Ae.iReadCardBas:n=JSON.stringify({method:e,args:{icType:"1"}});break;case Ae.FingerPrint_Base64:n="getimgae,1,0,288,0";break;default:n=JSON.stringify({method:e,args:{outTimes:30}});break}return this.ws.send(n),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error(t+"未准备完成")}static async idCardRead(e=Ae.ReadIDCard_Base64){const t=await He.read(Ae.ReadIDCard_Base64);if(console.log("读取二代身份证==>",t),!t)throw Error("未匹配可用的E窗通读取设备");if(0!==t.retVal)throw Error("读取二代身份证失败,返回值:"+t.retVal+",错误信息:"+t.errMsg);const n=t.idInfo.data,{name:i,sex:r,birthday:a,address:s,id_num:o,nations:l}=n,c={info:{name:i,sex:r,birthday:a.replace("-","").replace("-",""),address:s,cardId:o,nation:l},headImage:t.idPhotoPicBase64};return console.log("读取二代身份证结果==>",c),c}static async faceValidateWithIdCardRead(){const e=await He.read(Ae.FaceValidateWithIdCard_Base64);if(console.log("人证比对==>",e),!e)throw Error("未匹配可用的E窗通读取设备");if(0!==e.retVal)throw Error("人证比对失败,返回值:"+e.retVal+",错误信息:"+e.errMsg);const t=e.idInfo.data,{name:n,sex:i,birth:r,address:a,idNo:s,nation:o}=t,l={idCard:{info:{name:n,sex:i,birthday:r.replace("-","").replace("-",""),address:a,cardId:s,nation:o},headImage:e.idPhotoBase64},faceimg:e.scenceBase64};return console.log("人证比对结果==>",l),l}static async socialSecurityCardRead(){const e=await He.read(Ae.iReadCardBas);if(!e)throw Error("未匹配可用的E窗通读取设备");if(0!==e.retVal)throw Error("读取社保卡基本信息失败,返回值:"+e.retVal+",错误信息:"+e.outInfo);const t=e.outInfo,n=t.split("|"),i=n[1],r=ce.getBirthdayByIdNumber(i).replace("-","").replace("-",""),a=ce.getGenderByIdNumber(i),s={info:{name:n[4],sex:a,birthday:r,address:"",cardId:i},headImage:""};return console.log("读取社保卡==>",e),s}static async signNameRead(){const e=await He.read(Ae.GetSignName_Base64);if(!e)throw Error("未匹配可用的E窗通读取设备");if(0!==e.retVal)throw Error("读取签名失败,返回值:"+e.retVal+",错误信息:"+e.errMsg);return console.log("获取签名==>",e),e.signPicBase64}static async fingerPrintRead(){let e=30;async function t(){const n=await He.read(Ae.FingerPrint_Base64);if(!n)throw Error("未匹配可用的E窗通读取设备");let i=n.fingerPrintInfo.split("|");console.log(i);let r=Number(i[1]);return r>1?e>0?(e--,await t()):{status:"error",data:"已超时,请重新操作,按压指纹"}:{status:"success",data:n.fingerPrintInfo}}let{status:n,data:i}=await t();if("error"===n)throw Error(i);{let[e,t,n,r,a]=i.split("|");return{method:e,result:t,quality:n,image:r,featureCode:a}}}}var qe;z(He,"iReadCardBasWebSocketUrl","ws://127.0.0.1:5847"),z(He,"fingerPrintBasWebSocketUrl","ws://127.0.0.1:9000"),z(He,"ws",void 0),z(He,"requestStore",[]),function(e){e[e["ReadSocialSecurityCard"]=1002]="ReadSocialSecurityCard",e[e["ReadIDCard"]=1003]="ReadIDCard"}(qe||(qe={}));class Ue{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const e=this.HaDWebSocketUrl,t=new WebSocket(e);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>this.handleMessage(e),t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}))}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){const t=JSON.parse(e.data);this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e){if(await this.startConnect(),1===this.ws.readyState){let t;1003!==e&&1002!==e||(t={tsCode:e.toString(),picFilePath:"d:\\zp.bmp"});const n=JSON.stringify(t);return this.ws.send(n),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error("设备未准备完成")}static async idCardRead(){const e=await Ue.read(qe.ReadIDCard);if(console.log("读取二代身份证==>",e),!e)throw Error("未匹配可用的读取设备");const t=e.cardInfo.split("|")[1],n=e.cardInfo.split("|")[2],i=e.cardInfo.split("|")[3],r=e.cardInfo.split("|")[4],a=e.cardInfo.split("|")[5],s=e.cardInfo.split("|")[6],o=(e.cardInfo.split("|")[7],e.cardInfo.split("|")[8],e.cardInfo.split("|")[9],e.cardInfo.split("|")[10]),l={info:{name:t,sex:n,birthday:r,address:a,cardId:s,nation:i},headImage:o};return console.log("读取二代身份证结果==>",l),l}static async socialSecurityCardRead(){const e=await Ue.read(qe.ReadSocialSecurityCard);if(!e)throw Error("未匹配可用的读取设备");const t=e.cardInfo.split("|")[1],n=e.cardInfo.split("|")[2],i=ce.getBirthdayByIdNumber(t).replace("-","").replace("-",""),r=ce.getGenderByIdNumber(t),a={info:{name:n,sex:r,birthday:i,address:"",cardId:t},headImage:""};return console.log("读取社保卡==>",e),a}}z(Ue,"HaDWebSocketUrl","ws://127.0.0.1:36669/"),z(Ue,"ws",void 0),z(Ue,"requestStore",[]);var Ye,Ge=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);function Ke(e){var t,n,i,r,a,s,o;s=e.length,a=0,o="";while(a<s){do{t=Ge[255&e.charCodeAt(a++)]}while(a<s&&-1==t);if(-1==t)break;do{n=Ge[255&e.charCodeAt(a++)]}while(a<s&&-1==n);if(-1==n)break;o+=String.fromCharCode(t<<2|(48&n)>>4);do{if(i=255&e.charCodeAt(a++),61==i)return o;i=Ge[i]}while(a<s&&-1==i);if(-1==i)break;o+=String.fromCharCode((15&n)<<4|(60&i)>>2);do{if(r=255&e.charCodeAt(a++),61==r)return o;r=Ge[r]}while(a<s&&-1==r);if(-1==r)break;o+=String.fromCharCode((3&i)<<6|r)}return o}function Xe(e){var t,n,i,r,a,s;t="",i=e.length,n=0;while(n<i)switch(r=e.charCodeAt(n++),r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=e.charAt(n-1);break;case 12:case 13:a=e.charCodeAt(n++),t+=String.fromCharCode((31&r)<<6|63&a);break;case 14:a=e.charCodeAt(n++),s=e.charCodeAt(n++),t+=String.fromCharCode((15&r)<<12|(63&a)<<6|(63&s)<<0);break}return t}(function(e){e["ReadIDCard"]="$=Action|127.0.0.1|1352"})(Ye||(Ye={}));class Je{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const t=this.MRAdbWebSocketUrl,n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{n.send(e),i(!0)},n.onmessage=e=>this.handleMessage(e),n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}))}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){const t=JSON.parse(e.data);this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e){return await this.startConnect(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}static async idCardRead(){const e=await Je.read(Ye.ReadIDCard);if(console.log("中正智能人证核验返回==>",e),!e)throw Error("未匹配可用的读取设备");const{result:t,data:n}=e;switch(t){case-1:throw Error("服务器IP地址或者服务端口错误");case-2:throw Error("输入的发送数据参数非法");case-3:throw Error("连接服务器失败");case-4:throw Error("发送数据失败");case-5:throw Error("接收应答数据超时");case-6:throw Error("接收应答数据失败");case-7:throw Error("输出应答数据参数非法");case-8:throw Error("Websocket无法识别命令字");case-9:throw Error("Websocket解析命令字错误");case-10:throw Error("Websocket base64编码失败");case-11:throw Error("指纹驱动未安装或者未启动");case 0:{const e=Xe(Ke(n));console.log("中正智能人证核验结果==>",e);const t=e.split("$"),i=t[2].split("=#=")[1],r=t[3].split("=#=")[1],a=t[10].split("=#=")[1],s=t[6].split("=#=")[1],o=t[5].split("=#=")[1],l=t[4].split("=#=")[1],c=(t[11].split("=#=")[1],t[8].split("=#=")[1]),u=t[9].split("=#=")[1],h={idCard:{info:{name:i,sex:r,birthday:s,address:o,cardId:l,nation:a},headImage:c},faceimg:u};return console.log("中正智能人证核验结果转换==>",{name:i,sex:r,birthday:s,address:o,cardId:l,nation:a}),h}}return""}}z(Je,"MRAdbWebSocketUrl","ws://127.0.0.1:8003/finger"),z(Je,"ws",void 0),z(Je,"requestStore",[]);var Ze=__webpack_require__(1478),Qe=function(){var e=this,t=e._self._c;return e.visibility?t("el-dialog",{staticClass:"face-auth-dialog",attrs:{title:"人脸识别",top:"5vh",width:"1280px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("el-container",[t("el-aside",{attrs:{width:"900px"}},[t("zs-card",{attrs:{title:"身份证信息读取"}},[t("div",{staticClass:"idcard-photo"},[t("div",{staticClass:"flex-1"},[t("img",{staticStyle:{width:"433px",height:"278px"},attrs:{src:__webpack_require__(2234)}}),t("span",{staticClass:"idcard-info name"},[e._v(e._s(e.IDInfo.name))]),t("span",{staticClass:"idcard-info sex"},[e._v(e._s(e.IDInfo.sex))]),t("span",{staticClass:"idcard-info nation"},[e._v(e._s(e.IDInfo.nation))]),t("span",{staticClass:"idcard-info year"},[e._v(e._s(e.birthYear))]),t("span",{staticClass:"idcard-info month"},[e._v(e._s(e.birthMonth))]),t("span",{staticClass:"idcard-info day"},[e._v(e._s(e.birthDay))]),t("span",{staticClass:"idcard-info address"},[e._v(e._s(e.IDInfo.address))]),t("span",{staticClass:"idcard-info idnumber"},[e._v(e._s(e.IDInfo.cardId))])]),t("div",[t("img",{staticStyle:{width:"433px",height:"278px"},attrs:{src:__webpack_require__(4923)}}),t("span",{staticClass:"idcard-info qfjg"},[e._v(e._s(e.IDInfo.police))]),t("span",{staticClass:"idcard-info yxrq"},[e._v(e._s(e.validDate))])])])])],1),t("el-main",[t("zs-card",{staticClass:"camera",attrs:{title:"摄像头"},scopedSlots:e._u([{key:"extra",fn:function(){return[t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.veriface}},[e._v("开始识别")])]},proxy:!0}],null,!1,3429989024)},[t("div",{staticStyle:{width:"320px",height:"240px"},attrs:{id:"camera_row"}})])],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},e._l(e.buttonList,(function(n){return t("el-button",e._b({key:n.name,on:{click:function(t){return e.buttonClickEvent(n.name)}}},"el-button",n,!1),[e._v(e._s(n.label)+" ")])})),1)],1):e._e()},et=[],tt={name:"face-auth-dialog",data:()=>({visibility:!0,buttonList:[{name:"cancel",label:"取消",size:"small"},{name:"sure",label:"确定",type:"primary",size:"small",icon:"el-icon-success"}],idCardInfo:{info:{name:"",sex:"",nation:"",birthday:"",address:"",cardId:"",police:"",validStart:"",validEnd:"",sexCode:"",nationCode:""},headImage:void 0},verifaceData:verifaceData}),computed:{IDInfo(){return this.idCardInfo.info},birthYear(){return this.idCardInfo.info.birthday?this.idCardInfo.info.birthday.slice(0,4):""},birthMonth(){return this.idCardInfo.info.birthday?this.idCardInfo.info.birthday.slice(4,6):""},birthDay(){return this.idCardInfo.info.birthday?this.idCardInfo.info.birthday.slice(6,8):""},validDate(){return this.idCardInfo.info.validStart&&this.idCardInfo.info.validEnd?this.idCardInfo.info.validStart+"-"+this.idCardInfo.info.validEnd:""}},mounted(){this.$nextTick((()=>{(0,Ze.xj)()}))},methods:{async veriface(){const e=await Ze.g$.getElement(4);this.idCardInfo=e.idCard,this.verifaceData=e},buttonClickEvent(e){switch(e){case"cancel":this.visibility=!1;break;case"sure":this.$emit("close",this.verifaceData),this.visibility=!1;break}}}},nt=tt,it=l(nt,Qe,et,!1,null,null,null),rt=it.exports,at=function(){var e=this,t=e._self._c;return e.visibility?t("el-dialog",{staticClass:"face-auth-dialog",attrs:{title:"拍照",top:"5vh",width:"620px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("div",{staticClass:"image-container"},[t("img",{directives:[{name:"show",rawName:"v-show",value:!e.scannerPhotoSrc,expression:"!scannerPhotoSrc"}],staticStyle:{width:"600px",height:"450px"},attrs:{id:"photo",src:e.scannerVideoSrc}}),t("img",{directives:[{name:"show",rawName:"v-show",value:e.scannerPhotoSrc,expression:"scannerPhotoSrc"}],staticStyle:{width:"600px",height:"450px"},attrs:{id:"photo",src:"data:image/jpg;base64,"+e.scannerPhotoSrc}})]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e._l(e.buttonList,(function(n){return[e.isShowButton(n.name)?t("el-button",e._b({key:n.name,on:{click:function(t){return e.buttonClickEvent(n.name)}}},"el-button",n,!1),[e._v(e._s(n.label)+" ")]):e._e()]}))],2)]):e._e()},st=[],ot={name:"eloam-take-photo-dialog",data:()=>({visibility:!0,scannerVideoSrc:W.secondaryCameraUrl,scannerPhotoSrc:"",buttonList:[{name:"cancel",label:"取消",size:"small"},{name:"take-photo",label:"拍照",type:"primary",size:"small"},{name:"retake-photo",label:"重拍",type:"primary",size:"small"},{name:"sure",label:"确定",type:"primary",size:"small"}]}),methods:{isShowButton(e){switch(e){case"take-photo":return!this.scannerPhotoSrc;case"retake-photo":return this.scannerPhotoSrc;default:return!0}},async buttonClickEvent(e){switch(e){case"cancel":this.visibility=!1;break;case"take-photo":const e=await W.scanBySecondaryCamera();this.scannerPhotoSrc=e;break;case"retake-photo":this.scannerPhotoSrc="";break;case"sure":let t={faceimg:this.scannerPhotoSrc};this.$emit("close",t),this.visibility=!1;break}}}},lt=ot,ct=l(lt,at,st,!1,null,"6e18b4de",null),ut=ct.exports,ht=__webpack_require__(7203),dt=__webpack_require__.n(ht);class ft{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let e=this.idCardWebSocketUrl;const t=new WebSocket(e);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>this.handleMessage(e),t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("读取身份证功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";try{t=e.data}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(){if(await this.startConnect(),1===this.ws.readyState)return this.ws.send("04?timeout=10000"),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("读取身份证未准备完成")}static async idCardRead(){const e=await ft.read();if(e){let[t,n,i,r,a,s,o,l,c,u]=e.split("|"),h=e.split("|")[17];const d={info:{name:n,sex:i,birthday:a,address:s,cardId:o,nation:r,police:l,validStart:c,validEnd:u},headImage:h};return d}throw Error("未匹配可用的读卡器")}}z(ft,"idCardWebSocketUrl","ws://127.0.0.1:7415"),z(ft,"ws",void 0),z(ft,"requestStore",[]);var pt=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"face-auth-dialog",attrs:{title:"拍照",top:"5vh",width:"620px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("div",{staticClass:"image-container"},[t("video",{ref:"monitor",staticClass:"videoContainer",attrs:{autoplay:"",width:"250",height:"300"}}),t("canvas",{ref:"photo",staticClass:"videoContainer photo",staticStyle:{display:"none"},attrs:{width:"1920",height:"1080"}}),t("img",{staticClass:"videoContainer photo",attrs:{src:e.viewerPhotoSrc}})]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e._l(e.buttonList,(function(n){return[t("el-button",e._b({key:n.name,on:{click:function(t){return e.buttonClickEvent(n.name)}}},"el-button",n,!1),[e._v(e._s(n.label)+" ")])]}))],2)])},mt=[],vt={name:"default-take-photo-dialog",data:()=>({visibility:!0,viewerPhotoSrc:"",scannerPhotoSrc:"",cameraStream:"",buttonList:[{name:"cancel",label:"取消",size:"small"},{name:"take-photo",label:"拍照",type:"primary",size:"small"},{name:"sure",label:"确定",type:"primary",size:"small"}]}),mounted(){this.$nextTick((()=>{this.initDefaultCamera()}))},beforeDestroy(){this.cameraStream.getVideoTracks().forEach((e=>{e.stop()}))},methods:{async initDefaultCamera(){let e=this.$refs.monitor,t=this.$refs.photo;console.log(e,t);let n={audio:!1,video:{width:1920,height:1080}};if(navigator.mediaDevices.getUserMedia)try{let t=await navigator.mediaDevices.getUserMedia(n);e.srcObject=t,e.play(),this.cameraStream=t}catch(i){this.$message.error("没有可用的摄像头!"),console.log(i)}},takePicture(){let e=this.$refs.monitor,t=this.$refs.photo,n=t.getContext("2d");n.drawImage(e,0,0,1920,1080);let i=t.toDataURL("image/png");t.src=i,this.viewerPhotoSrc=i,this.scannerPhotoSrc=i.replace("data:image/png;base64,","")},async buttonClickEvent(e){switch(e){case"cancel":this.visibility=!1,this.$emit("close");break;case"take-photo":this.takePicture();break;case"sure":let e={faceimg:this.scannerPhotoSrc};this.$emit("close",e),this.visibility=!1;break}}}},gt=vt,bt=l(gt,pt,mt,!1,null,null,null),yt=bt.exports,_t=function(){var e=this,t=e._self._c;return e.visibility?t("el-dialog",{staticClass:"wei-rong-face-auth-dialog",attrs:{title:"人脸识别",top:"5vh",width:"640px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("div",{staticClass:"image-container"},[t("img",{staticStyle:{width:"600px",height:"450px"},attrs:{id:"photo",src:e.viewFaceImage}})])]):e._e()},wt=[];const xt="data:image/jpg;base64,";var Ct={name:"wei-rong-face-auth-dialog",data:()=>({visibility:!0,viewFaceImage:""}),async created(){window.addEventListener(oe,(e=>{e.type===oe&&(this.viewFaceImage=`${xt}${e.scannerResultUrl}`)}));let e=await be.faceValidateWithIdCardRead();this.$message.success("认证成功"),setTimeout((()=>{this.$emit("close",e)}),1500)}},kt=Ct,St=l(kt,_t,wt,!1,null,"5bbb0afc",null),Et=St.exports,Ot={name:"id-card-reader-button",props:{label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"mini",type:String},type:{default:"primary",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"el-icon-postcard",type:String},disabled:{default:!1,type:Boolean},readMachineType:{default:0,type:Number},readerMode:{default:"idCard",type:String},filePath:{default:"JVBERi0xLjcKJcKzx9gNCjMgMCBvYmoNPDwvQXV0aG9yIChhZG1pbikgL0NvbW1lbnRzICgpIC9Db21wYW55ICgpIC9DcmVhdGlvbkRhdGUgKEQ6MjAyMzA4MjYxNjQzMzUrMDgnNDMnKSAvQ3JlYXRvciAo/v8AVwBQAFMAIGWHW1cpIC9LZXl3b3JkcyAoKSAvTW9kRGF0ZSAoRDoyMDIzMDgyNjE2NDMzNSswOCc0MycpIC9Qcm9kdWNlciAoKSAvU291cmNlTW9kaWZpZWQgKEQ6MjAyMzA4MjYxNjQzMzUrMDgnNDMnKSAvU3ViamVjdCAoKSAvVGl0bGUgKCkgL1RyYXBwZWQgL0ZhbHNlPj4NZW5kb2JqDTYgMCBvYmoNPDwvQ29udGVudHMgNyAwIFIgL01lZGlhQm94IFswIDAgNTk1LjMgODQxLjldIC9QYXJlbnQgMiAwIFIgL1R5cGUgL1BhZ2U+Pg1lbmRvYmoNNyAwIG9iag08PC9GaWx0ZXIgL0ZsYXRlRGVjb2RlIC9MZW5ndGggMjg+Pg0Kc3RyZWFtDQp4nCvkNVQwAEJdEGVhYqhnqZCcyxvICwA4EQSdDQplbmRzdHJlYW0NZW5kb2JqDTIgMCBvYmoNPDwvQ291bnQgMSAvS2lkcyBbNiAwIFJdIC9UeXBlIC9QYWdlcz4+DWVuZG9iag0xIDAgb2JqDTw8L05hbWVzIDw8L0Rlc3RzIDQgMCBSPj4gL091dGxpbmVzIDUgMCBSIC9QYWdlcyAyIDAgUiAvVHlwZSAvQ2F0YWxvZz4+DWVuZG9iag00IDAgb2JqDTw8L05hbWVzIFtdPj4NZW5kb2JqDTUgMCBvYmoNPDw+Pg1lbmRvYmoNeHJlZg0KMCA4DQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDA1MjcgMDAwMDAgbg0KMDAwMDAwMDQ3MiAwMDAwMCBuDQowMDAwMDAwMDE2IDAwMDAwIG4NCjAwMDAwMDA2MTQgMDAwMDAgbg0KMDAwMDAwMDY0MyAwMDAwMCBuDQowMDAwMDAwMjgzIDAwMDAwIG4NCjAwMDAwMDAzNzIgMDAwMDAgbg0KdHJhaWxlcjw8L1NpemUgOCAvUm9vdCAxIDAgUiAvSW5mbyAzIDAgUiAvSUQgWzxiYTllMTE5ZmNjODQ0MGVjYThjZDYyZWNiYjNmNzA0OD48ZjI5MDhkYTE4YTMxNDkyZDhlODBkZTMyYzg5MjIyMjg+XT4+DXN0YXJ0eHJlZg02NjMNJSVFT0YN",type:String}},data:()=>({showIDCardChrome:!1}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e},isJIEYUPlugin(){return"sign"===this.readerMode&&3===this.readMachineType||"idCard"===this.readerMode&&6===this.readMachineType||"idCard"===this.readerMode&&6===this.readMachineType}},watch:{isJIEYUPlugin:{handler:async e=>{e&&await pe.initParams()}}},async created(){this.isJIEYUPlugin&&await pe.initParams()},methods:{handleClick(){switch(this.readerMode){case"idCard":return this.idCardRReaderEvent();case"veriface":return this.faceReaderEvent();case"sign":return this.signEvent();case"socialSecurityCard":return this.socialSecurityCardReaderEvent()}},async idCardRReaderEvent(){let e;switch(this.readMachineType){case 0:e=await Ve.idCardCommonRead(),this.$emit("click",e);break;case 1:return this.readLSIDCard();case 2:e=await He.idCardRead(),this.$emit("click",e);break;case 3:const t=await Je.idCardRead();t&&(e=t.idCard),this.$emit("click",e);break;case 4:e=await Ue.idCardRead(),this.$emit("click",e);break;case 5:e=await W.idCardRead(),this.$emit("click",e);break;case 6:e=await pe.idCardRead(),this.$emit("click",e);break;case 8:e=await ft.idCardRead(),this.$emit("click",e);break;case 9:e=await pe.idCardReadByScanner(),this.$emit("click",e);break;case 10:e=await be.idCardRead(),this.$emit("click",e);break}},async faceReaderEvent(){switch(this.readMachineType){case 0:this.readFacePhotoByDefault();break;case 1:this.readLSIDCardAndMatchFace();break;case 2:{const e=await He.faceValidateWithIdCardRead();this.$emit("click",e);break}case 3:{const e=await Je.idCardRead();this.$emit("click",e);break}case 5:this.readFacePhotoByELoam();break;case 6:{const e=await pe.faceValidateWithIdCardRead();this.$emit("click",e);break}case 10:this.openWEIRONGFaceValidateDialog();break}},async socialSecurityCardReaderEvent(){try{let e;switch(this.readMachineType){case 2:e=await He.socialSecurityCardRead();break;case 4:e=await Ue.socialSecurityCardRead();break;case 5:e=await be.socialSecurityCardRead();break}this.$emit("click",e)}catch(e){throw Error("读取社保卡失败")}},async signEvent(){let e="";switch(this.readMachineType){case 0:e=await Re.read();break;case 1:e=await Re.read(je.hwSign);break;case 2:e=await He.signNameRead();break;case 3:const t=await pe.signNameRead(this.filePath),n=t.SignNameBase64?JSON.parse(t.SignNameBase64):{SignName0:""},i=t.FingerPrintBase64?JSON.parse(t.FingerPrintBase64):{FingerPrint0:""},r=n.SignName0.split(";")[0],a=i.FingerPrint0.split(";")[0];console.log("签字&指纹",r,a),a?(e=await pe.mergeImage(r,a),console.log(e)):e=r;break;case 5:e=await be.signNameRead();break}this.$emit("click",e)},async readLSIDCardAndMatchFace(){this.showIDCardChrome=!0;const e=document.createElement("div");document.body.appendChild(e);const t=new(dt())({render:e=>e(rt,{props:{},on:{close:e=>{if(console.log("destroy data=>",e),"比对成功"!==e.zt)throw Error("认证失败");this.$message.success("认证成功"),this.$emit("click",e),this.showIDCardChrome=!1,t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},openWEIRONGFaceValidateDialog(){console.log("打开人脸识别弹框");const e=document.createElement("div");document.body.appendChild(e);const t=new(dt())({render:e=>e(Et,{props:{},on:{close:e=>{this.$emit("click",e),t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},readFacePhotoByELoam(){const e=document.createElement("div");document.body.appendChild(e);const t=new(dt())({render:e=>e(ut,{props:{},on:{close:e=>{console.log("良田拍照信息=>",e),this.$emit("click",e),t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},readFacePhotoByDefault(){const e=document.createElement("div");document.body.appendChild(e);const t=new(dt())({render:e=>e(yt,{props:{},on:{close:e=>{e&&(console.log("浏览器自带拍照=>",e),this.$emit("click",e)),t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},readLSIDCard(){this.showIDCardChrome=!0,this.$nextTick((async()=>{try{const e=await(0,Ze.oK)();console.log("丽水一体机读取身份证信息=>",e),this.$emit("click",e)}catch(e){throw Error("读取身份证信息失败")}finally{this.showIDCardChrome=!1}}))}}},Dt=Ot,$t=l(Dt,Be,Le,!1,null,"19ae37ba",null),Tt=$t.exports;Tt.install=e=>{e.component(Tt.name,Tt)};var It=Tt;const Mt=[h,b,Fe,It,P,ee,De],Pt=e=>{e.use(i()),Pt.installed||Mt.forEach((t=>{e.component(t.name,t)}))};"undefined"!==typeof window&&window.Vue&&Pt(window.Vue);var Nt={install:Pt,...Mt},jt=Nt}(),__webpack_exports__}()}));
|
24
|
+
function a(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,a=n in document;if(!a){var s=document.createElement("div");s.setAttribute(n,"return;"),a="function"===typeof s[n]}return!a&&i&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}r.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=a},643:function(e,t,n){"use strict";var i=n(4518),r=n(6534),a=10,s=40,o=800;function l(e){var t=0,n=0,i=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*a,r=n*a,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||r)&&e.deltaMode&&(1==e.deltaMode?(i*=s,r*=s):(i*=o,r*=o)),i&&!t&&(t=i<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:r}}l.getEventType=function(){return i.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},1033:function(e,t,n){"use strict";n.r(t);var i=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];e.call(t,r[1],r[0])}},t}()}(),r="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,a=function(){return"undefined"!==typeof n.g&&n.g.Math===Math?n.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")()}(),s=function(){return"function"===typeof requestAnimationFrame?requestAnimationFrame.bind(a):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)}}(),o=2;function l(e,t){var n=!1,i=!1,r=0;function a(){n&&(n=!1,e()),i&&c()}function l(){s(a)}function c(){var e=Date.now();if(n){if(e-r<o)return;i=!0}else n=!0,i=!1,setTimeout(l,t);r=e}return c}var c=20,u=["top","right","bottom","left","width","height","size","weight"],h="undefined"!==typeof MutationObserver,d=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=l(this.refresh.bind(this),c)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,i=u.some((function(e){return!!~n.indexOf(e)}));i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),f=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},p=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||a},m=S(0,0,0,0);function v(e){return parseFloat(e)||0}function g(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){var i=e["border-"+n+"-width"];return t+v(i)}),0)}function b(e){for(var t=["top","right","bottom","left"],n={},i=0,r=t;i<r.length;i++){var a=r[i],s=e["padding-"+a];n[a]=v(s)}return n}function y(e){var t=e.getBBox();return S(0,0,t.width,t.height)}function _(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return m;var i=p(e).getComputedStyle(e),r=b(i),a=r.left+r.right,s=r.top+r.bottom,o=v(i.width),l=v(i.height);if("border-box"===i.boxSizing&&(Math.round(o+a)!==t&&(o-=g(i,"left","right")+a),Math.round(l+s)!==n&&(l-=g(i,"top","bottom")+s)),!x(e)){var c=Math.round(o+a)-t,u=Math.round(l+s)-n;1!==Math.abs(c)&&(o-=c),1!==Math.abs(u)&&(l-=u)}return S(r.left,r.top,o,l)}var w=function(){return"undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof p(e).SVGGraphicsElement}:function(e){return e instanceof p(e).SVGElement&&"function"===typeof e.getBBox}}();function x(e){return e===p(e).document.documentElement}function C(e){return r?w(e)?y(e):_(e):m}function k(e){var t=e.x,n=e.y,i=e.width,r=e.height,a="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(a.prototype);return f(s,{x:t,y:n,width:i,height:r,top:n,right:t+i,bottom:r+n,left:t}),s}function S(e,t,n,i){return{x:e,y:t,width:n,height:i}}var E=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=S(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=C(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),O=function(){function e(e,t){var n=k(t);f(this,{target:e,contentRect:n})}return e}(),D=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new i,"function"!==typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new E(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new O(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$="undefined"!==typeof WeakMap?new WeakMap:new i,T=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=d.getInstance(),i=new D(t,n,this);$.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach((function(e){T.prototype[e]=function(){var t;return(t=$.get(this))[e].apply(t,arguments)}}));var I=function(){return"undefined"!==typeof a.ResizeObserver?a.ResizeObserver:T}();t["default"]=I},1478:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{g$:function(){return tsToJs},oK:function(){return GetIDCardOnly},xj:function(){return loadCamera}});var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7658),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__),tsToJs={getElement:function Stirng(flag,photoId){var plugin;if(1==flag){console.log("人脸识别开始-----");var plugin=document.getElementById("facePlugin");console.log("plugin-----",plugin);var data="$=Action",temp=plugin.SendDataToADB("127.0.0.1",1352,15e3,data,data.length);if(console.log(temp+"-----===="),"undefined"===typeof temp)return null;var str=temp.split("$"),result=str[1].split("=#=")[1];console.log("result:"+result+"-----++++");var name=str[2].split("=#=")[1],sex=str[3].split("=#=")[1],cardNo=str[4].split("=#=")[1];console.log("cardNo:"+cardNo+"-----++++");var address=str[5].split("=#=")[1],birthday=str[6].split("=#=")[1],cardImg=str[8].split("=#=")[1],faceImg=str[9].split("=#=")[1],race=str[10].split("=#=")[1],regOrg=str[11].split("=#=")[1],validTime=str[12].split("=#=")[1],validTimeStart=validTime.split("-")[0],validTimeEnd=validTime.split("-")[1],objSfz={idCard:{info:{name:name.toString(),sex:sex.toString(),nation:race.toString(),birthday:birthday.toString(),address:address.toString(),cardId:cardNo.toString(),police:regOrg.toString(),validStart:validTimeStart.toString(),validEnd:validTimeEnd.toString(),sexCode:"",nationCode:""},headImage:cardImg.toString()},faceimg:faceImg.toString(),zt:""};return console.log("-------------------objSfz成功返回数据---------------------"),console.log("人脸识别结果===>",objSfz),objSfz}if(2==flag){plugin=document.getElementById("plugin");var temp2=plugin.On_OpenDevice(1001),obj=eval("("+temp2+")");return"undefined"!=typeof obj["照片"]&&(photoId&&document.getElementById(photoId)&&(document.getElementById(photoId).src="data:image/jpeg;base64,"+obj["照片"]),console.log(obj["身份证号2"]+"._____."),console.log(obj["照片2"]+"._____.-----------")),obj}if(3==flag){console.log("-----开始读取身份证信息-----");var plugin=document.getElementById("plugin"),temp2=plugin.On_OpenDevice(1001),obj=eval("("+temp2+")"),result={info:{name:obj["姓名"],sex:obj["性别"],nation:obj["名族"],birthday:obj["出生日期"],address:obj["地址"],cardId:obj["身份证号"],police:obj["发证机关"],validStart:obj["有效期开始"],validEnd:obj["有效期结束"],sexCode:"",nationCode:""},headImage:obj["照片"]};return console.log("-----身份证信息读取结果-----"),console.log(result),result}if(4==flag)return GetIDCardAndMatchImage()},getExportInfo:function(){var e="",t="";return $.ajaxSettings.async=!1,$.get("assets/xml/Export.xml",!1,(function(n){var i=[],r=[];$(n).find("ElementTable").each((function(){var e=$(this),t=e.attr("ColumnName"),n=e.attr("CaptionName");i.push(t),r.push(n)})),e=i.join(","),t=r.join(","),xmlxx={columNameStr:e,captionNameStr:t}})),$.ajaxSettings.async=!0,xmlxx},getAreaData:function(){$.ajaxSettings.async=!1;var e=[],t=[];return $.get("assets/xml/AreaData.xml",(function(n){$(n).find("ElementTable").each((function(){var n=$(this),i=n.attr("tableName"),r=n.children("DataBaseLink").attr("Name");e.push(i),t.push(r)}))})),$.ajaxSettings.async=!0,xmlxx={nameArray:e,dataBaseLinkArray:t},xmlxx},getAreaTable:function(){$.ajaxSettings.async=!1;var e=[];return $.get("assets/xml/AreaData.xml",(function(t){$(t).find("ElementTable").each((function(){var t=$(this),n=t.attr("tableName"),i=t.children("DataBaseLink").attr("Name");xmlxx={tableName:n,dataBaseLink:i},e.push(xmlxx)}))})),$.ajaxSettings.async=!0,e},getPhoto:function(e,t){document.getElementById(t).src="data:image/jpeg;base64,"+e},printImg:function(e){$("#"+e).jqprint()}};function loadCamera(){document.getElementById("IDCard_chrome");var e=document.getElementById("camera_row");e.innerHTML='<object clsid="{23D85CA3-E783-431E-A229-18BB6BEB9AD9}" type="application/x-itst-activex" width=320 height=240 name="FaceObj"></object>'}function GetIDCardOnly(){var e=document.getElementById("IDCard_chrome"),t=e.OpenDevice();if(0==t){t=e.ReadIDCardInfo();var n={info:{name:e.IDName,sex:e.IDSex,nation:e.IDFolk,birthday:e.IDBirth,address:e.IDAddress,cardId:e.IDNumber,police:e.IDOrgan,validStart:e.IDTermBegin.substring(0,4)+"."+e.IDTermBegin.substring(4,6)+"."+e.IDTermBegin.substring(6,8),validEnd:e.IDTermEnd.substring(0,4)+"."+e.IDTermEnd.substring(4,6)+"."+e.IDTermEnd.substring(6,8),sexCode:"",nationCode:""},headImage:e.IDPhoto64};return n}debug("一体机启动失败")}function GetIDCardAndMatchImage(){console.log("-----开启一体机功能-----");var e=document.getElementById("IDCard_chrome"),t=e.OpenDevice();if(0==t){t=e.ReadIDCardInfo();var n={idCard:{info:{name:e.IDName,sex:e.IDSex,nation:e.IDFolk,birthday:e.IDBirth,address:e.IDAddress,cardId:e.IDNumber,police:e.IDOrgan,validStart:e.IDTermBegin.substring(0,4)+"."+e.IDTermBegin.substring(4,6)+"."+e.IDTermBegin.substring(6,8),validEnd:e.IDTermEnd.substring(0,4)+"."+e.IDTermEnd.substring(4,6)+"."+e.IDTermEnd.substring(6,8),sexCode:"",nationCode:""},headImage:e.IDPhoto64},faceimg:"",zt:""};return MatchImage(n)}debug("一体机启动失败")}function MatchImage(e){var t=FaceObj.MatchFace(e.idCard.headImage),n=JSON.parse(t);return e.faceimg=n.image,e.zt=n.retinfo,console.log(e),e}},2823:function(e,t,n){var i=n(8563);e.exports=function(e,t,n){return void 0===n?i(e,t,!1):i(e,n,!1!==t)}},4592:function(e,t,n){var i=n(8563),r=n(2823);e.exports={throttle:i,debounce:r}},8563:function(e){e.exports=function(e,t,n,i){var r,a=0;function s(){var s=this,o=Number(new Date)-a,l=arguments;function c(){a=Number(new Date),n.apply(s,l)}function u(){r=void 0}i&&!r&&c(),r&&clearTimeout(r),void 0===i&&o>e?c():!0!==t&&(r=setTimeout(i?u:c,void 0===i?e-o:e))}return"boolean"!==typeof t&&(i=n,n=t,t=void 0),s}},2234:function(e,t,n){"use strict";e.exports=n.p+"img/idcardbg1.1f8e1fc6.gif"},4923:function(e,t,n){"use strict";e.exports=n.p+"img/idcardbg2.2e47b05f.gif"},5053:function(e,t,n){"use strict";e.exports=n.p+"img/img_blank_empty.92ddadbb.png"},7203:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__7203__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}!function(){__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return __webpack_require__.d(t,{a:t}),t}}(),function(){__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){__webpack_require__.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){__webpack_require__.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){__webpack_require__.p=""}();var __webpack_exports__={};return function(){"use strict";if(__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:function(){return Nt}}),"undefined"!==typeof window){var e=window.document.currentScript,t=e&&e.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);t&&(__webpack_require__.p=t[1])}var n=__webpack_require__(4720),i=__webpack_require__.n(n),r=function(){var e=this;e._self._c;return e._m(0)},a=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"zs-empty"},[t("img",{attrs:{src:__webpack_require__(5053)}})])}],s={name:"zs-empty",props:{emptyTip:{default:"暂无数据",type:String}},methods:{}},o=s;function l(e,t,n,i,r,a,s,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),s?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):r&&(l=o?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}var c=l(o,r,a,!1,null,"88c40896",null),u=c.exports;u.install=e=>{e.component(u.name,u)};var h=u,d=function(){var e=this,t=e._self._c;return e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)},f=[],p=(__webpack_require__(7658),{name:"id-card-reader-demo",props:{label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"mini",type:String},type:{default:"primary",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"el-icon-postcard",type:String},disabled:{default:!1,type:Boolean}},computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{handleClick(){const e={info:{name:"",sex:"",nation:"",birthday:"",address:"",cardId:"",police:"",validStart:"",validEnd:""},headImage:""};this.$emit("click",e)}}}),m=p,v=l(m,d,f,!1,null,"3d89866c",null),g=v.exports;g.install=e=>{e.component(g.name,g)};var b=g,y=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-container"},["dialog"===e.openMode?t("div",{staticClass:"scanner-high-camera-button"},[e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("el-dialog",{staticClass:"scanner-high-camera-dialog",attrs:{title:"影像扫描",visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[e.dialogVisible?t("scanner-high-camera-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)}):e._e(),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.sendScannerResult}},[e._v("确 定")])],1)],1)],1):t("scanner-high-camera-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)})],1)},_=[],w=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-component"},[t("div",{staticClass:"scanner-result-content"},[t("div",{staticClass:"content-main flex-1"},[e.loadSuccess?t("div",{staticClass:"load-success"},[t("img",{attrs:{id:"photo",src:e.scannerResultSrc}})]):t("div",{staticClass:"load-error"},[t("i",{staticClass:"el-icon-s-cooperation"}),t("p",[e._v("请先安装插件")])])]),t("div",{staticClass:"handle-action"},[t("el-select",{staticClass:"select",attrs:{size:"small"},on:{change:e.selectChange},model:{value:e.camera,callback:function(t){e.camera=t},expression:"camera"}},e._l(e.cameras,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1),e._l(e.buttonList,(function(n){return[t("el-button",{key:n.name,attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleAction(n.name)}}},[e._v(e._s(n.label))]),e._t("action")]}))],2)])])},x=[];const C="data:image/jpeg;base64,";var k={name:"scanner-high-camera-component",data:()=>({totalTimeLength:0,timeLength:"",timer:0,str1:"",str2:"",webSocket:{},scannerResultSrc:"",loadSuccess:!0,camera:0,cameras:[{name:"文档",value:0},{name:"照片",value:1}],buttonList:[{label:"拍照",name:"take-pictures"}]}),mounted(){this.webSocket=new WebSocket("ws://127.0.0.1:1818"),window.onbeforeunload=()=>{this.webSocket.send("bStopPlay()"),this.webSocket.send("bStopPlay4()")},this.webSocket.onerror=e=>{this.onError(e)},this.webSocket.onopen=e=>{this.onOpen(e)},this.webSocket.onclose=e=>{this.onClose(e),this.webSocket.send("bStopPlay()")},this.webSocket.onmessage=e=>{this.onMessage(e)},setTimeout((()=>{this.handleAction("start-main")}),800)},destroyed(){this.handleAction("stop"),this.webSocket.close()},methods:{selectChange(e){let t=1===e?"start-vice":"start-main";this.handleAction(t)},handleAction(e){switch(e){case"start-main":this.StartPlay_onclick();break;case"rotation":this.start("bStartPlayRotate(90)");break;case"start-vice":this.start("bStartPlay2");break;case"stop":this.start("bStopPlay");break;case"autofocus":this.start("AutoFocus");break;case"Black edge":this.start("vSetDelHBFlag(true)");break;case"base64":this.start("sGetBase64");break;case"start-record":this.start("bStartRec(d:\\test.avi)");break;case"stop-record":this.start("bStopRec");break;case"take-pictures":this.start("bSaveJPG(D:\\,Photo)"),this.$emit("send-scanner-result",this.scannerResultSrc);break}},timeGo(){this.totalTimeLength++;let e=0,t=0,n=0;e=Math.floor(this.totalTimeLength/3600),t=Math.floor(this.totalTimeLength/60%60),n=Math.floor(this.totalTimeLength%60),this.timeLength=e+"时"+t+"分"+n+"秒"},onMessage(e){e.data.indexOf("BarCodeTransferBegin")>=0?console.log(e.data.replace("BarCodeTransferBegin","").replace("BarCodeTransferEnd","")):e.data.indexOf("BeginbSaveJPG")>=0?(this.str1=e.data.replace("BeginbSaveJPG","").replace("EndbSaveJPG",""),console.log(this.str1)):e.data.indexOf("BeginbStopPlay")>=0?(console.log(e.data),console.log(e.data.replace("BeginbStopPlay","").replace("EndbStopPlay",""))):e.data.indexOf("BeginvSetResolution")>=0?console.log(e.data.replace("BeginvSetResolution","").replace("EndvSetResolution","")):e.data.indexOf("BeginvSetRemoveGBFlag")>=0?console.log(e.data.replace("BeginvSetRemoveGBFlag","").replace("EndvSetRemoveGBFlag","")):e.data.indexOf("BeginbFileExist")>=0?console.log(e.data.replace("BeginbFileExist","").replace("EndbFileExist","")):e.data.indexOf("BeginbStartPlay2")>=0?console.log(e.data.replace("BeginbStartPlay2","").replace("EndbStartPlay2","")):e.data.indexOf("BeginbStartPlay")>=0?console.log(e.data.replace("BeginbStartPlay","").replace("EndbStartPlay","")):e.data.indexOf("BeginbSetMode")>=0?console.log(e.data.replace("BeginbSetMode","").replace("EndbSetMode","")):this.scannerResultSrc=`${C}${e.data}`},onError(e){console.log("error",e.data),this.loadSuccess=!1},onClose(e){this.webSocket.send("bStopPlay()"),this.webSocket.send("bStopPlay4()")},onOpen(e){},start(e){return"bStartRec(d:\\test.avi)"==e&&(this.timer=window.setInterval(this.timeGo,1e3)),"bStopRec"==e&&(window.clearInterval(this.timer),this.totalTimeLength=0,console.log("录屏结束")),this.webSocket.send(e),!1},vout_OnClick(){},Stop_onclick(){this.webSocket.send("bStopPlay()")},StartPlay_onclick(){this.webSocket.send("vSetResolution(8)"),this.webSocket.send("bStartPlay()")}}},S=k,E=l(S,w,x,!1,null,"e24dd0c8",null),O=E.exports,D={name:"scanner-high-camera-jieyu",components:{ScannerHighCameraComponent:O},props:{openMode:{default:"",type:String},label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"",type:String},type:{default:"",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"",type:String},disabled:{default:!1,type:Boolean}},data:()=>({dialogVisible:!1,scannerResult:""}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{openScanDialog(){this.dialogVisible=!0},setScannerResult(e){this.scannerResult=e,"dialog"!==this.openMode&&this.$emit("send-scanner-result",this.scannerResult)},sendScannerResult(){this.scannerResult&&(this.$emit("send-scanner-result",this.scannerResult),this.dialogVisible=!1)}}},$=D,T=l($,y,_,!1,null,"ffa79d1e",null),I=T.exports;I.install=e=>{e.component(I.name,I)};var M,P=I,N=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-container"},["dialog"===e.openMode?t("div",{staticClass:"scanner-high-camera-button"},[e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("el-dialog",{staticClass:"scanner-high-camera-dialog",attrs:{title:"影像扫描",visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[e.dialogVisible?t("scanner-eloam-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)}):e._e(),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.sendScannerResult}},[e._v("确 定")])],1)],1)],1):t("scanner-eloam-component",{on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)})],1)},j=[],A=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-component"},[t("div",{staticClass:"scanner-result-content"},[t("div",{staticClass:"content-main flex-1"},[e.loadSuccess?t("div",{staticClass:"load-success"},[t("img",{staticStyle:{width:"800px",height:"600px"},attrs:{id:"photo",src:e.scannerVideoSrc}})]):t("div",{staticClass:"load-error"},[t("i",{staticClass:"el-icon-s-cooperation"}),t("p",[e._v("请先安装插件")])])]),t("div",{staticClass:"handle-action"},[t("el-select",{staticClass:"select",attrs:{size:"small"},on:{change:e.selectChange},model:{value:e.camera,callback:function(t){e.camera=t},expression:"camera"}},e._l(e.cameras,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1),e._l(e.buttonList,(function(n){return[t("el-button",{key:n.name,attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleAction(n.name)}}},[e._v(e._s(n.label))]),e._t("action")]}))],2)])])},F=[];function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function L(e,t){if("object"!==B(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==B(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function V(e){var t=L(e,"string");return"symbol"===B(t)?t:String(t)}function z(e,t,n){return t=V(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class R{static startConnect(e,t,n={}){return new Promise(((i,r)=>{let a=new XMLHttpRequest;if(e=e.toUpperCase(),"GET"==e){let e="";Object.keys(n).forEach((t=>{e+=`${t}=${n[t]}&`})),e=e.substring(0,e.lastIndexOf("&")),t=t+"?"+e}else"POST"==e||r("error method: Currently only supported GET or POST method!");a.open(e,t,!0),a.setRequestHeader("Accept","application/json"),"GET"===e?a.send():a.send(JSON.stringify(n)),a.onreadystatechange=function(){if(4===this.readyState)if(200===this.status){let e=this.response;"object"!==typeof e&&(e=JSON.parse(e)),i(e)}else r(a)}}))}static async get(e){let t=await R.startConnect("GET",e);return t}static async post(e,t){let n=await R.startConnect("POST",e,t);return n}}(function(e){e["ScannerMainCamera_Base64"]="ScannerMainCamera_Base64",e["ScannerSecondaryCamera_Base64"]="ScannerSecondaryCamera_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64"})(M||(M={}));M.ScannerMainCamera_Base64,M.ScannerSecondaryCamera_Base64,M.ReadIDCard_Base64;class W{static get mainCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=0"}static get secondaryCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=1"}static async read(e){let t={},n="";switch(e){case M.ScannerMainCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"base64",rotate:"0",deskew:"1",camidx:"0",ColorMode:"0",quality:"0"};break;case M.ScannerSecondaryCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"base64",rotate:"0",deskew:"0",camidx:"1",ColorMode:"0",quality:"0"};break;case M.ReadIDCard_Base64:n=this.baseServiceUrl+"/card=idcard";break}let i=await R.post(n,t);return i}static async scanByMainCamera(){const e=await W.read(M.ScannerMainCamera_Base64);return e.photoBase64}static async scanBySecondaryCamera(){const e=await W.read(M.ScannerSecondaryCamera_Base64);return e.photoBase64}static async idCardRead(){const e=await W.read(M.ReadIDCard_Base64);let{name:t,sex:n,birthday:i,address:r,cardID:a,nationCode:s,photoBase64:o,issueOrgan:l,validStart:c,validEnd:u}=e.IDCardInfo;const h={info:{name:t,sex:n,birthday:i.replace("-","").replace("-",""),address:r,cardId:a,nation:s,police:l,validStart:c,validEnd:u},headImage:o};return h}}z(W,"baseServiceUrl","http://127.0.0.1:38088");const H="data:image/jpg;base64,";var q={name:"scanner-eloam-component",data:()=>({totalTimeLength:0,timeLength:"",timer:0,str1:"",str2:"",webSocket:{},scannerVideoSrc:"",scannerResultSrc:"",loadSuccess:!0,camera:0,cameras:[{name:"文档",value:0},{name:"照片",value:1}],buttonList:[{label:"拍照",name:"take-pictures"}]}),created(){this.scannerVideoSrc=W.mainCameraUrl},methods:{selectChange(e){let t=1===e?"start-vice":"start-main";this.handleAction(t)},handleAction(e){switch(e){case"start-main":this.scannerVideoSrc=W.mainCameraUrl;break;case"start-vice":this.scannerVideoSrc=W.secondaryCameraUrl;break;case"take-pictures":this.takePictures();break}},async takePictures(){if(0===this.camera){const e=await W.scanByMainCamera();this.$emit("send-scanner-result",`${H}${e}`)}else{const e=await W.scanBySecondaryCamera();this.$emit("send-scanner-result",`${H}${e}`)}}}},U=q,Y=l(U,A,F,!1,null,"428304e7",null),G=Y.exports,K={name:"scanner-eloam",components:{ScannerEloamComponent:G},props:{openMode:{default:"",type:String},label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"",type:String},type:{default:"",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"",type:String},disabled:{default:!1,type:Boolean}},data:()=>({dialogVisible:!1,scannerResult:""}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{openScanDialog(){this.dialogVisible=!0},setScannerResult(e){this.scannerResult=e,"dialog"!==this.openMode&&this.$emit("send-scanner-result",this.scannerResult)},sendScannerResult(){this.scannerResult&&(this.$emit("send-scanner-result",this.scannerResult),this.dialogVisible=!1)}}},X=K,J=l(X,N,j,!1,null,"a80d3a26",null),Z=J.exports;Z.install=e=>{e.component(Z.name,Z)};var Q,ee=Z,te=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-camera-container"},["dialog"===e.openMode?t("div",{staticClass:"scanner-camera-button"},[e.tip?t("el-tooltip",{staticClass:"id-card-reader-demo",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.openScanDialog}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("el-dialog",{staticClass:"scanner-camera-dialog",attrs:{title:"影像扫描",visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[e.dialogVisible?t("scanner-camera-component",{attrs:{"machine-type":e.machineType},on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)}):e._e(),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.sendScannerResult}},[e._v("确 定")])],1)],1)],1):t("scanner-camera-component",{attrs:{"machine-type":e.machineType},on:{"send-scanner-result":e.setScannerResult},scopedSlots:e._u([{key:"action",fn:function(){return[e._t("right-action")]},proxy:!0}],null,!0)})],1)},ne=[],ie=function(){var e=this,t=e._self._c;return t("div",{staticClass:"scanner-high-camera-component"},[t("div",{staticClass:"scanner-result-content"},[t("div",{staticClass:"content-main flex-1"},[e.loadSuccess?t("div",{staticClass:"load-success"},[t("img",{staticStyle:{width:"800px",height:"600px"},attrs:{id:"photo",src:e.scannerVideoSrc}})]):t("div",{staticClass:"load-error"},[t("i",{staticClass:"el-icon-s-cooperation"}),t("p",[e._v("请先安装插件")])])]),t("div",{staticClass:"handle-action"},[t("el-select",{staticClass:"select",attrs:{size:"small"},on:{change:e.selectChange},model:{value:e.camera,callback:function(t){e.camera=t},expression:"camera"}},e._l(e.cameras,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1),e._l(e.buttonList,(function(n){return[t("el-button",{key:n.name,attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleAction(n.name)}}},[e._v(e._s(n.label))]),e._t("action")]}))],2)])])},re=[];class ae{static startConnect(e,t,n={}){return new Promise(((i,r)=>{let a=new XMLHttpRequest;if(e=e.toUpperCase(),"GET"==e){let e="";Object.keys(n).forEach((t=>{e+=`${t}=${n[t]}&`})),e=e.substring(0,e.lastIndexOf("&")),t=t+"?"+e}else"POST"==e||r("error method: Currently only supported GET or POST method!");a.open(e,t,!0),a.setRequestHeader("Accept","application/json"),"GET"===e?a.send():a.send(JSON.stringify(n)),a.onreadystatechange=function(){if(4===this.readyState)if(200===this.status){let e=this.response;"object"!==typeof e&&(e=JSON.parse(e)),i(e)}else r(a)}}))}static async get(e){let t=await ae.startConnect("GET",e);return t}static async post(e,t){let n=await ae.startConnect("POST",e,t);return n}}(function(e){e["ScannerMainCamera_Base64"]="ScannerMainCamera_Base64",e["ScannerSecondaryCamera_Base64"]="ScannerSecondaryCamera_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64"})(Q||(Q={}));Q.ScannerMainCamera_Base64,Q.ScannerSecondaryCamera_Base64,Q.ReadIDCard_Base64;class se{static get mainCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=0"}static get secondaryCameraUrl(){return this.baseServiceUrl+"/video=stream&camidx=1"}static async read(e){let t={},n="";switch(e){case Q.ScannerMainCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"",rotate:"0",deskew:"0",deskewval:"0",camidx:"0",ColorMode:"0",quality:"0",bIsPrint1to1:"0"};break;case Q.ScannerSecondaryCamera_Base64:n=this.baseServiceUrl+"/video=grabimage",t={filepath:"",rotate:"0",deskew:"0",deskewval:"0",camidx:"1",ColorMode:"0",quality:"0",bIsPrint1to1:"0"};break;case Q.ReadIDCard_Base64:n=this.baseServiceUrl+"/card=idcard";break}let i=await ae.post(n,t);return i}static async scanByMainCamera(){const e=await se.read(Q.ScannerMainCamera_Base64);return e.photoBase64}static async scanBySecondaryCamera(){const e=await se.read(Q.ScannerSecondaryCamera_Base64);return e.photoBase64}static async scanByCamera(e){switch(e){case"main":return this.scanByMainCamera();case"vice":return this.scanBySecondaryCamera()}}static async turnOnTheCamera(){}static async idCardRead(){const e=await se.read(Q.ReadIDCard_Base64);let{name:t,sex:n,birthday:i,address:r,cardID:a,nationCode:s,photoBase64:o,issueOrgan:l,validStart:c,validEnd:u}=e.IDCardInfo;const h={info:{name:t,sex:n,birthday:i.replace("-","").replace("-",""),address:r,cardId:a,nation:s,police:l,validStart:c,validEnd:u},headImage:o};return h}}z(se,"baseServiceUrl","http://127.0.0.1:38088");const oe="scanner-camera-refresh-photo-event";class le extends Event{constructor(e){super(oe),z(this,"scannerResultUrl",""),this.scannerResultUrl=e}}class ce{static getGenderByIdNumber(e){if(e){let t;if(18==e.length?t=e.charAt(16):15==e.length&&(t=e.charAt(14)),t&&!isNaN(t))return parseInt(t)%2==0?"女":"男"}return""}static getBirthdayByIdNumber(e){if(e&&e&&e.length>13){const t=e.substring(6,10),n=e.substring(10,12),i=e.substring(12,14);return t+"-"+n+"-"+i}return""}static getAgeByIdNumber(e){if(e){const t=new Date,n=t.getMonth()+1,i=t.getDate();let r=t.getFullYear()-e.substring(6,10)-1;return(e.substring(10,12)<n||e.substring(10,12)===n&&e.substring(12,14)<=i)&&r++,r<=0&&(r=1),r}return""}static isForeignersIdCard(e){let t=/^[a-zA-Z]{3}[0-9]{12}$/;return t.test(e)||e.startsWith("9")}}var ue,he,de,fe;(function(e){e["ScannerCamera"]="scannerCamera",e["InteractiveTerminal"]="interactiveTerminal"})(ue||(ue={})),function(e){e["ScannerMainCamera_Base64"]="main",e["ScannerSecondaryCamera_Base64"]="vice",e["TakePhoto_Base64"]="takePhoto",e["ScannerReadCard"]="ScannerReadCard",e["InitParams"]="InitParams",e["GetSignName_Base64"]="GetSignName_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64",e["FaceValidateWithIdCard_Base64"]="FaceValidateWithIdCard_Base64",e["FingerPrint_Base64"]="FingerPrint_Base64",e["ScanQRCode"]="ScanQRCode",e["Evaluate"]="Evaluate",e["StartProjection"]="StartProjection",e["EndProjection"]="EndProjection"}(he||(he={}));class pe{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t="";switch(e){case ue.InteractiveTerminal:t=this.interactiveTerminalUrl;break;case ue.ScannerCamera:t=this.scannerCameraUrl;break}const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=e=>{this.handleMessage(e)},n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("捷宇高拍仪设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";if(e.origin===this.interactiveTerminalUrl){try{t=JSON.parse(e.data)}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}else{if(t=e.data,!t.startsWith("BarCode")&&!t.startsWith("Begin")){const e=new le(t);return window.dispatchEvent(e)}(t.indexOf("BeginbSaveJPGEx")>=0||t.indexOf("BeginReadCard")>=0)&&(this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[])}}static async read(e,t,n){if(await this.startConnect(e),1===this.ws.readyState){let e="";switch(t){case he.ScannerMainCamera_Base64:this.ws.send("vSetResolution(7)"),this.ws.send("bStopPlay()"),this.ws.send("bStartPlay()"),this.ws.send("bSetMode(3)"),e="vSetOpenInpain(1)";break;case he.ScannerSecondaryCamera_Base64:e="bStartPlay2";break;case he.TakePhoto_Base64:e="bSaveJPGEx";break;case he.ScannerReadCard:e="ReadCard(1001, C:Doccamera)";break;case he.InitParams:e=JSON.stringify({projectCode:n.projectCode,type:181});break;case he.GetSignName_Base64:e=JSON.stringify({type:3,Timeout:60,Location:"0,1,450,500|1,1,450,500",PDFPath:n.PDFPath,Retain:"test",XmlPath:""});break;case he.ReadIDCard_Base64:e=JSON.stringify({type:4});break;case he.FaceValidateWithIdCard_Base64:e=JSON.stringify({type:5});break;case he.FingerPrint_Base64:e=JSON.stringify({FileFullName:"d:\\Fingerprint.png",TimeOut:60,type:12});break;case he.ScanQRCode:e=JSON.stringify({type:61});break;case he.StartProjection:e=JSON.stringify({type:82});break;case he.EndProjection:e=JSON.stringify({type:83});break;case he.Evaluate:e=JSON.stringify({type:90,URL:n.URL});break}return this.ws.send(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error("设备未准备完成")}static async turnOnTheCamera(e){this.ws&&this.ws.close(),await pe.read(ue.ScannerCamera,e)}static async scanByCamera(){let e=await pe.read(ue.ScannerCamera,he.TakePhoto_Base64);return e.replace("BeginbSaveJPGEx","").replace("EndbSaveJPGEx","")}static async initParams(){this.ws&&this.ws.close();let e="ls8t1IYtBhOg5kwajaZsmeim/GIw0PY6NEoJ2cbNoptx678YKIqWaRVe0XPy1u5/cXLuXKW/Vufptwgo8Gc/lHMHbqiOHj7ySAqb9VCvP9KI1HAoqzPMpueyQhJskyfGk+L8/9dKK5/rySTLDuT4Un0W1o/1p9D41EDPwkAm2YY=";await pe.read(ue.InteractiveTerminal,he.InitParams,{projectCode:e})}static async signNameRead(e){let t=await pe.read(ue.InteractiveTerminal,he.GetSignName_Base64,{PDFPath:e});if(!t)throw Error("未匹配可用的捷宇信息交互终端设备");if(0!==t.ret)throw Error("读取二代身份证失败,返回值:"+t.ret+",错误信息:"+t.errMsg);return t}static async idCardReadByScanner(){let e=await pe.read(ue.ScannerCamera,he.ScannerReadCard);if(!e)throw Error("未匹配可用的捷宇高拍仪设备");let t=JSON.parse(e.replace("BeginReadCard","").replace("EndReadCard",""));if(1!==t.result)throw Error("读取二代身份证失败,返回值:"+t.ret+",错误信息:"+t.errMsg);console.log(t);let{Name:n,EnglishName:i,Sex:r,BirthDate:a,Address:s,IdNo:o,Folk:l,Agency:c,Valid:u,PhotoB64:h}=t,[d,f]=u.split("-"),p="",m="1",v="中国",g=ce.isForeignersIdCard(o);g&&(m="9",p=n,n="无中文姓名"===n?i:n,c="中华人民共和国国家移民管理局",v=l,l="");const b={info:{cardType:m,nationality:v,name:n,chineseName:p,englishName:i,sex:r,birthday:a,address:s,cardId:o,nation:l,police:c,validStart:d,validEnd:f},headImage:h};return console.log(b),b}static async idCardRead(){let e=await pe.read(ue.InteractiveTerminal,he.ReadIDCard_Base64);if(!e)throw Error("未匹配可用的捷宇信息交互终端设备");if(0!==e.ret)throw Error("读取二代身份证失败,返回值:"+e.ret+",错误信息:"+e.errMsg);let{name:t,sex:n,birth:i,addr:r,id_num:a,nation:s,base64_ID:o,depart:l,validityTime:c}=e,[u,h]=c.split("-");const d={info:{name:t,sex:n,birthday:i.replace("年","").replace("月","").replace("日",""),address:r,cardId:a,nation:s,police:l,validStart:u,validEnd:h},headImage:o};return console.log("读取二代身份证结果==>",d),d}static async faceValidateWithIdCardRead(){let e=await pe.read(ue.InteractiveTerminal,he.FaceValidateWithIdCard_Base64);if(!e)throw Error("未匹配可用的捷宇信息交互终端设备");if(0!==e.ret)throw Error("读取二代身份证失败,返回值:"+e.ret+",错误信息:"+e.errMsg);let{name:t,sex:n,birth:i,addr:r,id_num:a,nation:s,base64_ID:o,depart:l,validityTime:c,base64_Face:u}=e,[h,d]=c.split("-");const f={idCard:{info:{name:t,sex:n,birthday:i.replace("年","").replace("月","").replace("日",""),address:r,cardId:a,nation:s,police:l,validStart:h,validEnd:d},headImage:o},faceimg:e.base64_Face};return console.log("读取二代身份证结果==>",f),f}static async mergeImage(e,t){return new Promise(((n,i)=>{let r=document.createElement("canvas");r.width=600,r.height=360;let a=r.getContext("2d");a.rect(0,0,r.width,r.height),a.fillStyle="#fff",a.fill();let s=new Image;s.src="data:image/png;base64,"+e,s.crossOrigin="Anonymous",s.onload=function(){a.drawImage(s,0,0,500,360);let e=new Image;e.src="data:image/png;base64,"+t,e.crossOrigin="Anonymous",e.onload=function(){a.drawImage(e,320,0,256,360);let t=r.toDataURL("image/png");t=t.replace("data:image/png;base64,",""),n(t)}}}))}}z(pe,"scannerCameraUrl","ws://127.0.0.1:1818"),z(pe,"interactiveTerminalUrl","ws://127.0.0.1:1919"),z(pe,"ws",void 0),z(pe,"requestStore",[]);class me{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const e=new WebSocket(this.scannerCameraUrl);let t;const n=new Promise((e=>{t=e}));return e.onopen=()=>{t(!0)},e.onmessage=e=>{this.handleMessage(e)},e.onclose=()=>this.handleClose(),e.onerror=()=>this.handleError(),this.ws=e,n}static handleError(){throw Error("方正高影仪设备功能加载失败")}static handleClose(){this.ws&&this.ws.close()}static handleMessage(e){let t=e.data?JSON.parse(e.data):{};if("video_stream"===t.function){const e=new le(t.image_base64);return window.dispatchEvent(e)}}static async read(e){if(await this.startConnect(),1!==this.ws.readyState)throw Error("设备未准备完成");this.ws.send(JSON.stringify({function:"open_camera",camidx:"0"})),this.ws.send(JSON.stringify(e))}static async turnOnTheCamera(){let e={function:"set_cutpage",params:{cutpage:"false"}};await me.read(e)}}z(me,"scannerCameraUrl","ws://127.0.0.1:38088"),z(me,"ws",void 0),function(e){e["TurnOnCamera"]="turnOnCamera",e["TakePhoto_Base64"]="TakePhoto_Base64"}(de||(de={}));class ve{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const e=new WebSocket(this.scannerCameraUrl);let t;const n=new Promise((e=>{t=e}));return e.onopen=()=>{t(!0)},e.onmessage=e=>{this.handleMessage(e)},e.onclose=()=>this.handleClose(),e.onerror=()=>this.handleError(),this.ws=e,n}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("紫图速拍仪设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}));this.ws&&this.ws.close()}static handleMessage(e){let t=e.data?JSON.parse(e.data):{};if("ShowVideo"===t.FuncName){const e=new le(t.result);return window.dispatchEvent(e)}"CaptureBase64"!==t.FuncName&&"CaptureDualBase64"!==t.FuncName||(this.requestStore.forEach((({resolve:e})=>{e(t.result)})),this.requestStore=[])}static async read(e,t){if(await this.startConnect(),1===this.ws.readyState){let t="";switch(e){case de.TurnOnCamera:this.ws.send(JSON.stringify({Func:"StartRunMain",arg:0})),t=JSON.stringify({Func:"ChangeCutType",arg:0});break;case de.TakePhoto_Base64:this.ws.send(JSON.stringify({Func:"SetJPGQuality",arg:70})),this.ws.send(JSON.stringify({Func:"SetColorType",arg:"彩色"})),this.ws.send(JSON.stringify({Func:"SetBoardColor",arg:0})),this.ws.send(JSON.stringify({Func:"SetCamDPI",arg:720})),t=JSON.stringify({Func:"CaptureBase64",arg:0})}return this.ws.send(t),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error("设备未准备完成")}static async turnOnTheCamera(){await ve.read(de.TurnOnCamera)}static async scanByCamera(){const e=await ve.read(de.TakePhoto_Base64);return e}}z(ve,"scannerCameraUrl","ws://127.0.0.1:8341"),z(ve,"ws",void 0),z(ve,"requestStore",[]),function(e){e["ReadCard_Base64"]="ReadCard_Base64",e["StartSignName"]="StartSignName",e["GetSignNameStatus"]="GetSignNameStatus",e["GetSignName_Base64"]="GetSignName_Base64",e["FaceValidateWithIdCard_Base64"]="FaceValidateWithIdCard_Base64",e["TurnOnTheCamera"]="TurnOnTheCamera",e["ScannerCamera"]="ScannerCamera"}(fe||(fe={}));fe.ReadCard_Base64,fe.StartSignName,fe.GetSignNameStatus,fe.GetSignName_Base64,fe.FaceValidateWithIdCard_Base64,fe.TurnOnTheCamera,fe.ScannerCamera;class ge{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.OPEN)return this;const t=new WebSocket(this.webSocketUrl);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>{this.handleMessage(e)},t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t={};try{t=JSON.parse(e.data)}catch(n){t={}}if("FaceScreenStream"===t.method||"VideoStream"===t.method){const e=new le(t.imgBase64);window.dispatchEvent(e)}else this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[]}static async read(e){if(await this.startConnect(e),1===this.ws.readyState){let t;switch(e){case fe.ReadCard_Base64:t=JSON.stringify({method:"ReadIDCard_Base64",args:{outTimes:30,cardReader:0}});break;case fe.FaceValidateWithIdCard_Base64:t=JSON.stringify({method:"FaceValidateWithIdCard_Base64",args:{outTimes:30,score:75}});break;case fe.StartSignName:t=JSON.stringify({method:"SignNameScreen_Start",args:{outTimes:30}});break;case fe.GetSignNameStatus:t=JSON.stringify({method:"SignNameScreen_Status",args:{}});break;case fe.GetSignName_Base64:t=JSON.stringify({method:"SignNameScreen_Get",args:{}});break;case fe.TurnOnTheCamera:t=JSON.stringify({method:"VideoStart",args:{}});break;case fe.ScannerCamera:t=JSON.stringify({method:"GetCameraImage",args:{imagePath:""}});break}return this.ws.send(t),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error("设备未准备完成")}static async idCardRead(){const e=await ge.read(fe.ReadCard_Base64);if(!e)throw Error("未匹配到可用的读取设备");if(0!=e.retVal)throw this.ws?.close(),Error("读取二代身份证失败,返回值:"+e.retVal+",错误信息:"+e.errMsg);let t=e.idInfo,{name:n,ENfullname:i,Nationality:r,sex:a,birthday:s,address:o,number:l,nation:c,organs:u,signdate:h,validterm:d}=t,f="",p="1",m="中国";1==e.cardType||2==e.cardType?(p="9",f=n,n=n||i,u=u||"中华人民共和国国家移民管理局",m=r,c=""):p="1";const v={info:{cardType:p,nationality:m,name:n,chineseName:f,englishName:i,sex:a,birthday:s.replace("-","").replace("-",""),address:o,cardId:l,nation:c,police:u,validStart:h,validEnd:d},headImage:e.idPhotoBase64};return this.ws?.close(),v}static async socialSecurityCardRead(){const e=await ge.read(fe.ReadCard_Base64);if(!e)throw Error("未匹配可用的读取设备");if(0!==e.retVal)throw this.ws?.close(),Error("读取社保卡基本信息失败,返回值:"+e.retVal+",错误信息:"+e.idInfo);const t=e.idInfo;let{name:n,sex:i,birthday:r,number:a,cardnumber:s}=t;const o={info:{name:n,sex:i,birthday:r,address:"",cardId:a,cardnumber:s},headImage:""};return this.ws?.close(),o}static async faceValidateWithIdCardRead(){const e=await ge.read(fe.FaceValidateWithIdCard_Base64);if("FaceValidateWithIdCard_Base64"===e.method&&"0"==e.retVal){console.log("认证成功=>",e);const t=e.idInfo;let{name:n,ENfullname:i,Nationality:r,sex:a,birthday:s,address:o,number:l,nation:c,organs:u,signdate:h,validterm:d}=t,f="",p="1",m="中国";1==e.cardType||2==e.cardType?(p="9",f=n,n=n||i,u=u||"中华人民共和国国家移民管理局",m=r,c=""):p="1";const v={idCard:{info:{cardType:p,nationality:m,name:n,chineseName:f,englishName:i,sex:a,birthday:s.replace("-","").replace("-",""),address:o,cardId:l,nation:c,police:u,validStart:h,validEnd:d},headImage:e.idPhotoBase64},faceimg:e.scenceBase64,score:e.score};return this.ws?.close(),v}throw this.ws?.close(),new Error("人证对比失败")}static signNameRead(){return new Promise((async(e,t)=>{const n=await ge.read(fe.StartSignName);console.log("开始签名=>",n),"SignNameScreen_Start"===n.method&&(0!==n.retVal?(this.ws?.close(),t(`开始签名失败,返回值:${n.retVal},错误信息:${n.errMsg}`)):this.timer||(this.timer=setInterval((async()=>{let n=await ge.read(fe.GetSignNameStatus);if(2==n.signScreenStatus){clearInterval(this.timer),this.timer=null;let t=await ge.read(fe.GetSignName_Base64);this.ws?.close(),e(t.signPicBase64)}else 3==n.retVal&&(clearInterval(this.timer),this.timer=null,this.ws?.close(),t("签字结果=>签字失败,或意外中断!"))}),2e3)))}))}static async turnOnTheCamera(){await ge.read(fe.TurnOnTheCamera)}static async scanByCamera(){let e=await ge.read(fe.ScannerCamera);if("GetCameraImage"===e.method&&0==e.retVal)return this.ws?.close(),e.cameraImgBase64;throw this.ws?.close(),new Error("拍照失败")}}z(ge,"webSocketUrl","ws://127.0.0.1:5847"),z(ge,"ws",void 0),z(ge,"requestStore",[]),z(ge,"timer",null);const be="data:image/jpg;base64,";var ye={name:"scanner-camera-component",props:{machineType:{default:0,type:Number}},data:()=>({scannerVideoSrc:"",scannerResultSrc:"",loadSuccess:!0,camera:0,cameras:[{name:"文档",value:0},{name:"照片",value:1}],buttonList:[{label:"拍照",name:"take-pictures"}]}),watch:{machineType:function(){let e=1===this.camera?"start-vice":"start-main";this.handleAction(e)}},created(){this.handleAction("start-main"),window.addEventListener(oe,(e=>{e.type===oe&&(this.scannerVideoSrc=`${be}${e.scannerResultUrl}`)}))},methods:{selectChange(e){let t=1===e?"start-vice":"start-main";this.handleAction(t)},async takePictures(){switch(this.machineType){case 0:let e=await pe.scanByCamera();this.$emit("send-scanner-result",`${be}${e}`);break;case 3:this.$emit("send-scanner-result",this.scannerVideoSrc);break;case 4:{let e=await ve.scanByCamera();this.$emit("send-scanner-result",`${be}${e}`);break}case 5:{let e=0===this.camera?"main":"vice";const t=await se.scanByCamera(e);this.$emit("send-scanner-result",`${be}${t}`);break}case 6:{let e=await ge.scanByCamera();this.$emit("send-scanner-result",`${be}${e}`);break}}},async handleStartMain(){switch(this.machineType){case 0:await pe.turnOnTheCamera("main");break;case 3:await me.turnOnTheCamera();break;case 4:await ve.turnOnTheCamera();break;case 5:this.scannerVideoSrc=se.mainCameraUrl;break;case 6:await ge.turnOnTheCamera();break}},async handleStartVice(){switch(this.machineType){case 0:await pe.turnOnTheCamera("vice");break;case 3:await me.turnOnTheCamera();break;case 4:await ve.turnOnTheCamera();break;case 5:this.scannerVideoSrc=se.secondaryCameraUrl;break;case 6:await ge.turnOnTheCamera();break}},handleAction(e){switch(e){case"start-main":this.handleStartMain();break;case"start-vice":this.handleStartVice();break;case"take-pictures":this.takePictures();break}}}},_e=ye,we=l(_e,ie,re,!1,null,"bc9cce92",null),xe=we.exports,Ce={name:"scanner-camera",components:{ScannerCameraComponent:xe},props:{machineType:{default:0,type:Number},openMode:{default:"",type:String},label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"",type:String},type:{default:"",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"",type:String},disabled:{default:!1,type:Boolean}},data:()=>({dialogVisible:!1,scannerResult:""}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{openScanDialog(){this.dialogVisible=!0},setScannerResult(e){this.scannerResult=e,"dialog"!==this.openMode&&this.$emit("send-scanner-result",this.scannerResult)},sendScannerResult(){this.scannerResult&&(this.$emit("send-scanner-result",this.scannerResult),this.dialogVisible=!1)}}},ke=Ce,Se=l(ke,te,ne,!1,null,"00e9072f",null),Ee=Se.exports;Ee.install=e=>{e.component(Ee.name,Ee)};var Oe=Ee,De=function(){var e=this,t=e._self._c;return e.tip?t("el-tooltip",{staticClass:"id-card-reader-eloam",attrs:{content:e.tip,placement:"top"}},[t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)],1):t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2)},$e=[],Te={name:"id-card-reader-eloam",props:{label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"mini",type:String},type:{default:"primary",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"el-icon-postcard",type:String},disabled:{default:!1,type:Boolean}},computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e}},methods:{async handleClick(){let e=await W.idCardRead();this.$emit("click",e)}}},Ie=Te,Me=l(Ie,De,$e,!1,null,"5b7ce781",null),Pe=Me.exports;Pe.install=e=>{e.component(Pe.name,Pe)};var Ne,je,Ae=Pe,Fe=function(){var e=this,t=e._self._c;return e.tip?t("el-tooltip",{staticClass:"id-card-reader-button",attrs:{content:e.tip,placement:"top"}},[e.showIDCardChrome?t("embed",{attrs:{clsid:"{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",type:"application/x-itst-activex",width:"0",height:"0",name:"IDCard_chrome",id:"IDCard_chrome"}}):e._e(),t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e._t("default",(function(){return[e._v(e._s(e.label))]}))],2),t("canvas",{staticStyle:{display:"none"},attrs:{id:"canvas",width:"500",height:"360"}})],1):t("el-button",e._b({on:{click:e.handleClick}},"el-button",{disabled:e.disabled,icon:e.icon,loading:e.loading,plain:e.plain,round:e.round,size:e.size,type:e.type,class:e._className},!1),[e.showIDCardChrome?t("embed",{attrs:{clsid:"{E6B50A65-EDFB-4394-B092-A8C6E966C0E6}",type:"application/x-itst-activex",width:"0",height:"0",name:"IDCard_chrome",id:"IDCard_chrome"}}):e._e(),e._t("default",(function(){return[e._v(e._s(e.label))]})),t("canvas",{staticStyle:{display:"none"},attrs:{id:"canvas",width:"500",height:"360"}})],2)},Be=[];(function(e){e["idcard"]="sfz",e["jlsfz"]="jlsfz",e["camera"]="sxt",e["ywSign"]="yw",e["hwSign"]="hwsign"})(Ne||(Ne={}));class Le{static startConnect(e=Ne.idcard){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t=this.idcardWebSocketUrl;switch(e){case Ne.idcard:t=this.idcardWebSocketUrl;break;case Ne.jlsfz:t=this.jlsfzWebSocketUrl}const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=e=>this.handleMessage(e),n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("读取身份证功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";try{t=JSON.parse(e.data)}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e=Ne.idcard){if(await this.startConnect(e),1===this.ws.readyState)return this.ws.send(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("读取身份证未准备完成")}static async idCardCommonRead(){let e;for(const t of[Ne.jlsfz,Ne.idcard]){const n=await Le.read(t);if(n&&n.hasOwnProperty("info")){e=n;break}}if(e)return e;throw Error("未匹配可用的读卡器")}}z(Le,"idcardWebSocketUrl","ws://127.0.0.1:8152/SFZManage"),z(Le,"jlsfzWebSocketUrl","ws://127.0.0.1:8152/JLSFZManage"),z(Le,"ws",void 0),z(Le,"requestStore",[]);class Ve{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let e=this.cameraWebSocketUrl;const t=new WebSocket(e);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>this.handleMessage(e),t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("读取拍照功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t=e.data;this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(){if(await this.startConnect(),1===this.ws.readyState)return this.ws.send(Ne.camera),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("读取拍照未准备完成")}}z(Ve,"cameraWebSocketUrl","ws://127.0.0.1:8152/SXTManage"),z(Ve,"ws",void 0),z(Ve,"requestStore",[]);class ze{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t=this.signWebSocketUrl;e===Ne.hwSign&&(t=this.hwSignWebSocketUrl);const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=e=>this.handleMessage(e),n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("签字板加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t=e.data;this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e=Ne.ywSign){if(await this.startConnect(e),1===this.ws.readyState)return console.log("签字板连接成功"),this.ws.send(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("签字板未准备完成")}}z(ze,"signWebSocketUrl","ws://127.0.0.1:8152/chromeManage"),z(ze,"hwSignWebSocketUrl","ws://127.0.0.1:8152/HWSIGNManage"),z(ze,"ws",void 0),z(ze,"requestStore",[]),function(e){e["iReadCardBas"]="iReadCardBas",e["GetSignName_Base64"]="GetSignName_Base64",e["ReadIDCard_Base64"]="ReadIDCard_Base64",e["FaceValidateWithIdCard_Base64"]="FaceValidateWithIdCard_Base64",e["FingerPrint_Base64"]="FingerPrint_Base64"}(je||(je={}));const Re={[je.iReadCardBas]:"读取社保卡",[je.GetSignName_Base64]:"获取签名",[je.ReadIDCard_Base64]:"读取二代身份证",[je.FaceValidateWithIdCard_Base64]:"人证比对",[je.FingerPrint_Base64]:"获取指纹"};class We{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let t="";switch(e){case je.FingerPrint_Base64:t=this.fingerPrintBasWebSocketUrl;break;default:t=this.iReadCardBasWebSocketUrl;break}const n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{i(!0)},n.onmessage=t=>{e===je.FingerPrint_Base64&&(t={...t,data:JSON.stringify({fingerPrintInfo:t.data})}),this.handleMessage(t)},n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("E窗通设备功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";try{t=JSON.parse(e.data)}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e){await this.startConnect(e);const t=Re[e];if(1===this.ws.readyState){let n;switch(e!==je.FingerPrint_Base64&&console.log(t+"连接成功"),e){case je.ReadIDCard_Base64:n=JSON.stringify({method:e,args:{outTimes:30,cardReader:1}});break;case je.FaceValidateWithIdCard_Base64:n=JSON.stringify({method:e,args:{outTimes:30,cardReader:1,cameraType:0}});break;case je.iReadCardBas:n=JSON.stringify({method:e,args:{icType:"1"}});break;case je.FingerPrint_Base64:n="getimgae,1,0,288,0";break;default:n=JSON.stringify({method:e,args:{outTimes:30}});break}return this.ws.send(n),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error(t+"未准备完成")}static async idCardRead(e=je.ReadIDCard_Base64){const t=await We.read(je.ReadIDCard_Base64);if(console.log("读取二代身份证==>",t),!t)throw Error("未匹配可用的E窗通读取设备");if(0!==t.retVal)throw Error("读取二代身份证失败,返回值:"+t.retVal+",错误信息:"+t.errMsg);const n=t.idInfo.data,{name:i,sex:r,birthday:a,address:s,id_num:o,nations:l}=n,c={info:{name:i,sex:r,birthday:a.replace("-","").replace("-",""),address:s,cardId:o,nation:l},headImage:t.idPhotoPicBase64};return console.log("读取二代身份证结果==>",c),c}static async faceValidateWithIdCardRead(){const e=await We.read(je.FaceValidateWithIdCard_Base64);if(console.log("人证比对==>",e),!e)throw Error("未匹配可用的E窗通读取设备");if(0!==e.retVal)throw Error("人证比对失败,返回值:"+e.retVal+",错误信息:"+e.errMsg);const t=e.idInfo.data,{name:n,sex:i,birth:r,address:a,idNo:s,nation:o}=t,l={idCard:{info:{name:n,sex:i,birthday:r.replace("-","").replace("-",""),address:a,cardId:s,nation:o},headImage:e.idPhotoBase64},faceimg:e.scenceBase64};return console.log("人证比对结果==>",l),l}static async socialSecurityCardRead(){const e=await We.read(je.iReadCardBas);if(!e)throw Error("未匹配可用的E窗通读取设备");if(0!==e.retVal)throw Error("读取社保卡基本信息失败,返回值:"+e.retVal+",错误信息:"+e.outInfo);const t=e.outInfo,n=t.split("|"),i=n[1],r=ce.getBirthdayByIdNumber(i).replace("-","").replace("-",""),a=ce.getGenderByIdNumber(i),s={info:{name:n[4],sex:a,birthday:r,address:"",cardId:i},headImage:""};return console.log("读取社保卡==>",e),s}static async signNameRead(){const e=await We.read(je.GetSignName_Base64);if(!e)throw Error("未匹配可用的E窗通读取设备");if(0!==e.retVal)throw Error("读取签名失败,返回值:"+e.retVal+",错误信息:"+e.errMsg);return console.log("获取签名==>",e),e.signPicBase64}static async fingerPrintRead(){let e=30;async function t(){const n=await We.read(je.FingerPrint_Base64);if(!n)throw Error("未匹配可用的E窗通读取设备");let i=n.fingerPrintInfo.split("|");console.log(i);let r=Number(i[1]);return r>1?e>0?(e--,await t()):{status:"error",data:"已超时,请重新操作,按压指纹"}:{status:"success",data:n.fingerPrintInfo}}let{status:n,data:i}=await t();if("error"===n)throw Error(i);{let[e,t,n,r,a]=i.split("|");return{method:e,result:t,quality:n,image:r,featureCode:a}}}}var He;z(We,"iReadCardBasWebSocketUrl","ws://127.0.0.1:5847"),z(We,"fingerPrintBasWebSocketUrl","ws://127.0.0.1:9000"),z(We,"ws",void 0),z(We,"requestStore",[]),function(e){e[e["ReadSocialSecurityCard"]=1002]="ReadSocialSecurityCard",e[e["ReadIDCard"]=1003]="ReadIDCard"}(He||(He={}));class qe{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const e=this.HaDWebSocketUrl,t=new WebSocket(e);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>this.handleMessage(e),t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}))}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){const t=JSON.parse(e.data);this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e){if(await this.startConnect(),1===this.ws.readyState){let t;1003!==e&&1002!==e||(t={tsCode:e.toString(),picFilePath:"d:\\zp.bmp"});const n=JSON.stringify(t);return this.ws.send(n),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}throw Error("设备未准备完成")}static async idCardRead(){const e=await qe.read(He.ReadIDCard);if(console.log("读取二代身份证==>",e),!e)throw Error("未匹配可用的读取设备");const t=e.cardInfo.split("|")[1],n=e.cardInfo.split("|")[2],i=e.cardInfo.split("|")[3],r=e.cardInfo.split("|")[4],a=e.cardInfo.split("|")[5],s=e.cardInfo.split("|")[6],o=(e.cardInfo.split("|")[7],e.cardInfo.split("|")[8],e.cardInfo.split("|")[9],e.cardInfo.split("|")[10]),l={info:{name:t,sex:n,birthday:r,address:a,cardId:s,nation:i},headImage:o};return console.log("读取二代身份证结果==>",l),l}static async socialSecurityCardRead(){const e=await qe.read(He.ReadSocialSecurityCard);if(!e)throw Error("未匹配可用的读取设备");const t=e.cardInfo.split("|")[1],n=e.cardInfo.split("|")[2],i=ce.getBirthdayByIdNumber(t).replace("-","").replace("-",""),r=ce.getGenderByIdNumber(t),a={info:{name:n,sex:r,birthday:i,address:"",cardId:t},headImage:""};return console.log("读取社保卡==>",e),a}}z(qe,"HaDWebSocketUrl","ws://127.0.0.1:36669/"),z(qe,"ws",void 0),z(qe,"requestStore",[]);var Ue,Ye=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);function Ge(e){var t,n,i,r,a,s,o;s=e.length,a=0,o="";while(a<s){do{t=Ye[255&e.charCodeAt(a++)]}while(a<s&&-1==t);if(-1==t)break;do{n=Ye[255&e.charCodeAt(a++)]}while(a<s&&-1==n);if(-1==n)break;o+=String.fromCharCode(t<<2|(48&n)>>4);do{if(i=255&e.charCodeAt(a++),61==i)return o;i=Ye[i]}while(a<s&&-1==i);if(-1==i)break;o+=String.fromCharCode((15&n)<<4|(60&i)>>2);do{if(r=255&e.charCodeAt(a++),61==r)return o;r=Ye[r]}while(a<s&&-1==r);if(-1==r)break;o+=String.fromCharCode((3&i)<<6|r)}return o}function Ke(e){var t,n,i,r,a,s;t="",i=e.length,n=0;while(n<i)switch(r=e.charCodeAt(n++),r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=e.charAt(n-1);break;case 12:case 13:a=e.charCodeAt(n++),t+=String.fromCharCode((31&r)<<6|63&a);break;case 14:a=e.charCodeAt(n++),s=e.charCodeAt(n++),t+=String.fromCharCode((15&r)<<12|(63&a)<<6|(63&s)<<0);break}return t}(function(e){e["ReadIDCard"]="$=Action|127.0.0.1|1352"})(Ue||(Ue={}));class Xe{static startConnect(e){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;const t=this.MRAdbWebSocketUrl,n=new WebSocket(t);let i;const r=new Promise((e=>{i=e}));return n.onopen=()=>{n.send(e),i(!0)},n.onmessage=e=>this.handleMessage(e),n.onclose=()=>this.handleClose(),n.onerror=()=>this.handleError(),this.ws=n,r}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}))}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){const t=JSON.parse(e.data);this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(e){return await this.startConnect(e),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}))}static async idCardRead(){const e=await Xe.read(Ue.ReadIDCard);if(console.log("中正智能人证核验返回==>",e),!e)throw Error("未匹配可用的读取设备");const{result:t,data:n}=e;switch(t){case-1:throw Error("服务器IP地址或者服务端口错误");case-2:throw Error("输入的发送数据参数非法");case-3:throw Error("连接服务器失败");case-4:throw Error("发送数据失败");case-5:throw Error("接收应答数据超时");case-6:throw Error("接收应答数据失败");case-7:throw Error("输出应答数据参数非法");case-8:throw Error("Websocket无法识别命令字");case-9:throw Error("Websocket解析命令字错误");case-10:throw Error("Websocket base64编码失败");case-11:throw Error("指纹驱动未安装或者未启动");case 0:{const e=Ke(Ge(n));console.log("中正智能人证核验结果==>",e);const t=e.split("$"),i=t[2].split("=#=")[1],r=t[3].split("=#=")[1],a=t[10].split("=#=")[1],s=t[6].split("=#=")[1],o=t[5].split("=#=")[1],l=t[4].split("=#=")[1],c=(t[11].split("=#=")[1],t[8].split("=#=")[1]),u=t[9].split("=#=")[1],h={idCard:{info:{name:i,sex:r,birthday:s,address:o,cardId:l,nation:a},headImage:c},faceimg:u};return console.log("中正智能人证核验结果转换==>",{name:i,sex:r,birthday:s,address:o,cardId:l,nation:a}),h}}return""}}z(Xe,"MRAdbWebSocketUrl","ws://127.0.0.1:8003/finger"),z(Xe,"ws",void 0),z(Xe,"requestStore",[]);var Je=__webpack_require__(1478),Ze=function(){var e=this,t=e._self._c;return e.visibility?t("el-dialog",{staticClass:"face-auth-dialog",attrs:{title:"人脸识别",top:"5vh",width:"1280px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("el-container",[t("el-aside",{attrs:{width:"900px"}},[t("zs-card",{attrs:{title:"身份证信息读取"}},[t("div",{staticClass:"idcard-photo"},[t("div",{staticClass:"flex-1"},[t("img",{staticStyle:{width:"433px",height:"278px"},attrs:{src:__webpack_require__(2234)}}),t("span",{staticClass:"idcard-info name"},[e._v(e._s(e.IDInfo.name))]),t("span",{staticClass:"idcard-info sex"},[e._v(e._s(e.IDInfo.sex))]),t("span",{staticClass:"idcard-info nation"},[e._v(e._s(e.IDInfo.nation))]),t("span",{staticClass:"idcard-info year"},[e._v(e._s(e.birthYear))]),t("span",{staticClass:"idcard-info month"},[e._v(e._s(e.birthMonth))]),t("span",{staticClass:"idcard-info day"},[e._v(e._s(e.birthDay))]),t("span",{staticClass:"idcard-info address"},[e._v(e._s(e.IDInfo.address))]),t("span",{staticClass:"idcard-info idnumber"},[e._v(e._s(e.IDInfo.cardId))])]),t("div",[t("img",{staticStyle:{width:"433px",height:"278px"},attrs:{src:__webpack_require__(4923)}}),t("span",{staticClass:"idcard-info qfjg"},[e._v(e._s(e.IDInfo.police))]),t("span",{staticClass:"idcard-info yxrq"},[e._v(e._s(e.validDate))])])])])],1),t("el-main",[t("zs-card",{staticClass:"camera",attrs:{title:"摄像头"},scopedSlots:e._u([{key:"extra",fn:function(){return[t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.veriface}},[e._v("开始识别")])]},proxy:!0}],null,!1,3429989024)},[t("div",{staticStyle:{width:"320px",height:"240px"},attrs:{id:"camera_row"}})])],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},e._l(e.buttonList,(function(n){return t("el-button",e._b({key:n.name,on:{click:function(t){return e.buttonClickEvent(n.name)}}},"el-button",n,!1),[e._v(e._s(n.label)+" ")])})),1)],1):e._e()},Qe=[],et={name:"face-auth-dialog",data:()=>({visibility:!0,buttonList:[{name:"cancel",label:"取消",size:"small"},{name:"sure",label:"确定",type:"primary",size:"small",icon:"el-icon-success"}],idCardInfo:{info:{name:"",sex:"",nation:"",birthday:"",address:"",cardId:"",police:"",validStart:"",validEnd:"",sexCode:"",nationCode:""},headImage:void 0},verifaceData:verifaceData}),computed:{IDInfo(){return this.idCardInfo.info},birthYear(){return this.idCardInfo.info.birthday?this.idCardInfo.info.birthday.slice(0,4):""},birthMonth(){return this.idCardInfo.info.birthday?this.idCardInfo.info.birthday.slice(4,6):""},birthDay(){return this.idCardInfo.info.birthday?this.idCardInfo.info.birthday.slice(6,8):""},validDate(){return this.idCardInfo.info.validStart&&this.idCardInfo.info.validEnd?this.idCardInfo.info.validStart+"-"+this.idCardInfo.info.validEnd:""}},mounted(){this.$nextTick((()=>{(0,Je.xj)()}))},methods:{async veriface(){const e=await Je.g$.getElement(4);this.idCardInfo=e.idCard,this.verifaceData=e},buttonClickEvent(e){switch(e){case"cancel":this.visibility=!1;break;case"sure":this.$emit("close",this.verifaceData),this.visibility=!1;break}}}},tt=et,nt=l(tt,Ze,Qe,!1,null,null,null),it=nt.exports,rt=function(){var e=this,t=e._self._c;return e.visibility?t("el-dialog",{staticClass:"face-auth-dialog",attrs:{title:"拍照",top:"5vh",width:"620px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("div",{staticClass:"image-container"},[t("img",{directives:[{name:"show",rawName:"v-show",value:!e.scannerPhotoSrc,expression:"!scannerPhotoSrc"}],staticStyle:{width:"600px",height:"450px"},attrs:{id:"photo",src:e.scannerVideoSrc}}),t("img",{directives:[{name:"show",rawName:"v-show",value:e.scannerPhotoSrc,expression:"scannerPhotoSrc"}],staticStyle:{width:"600px",height:"450px"},attrs:{id:"photo",src:"data:image/jpg;base64,"+e.scannerPhotoSrc}})]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e._l(e.buttonList,(function(n){return[e.isShowButton(n.name)?t("el-button",e._b({key:n.name,on:{click:function(t){return e.buttonClickEvent(n.name)}}},"el-button",n,!1),[e._v(e._s(n.label)+" ")]):e._e()]}))],2)]):e._e()},at=[],st={name:"eloam-take-photo-dialog",data:()=>({visibility:!0,scannerVideoSrc:W.secondaryCameraUrl,scannerPhotoSrc:"",buttonList:[{name:"cancel",label:"取消",size:"small"},{name:"take-photo",label:"拍照",type:"primary",size:"small"},{name:"retake-photo",label:"重拍",type:"primary",size:"small"},{name:"sure",label:"确定",type:"primary",size:"small"}]}),methods:{isShowButton(e){switch(e){case"take-photo":return!this.scannerPhotoSrc;case"retake-photo":return this.scannerPhotoSrc;default:return!0}},async buttonClickEvent(e){switch(e){case"cancel":this.visibility=!1;break;case"take-photo":const e=await W.scanBySecondaryCamera();this.scannerPhotoSrc=e;break;case"retake-photo":this.scannerPhotoSrc="";break;case"sure":let t={faceimg:this.scannerPhotoSrc};this.$emit("close",t),this.visibility=!1;break}}}},ot=st,lt=l(ot,rt,at,!1,null,"6e18b4de",null),ct=lt.exports,ut=__webpack_require__(7203),ht=__webpack_require__.n(ut);class dt{static startConnect(){if(this.ws&&this.ws.readyState===WebSocket.CONNECTING)return this;let e=this.idCardWebSocketUrl;const t=new WebSocket(e);let n;const i=new Promise((e=>{n=e}));return t.onopen=()=>{n(!0)},t.onmessage=e=>this.handleMessage(e),t.onclose=()=>this.handleClose(),t.onerror=()=>this.handleError(),this.ws=t,i}static handleError(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("handleError")}));throw Error("读取身份证功能加载失败")}static handleClose(){for(const e in this.requestStore)this.requestStore.forEach((({reject:e})=>{e("close")}))}static handleMessage(e){let t="";try{t=e.data}catch(n){t=""}this.requestStore.forEach((({resolve:e})=>{e(t)})),this.requestStore=[],this.ws.close()}static async read(){if(await this.startConnect(),1===this.ws.readyState)return this.ws.send("04?timeout=10000"),new Promise(((e,t)=>{this.requestStore||(this.requestStore=[]),this.requestStore.push({resolve:e,reject:t})}));throw Error("读取身份证未准备完成")}static async idCardRead(){const e=await dt.read();if(e){let[t,n,i,r,a,s,o,l,c,u]=e.split("|"),h=e.split("|")[17];const d={info:{name:n,sex:i,birthday:a,address:s,cardId:o,nation:r,police:l,validStart:c,validEnd:u},headImage:h};return d}throw Error("未匹配可用的读卡器")}}z(dt,"idCardWebSocketUrl","ws://127.0.0.1:7415"),z(dt,"ws",void 0),z(dt,"requestStore",[]);var ft=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"face-auth-dialog",attrs:{title:"拍照",top:"5vh",width:"620px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("div",{staticClass:"image-container"},[t("video",{ref:"monitor",staticClass:"videoContainer",attrs:{autoplay:"",width:"250",height:"300"}}),t("canvas",{ref:"photo",staticClass:"videoContainer photo",staticStyle:{display:"none"},attrs:{width:"1920",height:"1080"}}),t("img",{staticClass:"videoContainer photo",attrs:{src:e.viewerPhotoSrc}})]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e._l(e.buttonList,(function(n){return[t("el-button",e._b({key:n.name,on:{click:function(t){return e.buttonClickEvent(n.name)}}},"el-button",n,!1),[e._v(e._s(n.label)+" ")])]}))],2)])},pt=[],mt={name:"default-take-photo-dialog",data:()=>({visibility:!0,viewerPhotoSrc:"",scannerPhotoSrc:"",cameraStream:"",buttonList:[{name:"cancel",label:"取消",size:"small"},{name:"take-photo",label:"拍照",type:"primary",size:"small"},{name:"sure",label:"确定",type:"primary",size:"small"}]}),mounted(){this.$nextTick((()=>{this.initDefaultCamera()}))},beforeDestroy(){this.cameraStream.getVideoTracks().forEach((e=>{e.stop()}))},methods:{async initDefaultCamera(){let e=this.$refs.monitor,t=this.$refs.photo;console.log(e,t);let n={audio:!1,video:{width:1920,height:1080}};if(navigator.mediaDevices.getUserMedia)try{let t=await navigator.mediaDevices.getUserMedia(n);e.srcObject=t,e.play(),this.cameraStream=t}catch(i){this.$message.error("没有可用的摄像头!"),console.log(i)}},takePicture(){let e=this.$refs.monitor,t=this.$refs.photo,n=t.getContext("2d");n.drawImage(e,0,0,1920,1080);let i=t.toDataURL("image/png");t.src=i,this.viewerPhotoSrc=i,this.scannerPhotoSrc=i.replace("data:image/png;base64,","")},async buttonClickEvent(e){switch(e){case"cancel":this.visibility=!1,this.$emit("close");break;case"take-photo":this.takePicture();break;case"sure":let e={faceimg:this.scannerPhotoSrc};this.$emit("close",e),this.visibility=!1;break}}}},vt=mt,gt=l(vt,ft,pt,!1,null,null,null),bt=gt.exports,yt=function(){var e=this,t=e._self._c;return e.visibility?t("el-dialog",{staticClass:"wei-rong-face-auth-dialog",attrs:{title:"人脸识别",top:"5vh",width:"640px",visible:e.visibility,"close-on-click-modal":!1},on:{"update:visible":function(t){e.visibility=t}}},[t("div",{staticClass:"image-container"},[t("img",{staticStyle:{width:"600px",height:"450px"},attrs:{id:"photo",src:e.viewFaceImage}})])]):e._e()},_t=[];const wt="data:image/jpg;base64,";var xt={name:"wei-rong-face-auth-dialog",data:()=>({visibility:!0,viewFaceImage:""}),async created(){window.addEventListener(oe,(e=>{e.type===oe&&(this.viewFaceImage=`${wt}${e.scannerResultUrl}`)}));let e=await ge.faceValidateWithIdCardRead();this.$message.success("认证成功"),setTimeout((()=>{this.$emit("close",e)}),1500)}},Ct=xt,kt=l(Ct,yt,_t,!1,null,"5bbb0afc",null),St=kt.exports,Et={name:"id-card-reader-button",props:{label:{default:"",type:String},tip:{default:"",type:String},className:{default:"",type:String},size:{default:"mini",type:String},type:{default:"primary",type:String},plain:{default:!1,type:Boolean},round:{default:!1,type:Boolean},loading:{default:!1,type:Boolean},icon:{default:"el-icon-postcard",type:String},disabled:{default:!1,type:Boolean},readMachineType:{default:0,type:Number},readerMode:{default:"idCard",type:String},filePath:{default:"JVBERi0xLjcKJcKzx9gNCjMgMCBvYmoNPDwvQXV0aG9yIChhZG1pbikgL0NvbW1lbnRzICgpIC9Db21wYW55ICgpIC9DcmVhdGlvbkRhdGUgKEQ6MjAyMzA4MjYxNjQzMzUrMDgnNDMnKSAvQ3JlYXRvciAo/v8AVwBQAFMAIGWHW1cpIC9LZXl3b3JkcyAoKSAvTW9kRGF0ZSAoRDoyMDIzMDgyNjE2NDMzNSswOCc0MycpIC9Qcm9kdWNlciAoKSAvU291cmNlTW9kaWZpZWQgKEQ6MjAyMzA4MjYxNjQzMzUrMDgnNDMnKSAvU3ViamVjdCAoKSAvVGl0bGUgKCkgL1RyYXBwZWQgL0ZhbHNlPj4NZW5kb2JqDTYgMCBvYmoNPDwvQ29udGVudHMgNyAwIFIgL01lZGlhQm94IFswIDAgNTk1LjMgODQxLjldIC9QYXJlbnQgMiAwIFIgL1R5cGUgL1BhZ2U+Pg1lbmRvYmoNNyAwIG9iag08PC9GaWx0ZXIgL0ZsYXRlRGVjb2RlIC9MZW5ndGggMjg+Pg0Kc3RyZWFtDQp4nCvkNVQwAEJdEGVhYqhnqZCcyxvICwA4EQSdDQplbmRzdHJlYW0NZW5kb2JqDTIgMCBvYmoNPDwvQ291bnQgMSAvS2lkcyBbNiAwIFJdIC9UeXBlIC9QYWdlcz4+DWVuZG9iag0xIDAgb2JqDTw8L05hbWVzIDw8L0Rlc3RzIDQgMCBSPj4gL091dGxpbmVzIDUgMCBSIC9QYWdlcyAyIDAgUiAvVHlwZSAvQ2F0YWxvZz4+DWVuZG9iag00IDAgb2JqDTw8L05hbWVzIFtdPj4NZW5kb2JqDTUgMCBvYmoNPDw+Pg1lbmRvYmoNeHJlZg0KMCA4DQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDA1MjcgMDAwMDAgbg0KMDAwMDAwMDQ3MiAwMDAwMCBuDQowMDAwMDAwMDE2IDAwMDAwIG4NCjAwMDAwMDA2MTQgMDAwMDAgbg0KMDAwMDAwMDY0MyAwMDAwMCBuDQowMDAwMDAwMjgzIDAwMDAwIG4NCjAwMDAwMDAzNzIgMDAwMDAgbg0KdHJhaWxlcjw8L1NpemUgOCAvUm9vdCAxIDAgUiAvSW5mbyAzIDAgUiAvSUQgWzxiYTllMTE5ZmNjODQ0MGVjYThjZDYyZWNiYjNmNzA0OD48ZjI5MDhkYTE4YTMxNDkyZDhlODBkZTMyYzg5MjIyMjg+XT4+DXN0YXJ0eHJlZg02NjMNJSVFT0YN",type:String}},data:()=>({showIDCardChrome:!1}),computed:{_className(){const e=["z-button"];return"text"===this.type&&e.push("i-font-size"),this.className?("string"===typeof this.className?e.push(this.className):e.push(...this.className),e):e},isJIEYUPlugin(){return"sign"===this.readerMode&&3===this.readMachineType||"idCard"===this.readerMode&&6===this.readMachineType||"idCard"===this.readerMode&&6===this.readMachineType}},watch:{isJIEYUPlugin:{handler:async e=>{e&&await pe.initParams()}}},async created(){this.isJIEYUPlugin&&await pe.initParams()},methods:{handleClick(){switch(this.readerMode){case"idCard":return this.idCardRReaderEvent();case"veriface":return this.faceReaderEvent();case"sign":return this.signEvent();case"socialSecurityCard":return this.socialSecurityCardReaderEvent()}},async idCardRReaderEvent(){let e;switch(this.readMachineType){case 0:e=await Le.idCardCommonRead(),this.$emit("click",e);break;case 1:return this.readLSIDCard();case 2:e=await We.idCardRead(),this.$emit("click",e);break;case 3:const t=await Xe.idCardRead();t&&(e=t.idCard),this.$emit("click",e);break;case 4:e=await qe.idCardRead(),this.$emit("click",e);break;case 5:e=await W.idCardRead(),this.$emit("click",e);break;case 6:e=await pe.idCardRead(),this.$emit("click",e);break;case 8:e=await dt.idCardRead(),this.$emit("click",e);break;case 9:e=await pe.idCardReadByScanner(),this.$emit("click",e);break;case 10:e=await ge.idCardRead(),this.$emit("click",e);break}},async faceReaderEvent(){switch(this.readMachineType){case 0:this.readFacePhotoByDefault();break;case 1:this.readLSIDCardAndMatchFace();break;case 2:{const e=await We.faceValidateWithIdCardRead();this.$emit("click",e);break}case 3:{const e=await Xe.idCardRead();this.$emit("click",e);break}case 5:this.readFacePhotoByELoam();break;case 6:{const e=await pe.faceValidateWithIdCardRead();this.$emit("click",e);break}case 10:this.openWEIRONGFaceValidateDialog();break}},async socialSecurityCardReaderEvent(){try{let e;switch(this.readMachineType){case 2:e=await We.socialSecurityCardRead();break;case 4:e=await qe.socialSecurityCardRead();break;case 5:e=await ge.socialSecurityCardRead();break}this.$emit("click",e)}catch(e){throw Error("读取社保卡失败")}},async signEvent(){let e="";switch(this.readMachineType){case 0:e=await ze.read();break;case 1:e=await ze.read(Ne.hwSign);break;case 2:e=await We.signNameRead();break;case 3:const t=await pe.signNameRead(this.filePath),n=t.SignNameBase64?JSON.parse(t.SignNameBase64):{SignName0:""},i=t.FingerPrintBase64?JSON.parse(t.FingerPrintBase64):{FingerPrint0:""},r=n.SignName0.split(";")[0],a=i.FingerPrint0.split(";")[0];console.log("签字&指纹",r,a),a?(e=await pe.mergeImage(r,a),console.log(e)):e=r;break;case 5:e=await ge.signNameRead();break}this.$emit("click",e)},async readLSIDCardAndMatchFace(){this.showIDCardChrome=!0;const e=document.createElement("div");document.body.appendChild(e);const t=new(ht())({render:e=>e(it,{props:{},on:{close:e=>{if(console.log("destroy data=>",e),"比对成功"!==e.zt)throw Error("认证失败");this.$message.success("认证成功"),this.$emit("click",e),this.showIDCardChrome=!1,t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},openWEIRONGFaceValidateDialog(){console.log("打开人脸识别弹框");const e=document.createElement("div");document.body.appendChild(e);const t=new(ht())({render:e=>e(St,{props:{},on:{close:e=>{this.$emit("click",e),t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},readFacePhotoByELoam(){const e=document.createElement("div");document.body.appendChild(e);const t=new(ht())({render:e=>e(ct,{props:{},on:{close:e=>{console.log("良田拍照信息=>",e),this.$emit("click",e),t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},readFacePhotoByDefault(){const e=document.createElement("div");document.body.appendChild(e);const t=new(ht())({render:e=>e(bt,{props:{},on:{close:e=>{e&&(console.log("浏览器自带拍照=>",e),this.$emit("click",e)),t.$destroy(),t.$el.remove()}}}),parent:this}).$mount(e)},readLSIDCard(){this.showIDCardChrome=!0,this.$nextTick((async()=>{try{const e=await(0,Je.oK)();console.log("丽水一体机读取身份证信息=>",e),this.$emit("click",e)}catch(e){throw Error("读取身份证信息失败")}finally{this.showIDCardChrome=!1}}))}}},Ot=Et,Dt=l(Ot,Fe,Be,!1,null,"19ae37ba",null),$t=Dt.exports;$t.install=e=>{e.component($t.name,$t)};var Tt=$t;const It=[h,b,Ae,Tt,P,ee,Oe],Mt=e=>{e.use(i()),Mt.installed||It.forEach((t=>{e.component(t.name,t)}))};"undefined"!==typeof window&&window.Vue&&Mt(window.Vue);var Pt={install:Mt,...It},Nt=Pt}(),__webpack_exports__}()}));
|