unify-external-plugin-platform 0.0.3-77 → 0.0.3-79

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.
@@ -89752,8 +89752,8 @@ id_card_reader_button.install = Vue => {
89752
89752
  Vue.component(id_card_reader_button.name, id_card_reader_button);
89753
89753
  };
89754
89754
  /* harmony default export */ var id_card_reader_id_card_reader_button = (id_card_reader_button);
89755
- ;// 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-nko/src/scanner-nko.vue?vue&type=template&id=f121193e&
89756
- var scanner_nkovue_type_template_id_f121193e_render = function render() {
89755
+ ;// 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-nko/src/scanner-nko.vue?vue&type=template&id=2b36bc1b&
89756
+ var scanner_nkovue_type_template_id_2b36bc1b_render = function render() {
89757
89757
  var _vm = this,
89758
89758
  _c = _vm._self._c;
89759
89759
  return _c('el-container', {
@@ -90083,7 +90083,7 @@ var scanner_nkovue_type_template_id_f121193e_render = function render() {
90083
90083
  }
90084
90084
  }, [_vm._v("上传")])], 1)])], 1)], 1);
90085
90085
  };
90086
- var scanner_nkovue_type_template_id_f121193e_staticRenderFns = [];
90086
+ var scanner_nkovue_type_template_id_2b36bc1b_staticRenderFns = [];
90087
90087
 
90088
90088
  // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js
90089
90089
  var web_dom_exception_stack = __webpack_require__(2801);
@@ -90478,9 +90478,36 @@ _defineProperty(NkoService, "fileList", []);
90478
90478
  }
90479
90479
  },
90480
90480
  created() {
90481
- this.scanConfig.fileTransferMode = this.fileTransferMode;
90481
+ // 优先使用 prop 传入的传输模式,否则从缓存恢复
90482
+ const cachedConfig = this.getCachedConfig();
90483
+ if (this.fileTransferMode) {
90484
+ this.scanConfig.fileTransferMode = this.fileTransferMode;
90485
+ } else if (cachedConfig && cachedConfig.fileTransferMode) {
90486
+ this.scanConfig.fileTransferMode = cachedConfig.fileTransferMode;
90487
+ }
90482
90488
  },
90483
90489
  methods: {
90490
+ /** localStorage 缓存 key */
90491
+ _cacheKey() {
90492
+ return 'scanner-nko-config';
90493
+ },
90494
+ /** 读取缓存的扫描配置 */
90495
+ getCachedConfig() {
90496
+ try {
90497
+ const raw = localStorage.getItem(this._cacheKey());
90498
+ return raw ? JSON.parse(raw) : null;
90499
+ } catch (e) {
90500
+ return null;
90501
+ }
90502
+ },
90503
+ /** 将当前扫描配置写入缓存 */
90504
+ saveConfigToCache() {
90505
+ try {
90506
+ localStorage.setItem(this._cacheKey(), JSON.stringify(this.scanConfig));
90507
+ } catch (e) {
90508
+ // ignore
90509
+ }
90510
+ },
90484
90511
  handleCheckAllChange(val) {
90485
90512
  this.scanFileList.forEach(data => {
90486
90513
  data.checked = val;
@@ -90502,6 +90529,14 @@ _defineProperty(NkoService, "fileList", []);
90502
90529
  this.deviceList = await NkoService.getDeivceList();
90503
90530
  this.deviceOpend = true;
90504
90531
  this.pageLoading = false;
90532
+
90533
+ // 连接成功后,恢复缓存的扫描源(deviceId)
90534
+ const cached = this.getCachedConfig();
90535
+ if (cached && cached.deviceId && this.deviceList.some(d => d.deviceId === cached.deviceId)) {
90536
+ this.scanConfig.deviceId = cached.deviceId;
90537
+ // 自动触发获取该设备的能力选项
90538
+ this.openDeivce();
90539
+ }
90505
90540
  },
90506
90541
  /**
90507
90542
  * 扫描服务关闭时回调
@@ -90555,11 +90590,19 @@ _defineProperty(NkoService, "fileList", []);
90555
90590
  this.resolutionOptions = options.resolution;
90556
90591
  this.paperSizeOptions = options['paper-size'];
90557
90592
  this.fileFormatOptions = options['image-format'];
90558
- this.scanConfig.source = this.sourceOptions[0] || null;
90559
- this.scanConfig.mode = this.modeOptions[0] || null;
90560
- this.scanConfig.resolution = this.resolutionOptions[0] || null;
90561
- this.scanConfig.paperSize = this.paperSizeOptions[0] || null;
90562
- this.scanConfig.fileFormat = this.fileFormatOptions[0] || null;
90593
+
90594
+ // 恢复缓存配置:若缓存值在当前设备能力列表中则使用缓存值,否则取第一项
90595
+ const cached = this.getCachedConfig() || {};
90596
+ const isValid = (list, val) => val && list.includes(val);
90597
+ this.scanConfig.source = isValid(this.sourceOptions, cached.source) ? cached.source : this.sourceOptions[0] || null;
90598
+ this.scanConfig.mode = isValid(this.modeOptions, cached.mode) ? cached.mode : this.modeOptions[0] || null;
90599
+ this.scanConfig.resolution = isValid(this.resolutionOptions, cached.resolution) ? cached.resolution : this.resolutionOptions[0] || null;
90600
+ this.scanConfig.paperSize = isValid(this.paperSizeOptions, cached.paperSize) ? cached.paperSize : this.paperSizeOptions[0] || null;
90601
+ this.scanConfig.fileFormat = isValid(this.fileFormatOptions, cached.fileFormat) ? cached.fileFormat : this.fileFormatOptions[0] || null;
90602
+ // fileTransferMode 不依赖设备,直接恢复
90603
+ if (cached.fileTransferMode) {
90604
+ this.scanConfig.fileTransferMode = cached.fileTransferMode;
90605
+ }
90563
90606
  this.deviceOpend = true;
90564
90607
  this.pageLoading = false;
90565
90608
  },
@@ -90580,6 +90623,8 @@ _defineProperty(NkoService, "fileList", []);
90580
90623
  });
90581
90624
  const data = await NkoService.scan(this.scanConfig.fileFormat, this.fileSavePath, this.fileNamePrefix, this.fileNameFormat, this.scanConfig.fileTransferMode);
90582
90625
  this.scanFileList = [...this.scanFileList, ...data];
90626
+ // 扫描成功后缓存当前配置,下次使用时直接恢复
90627
+ this.saveConfigToCache();
90583
90628
  this.pageLoading = false;
90584
90629
  },
90585
90630
  //预览
@@ -90611,10 +90656,10 @@ _defineProperty(NkoService, "fileList", []);
90611
90656
  });
90612
90657
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue?vue&type=script&lang=js&
90613
90658
  /* harmony default export */ var src_scanner_nkovue_type_script_lang_js_ = (scanner_nkovue_type_script_lang_js_);
90614
- ;// 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-nko/src/scanner-nko.vue?vue&type=style&index=0&id=f121193e&prod&lang=scss&
90659
+ ;// 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-nko/src/scanner-nko.vue?vue&type=style&index=0&id=2b36bc1b&prod&lang=scss&
90615
90660
  // extracted by mini-css-extract-plugin
90616
90661
 
90617
- ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue?vue&type=style&index=0&id=f121193e&prod&lang=scss&
90662
+ ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue?vue&type=style&index=0&id=2b36bc1b&prod&lang=scss&
90618
90663
 
90619
90664
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue
90620
90665
 
@@ -90627,8 +90672,8 @@ _defineProperty(NkoService, "fileList", []);
90627
90672
 
90628
90673
  var scanner_nko_component = normalizeComponent(
90629
90674
  src_scanner_nkovue_type_script_lang_js_,
90630
- scanner_nkovue_type_template_id_f121193e_render,
90631
- scanner_nkovue_type_template_id_f121193e_staticRenderFns,
90675
+ scanner_nkovue_type_template_id_2b36bc1b_render,
90676
+ scanner_nkovue_type_template_id_2b36bc1b_staticRenderFns,
90632
90677
  false,
90633
90678
  null,
90634
90679
  null,
@@ -89762,8 +89762,8 @@ id_card_reader_button.install = Vue => {
89762
89762
  Vue.component(id_card_reader_button.name, id_card_reader_button);
89763
89763
  };
89764
89764
  /* harmony default export */ var id_card_reader_id_card_reader_button = (id_card_reader_button);
89765
- ;// 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/scanner/scanner-nko/src/scanner-nko.vue?vue&type=template&id=f121193e&
89766
- var scanner_nkovue_type_template_id_f121193e_render = function render() {
89765
+ ;// 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/scanner/scanner-nko/src/scanner-nko.vue?vue&type=template&id=2b36bc1b&
89766
+ var scanner_nkovue_type_template_id_2b36bc1b_render = function render() {
89767
89767
  var _vm = this,
89768
89768
  _c = _vm._self._c;
89769
89769
  return _c('el-container', {
@@ -90093,7 +90093,7 @@ var scanner_nkovue_type_template_id_f121193e_render = function render() {
90093
90093
  }
90094
90094
  }, [_vm._v("上传")])], 1)])], 1)], 1);
90095
90095
  };
90096
- var scanner_nkovue_type_template_id_f121193e_staticRenderFns = [];
90096
+ var scanner_nkovue_type_template_id_2b36bc1b_staticRenderFns = [];
90097
90097
 
90098
90098
  // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js
90099
90099
  var web_dom_exception_stack = __webpack_require__(2801);
@@ -90488,9 +90488,36 @@ _defineProperty(NkoService, "fileList", []);
90488
90488
  }
90489
90489
  },
90490
90490
  created() {
90491
- this.scanConfig.fileTransferMode = this.fileTransferMode;
90491
+ // 优先使用 prop 传入的传输模式,否则从缓存恢复
90492
+ const cachedConfig = this.getCachedConfig();
90493
+ if (this.fileTransferMode) {
90494
+ this.scanConfig.fileTransferMode = this.fileTransferMode;
90495
+ } else if (cachedConfig && cachedConfig.fileTransferMode) {
90496
+ this.scanConfig.fileTransferMode = cachedConfig.fileTransferMode;
90497
+ }
90492
90498
  },
90493
90499
  methods: {
90500
+ /** localStorage 缓存 key */
90501
+ _cacheKey() {
90502
+ return 'scanner-nko-config';
90503
+ },
90504
+ /** 读取缓存的扫描配置 */
90505
+ getCachedConfig() {
90506
+ try {
90507
+ const raw = localStorage.getItem(this._cacheKey());
90508
+ return raw ? JSON.parse(raw) : null;
90509
+ } catch (e) {
90510
+ return null;
90511
+ }
90512
+ },
90513
+ /** 将当前扫描配置写入缓存 */
90514
+ saveConfigToCache() {
90515
+ try {
90516
+ localStorage.setItem(this._cacheKey(), JSON.stringify(this.scanConfig));
90517
+ } catch (e) {
90518
+ // ignore
90519
+ }
90520
+ },
90494
90521
  handleCheckAllChange(val) {
90495
90522
  this.scanFileList.forEach(data => {
90496
90523
  data.checked = val;
@@ -90512,6 +90539,14 @@ _defineProperty(NkoService, "fileList", []);
90512
90539
  this.deviceList = await NkoService.getDeivceList();
90513
90540
  this.deviceOpend = true;
90514
90541
  this.pageLoading = false;
90542
+
90543
+ // 连接成功后,恢复缓存的扫描源(deviceId)
90544
+ const cached = this.getCachedConfig();
90545
+ if (cached && cached.deviceId && this.deviceList.some(d => d.deviceId === cached.deviceId)) {
90546
+ this.scanConfig.deviceId = cached.deviceId;
90547
+ // 自动触发获取该设备的能力选项
90548
+ this.openDeivce();
90549
+ }
90515
90550
  },
90516
90551
  /**
90517
90552
  * 扫描服务关闭时回调
@@ -90565,11 +90600,19 @@ _defineProperty(NkoService, "fileList", []);
90565
90600
  this.resolutionOptions = options.resolution;
90566
90601
  this.paperSizeOptions = options['paper-size'];
90567
90602
  this.fileFormatOptions = options['image-format'];
90568
- this.scanConfig.source = this.sourceOptions[0] || null;
90569
- this.scanConfig.mode = this.modeOptions[0] || null;
90570
- this.scanConfig.resolution = this.resolutionOptions[0] || null;
90571
- this.scanConfig.paperSize = this.paperSizeOptions[0] || null;
90572
- this.scanConfig.fileFormat = this.fileFormatOptions[0] || null;
90603
+
90604
+ // 恢复缓存配置:若缓存值在当前设备能力列表中则使用缓存值,否则取第一项
90605
+ const cached = this.getCachedConfig() || {};
90606
+ const isValid = (list, val) => val && list.includes(val);
90607
+ this.scanConfig.source = isValid(this.sourceOptions, cached.source) ? cached.source : this.sourceOptions[0] || null;
90608
+ this.scanConfig.mode = isValid(this.modeOptions, cached.mode) ? cached.mode : this.modeOptions[0] || null;
90609
+ this.scanConfig.resolution = isValid(this.resolutionOptions, cached.resolution) ? cached.resolution : this.resolutionOptions[0] || null;
90610
+ this.scanConfig.paperSize = isValid(this.paperSizeOptions, cached.paperSize) ? cached.paperSize : this.paperSizeOptions[0] || null;
90611
+ this.scanConfig.fileFormat = isValid(this.fileFormatOptions, cached.fileFormat) ? cached.fileFormat : this.fileFormatOptions[0] || null;
90612
+ // fileTransferMode 不依赖设备,直接恢复
90613
+ if (cached.fileTransferMode) {
90614
+ this.scanConfig.fileTransferMode = cached.fileTransferMode;
90615
+ }
90573
90616
  this.deviceOpend = true;
90574
90617
  this.pageLoading = false;
90575
90618
  },
@@ -90590,6 +90633,8 @@ _defineProperty(NkoService, "fileList", []);
90590
90633
  });
90591
90634
  const data = await NkoService.scan(this.scanConfig.fileFormat, this.fileSavePath, this.fileNamePrefix, this.fileNameFormat, this.scanConfig.fileTransferMode);
90592
90635
  this.scanFileList = [...this.scanFileList, ...data];
90636
+ // 扫描成功后缓存当前配置,下次使用时直接恢复
90637
+ this.saveConfigToCache();
90593
90638
  this.pageLoading = false;
90594
90639
  },
90595
90640
  //预览
@@ -90621,10 +90666,10 @@ _defineProperty(NkoService, "fileList", []);
90621
90666
  });
90622
90667
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue?vue&type=script&lang=js&
90623
90668
  /* harmony default export */ var src_scanner_nkovue_type_script_lang_js_ = (scanner_nkovue_type_script_lang_js_);
90624
- ;// 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/scanner/scanner-nko/src/scanner-nko.vue?vue&type=style&index=0&id=f121193e&prod&lang=scss&
90669
+ ;// 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/scanner/scanner-nko/src/scanner-nko.vue?vue&type=style&index=0&id=2b36bc1b&prod&lang=scss&
90625
90670
  // extracted by mini-css-extract-plugin
90626
90671
 
90627
- ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue?vue&type=style&index=0&id=f121193e&prod&lang=scss&
90672
+ ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue?vue&type=style&index=0&id=2b36bc1b&prod&lang=scss&
90628
90673
 
90629
90674
  ;// CONCATENATED MODULE: ./packages/scanner/scanner-nko/src/scanner-nko.vue
90630
90675
 
@@ -90637,8 +90682,8 @@ _defineProperty(NkoService, "fileList", []);
90637
90682
 
90638
90683
  var scanner_nko_component = normalizeComponent(
90639
90684
  src_scanner_nkovue_type_script_lang_js_,
90640
- scanner_nkovue_type_template_id_f121193e_render,
90641
- scanner_nkovue_type_template_id_f121193e_staticRenderFns,
90685
+ scanner_nkovue_type_template_id_2b36bc1b_render,
90686
+ scanner_nkovue_type_template_id_2b36bc1b_staticRenderFns,
90642
90687
  false,
90643
90688
  null,
90644
90689
  null,