unify-external-plugin-platform 0.0.2-80 → 0.0.2-82
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.
@@ -85022,11 +85022,9 @@ var WEIRONGMethodCode;
|
|
85022
85022
|
})(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
|
85023
85023
|
class WeiRongPluginService {
|
85024
85024
|
static startConnect(method) {
|
85025
|
-
console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
|
85026
85025
|
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
85027
85026
|
return this;
|
85028
85027
|
}
|
85029
|
-
console.log('重新链接');
|
85030
85028
|
const ws = new WebSocket(this.webSocketUrl);
|
85031
85029
|
let resolved;
|
85032
85030
|
const onConnect = new Promise(resolve => {
|
@@ -85160,12 +85158,11 @@ class WeiRongPluginService {
|
|
85160
85158
|
throw Error('未匹配到可用的读取设备');
|
85161
85159
|
}
|
85162
85160
|
if (readData.retVal !== 0) {
|
85163
|
-
this.ws
|
85161
|
+
if (this.ws) this.ws.close();
|
85164
85162
|
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85165
85163
|
}
|
85166
85164
|
let idInfo = readData.idInfo;
|
85167
|
-
// name
|
85168
|
-
// organs:签发机关 signdate:开始有效期 validterm: 结束有效期
|
85165
|
+
// let idInfo = { name: '姓名', ENfullname: '英文姓名', sex:'性别', nation:'民族', number: '身份证号码', birthday: '生日', address: '地址', organs:'签发机关', signdate:'开始有效期', validterm: '结束有效期',}
|
85169
85166
|
let {
|
85170
85167
|
name,
|
85171
85168
|
ENfullname: englishName,
|
@@ -85213,7 +85210,7 @@ class WeiRongPluginService {
|
|
85213
85210
|
},
|
85214
85211
|
headImage: readData.idPhotoBase64
|
85215
85212
|
};
|
85216
|
-
this.ws
|
85213
|
+
if (this.ws) this.ws.close();
|
85217
85214
|
return IDCardData;
|
85218
85215
|
}
|
85219
85216
|
/** 读取社保卡 */
|
@@ -85223,22 +85220,11 @@ class WeiRongPluginService {
|
|
85223
85220
|
throw Error('未匹配可用的读取设备');
|
85224
85221
|
}
|
85225
85222
|
if (readData.retVal !== 0) {
|
85226
|
-
this.ws
|
85223
|
+
if (this.ws) this.ws.close();
|
85227
85224
|
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.idInfo);
|
85228
85225
|
}
|
85229
85226
|
// 返回数据:cardType 3 社保卡
|
85230
|
-
// idInfo:
|
85231
|
-
// name:姓名
|
85232
|
-
// sex:性别
|
85233
|
-
// nation:民族
|
85234
|
-
// cardnumber:卡号
|
85235
|
-
// number:社会保障号码(身份证号)
|
85236
|
-
// birthday:出生日期"\
|
85237
|
-
// city:城市代码
|
85238
|
-
// signdate:开始有效期
|
85239
|
-
// validterm:结束有效期
|
85240
|
-
// cardveVrsion:社保卡版本
|
85241
|
-
// }
|
85227
|
+
// let idInfo = { name:'姓名', sex:'性别', nation:'民族', cardnumber:'卡号', number:'社会保障号码(身份证号)', birthday:'出生日期', city:'城市代码', signdate:'开始有效期',validterm:'结束有效期', cardveVrsion:'社保卡版本', }
|
85242
85228
|
const idInfo = readData.idInfo;
|
85243
85229
|
let {
|
85244
85230
|
name,
|
@@ -85258,7 +85244,7 @@ class WeiRongPluginService {
|
|
85258
85244
|
},
|
85259
85245
|
headImage: ''
|
85260
85246
|
};
|
85261
|
-
this.ws
|
85247
|
+
if (this.ws) this.ws.close();
|
85262
85248
|
return IDCardData;
|
85263
85249
|
}
|
85264
85250
|
/**
|
@@ -85267,7 +85253,6 @@ class WeiRongPluginService {
|
|
85267
85253
|
static async faceValidateWithIdCardRead() {
|
85268
85254
|
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.FaceValidateWithIdCard_Base64);
|
85269
85255
|
if (readData.method === 'FaceValidateWithIdCard_Base64' && readData.retVal == '0') {
|
85270
|
-
console.log('认证成功=>', readData);
|
85271
85256
|
const idInfo = readData.idInfo;
|
85272
85257
|
let {
|
85273
85258
|
name,
|
@@ -85320,20 +85305,19 @@ class WeiRongPluginService {
|
|
85320
85305
|
faceimg: readData.scenceBase64,
|
85321
85306
|
score: readData.score
|
85322
85307
|
};
|
85323
|
-
this.ws
|
85308
|
+
if (this.ws) this.ws.close();
|
85324
85309
|
return IDCardData;
|
85325
85310
|
} else {
|
85326
|
-
this.ws
|
85311
|
+
if (this.ws) this.ws.close();
|
85327
85312
|
}
|
85328
85313
|
}
|
85329
85314
|
/** 签字*/
|
85330
85315
|
static async signNameRead() {
|
85331
85316
|
return new Promise(async (resolve, reject) => {
|
85332
85317
|
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
|
85333
|
-
console.log('开始签名=>', readData);
|
85334
85318
|
if (readData.method === 'SignNameScreen_Start') {
|
85335
85319
|
if (readData.retVal !== 0) {
|
85336
|
-
this.ws
|
85320
|
+
if (this.ws) this.ws.close();
|
85337
85321
|
reject(`开始签名失败,返回值:${readData.retVal},错误信息:${readData.errMsg}`);
|
85338
85322
|
} else {
|
85339
85323
|
if (!this.timer) {
|
@@ -85343,12 +85327,12 @@ class WeiRongPluginService {
|
|
85343
85327
|
clearInterval(this.timer);
|
85344
85328
|
this.timer = null;
|
85345
85329
|
let res = await WeiRongPluginService.read(WEIRONGMethodCode.GetSignName_Base64);
|
85346
|
-
this.ws
|
85330
|
+
if (this.ws) this.ws.close();
|
85347
85331
|
resolve(res.signPicBase64);
|
85348
85332
|
} else if (status.retVal == 3) {
|
85349
85333
|
clearInterval(this.timer);
|
85350
85334
|
this.timer = null;
|
85351
|
-
this.ws
|
85335
|
+
if (this.ws) this.ws.close();
|
85352
85336
|
reject('签字结果=>签字失败,或意外中断!');
|
85353
85337
|
}
|
85354
85338
|
}, 2000);
|
@@ -85363,15 +85347,14 @@ class WeiRongPluginService {
|
|
85363
85347
|
}
|
85364
85348
|
// 拍照
|
85365
85349
|
static async scanByCamera() {
|
85366
|
-
// if (this.ws) this.ws.close();
|
85367
85350
|
let res = await WeiRongPluginService.read(WEIRONGMethodCode.ScannerCamera);
|
85368
85351
|
if (res.method === 'GetCameraImage' && res.retVal == 0) {
|
85369
|
-
this.ws
|
85352
|
+
if (this.ws) this.ws.close();
|
85370
85353
|
return res.cameraImgBase64;
|
85371
85354
|
}
|
85372
85355
|
}
|
85373
85356
|
}
|
85374
|
-
_defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:
|
85357
|
+
_defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:5847');
|
85375
85358
|
_defineProperty(WeiRongPluginService, "ws", void 0);
|
85376
85359
|
_defineProperty(WeiRongPluginService, "requestStore", []);
|
85377
85360
|
_defineProperty(WeiRongPluginService, "timer", null);
|
@@ -85865,8 +85848,8 @@ id_card_reader_eloam.install = Vue => {
|
|
85865
85848
|
Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
|
85866
85849
|
};
|
85867
85850
|
/* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
|
85868
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=template&id=
|
85869
|
-
var
|
85851
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=template&id=cb0d757e&scoped=true&
|
85852
|
+
var id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_render = function render() {
|
85870
85853
|
var _vm = this,
|
85871
85854
|
_c = _vm._self._c;
|
85872
85855
|
return _vm.tip ? _c('el-tooltip', {
|
@@ -85943,7 +85926,7 @@ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = func
|
|
85943
85926
|
}
|
85944
85927
|
})], 2);
|
85945
85928
|
};
|
85946
|
-
var
|
85929
|
+
var id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_staticRenderFns = [];
|
85947
85930
|
|
85948
85931
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
|
85949
85932
|
|
@@ -87528,8 +87511,8 @@ class HuaShiService {
|
|
87528
87511
|
_defineProperty(HuaShiService, "idCardWebSocketUrl", 'ws://127.0.0.1:7415');
|
87529
87512
|
_defineProperty(HuaShiService, "ws", void 0);
|
87530
87513
|
_defineProperty(HuaShiService, "requestStore", []);
|
87531
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=template&id=
|
87532
|
-
var
|
87514
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=template&id=f72876fa&
|
87515
|
+
var default_take_photo_dialogvue_type_template_id_f72876fa_render = function render() {
|
87533
87516
|
var _vm = this,
|
87534
87517
|
_c = _vm._self._c;
|
87535
87518
|
return _c('el-dialog', {
|
@@ -87588,7 +87571,7 @@ var default_take_photo_dialogvue_type_template_id_3835614e_render = function ren
|
|
87588
87571
|
}, 'el-button', button, false), [_vm._v(_vm._s(button.label) + " ")])];
|
87589
87572
|
})], 2)]);
|
87590
87573
|
};
|
87591
|
-
var
|
87574
|
+
var default_take_photo_dialogvue_type_template_id_f72876fa_staticRenderFns = [];
|
87592
87575
|
|
87593
87576
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=script&lang=js&
|
87594
87577
|
/* harmony default export */ var default_take_photo_dialogvue_type_script_lang_js_ = ({
|
@@ -87638,7 +87621,7 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87638
87621
|
height: 1080
|
87639
87622
|
}
|
87640
87623
|
};
|
87641
|
-
if (navigator.mediaDevices.getUserMedia) {
|
87624
|
+
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
87642
87625
|
try {
|
87643
87626
|
let stream = await navigator.mediaDevices.getUserMedia(videoObj);
|
87644
87627
|
video.srcObject = stream;
|
@@ -87648,6 +87631,8 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87648
87631
|
this.$message.error('没有可用的摄像头!');
|
87649
87632
|
console.log(e);
|
87650
87633
|
}
|
87634
|
+
} else {
|
87635
|
+
this.$message.error('调用摄像头失败,请在首页左上角我的设备中设置读拍照/人脸识别选项,并确保已为浏览器设置相关权限!');
|
87651
87636
|
}
|
87652
87637
|
},
|
87653
87638
|
takePicture() {
|
@@ -87682,10 +87667,10 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87682
87667
|
});
|
87683
87668
|
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=script&lang=js&
|
87684
87669
|
/* harmony default export */ var dialog_default_take_photo_dialogvue_type_script_lang_js_ = (default_take_photo_dialogvue_type_script_lang_js_);
|
87685
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=
|
87670
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=f72876fa&prod&lang=scss&
|
87686
87671
|
// extracted by mini-css-extract-plugin
|
87687
87672
|
|
87688
|
-
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=
|
87673
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=f72876fa&prod&lang=scss&
|
87689
87674
|
|
87690
87675
|
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue
|
87691
87676
|
|
@@ -87698,8 +87683,8 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87698
87683
|
|
87699
87684
|
var default_take_photo_dialog_component = normalizeComponent(
|
87700
87685
|
dialog_default_take_photo_dialogvue_type_script_lang_js_,
|
87701
|
-
|
87702
|
-
|
87686
|
+
default_take_photo_dialogvue_type_template_id_f72876fa_render,
|
87687
|
+
default_take_photo_dialogvue_type_template_id_f72876fa_staticRenderFns,
|
87703
87688
|
false,
|
87704
87689
|
null,
|
87705
87690
|
null,
|
@@ -87917,12 +87902,16 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87917
87902
|
handleClick() {
|
87918
87903
|
switch (this.readerMode) {
|
87919
87904
|
case 'idCard':
|
87905
|
+
this.$emit('sendType', '读卡器');
|
87920
87906
|
return this.idCardRReaderEvent();
|
87921
87907
|
case 'veriface':
|
87908
|
+
this.$emit('sendType', '拍照');
|
87922
87909
|
return this.faceReaderEvent();
|
87923
87910
|
case 'sign':
|
87911
|
+
this.$emit('sendType', '签字版');
|
87924
87912
|
return this.signEvent();
|
87925
87913
|
case 'socialSecurityCard':
|
87914
|
+
this.$emit('sendType', '社保卡');
|
87926
87915
|
return this.socialSecurityCardReaderEvent();
|
87927
87916
|
}
|
87928
87917
|
},
|
@@ -87971,6 +87960,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87971
87960
|
idcardInfo = await WeiRongPluginService.idCardRead();
|
87972
87961
|
this.$emit('click', idcardInfo);
|
87973
87962
|
break;
|
87963
|
+
default:
|
87964
|
+
this.$message.warning('请在首页左上角我的设备中设置读卡器选项!');
|
87965
|
+
break;
|
87974
87966
|
}
|
87975
87967
|
},
|
87976
87968
|
/**
|
@@ -88012,6 +88004,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88012
88004
|
case 10:
|
88013
88005
|
this.openWEIRONGFaceValidateDialog();
|
88014
88006
|
break;
|
88007
|
+
default:
|
88008
|
+
this.$message.warning('请在首页左上角我的设备中设置读拍照/人脸识别选项!');
|
88009
|
+
break;
|
88015
88010
|
}
|
88016
88011
|
},
|
88017
88012
|
/**
|
@@ -88030,6 +88025,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88030
88025
|
case 5:
|
88031
88026
|
idcardInfo = await WeiRongPluginService.socialSecurityCardRead();
|
88032
88027
|
break;
|
88028
|
+
default:
|
88029
|
+
this.$message.warning('请在首页左上角我的设备中设置社保卡选项!');
|
88030
|
+
break;
|
88033
88031
|
}
|
88034
88032
|
this.$emit('click', idcardInfo);
|
88035
88033
|
} catch (e) {
|
@@ -88075,6 +88073,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88075
88073
|
case 5:
|
88076
88074
|
userSignature = await WeiRongPluginService.signNameRead();
|
88077
88075
|
break;
|
88076
|
+
default:
|
88077
|
+
this.$message.warning('请在首页左上角我的设备中设置签字版选项!');
|
88078
|
+
break;
|
88078
88079
|
}
|
88079
88080
|
// 返回base64编码内容,无前缀
|
88080
88081
|
this.$emit('click', userSignature);
|
@@ -88198,11 +88199,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88198
88199
|
;
|
88199
88200
|
var id_card_reader_button_component = normalizeComponent(
|
88200
88201
|
src_id_card_reader_buttonvue_type_script_lang_js_,
|
88201
|
-
|
88202
|
-
|
88202
|
+
id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_render,
|
88203
|
+
id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_staticRenderFns,
|
88203
88204
|
false,
|
88204
88205
|
null,
|
88205
|
-
"
|
88206
|
+
"cb0d757e",
|
88206
88207
|
null
|
88207
88208
|
|
88208
88209
|
)
|
@@ -85032,11 +85032,9 @@ var WEIRONGMethodCode;
|
|
85032
85032
|
})(WEIRONGMethodCode || (WEIRONGMethodCode = {}));
|
85033
85033
|
class WeiRongPluginService {
|
85034
85034
|
static startConnect(method) {
|
85035
|
-
console.log('startConnect', method, this.ws?.readyState, WebSocket.CONNECTING);
|
85036
85035
|
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
85037
85036
|
return this;
|
85038
85037
|
}
|
85039
|
-
console.log('重新链接');
|
85040
85038
|
const ws = new WebSocket(this.webSocketUrl);
|
85041
85039
|
let resolved;
|
85042
85040
|
const onConnect = new Promise(resolve => {
|
@@ -85170,12 +85168,11 @@ class WeiRongPluginService {
|
|
85170
85168
|
throw Error('未匹配到可用的读取设备');
|
85171
85169
|
}
|
85172
85170
|
if (readData.retVal !== 0) {
|
85173
|
-
this.ws
|
85171
|
+
if (this.ws) this.ws.close();
|
85174
85172
|
throw Error("读取二代身份证失败,返回值:" + readData.retVal + ",错误信息:" + readData.errMsg);
|
85175
85173
|
}
|
85176
85174
|
let idInfo = readData.idInfo;
|
85177
|
-
// name
|
85178
|
-
// organs:签发机关 signdate:开始有效期 validterm: 结束有效期
|
85175
|
+
// let idInfo = { name: '姓名', ENfullname: '英文姓名', sex:'性别', nation:'民族', number: '身份证号码', birthday: '生日', address: '地址', organs:'签发机关', signdate:'开始有效期', validterm: '结束有效期',}
|
85179
85176
|
let {
|
85180
85177
|
name,
|
85181
85178
|
ENfullname: englishName,
|
@@ -85223,7 +85220,7 @@ class WeiRongPluginService {
|
|
85223
85220
|
},
|
85224
85221
|
headImage: readData.idPhotoBase64
|
85225
85222
|
};
|
85226
|
-
this.ws
|
85223
|
+
if (this.ws) this.ws.close();
|
85227
85224
|
return IDCardData;
|
85228
85225
|
}
|
85229
85226
|
/** 读取社保卡 */
|
@@ -85233,22 +85230,11 @@ class WeiRongPluginService {
|
|
85233
85230
|
throw Error('未匹配可用的读取设备');
|
85234
85231
|
}
|
85235
85232
|
if (readData.retVal !== 0) {
|
85236
|
-
this.ws
|
85233
|
+
if (this.ws) this.ws.close();
|
85237
85234
|
throw Error("读取社保卡基本信息失败,返回值:" + readData.retVal + ",错误信息:" + readData.idInfo);
|
85238
85235
|
}
|
85239
85236
|
// 返回数据:cardType 3 社保卡
|
85240
|
-
// idInfo:
|
85241
|
-
// name:姓名
|
85242
|
-
// sex:性别
|
85243
|
-
// nation:民族
|
85244
|
-
// cardnumber:卡号
|
85245
|
-
// number:社会保障号码(身份证号)
|
85246
|
-
// birthday:出生日期"\
|
85247
|
-
// city:城市代码
|
85248
|
-
// signdate:开始有效期
|
85249
|
-
// validterm:结束有效期
|
85250
|
-
// cardveVrsion:社保卡版本
|
85251
|
-
// }
|
85237
|
+
// let idInfo = { name:'姓名', sex:'性别', nation:'民族', cardnumber:'卡号', number:'社会保障号码(身份证号)', birthday:'出生日期', city:'城市代码', signdate:'开始有效期',validterm:'结束有效期', cardveVrsion:'社保卡版本', }
|
85252
85238
|
const idInfo = readData.idInfo;
|
85253
85239
|
let {
|
85254
85240
|
name,
|
@@ -85268,7 +85254,7 @@ class WeiRongPluginService {
|
|
85268
85254
|
},
|
85269
85255
|
headImage: ''
|
85270
85256
|
};
|
85271
|
-
this.ws
|
85257
|
+
if (this.ws) this.ws.close();
|
85272
85258
|
return IDCardData;
|
85273
85259
|
}
|
85274
85260
|
/**
|
@@ -85277,7 +85263,6 @@ class WeiRongPluginService {
|
|
85277
85263
|
static async faceValidateWithIdCardRead() {
|
85278
85264
|
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.FaceValidateWithIdCard_Base64);
|
85279
85265
|
if (readData.method === 'FaceValidateWithIdCard_Base64' && readData.retVal == '0') {
|
85280
|
-
console.log('认证成功=>', readData);
|
85281
85266
|
const idInfo = readData.idInfo;
|
85282
85267
|
let {
|
85283
85268
|
name,
|
@@ -85330,20 +85315,19 @@ class WeiRongPluginService {
|
|
85330
85315
|
faceimg: readData.scenceBase64,
|
85331
85316
|
score: readData.score
|
85332
85317
|
};
|
85333
|
-
this.ws
|
85318
|
+
if (this.ws) this.ws.close();
|
85334
85319
|
return IDCardData;
|
85335
85320
|
} else {
|
85336
|
-
this.ws
|
85321
|
+
if (this.ws) this.ws.close();
|
85337
85322
|
}
|
85338
85323
|
}
|
85339
85324
|
/** 签字*/
|
85340
85325
|
static async signNameRead() {
|
85341
85326
|
return new Promise(async (resolve, reject) => {
|
85342
85327
|
const readData = await WeiRongPluginService.read(WEIRONGMethodCode.StartSignName);
|
85343
|
-
console.log('开始签名=>', readData);
|
85344
85328
|
if (readData.method === 'SignNameScreen_Start') {
|
85345
85329
|
if (readData.retVal !== 0) {
|
85346
|
-
this.ws
|
85330
|
+
if (this.ws) this.ws.close();
|
85347
85331
|
reject(`开始签名失败,返回值:${readData.retVal},错误信息:${readData.errMsg}`);
|
85348
85332
|
} else {
|
85349
85333
|
if (!this.timer) {
|
@@ -85353,12 +85337,12 @@ class WeiRongPluginService {
|
|
85353
85337
|
clearInterval(this.timer);
|
85354
85338
|
this.timer = null;
|
85355
85339
|
let res = await WeiRongPluginService.read(WEIRONGMethodCode.GetSignName_Base64);
|
85356
|
-
this.ws
|
85340
|
+
if (this.ws) this.ws.close();
|
85357
85341
|
resolve(res.signPicBase64);
|
85358
85342
|
} else if (status.retVal == 3) {
|
85359
85343
|
clearInterval(this.timer);
|
85360
85344
|
this.timer = null;
|
85361
|
-
this.ws
|
85345
|
+
if (this.ws) this.ws.close();
|
85362
85346
|
reject('签字结果=>签字失败,或意外中断!');
|
85363
85347
|
}
|
85364
85348
|
}, 2000);
|
@@ -85373,15 +85357,14 @@ class WeiRongPluginService {
|
|
85373
85357
|
}
|
85374
85358
|
// 拍照
|
85375
85359
|
static async scanByCamera() {
|
85376
|
-
// if (this.ws) this.ws.close();
|
85377
85360
|
let res = await WeiRongPluginService.read(WEIRONGMethodCode.ScannerCamera);
|
85378
85361
|
if (res.method === 'GetCameraImage' && res.retVal == 0) {
|
85379
|
-
this.ws
|
85362
|
+
if (this.ws) this.ws.close();
|
85380
85363
|
return res.cameraImgBase64;
|
85381
85364
|
}
|
85382
85365
|
}
|
85383
85366
|
}
|
85384
|
-
_defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:
|
85367
|
+
_defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:5847');
|
85385
85368
|
_defineProperty(WeiRongPluginService, "ws", void 0);
|
85386
85369
|
_defineProperty(WeiRongPluginService, "requestStore", []);
|
85387
85370
|
_defineProperty(WeiRongPluginService, "timer", null);
|
@@ -85875,8 +85858,8 @@ id_card_reader_eloam.install = Vue => {
|
|
85875
85858
|
Vue.component(id_card_reader_eloam.name, id_card_reader_eloam);
|
85876
85859
|
};
|
85877
85860
|
/* harmony default export */ var id_card_reader_id_card_reader_eloam = (id_card_reader_eloam);
|
85878
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=template&id=
|
85879
|
-
var
|
85861
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=template&id=cb0d757e&scoped=true&
|
85862
|
+
var id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_render = function render() {
|
85880
85863
|
var _vm = this,
|
85881
85864
|
_c = _vm._self._c;
|
85882
85865
|
return _vm.tip ? _c('el-tooltip', {
|
@@ -85953,7 +85936,7 @@ var id_card_reader_buttonvue_type_template_id_19ae37ba_scoped_true_render = func
|
|
85953
85936
|
}
|
85954
85937
|
})], 2);
|
85955
85938
|
};
|
85956
|
-
var
|
85939
|
+
var id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_staticRenderFns = [];
|
85957
85940
|
|
85958
85941
|
;// CONCATENATED MODULE: ./packages/service/external-plugins/default-plugin-socket.service.ts
|
85959
85942
|
|
@@ -87538,8 +87521,8 @@ class HuaShiService {
|
|
87538
87521
|
_defineProperty(HuaShiService, "idCardWebSocketUrl", 'ws://127.0.0.1:7415');
|
87539
87522
|
_defineProperty(HuaShiService, "ws", void 0);
|
87540
87523
|
_defineProperty(HuaShiService, "requestStore", []);
|
87541
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=template&id=
|
87542
|
-
var
|
87524
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=template&id=f72876fa&
|
87525
|
+
var default_take_photo_dialogvue_type_template_id_f72876fa_render = function render() {
|
87543
87526
|
var _vm = this,
|
87544
87527
|
_c = _vm._self._c;
|
87545
87528
|
return _c('el-dialog', {
|
@@ -87598,7 +87581,7 @@ var default_take_photo_dialogvue_type_template_id_3835614e_render = function ren
|
|
87598
87581
|
}, 'el-button', button, false), [_vm._v(_vm._s(button.label) + " ")])];
|
87599
87582
|
})], 2)]);
|
87600
87583
|
};
|
87601
|
-
var
|
87584
|
+
var default_take_photo_dialogvue_type_template_id_f72876fa_staticRenderFns = [];
|
87602
87585
|
|
87603
87586
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=script&lang=js&
|
87604
87587
|
/* harmony default export */ var default_take_photo_dialogvue_type_script_lang_js_ = ({
|
@@ -87648,7 +87631,7 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87648
87631
|
height: 1080
|
87649
87632
|
}
|
87650
87633
|
};
|
87651
|
-
if (navigator.mediaDevices.getUserMedia) {
|
87634
|
+
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
87652
87635
|
try {
|
87653
87636
|
let stream = await navigator.mediaDevices.getUserMedia(videoObj);
|
87654
87637
|
video.srcObject = stream;
|
@@ -87658,6 +87641,8 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87658
87641
|
this.$message.error('没有可用的摄像头!');
|
87659
87642
|
console.log(e);
|
87660
87643
|
}
|
87644
|
+
} else {
|
87645
|
+
this.$message.error('调用摄像头失败,请在首页左上角我的设备中设置读拍照/人脸识别选项,并确保已为浏览器设置相关权限!');
|
87661
87646
|
}
|
87662
87647
|
},
|
87663
87648
|
takePicture() {
|
@@ -87692,10 +87677,10 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87692
87677
|
});
|
87693
87678
|
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=script&lang=js&
|
87694
87679
|
/* harmony default export */ var dialog_default_take_photo_dialogvue_type_script_lang_js_ = (default_take_photo_dialogvue_type_script_lang_js_);
|
87695
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=
|
87680
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=f72876fa&prod&lang=scss&
|
87696
87681
|
// extracted by mini-css-extract-plugin
|
87697
87682
|
|
87698
|
-
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=
|
87683
|
+
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue?vue&type=style&index=0&id=f72876fa&prod&lang=scss&
|
87699
87684
|
|
87700
87685
|
;// CONCATENATED MODULE: ./packages/id-card-reader/id-card-reader-button/src/dialog/default-take-photo-dialog.vue
|
87701
87686
|
|
@@ -87708,8 +87693,8 @@ var default_take_photo_dialogvue_type_template_id_3835614e_staticRenderFns = [];
|
|
87708
87693
|
|
87709
87694
|
var default_take_photo_dialog_component = normalizeComponent(
|
87710
87695
|
dialog_default_take_photo_dialogvue_type_script_lang_js_,
|
87711
|
-
|
87712
|
-
|
87696
|
+
default_take_photo_dialogvue_type_template_id_f72876fa_render,
|
87697
|
+
default_take_photo_dialogvue_type_template_id_f72876fa_staticRenderFns,
|
87713
87698
|
false,
|
87714
87699
|
null,
|
87715
87700
|
null,
|
@@ -87927,12 +87912,16 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87927
87912
|
handleClick() {
|
87928
87913
|
switch (this.readerMode) {
|
87929
87914
|
case 'idCard':
|
87915
|
+
this.$emit('sendType', '读卡器');
|
87930
87916
|
return this.idCardRReaderEvent();
|
87931
87917
|
case 'veriface':
|
87918
|
+
this.$emit('sendType', '拍照');
|
87932
87919
|
return this.faceReaderEvent();
|
87933
87920
|
case 'sign':
|
87921
|
+
this.$emit('sendType', '签字版');
|
87934
87922
|
return this.signEvent();
|
87935
87923
|
case 'socialSecurityCard':
|
87924
|
+
this.$emit('sendType', '社保卡');
|
87936
87925
|
return this.socialSecurityCardReaderEvent();
|
87937
87926
|
}
|
87938
87927
|
},
|
@@ -87981,6 +87970,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
87981
87970
|
idcardInfo = await WeiRongPluginService.idCardRead();
|
87982
87971
|
this.$emit('click', idcardInfo);
|
87983
87972
|
break;
|
87973
|
+
default:
|
87974
|
+
this.$message.warning('请在首页左上角我的设备中设置读卡器选项!');
|
87975
|
+
break;
|
87984
87976
|
}
|
87985
87977
|
},
|
87986
87978
|
/**
|
@@ -88022,6 +88014,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88022
88014
|
case 10:
|
88023
88015
|
this.openWEIRONGFaceValidateDialog();
|
88024
88016
|
break;
|
88017
|
+
default:
|
88018
|
+
this.$message.warning('请在首页左上角我的设备中设置读拍照/人脸识别选项!');
|
88019
|
+
break;
|
88025
88020
|
}
|
88026
88021
|
},
|
88027
88022
|
/**
|
@@ -88040,6 +88035,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88040
88035
|
case 5:
|
88041
88036
|
idcardInfo = await WeiRongPluginService.socialSecurityCardRead();
|
88042
88037
|
break;
|
88038
|
+
default:
|
88039
|
+
this.$message.warning('请在首页左上角我的设备中设置社保卡选项!');
|
88040
|
+
break;
|
88043
88041
|
}
|
88044
88042
|
this.$emit('click', idcardInfo);
|
88045
88043
|
} catch (e) {
|
@@ -88085,6 +88083,9 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88085
88083
|
case 5:
|
88086
88084
|
userSignature = await WeiRongPluginService.signNameRead();
|
88087
88085
|
break;
|
88086
|
+
default:
|
88087
|
+
this.$message.warning('请在首页左上角我的设备中设置签字版选项!');
|
88088
|
+
break;
|
88088
88089
|
}
|
88089
88090
|
// 返回base64编码内容,无前缀
|
88090
88091
|
this.$emit('click', userSignature);
|
@@ -88208,11 +88209,11 @@ var wei_rong_face_auth_dialog_component = normalizeComponent(
|
|
88208
88209
|
;
|
88209
88210
|
var id_card_reader_button_component = normalizeComponent(
|
88210
88211
|
src_id_card_reader_buttonvue_type_script_lang_js_,
|
88211
|
-
|
88212
|
-
|
88212
|
+
id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_render,
|
88213
|
+
id_card_reader_buttonvue_type_template_id_cb0d757e_scoped_true_staticRenderFns,
|
88213
88214
|
false,
|
88214
88215
|
null,
|
88215
|
-
"
|
88216
|
+
"cb0d757e",
|
88216
88217
|
null
|
88217
88218
|
|
88218
88219
|
)
|
@@ -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 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={}));class ge{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){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}this.ws?.close()}static async 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}}z(ge,"webSocketUrl","ws://127.0.0.1:58471"),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__}()}));
|
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={}));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);return window.dispatchEvent(e)}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&&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&&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&&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&&this.ws.close(),o}static async faceValidateWithIdCardRead(){const e=await ge.read(fe.FaceValidateWithIdCard_Base64);if("FaceValidateWithIdCard_Base64"===e.method&&"0"==e.retVal){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&&this.ws.close(),v}this.ws&&this.ws.close()}static async signNameRead(){return new Promise((async(e,t)=>{const n=await ge.read(fe.StartSignName);"SignNameScreen_Start"===n.method&&(0!==n.retVal?(this.ws&&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&&this.ws.close(),e(t.signPicBase64)}else 3==n.retVal&&(clearInterval(this.timer),this.timer=null,this.ws&&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&&this.ws.close(),e.cameraImgBase64}}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&&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)}else this.$message.error("调用摄像头失败,请在首页左上角我的设备中设置读拍照/人脸识别选项,并确保已为浏览器设置相关权限!")},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.$emit("sendType","读卡器"),this.idCardRReaderEvent();case"veriface":return this.$emit("sendType","拍照"),this.faceReaderEvent();case"sign":return this.$emit("sendType","签字版"),this.signEvent();case"socialSecurityCard":return this.$emit("sendType","社保卡"),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;default:this.$message.warning("请在首页左上角我的设备中设置读卡器选项!");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;default:this.$message.warning("请在首页左上角我的设备中设置读拍照/人脸识别选项!");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;default:this.$message.warning("请在首页左上角我的设备中设置社保卡选项!");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;default:this.$message.warning("请在首页左上角我的设备中设置签字版选项!");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,"cb0d757e",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__}()}));
|