unify-external-plugin-platform 0.0.3-1 → 0.0.3-10

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.
@@ -84019,8 +84019,8 @@ var scanner_cameravue_type_template_id_00e9072f_scoped_true_render = function re
84019
84019
  };
84020
84020
  var scanner_cameravue_type_template_id_00e9072f_scoped_true_staticRenderFns = [];
84021
84021
 
84022
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=dc9fa1f2&scoped=true&
84023
- var scanner_camera_componentvue_type_template_id_dc9fa1f2_scoped_true_render = function render() {
84022
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=4394461f&scoped=true&
84023
+ var scanner_camera_componentvue_type_template_id_4394461f_scoped_true_render = function render() {
84024
84024
  var _vm = this,
84025
84025
  _c = _vm._self._c;
84026
84026
  return _c('div', {
@@ -84084,7 +84084,7 @@ var scanner_camera_componentvue_type_template_id_dc9fa1f2_scoped_true_render = f
84084
84084
  }, [_vm._v(_vm._s(item.label))]) : _vm._e()];
84085
84085
  }), _vm._t("action")]], 2)])]);
84086
84086
  };
84087
- var scanner_camera_componentvue_type_template_id_dc9fa1f2_scoped_true_staticRenderFns = [];
84087
+ var scanner_camera_componentvue_type_template_id_4394461f_scoped_true_staticRenderFns = [];
84088
84088
 
84089
84089
  ;// CONCATENATED MODULE: ./packages/utils/custom-axios.ts
84090
84090
  /**
@@ -84151,10 +84151,17 @@ class custom_axios_CustomAxios {
84151
84151
 
84152
84152
  var eloam_plugin_service_ELoamMethodCode;
84153
84153
  (function (ELoamMethodCode) {
84154
+ ELoamMethodCode["ScannerCameraLinuxInit"] = "ScannerCameraLinuxInit";
84155
+ /** 打开摄像头linux*/
84156
+ ELoamMethodCode["ScannerCameraLinuxStartPreview"] = "ScannerCameraLinuxStartPreview";
84157
+ /** 获取视频帧 linux*/
84158
+ ELoamMethodCode["ScannerCameraLinuxGetFrame"] = "ScannerCameraLinuxGetFrame";
84154
84159
  /** 糾偏 */
84155
84160
  ELoamMethodCode["ScannerCameraDeskew_Base64"] = "ScannerCameraDeskew_Base64";
84156
84161
  /** 合并*/
84157
84162
  ELoamMethodCode["ScannerCameraMerge_Base64"] = "ScannerCameraMerge_Base64";
84163
+ /** 旋转 */
84164
+ ELoamMethodCode["ScannerCameraRotate"] = "ScannerCameraRotate";
84158
84165
  /** 扫描-主摄像头 */
84159
84166
  ELoamMethodCode["ScannerMainCamera_Base64"] = "ScannerMainCamera_Base64";
84160
84167
  /** 扫描-副摄像头 */
@@ -84170,50 +84177,87 @@ const eloam_plugin_service_ELoamMethodDesc = {
84170
84177
  class eloam_plugin_service_ELoamPassService {
84171
84178
  /** 主摄像头地址 */
84172
84179
  static get mainCameraUrl() {
84173
- return this.baseServiceUrl + '/video=stream&camidx=0';
84180
+ if (this._isLinux) {
84181
+ return this.baseLinuxServiceUrl + '/StartPreview?dev_idx=0&res_id=0';
84182
+ } else {
84183
+ return this.baseServiceUrl + '/video=stream&camidx=0';
84184
+ }
84174
84185
  }
84175
84186
  /** 副摄像头地址 */
84176
84187
  static get secondaryCameraUrl() {
84177
- return this.baseServiceUrl + '/video=stream&camidx=1';
84188
+ if (this._isLinux) {
84189
+ return this.baseLinuxServiceUrl + '/StartPreview?dev_idx=1&res_id=0';
84190
+ } else {
84191
+ return this.baseServiceUrl + '/video=stream&camidx=1';
84192
+ }
84178
84193
  }
84179
84194
  static async read(method, data) {
84180
84195
  let param = {},
84181
84196
  url = '',
84182
84197
  requestType = '';
84183
84198
  switch (method) {
84184
- case eloam_plugin_service_ELoamMethodCode.ScannerCameraDeskew_Base64:
84185
- // 开启纠偏裁边
84186
- url = this.baseServiceUrl + '/dvideo=cameradeskew';
84199
+ case eloam_plugin_service_ELoamMethodCode.ScannerCameraLinuxInit:
84200
+ url = `${this.baseLinuxServiceUrl}/GetAllDisplayInfo`;
84201
+ requestType = 'get';
84202
+ break;
84203
+ case eloam_plugin_service_ELoamMethodCode.ScannerCameraLinuxStartPreview:
84204
+ url = `${this.baseLinuxServiceUrl}/StartPreview?dev_idx=${data}&res_id=0`;
84205
+ requestType = 'get';
84206
+ break;
84207
+ case eloam_plugin_service_ELoamMethodCode.ScannerCameraLinuxGetFrame:
84208
+ url = `${this.baseLinuxServiceUrl}/getFrame`;
84209
+ requestType = 'get';
84210
+ break;
84211
+ case eloam_plugin_service_ELoamMethodCode.ScannerCameraRotate:
84212
+ url = this.baseServiceUrl + '/video=rotate';
84187
84213
  param = {
84188
84214
  camidx: "0",
84189
- open: "1"
84215
+ rotate: data.toString()
84190
84216
  };
84191
84217
  requestType = 'post';
84192
84218
  break;
84219
+ case eloam_plugin_service_ELoamMethodCode.ScannerCameraDeskew_Base64:
84220
+ // 纠偏
84221
+ if (eloam_plugin_service_ELoamPassService._isLinux) {
84222
+ url = `${this.baseLinuxServiceUrl}/EnableDeskImage?enable=${data}`;
84223
+ requestType = 'get';
84224
+ } else {
84225
+ // 开启纠偏裁边
84226
+ url = this.baseServiceUrl + '/dvideo=cameradeskew';
84227
+ param = {
84228
+ camidx: "0",
84229
+ open: data
84230
+ };
84231
+ requestType = 'post';
84232
+ }
84233
+ break;
84193
84234
  case eloam_plugin_service_ELoamMethodCode.ScannerCameraMerge_Base64:
84194
84235
  // 合并
84195
- url = this.baseServiceUrl + '/compose=photos';
84196
- // outputfilepath 输出文件保存地址。例:D://res.jpg
84197
- // outputmaxwidth 合成后文件最大宽度。例:3000px
84198
- // inputimagetype 待合成文件类型:0:file;1:base64
84199
- // outputimagetype 合成后文件类型:0:jpg;1:PDF
84200
- param = {
84201
- outputfilepath: "",
84202
- outputmaxwidth: "3000",
84203
- inputimagetype: "1",
84204
- outputimagetype: "0",
84205
- imagelist: data.toString()
84206
- };
84207
- requestType = 'post';
84236
+ if (this._isLinux) {
84237
+ // 国产
84238
+ url = `${this.baseLinuxServiceUrl}/composeIDcardPic?image1=${data.list[0]}&image2=${data.list[1]}`;
84239
+ requestType = 'get';
84240
+ } else {
84241
+ url = this.baseServiceUrl + '/compose=photos';
84242
+ param = {
84243
+ outputfilepath: "",
84244
+ outputmaxwidth: "3000",
84245
+ inputimagetype: "1",
84246
+ outputimagetype: "0",
84247
+ isIDCardCompose: data.type,
84248
+ imagelist: data.list.toString()
84249
+ };
84250
+ requestType = 'post';
84251
+ }
84208
84252
  break;
84209
84253
  case eloam_plugin_service_ELoamMethodCode.ScannerMainCamera_Base64:
84210
84254
  // rotate: 旋转角度;deskew:纠偏,主摄像头1,副摄像头0 camidx:主摄像头0,副摄像头1;ColorMode:quality
84211
84255
  url = this.baseServiceUrl + '/video=grabimage';
84212
84256
  param = {
84213
- filepath: "",
84257
+ filepath: "base64",
84214
84258
  rotate: "0",
84215
- deskew: "0",
84216
- deskewval: "0",
84259
+ deskew: data,
84260
+ deskewval: "20",
84217
84261
  camidx: "0",
84218
84262
  ColorMode: "0",
84219
84263
  quality: "0",
@@ -84244,24 +84288,40 @@ class eloam_plugin_service_ELoamPassService {
84244
84288
  let res = await custom_axios_CustomAxios[requestType](url, param);
84245
84289
  return res;
84246
84290
  }
84291
+ static async initLinuxCamera() {
84292
+ await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraLinuxInit);
84293
+ }
84294
+ static async startPreview(data) {
84295
+ return await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraLinuxStartPreview, data);
84296
+ }
84297
+ static async getEloamFrame() {
84298
+ return await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraLinuxGetFrame);
84299
+ }
84247
84300
  /** 主摄像头拍照 */
84248
- static async scanByMainCamera() {
84249
- const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerMainCamera_Base64);
84250
- return res.photoBase64;
84301
+ static async scanByMainCamera(deskew) {
84302
+ const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerMainCamera_Base64, deskew);
84303
+ if (this._isLinux) {
84304
+ return res; // 国产
84305
+ } else {
84306
+ return res.photoBase64;
84307
+ }
84251
84308
  }
84252
84309
  /** 副摄像头拍照 */
84253
84310
  static async scanBySecondaryCamera() {
84254
84311
  const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerSecondaryCamera_Base64);
84255
84312
  return res.photoBase64;
84256
84313
  }
84257
- static async mergeImage(list) {
84258
- const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraMerge_Base64, list);
84259
- return res.base64;
84314
+ static async mergeImage(list, type) {
84315
+ const res = await eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraMerge_Base64, {
84316
+ list,
84317
+ type
84318
+ });
84319
+ return res.base64 || res.data;
84260
84320
  }
84261
- static async scanByCamera(type) {
84321
+ static async scanByCamera(type, deskew) {
84262
84322
  switch (type) {
84263
84323
  case "main":
84264
- return this.scanByMainCamera();
84324
+ return this.scanByMainCamera(deskew);
84265
84325
  case 'vice':
84266
84326
  return this.scanBySecondaryCamera();
84267
84327
  }
@@ -84322,6 +84382,8 @@ class eloam_plugin_service_ELoamPassService {
84322
84382
  }
84323
84383
  }
84324
84384
  _defineProperty(eloam_plugin_service_ELoamPassService, "baseServiceUrl", 'http://127.0.0.1:38088');
84385
+ _defineProperty(eloam_plugin_service_ELoamPassService, "baseLinuxServiceUrl", 'http://127.0.0.1:6543');
84386
+ _defineProperty(eloam_plugin_service_ELoamPassService, "_isLinux", String(navigator.platform).indexOf("Linux") > -1);
84325
84387
  ;// CONCATENATED MODULE: ./packages/model/common-message.ts
84326
84388
 
84327
84389
  /**
@@ -85469,13 +85531,26 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85469
85531
  name: '照片',
85470
85532
  value: 1
85471
85533
  }],
85534
+ deskewStatus: '0',
85535
+ rotateDeg: 0,
85472
85536
  buttonList: [{
85473
85537
  label: '拍照',
85474
85538
  name: 'take-pictures'
85475
85539
  }, {
85476
- label: '合并拍照',
85540
+ label: '图片合并',
85477
85541
  name: 'take-pictures-merge'
85542
+ }, {
85543
+ label: '证件合并',
85544
+ name: 'take-idCard-pictures-merge'
85545
+ }, {
85546
+ label: '纠偏裁边',
85547
+ name: 'open-deskew'
85548
+ }, {
85549
+ label: '旋转',
85550
+ name: 'rotate-video'
85478
85551
  }],
85552
+ _isLinux: String(navigator.platform).indexOf("Linux") > -1,
85553
+ eloamLinuxFrameTimer: {},
85479
85554
  mergeImageList: []
85480
85555
  };
85481
85556
  },
@@ -85542,10 +85617,10 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85542
85617
  {
85543
85618
  // 良田
85544
85619
  let type = this.camera === 0 ? 'main' : 'vice';
85545
- const res = await eloam_plugin_service_ELoamPassService.scanByCamera(type);
85546
- console.log('良田=>', res);
85620
+ const res = await eloam_plugin_service_ELoamPassService.scanByCamera(type, this.deskewStatus);
85547
85621
  if (res) {
85548
- this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res}`);
85622
+ let path = String(navigator.platform).indexOf("Linux") > -1 ? res.photoBase64 : res;
85623
+ this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${path}`);
85549
85624
  } else {
85550
85625
  this.$message.error('拍照出错,请检查设备是否连接成功');
85551
85626
  }
@@ -85579,10 +85654,15 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85579
85654
  break;
85580
85655
  case 5:
85581
85656
  // 良田高拍仪
85582
- this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.mainCameraUrl;
85583
- setTimeout(() => {
85584
- eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraDeskew_Base64); // 开启纠偏裁边
85585
- }, 2000);
85657
+ if (!(String(navigator.platform).indexOf("Linux") > -1)) {
85658
+ this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.mainCameraUrl;
85659
+ } else {
85660
+ await eloam_plugin_service_ELoamPassService.initLinuxCamera();
85661
+ let res = await eloam_plugin_service_ELoamPassService.startPreview('0');
85662
+ if (res.returnCode == "0" || res.returnCode == "2") {
85663
+ this.eloamLinuxFrameTimer = setInterval(this.getEloamFrame, 300);
85664
+ }
85665
+ }
85586
85666
  break;
85587
85667
  case 6:
85588
85668
  // 国产客户端一体机
@@ -85590,6 +85670,15 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85590
85670
  break;
85591
85671
  }
85592
85672
  },
85673
+ async getEloamFrame() {
85674
+ let res = await eloam_plugin_service_ELoamPassService.getEloamFrame();
85675
+ if (res.returnCode == "1") {
85676
+ clearInterval(this.eloamLinuxFrameTimer);
85677
+ return;
85678
+ }
85679
+ if (res.data.img == "") return;
85680
+ this.scannerVideoSrc = `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${res.data.img}`;
85681
+ },
85593
85682
  /**
85594
85683
  * 副摄像头
85595
85684
  */
@@ -85609,7 +85698,13 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85609
85698
  break;
85610
85699
  case 5:
85611
85700
  // 良田
85612
- this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.secondaryCameraUrl;
85701
+ if (!(String(navigator.platform).indexOf("Linux") > -1)) {
85702
+ this.scannerVideoSrc = eloam_plugin_service_ELoamPassService.mainCameraUrl;
85703
+ } else {
85704
+ await eloam_plugin_service_ELoamPassService.initLinuxCamera();
85705
+ await eloam_plugin_service_ELoamPassService.startPreview('1');
85706
+ this.eloamLinuxFrameTimer = setInterval(this.getEloamFrame, 300);
85707
+ }
85613
85708
  break;
85614
85709
  case 6:
85615
85710
  // 国产客户端一体机
@@ -85617,13 +85712,15 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85617
85712
  break;
85618
85713
  }
85619
85714
  },
85620
- async takePictureMerge() {
85621
- const res = await eloam_plugin_service_ELoamPassService.scanByCamera('main');
85715
+ async takePictureMerge(type) {
85716
+ if (type === '1' && this.deskewStatus === '0') return this.$message.warning('请先开启纠偏');
85717
+ const res = await eloam_plugin_service_ELoamPassService.scanByCamera('main', this.deskewStatus);
85622
85718
  if (res) {
85623
- this.mergeImageList.push(res);
85719
+ let path = String(navigator.platform).indexOf("Linux") > -1 ? res.filepath : res;
85720
+ this.mergeImageList.push(path);
85624
85721
  if (this.mergeImageList.length === 1) this.$message.success('第一张拍摄成功,请拍第二张');
85625
85722
  if (this.mergeImageList.length === 2) {
85626
- let result = await eloam_plugin_service_ELoamPassService.mergeImage(this.mergeImageList);
85723
+ let result = await eloam_plugin_service_ELoamPassService.mergeImage(this.mergeImageList, type);
85627
85724
  this.mergeImageList = [];
85628
85725
  this.$message.success('合并成功');
85629
85726
  this.$emit('send-scanner-result', `${scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA}${result}`);
@@ -85635,6 +85732,9 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85635
85732
  _isShowButton(name) {
85636
85733
  switch (name) {
85637
85734
  case 'take-pictures-merge':
85735
+ case 'take-idCard-pictures-merge':
85736
+ case 'open-deskew': // 纠偏裁边
85737
+ case 'rotate-video':
85638
85738
  return this.machineType === 5;
85639
85739
  // 良田显示合并拍照
85640
85740
  default:
@@ -85657,18 +85757,35 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85657
85757
  break;
85658
85758
  case 'take-pictures-merge':
85659
85759
  // 拍照合并
85660
- this.takePictureMerge();
85760
+ this.takePictureMerge('0');
85761
+ break;
85762
+ case 'take-idCard-pictures-merge':
85763
+ // 合并拍照身份证
85764
+ this.takePictureMerge('1');
85765
+ break;
85766
+ case 'rotate-video':
85767
+ if (String(navigator.platform).indexOf("Linux") > -1) {
85768
+ this.rotateDeg += 90;
85769
+ if (this.rotateDeg === 360) this.rotateDeg = 0;
85770
+ } else {
85771
+ this.rotateDeg = 90;
85772
+ }
85773
+ eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraRotate, this.rotateDeg); // 选装
85661
85774
  break;
85775
+ case 'open-deskew':
85776
+ this.deskewStatus = this.deskewStatus === '1' ? '0' : '1';
85777
+ eloam_plugin_service_ELoamPassService.read(eloam_plugin_service_ELoamMethodCode.ScannerCameraDeskew_Base64, this.deskewStatus);
85778
+ // 开启纠偏裁边
85662
85779
  }
85663
85780
  }
85664
85781
  }
85665
85782
  });
85666
85783
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
85667
85784
  /* harmony default export */ var component_scanner_camera_componentvue_type_script_lang_js_ = (scanner_camera_componentvue_type_script_lang_js_);
85668
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=dc9fa1f2&prod&scoped=true&lang=scss&
85785
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=4394461f&prod&scoped=true&lang=scss&
85669
85786
  // extracted by mini-css-extract-plugin
85670
85787
 
85671
- ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=dc9fa1f2&prod&scoped=true&lang=scss&
85788
+ ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=4394461f&prod&scoped=true&lang=scss&
85672
85789
 
85673
85790
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue
85674
85791
 
@@ -85681,11 +85798,11 @@ const scanner_camera_componentvue_type_script_lang_js_BEGIN_DATA = 'data:image/j
85681
85798
 
85682
85799
  var scanner_camera_component_component = normalizeComponent(
85683
85800
  component_scanner_camera_componentvue_type_script_lang_js_,
85684
- scanner_camera_componentvue_type_template_id_dc9fa1f2_scoped_true_render,
85685
- scanner_camera_componentvue_type_template_id_dc9fa1f2_scoped_true_staticRenderFns,
85801
+ scanner_camera_componentvue_type_template_id_4394461f_scoped_true_render,
85802
+ scanner_camera_componentvue_type_template_id_4394461f_scoped_true_staticRenderFns,
85686
85803
  false,
85687
85804
  null,
85688
- "dc9fa1f2",
85805
+ "4394461f",
85689
85806
  null
85690
85807
 
85691
85808
  )
@@ -87544,6 +87661,257 @@ var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpac
87544
87661
  * @date: 2023-10-12
87545
87662
  * @description:华视电子读卡器
87546
87663
  */
87664
+ const NationalityEnum = {
87665
+ AND: "安道尔",
87666
+ AFG: "阿富汗",
87667
+ ATG: "安提瓜和巴布达",
87668
+ AIA: "安圭拉",
87669
+ ALB: "阿尔巴尼亚",
87670
+ ARM: "亚美尼亚",
87671
+ AGO: "安哥拉",
87672
+ ATA: "南极洲",
87673
+ ARG: "阿根廷",
87674
+ ASM: "美属萨摩亚",
87675
+ AUT: "奥地利",
87676
+ AUS: "澳大利亚",
87677
+ ABW: "阿鲁巴",
87678
+ ALA: "奥兰群岛",
87679
+ AZE: "阿塞拜疆",
87680
+ BIH: "波黑",
87681
+ BRB: "巴巴多斯",
87682
+ BGD: "孟加拉",
87683
+ BEL: "比利时",
87684
+ BFA: "布基纳法索",
87685
+ BGR: "保加利亚",
87686
+ BHR: "巴林",
87687
+ BDI: "布隆迪",
87688
+ BEN: "贝宁",
87689
+ BLM: "圣巴泰勒米岛",
87690
+ BMU: "百慕大",
87691
+ BRN: "文莱",
87692
+ BOL: "玻利维亚",
87693
+ BES: "荷兰加勒比区",
87694
+ BRA: "巴西",
87695
+ BHS: "巴哈马",
87696
+ BTN: "不丹",
87697
+ BVT: "布韦岛",
87698
+ BWA: "博茨瓦纳",
87699
+ BLR: "白俄罗斯",
87700
+ BLZ: "伯利兹",
87701
+ CAN: "加拿大",
87702
+ CCK: "科科斯群岛",
87703
+ CAF: "中非",
87704
+ CHE: "瑞士",
87705
+ CHL: "智利",
87706
+ CMR: "喀麦隆",
87707
+ COL: "哥伦比亚",
87708
+ CRI: "哥斯达黎加",
87709
+ CUB: "古巴",
87710
+ CPV: "佛得角",
87711
+ CXR: "圣诞岛",
87712
+ CYP: "塞浦路斯",
87713
+ CZE: "捷克",
87714
+ DEU: "德国",
87715
+ DJI: "吉布提",
87716
+ DNK: "丹麦",
87717
+ DMA: "多米尼克",
87718
+ DOM: "多米尼加",
87719
+ DZA: "阿尔及利亚",
87720
+ ECU: "厄瓜多尔",
87721
+ EST: "爱沙尼亚",
87722
+ EGY: "埃及",
87723
+ ESH: "西撒哈拉",
87724
+ ERI: "厄立特里亚",
87725
+ ESP: "西班牙",
87726
+ FIN: "芬兰",
87727
+ FJI: "斐济群岛",
87728
+ FLK: "马尔维纳斯群岛(福克兰)",
87729
+ FSM: "密克罗尼西亚联邦",
87730
+ FRO: "法罗群岛",
87731
+ FRA: "法国",
87732
+ GAB: "加蓬",
87733
+ GRD: "格林纳达",
87734
+ GEO: "格鲁吉亚",
87735
+ GUF: "法属圭亚那",
87736
+ GHA: "加纳",
87737
+ GIB: "直布罗陀",
87738
+ GRL: "格陵兰",
87739
+ GIN: "几内亚",
87740
+ GLP: "瓜德罗普",
87741
+ GNQ: "赤道几内亚",
87742
+ GRC: "希腊",
87743
+ SGS: "南乔治亚岛和南桑威奇群岛",
87744
+ GTM: "危地马拉",
87745
+ GUM: "关岛",
87746
+ GNB: "几内亚比绍",
87747
+ GUY: "圭亚那",
87748
+ HKG: "香港",
87749
+ HMD: "赫德岛和麦克唐纳群岛",
87750
+ HND: "洪都拉斯",
87751
+ HRV: "克罗地亚",
87752
+ HTI: "海地",
87753
+ HUN: "匈牙利",
87754
+ IDN: "印尼",
87755
+ IRL: "爱尔兰",
87756
+ ISR: "以色列",
87757
+ IMN: "马恩岛",
87758
+ IND: "印度",
87759
+ IOT: "英属印度洋领地",
87760
+ IRQ: "伊拉克",
87761
+ IRN: "伊朗",
87762
+ ISL: "冰岛",
87763
+ ITA: "意大利",
87764
+ JEY: "泽西岛",
87765
+ JAM: "牙买加",
87766
+ JOR: "约旦",
87767
+ JPN: "日本",
87768
+ KHM: "柬埔寨",
87769
+ KIR: "基里巴斯",
87770
+ COM: "科摩罗",
87771
+ KWT: "科威特",
87772
+ CYM: "开曼群岛",
87773
+ LBN: "黎巴嫩",
87774
+ LIE: "列支敦士登",
87775
+ LKA: "斯里兰卡",
87776
+ LBR: "利比里亚",
87777
+ LSO: "莱索托",
87778
+ LTU: "立陶宛",
87779
+ LUX: "卢森堡",
87780
+ LVA: "拉脱维亚",
87781
+ LBY: "利比亚",
87782
+ MAR: "摩洛哥",
87783
+ MCO: "摩纳哥",
87784
+ MDA: "摩尔多瓦",
87785
+ MNE: "黑山",
87786
+ MAF: "法属圣马丁",
87787
+ MDG: "马达加斯加",
87788
+ MHL: "马绍尔群岛",
87789
+ MKD: "马其顿",
87790
+ MLI: "马里",
87791
+ MMR: "缅甸",
87792
+ MAC: "澳门",
87793
+ MTQ: "马提尼克",
87794
+ MRT: "毛里塔尼亚",
87795
+ MSR: "蒙塞拉特岛",
87796
+ MLT: "马耳他",
87797
+ MDV: "马尔代夫",
87798
+ MWI: "马拉维",
87799
+ MEX: "墨西哥",
87800
+ MYS: "马来西亚",
87801
+ NAM: "纳米比亚",
87802
+ NER: "尼日尔",
87803
+ NFK: "诺福克岛",
87804
+ NGA: "尼日利亚",
87805
+ NIC: "尼加拉瓜",
87806
+ NLD: "荷兰",
87807
+ NOR: "挪威",
87808
+ NPL: "尼泊尔",
87809
+ NRU: "瑙鲁",
87810
+ OMN: "阿曼",
87811
+ PAN: "巴拿马",
87812
+ PER: "秘鲁",
87813
+ PYF: "法属波利尼西亚",
87814
+ PNG: "巴布亚新几内亚",
87815
+ PHL: "菲律宾",
87816
+ PAK: "巴基斯坦",
87817
+ POL: "波兰",
87818
+ PCN: "皮特凯恩群岛",
87819
+ PRI: "波多黎各",
87820
+ PSE: "巴勒斯坦",
87821
+ PLW: "帕劳",
87822
+ PRY: "巴拉圭",
87823
+ QAT: "卡塔尔",
87824
+ REU: "留尼汪",
87825
+ ROU: "罗马尼亚",
87826
+ SRB: "塞尔维亚",
87827
+ RUS: "俄罗斯",
87828
+ RWA: "卢旺达",
87829
+ SLB: "所罗门群岛",
87830
+ SYC: "塞舌尔",
87831
+ SDN: "苏丹",
87832
+ SWE: "瑞典",
87833
+ SGP: "新加坡",
87834
+ SVN: "斯洛文尼亚",
87835
+ SJM: "斯瓦尔巴群岛和 扬马延岛",
87836
+ SVK: "斯洛伐克",
87837
+ SLE: "塞拉利昂",
87838
+ SMR: "圣马力诺",
87839
+ SEN: "塞内加尔",
87840
+ SOM: "索马里",
87841
+ SUR: "苏里南",
87842
+ SSD: "南苏丹",
87843
+ STP: "圣多美和普林西比",
87844
+ SLV: "萨尔瓦多",
87845
+ SYR: "叙利亚",
87846
+ SWZ: "斯威士兰",
87847
+ TCA: "特克斯和凯科斯群岛",
87848
+ TCD: "乍得",
87849
+ TGO: "多哥",
87850
+ THA: "泰国",
87851
+ TKL: "托克劳",
87852
+ TLS: "东帝汶",
87853
+ TUN: "突尼斯",
87854
+ TON: "汤加",
87855
+ TUR: "土耳其",
87856
+ TUV: "图瓦卢",
87857
+ TZA: "坦桑尼亚",
87858
+ UKR: "乌克兰",
87859
+ UGA: "乌干达",
87860
+ USA: "美国",
87861
+ URY: "乌拉圭",
87862
+ VAT: "梵蒂冈",
87863
+ VEN: "委内瑞拉",
87864
+ VGB: "英属维尔京群岛",
87865
+ VIR: "美属维尔京群岛",
87866
+ VNM: "越南",
87867
+ WLF: "瓦利斯和富图纳",
87868
+ WSM: "萨摩亚",
87869
+ YEM: "也门",
87870
+ MYT: "马约特",
87871
+ ZAF: "南非",
87872
+ ZMB: "赞比亚",
87873
+ ZWE: "津巴布韦",
87874
+ CHN: "中国",
87875
+ COG: "刚果(布)",
87876
+ COD: "刚果(金)",
87877
+ MOZ: "莫桑比克",
87878
+ GGY: "根西岛",
87879
+ GMB: "冈比亚",
87880
+ MNP: "北马里亚纳群岛",
87881
+ ETH: "埃塞俄比亚",
87882
+ NCL: "新喀里多尼亚",
87883
+ VUT: "瓦努阿图",
87884
+ ATF: "法属南部领地",
87885
+ NIU: "纽埃",
87886
+ UMI: "美国本土外小岛屿",
87887
+ COK: "库克群岛",
87888
+ GBR: "英国",
87889
+ TTO: "特立尼达和多巴哥",
87890
+ VCT: "圣文森特和格林纳丁斯",
87891
+ TWN: "台湾",
87892
+ NZL: "新西兰",
87893
+ SAU: "沙特阿拉伯",
87894
+ LAO: "老挝",
87895
+ PRK: "朝鲜",
87896
+ KOR: "韩国",
87897
+ PRT: "葡萄牙",
87898
+ KGZ: "吉尔吉斯斯坦",
87899
+ KAZ: "哈萨克斯坦",
87900
+ TJK: "塔吉克斯坦",
87901
+ TKM: "土库曼斯坦",
87902
+ UZB: "乌兹别克斯坦",
87903
+ KNA: "圣基茨和尼维斯",
87904
+ SPM: "圣皮埃尔和密克隆",
87905
+ SHN: "圣赫勒拿",
87906
+ LCA: "圣卢西亚",
87907
+ MUS: "毛里求斯",
87908
+ CIV: "科特迪瓦",
87909
+ KEN: "肯尼亚",
87910
+ MNG: "蒙古国"
87911
+ };
87912
+ function convertNationality(nationality) {
87913
+ return NationalityEnum[nationality];
87914
+ }
87547
87915
  class HuaShiService {
87548
87916
  static startConnect() {
87549
87917
  if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
@@ -87619,23 +87987,55 @@ class HuaShiService {
87619
87987
  const readData = await HuaShiService.read();
87620
87988
  if (readData) {
87621
87989
  // 身份证|姓名|性别|民族|生日|地址|证件号|派出所|有效期起|有效期止||证件照 中间好多占位
87622
- let [type, name, sex, nation, birthday, address, cardId, police, validStart, validEnd] = readData.split('|');
87623
- let base64_ID = readData.split('|')[17];
87624
- const IDCardData = {
87625
- info: {
87626
- name,
87627
- sex,
87628
- birthday,
87629
- address,
87630
- cardId,
87631
- nation,
87632
- police,
87633
- validStart,
87634
- validEnd
87635
- },
87636
- headImage: base64_ID
87637
- };
87638
- return IDCardData;
87990
+ // 永居证|姓名|性别|永居证证件号|国籍代码|中文姓名|有效期起|有效期止|生日|证件版本号|受理机关代码|证件类别|照片内容 中间好多占位
87991
+ // 永居证|姓名|性别|永居证证件号|国籍代码|中文姓名|有效期起|有效期止|生日|换证次数|旧证件号|证件类别|照片内容 中间好多占位
87992
+ // 港澳台|姓名|性别|生日|住址|证件号|派出所|有效期起|有效期止|通行证号码|签发次数|证件类别|照片内容 中间好多占位
87993
+ let [model, placeholder, type, name, sex, nation, birthday, address, cardId, police, validStart, validEnd] = readData.split('|');
87994
+ let base64_ID = readData.split('|')[19];
87995
+ let NationCode = readData.split('|')[18];
87996
+ if (NationCode === '1') {
87997
+ // 身份证
87998
+ const IDCardData = {
87999
+ info: {
88000
+ cardType: '1',
88001
+ name,
88002
+ chineseName: '',
88003
+ englishName: '',
88004
+ sex,
88005
+ birthday,
88006
+ address,
88007
+ cardId,
88008
+ nationality: '中国',
88009
+ nation,
88010
+ police,
88011
+ validStart,
88012
+ validEnd
88013
+ },
88014
+ headImage: base64_ID
88015
+ };
88016
+ return IDCardData;
88017
+ } else {
88018
+ let chineseName = readData.split('|')[16] || '无中文姓名';
88019
+ const IDCardData = {
88020
+ info: {
88021
+ cardType: '9',
88022
+ name: chineseName === '无中文姓名' ? name : chineseName || name,
88023
+ chineseName,
88024
+ englishName: name,
88025
+ sex,
88026
+ birthday,
88027
+ address,
88028
+ cardId,
88029
+ nationality: convertNationality(NationCode),
88030
+ nation: '',
88031
+ police: '中华人民共和国国家移民管理局',
88032
+ validStart,
88033
+ validEnd
88034
+ },
88035
+ headImage: base64_ID
88036
+ };
88037
+ return IDCardData;
88038
+ }
87639
88039
  } else {
87640
88040
  throw Error('未匹配可用的读卡器');
87641
88041
  }
@@ -87923,7 +88323,7 @@ var ExitAndEntryMethodCode;
87923
88323
  /** 获取识别结果 */
87924
88324
  ExitAndEntryMethodCode["GetReadResult"] = "GetReadResult";
87925
88325
  })(ExitAndEntryMethodCode || (ExitAndEntryMethodCode = {}));
87926
- const NationalityEnum = {
88326
+ const exit_and_entry_plugin_service_NationalityEnum = {
87927
88327
  AND: "安道尔",
87928
88328
  AFG: "阿富汗",
87929
88329
  ATG: "安提瓜和巴布达",
@@ -88007,7 +88407,7 @@ const NationalityEnum = {
88007
88407
  GUM: "关岛",
88008
88408
  GNB: "几内亚比绍",
88009
88409
  GUY: "圭亚那",
88010
- HKG: "中国",
88410
+ HKG: "香港",
88011
88411
  HMD: "赫德岛和麦克唐纳群岛",
88012
88412
  HND: "洪都拉斯",
88013
88413
  HRV: "克罗地亚",
@@ -88051,7 +88451,7 @@ const NationalityEnum = {
88051
88451
  MKD: "马其顿",
88052
88452
  MLI: "马里",
88053
88453
  MMR: "缅甸",
88054
- MAC: "中国",
88454
+ MAC: "澳门",
88055
88455
  MTQ: "马提尼克",
88056
88456
  MRT: "毛里塔尼亚",
88057
88457
  MSR: "蒙塞拉特岛",
@@ -88150,7 +88550,7 @@ const NationalityEnum = {
88150
88550
  GBR: "英国",
88151
88551
  TTO: "特立尼达和多巴哥",
88152
88552
  VCT: "圣文森特和格林纳丁斯",
88153
- TWN: "中国",
88553
+ TWN: "台湾",
88154
88554
  NZL: "新西兰",
88155
88555
  SAU: "沙特阿拉伯",
88156
88556
  LAO: "老挝",
@@ -88176,8 +88576,8 @@ var SexEnum;
88176
88576
  SexEnum["MALE"] = "\u7537";
88177
88577
  SexEnum["FEMALE"] = "\u5973";
88178
88578
  })(SexEnum || (SexEnum = {}));
88179
- function convertNationality(nationality) {
88180
- return NationalityEnum[nationality];
88579
+ function exit_and_entry_plugin_service_convertNationality(nationality) {
88580
+ return exit_and_entry_plugin_service_NationalityEnum[nationality];
88181
88581
  }
88182
88582
  function urlToBase64(url) {
88183
88583
  return new Promise((resolve, reject) => {
@@ -88240,7 +88640,7 @@ async function formatNFCResult(data) {
88240
88640
  sex: SexEnum[sex] || '未知',
88241
88641
  cardId: doc_number,
88242
88642
  birthday: birth_DateFormat.replace('-', '').replace('-', ''),
88243
- nationality: convertNationality(state),
88643
+ nationality: exit_and_entry_plugin_service_convertNationality(state),
88244
88644
  validEnd: expired_DateFormat.replace('-', '').replace('-', ''),
88245
88645
  headImage: img.replace('data:image/png;base64,', '')
88246
88646
  };
@@ -88324,7 +88724,7 @@ async function formatPermanentResidencePermit(data) {
88324
88724
  sex: xbdm.replace('性', ''),
88325
88725
  cardId: zjhm || yjjlzhm,
88326
88726
  birthday: csrq,
88327
- nationality: convertNationality(gjdm),
88727
+ nationality: exit_and_entry_plugin_service_convertNationality(gjdm),
88328
88728
  validStart: yxqqsrq || zjqfrq,
88329
88729
  validEnd: yxqjzrq || zjzzrq,
88330
88730
  police: '中华人民共和国国家移民管理局',