@deanwu/vue-component-library 1.0.38 → 1.0.40

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.
@@ -87212,6 +87212,15 @@ var es_array_splice = __webpack_require__("a434");
87212
87212
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
87213
87213
  var es_function_name = __webpack_require__("b0c0");
87214
87214
 
87215
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
87216
+ var es_regexp_exec = __webpack_require__("ac1f");
87217
+
87218
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
87219
+ var es_string_replace = __webpack_require__("5319");
87220
+
87221
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
87222
+ var es_string_split = __webpack_require__("1276");
87223
+
87215
87224
  // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
87216
87225
  var web_dom_collections_for_each = __webpack_require__("159b");
87217
87226
 
@@ -87850,18 +87859,9 @@ var es_object_to_string = __webpack_require__("d3b7");
87850
87859
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.constructor.js
87851
87860
  var es_regexp_constructor = __webpack_require__("4d63");
87852
87861
 
87853
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
87854
- var es_regexp_exec = __webpack_require__("ac1f");
87855
-
87856
87862
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
87857
87863
  var es_regexp_to_string = __webpack_require__("25f0");
87858
87864
 
87859
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
87860
- var es_string_replace = __webpack_require__("5319");
87861
-
87862
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
87863
- var es_string_split = __webpack_require__("1276");
87864
-
87865
87865
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
87866
87866
  var es_symbol = __webpack_require__("a4d3");
87867
87867
 
@@ -92407,127 +92407,6 @@ var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
92407
92407
  var axios = __webpack_require__("bc3a");
92408
92408
  var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
92409
92409
 
92410
- // CONCATENATED MODULE: ./src/assets/script/shortcuts.js
92411
-
92412
-
92413
-
92414
- var SHORTCUTS_CONFIG = {};
92415
- var SHORTCUTS_EVENT = {
92416
- 'ctrl+u': function ctrlU() {
92417
- window.$app.navigateTo('/cashier');
92418
- },
92419
- 'ctrl+i': function ctrlI() {
92420
- window.$app.navigateTo('/orderList');
92421
- },
92422
- 'ctrl+o': function ctrlO() {
92423
- window.$app.navigateTo('/afterSale');
92424
- },
92425
- 'ctrl+p': function ctrlP() {
92426
- window.$app.navigateTo('/handOver');
92427
- },
92428
- 'ctrl+g': function ctrlG() {
92429
- window.$app.navigateTo('/service');
92430
- },
92431
- 'ctrl+e': function ctrlE() {
92432
- window.$app.navigateTo('/orderList/filter/1');
92433
- }
92434
- };
92435
- var dictionary = {
92436
- '~': '`',
92437
- '!': '1',
92438
- '@': '2',
92439
- '#': '3',
92440
- '$': '4',
92441
- '%': '5',
92442
- '^': '6',
92443
- '&': '7',
92444
- '*': '8',
92445
- '(': '9',
92446
- ')': '0',
92447
- '_': '-',
92448
- '+': '=',
92449
- '{': '[',
92450
- '}': ']',
92451
- ':': ';',
92452
- '"': "'",
92453
- '<': ',',
92454
- '>': '.',
92455
- '?': '/',
92456
- ' ': 'space',
92457
- 'arrowup': 'up',
92458
- 'arrowdown': 'down',
92459
- 'arrowleft': 'left',
92460
- 'arrowright': 'right'
92461
- };
92462
- document.addEventListener('keydown', function (e) {
92463
- if (!e.key) return;
92464
-
92465
- switch (e.key) {
92466
- case 'Shift':
92467
- SHORTCUTS.shift = true;
92468
- break;
92469
-
92470
- case 'Control':
92471
- SHORTCUTS.ctrl = true;
92472
- break;
92473
-
92474
- case 'Alt':
92475
- SHORTCUTS.alt = true;
92476
- break;
92477
-
92478
- default:
92479
- SHORTCUTS.keymap(e.key.toLowerCase(), e);
92480
- }
92481
- });
92482
- document.addEventListener('keyup', function (e) {
92483
- switch (e.key) {
92484
- case 'Shift':
92485
- SHORTCUTS.shift = false;
92486
- break;
92487
-
92488
- case 'Control':
92489
- SHORTCUTS.ctrl = false;
92490
- break;
92491
-
92492
- case 'Alt':
92493
- SHORTCUTS.alt = false;
92494
- break;
92495
- }
92496
- });
92497
- var SHORTCUTS = {
92498
- config: function config(_config) {
92499
- for (var i in _config) {
92500
- SHORTCUTS_CONFIG[i] = _config[i];
92501
- }
92502
-
92503
- return SHORTCUTS;
92504
- },
92505
- listener: function listener(key, fun) {
92506
- (_typeof(key) != 'object' ? [key] : key).forEach(function (item) {
92507
- SHORTCUTS_EVENT[item] = fun;
92508
- });
92509
- return SHORTCUTS;
92510
- },
92511
- stop: function stop(key) {
92512
- (_typeof(key) != 'object' ? [key] : key).forEach(function (item) {
92513
- delete SHORTCUTS_EVENT[item];
92514
- });
92515
- return SHORTCUTS;
92516
- },
92517
- keymap: function keymap(key, e) {
92518
- key = (this.ctrl ? 'ctrl+' : '') + (this.shift ? 'shift+' : '') + (this.alt ? 'alt+' : '') + (dictionary[key] || key);
92519
-
92520
- if (SHORTCUTS_EVENT[key]) {
92521
- e && e.preventDefault();
92522
- SHORTCUTS_EVENT[key]({
92523
- key: key
92524
- });
92525
- }
92526
-
92527
- return SHORTCUTS;
92528
- }
92529
- };
92530
- /* harmony default export */ var shortcuts = (SHORTCUTS);
92531
92410
  // CONCATENATED MODULE: ./src/assets/script/global.js
92532
92411
 
92533
92412
 
@@ -92539,7 +92418,6 @@ var SHORTCUTS = {
92539
92418
 
92540
92419
 
92541
92420
 
92542
-
92543
92421
  Date.prototype.format = function () {
92544
92422
  var fmt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'yyyy-MM-dd hh:mm:ss';
92545
92423
  var o = {
@@ -92648,7 +92526,7 @@ function global_install(Vue, config) {
92648
92526
  config.request.log && console.log('@return', data);
92649
92527
 
92650
92528
  try {
92651
- if (config.response(data, axios_default.a.requestQueue) !== false) {
92529
+ if (config.request.response(data, axios_default.a.requestQueue) !== false) {
92652
92530
  if (data.code == 200) {
92653
92531
  // 请求成功
92654
92532
  opt.success && opt.success(data.obj, data.message);
@@ -92716,135 +92594,144 @@ function global_install(Vue, config) {
92716
92594
  axios_default.a.requestQueue[index] = request;
92717
92595
  return request;
92718
92596
  };
92719
- /**
92720
- * 函数防抖
92721
- * @param {Function} fun [要执行的方法]
92722
- * @param {Number} timer [间隔时间]
92723
- * @param {Booleans} immediate [是否立即执行]
92724
- * @return {Function} [设置防抖后方法]
92725
- **/
92726
-
92727
92597
 
92728
- Vue.prototype.debounce = function (fun) {
92729
- var timer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
92730
- var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
92731
- var timeout, args, context, timestamp, result;
92598
+ Vue.prototype.parsePixel = function (n) {
92599
+ if (!n) return 0;
92732
92600
 
92733
- var later = function later() {
92734
- var last = new Date().getTime() - timestamp;
92601
+ if (parseInt(n) == n) {
92602
+ return n + 'px';
92603
+ } else {
92604
+ return n;
92605
+ }
92606
+ };
92607
+ }
92608
+ // CONCATENATED MODULE: ./src/assets/script/shortcuts.js
92735
92609
 
92736
- if (last < timer && last >= 0) {
92737
- timeout = setTimeout(later, timer - last);
92738
- } else {
92739
- timeout = null;
92740
92610
 
92741
- if (!immediate) {
92742
- result = fun.apply(context, args);
92743
- if (!timeout) context = args = null;
92744
- }
92745
- }
92746
- };
92747
92611
 
92748
- return function () {
92749
- context = this;
92750
- args = arguments;
92751
- timestamp = new Date().getTime();
92752
- var callNow = immediate !== false && !timeout;
92753
- if (!timeout) timeout = setTimeout(later, timer);
92754
-
92755
- if (callNow) {
92756
- result = fun.apply(context, args);
92757
- context = args = null;
92758
- }
92612
+ var SHORTCUTS_CONFIG = {};
92613
+ var SHORTCUTS_EVENT = {
92614
+ 'ctrl+u': function ctrlU() {
92615
+ window.$app.navigateTo('/cashier');
92616
+ },
92617
+ 'ctrl+i': function ctrlI() {
92618
+ window.$app.navigateTo('/orderList');
92619
+ },
92620
+ 'ctrl+o': function ctrlO() {
92621
+ window.$app.navigateTo('/afterSale');
92622
+ },
92623
+ 'ctrl+p': function ctrlP() {
92624
+ window.$app.navigateTo('/handOver');
92625
+ },
92626
+ 'ctrl+g': function ctrlG() {
92627
+ window.$app.navigateTo('/service');
92628
+ },
92629
+ 'ctrl+e': function ctrlE() {
92630
+ window.$app.navigateTo('/orderList/filter/1');
92631
+ }
92632
+ };
92633
+ var dictionary = {
92634
+ '~': '`',
92635
+ '!': '1',
92636
+ '@': '2',
92637
+ '#': '3',
92638
+ '$': '4',
92639
+ '%': '5',
92640
+ '^': '6',
92641
+ '&': '7',
92642
+ '*': '8',
92643
+ '(': '9',
92644
+ ')': '0',
92645
+ '_': '-',
92646
+ '+': '=',
92647
+ '{': '[',
92648
+ '}': ']',
92649
+ ':': ';',
92650
+ '"': "'",
92651
+ '<': ',',
92652
+ '>': '.',
92653
+ '?': '/',
92654
+ ' ': 'space',
92655
+ 'arrowup': 'up',
92656
+ 'arrowdown': 'down',
92657
+ 'arrowleft': 'left',
92658
+ 'arrowright': 'right'
92659
+ };
92660
+ document.addEventListener('keydown', function (e) {
92661
+ if (!e.key) return;
92759
92662
 
92760
- return result;
92761
- };
92762
- };
92763
- /**
92764
- * 函数节流
92765
- * @param {Function} fun [执行的方法]
92766
- * @param {Number} timer [间隔事件]
92767
- * @param {Booleans} leading [是否立即执行一次]
92768
- * @param {Booleabs} trailing [是否执行最后一次延时调用]
92769
- * @return {Function} [设置节流后的方法]
92770
- **/
92663
+ switch (e.key) {
92664
+ case 'Shift':
92665
+ SHORTCUTS.shift = true;
92666
+ break;
92771
92667
 
92668
+ case 'Control':
92669
+ SHORTCUTS.ctrl = true;
92670
+ break;
92772
92671
 
92773
- Vue.prototype.throttle = function (fun) {
92774
- var timer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
92775
- var leading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
92776
- var trailing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
92777
- var context, args, result;
92778
- var timeout = null;
92779
- var previous = 0;
92672
+ case 'Alt':
92673
+ SHORTCUTS.alt = true;
92674
+ break;
92780
92675
 
92781
- var later = function later() {
92782
- previous = !leading ? 0 : new Date().getTime();
92783
- timeout = null;
92784
- result = fun.apply(context, args);
92785
- if (!timeout) context = args = null;
92786
- };
92676
+ default:
92677
+ SHORTCUTS.keymap(e.key.toLowerCase(), e);
92678
+ }
92679
+ });
92680
+ document.addEventListener('keyup', function (e) {
92681
+ switch (e.key) {
92682
+ case 'Shift':
92683
+ SHORTCUTS.shift = false;
92684
+ break;
92787
92685
 
92788
- return function () {
92789
- var now = new Date().getTime();
92790
- if (!previous && !leading) previous = now;
92791
- var remaining = timer - (now - previous);
92792
- context = this;
92793
- args = arguments;
92686
+ case 'Control':
92687
+ SHORTCUTS.ctrl = false;
92688
+ break;
92794
92689
 
92795
- if (remaining <= 0 || remaining > timer) {
92796
- if (timeout) {
92797
- clearTimeout(timeout);
92798
- timeout = null;
92799
- }
92690
+ case 'Alt':
92691
+ SHORTCUTS.alt = false;
92692
+ break;
92693
+ }
92694
+ });
92695
+ var SHORTCUTS = {
92696
+ config: function config(_config) {
92697
+ for (var i in _config) {
92698
+ SHORTCUTS_CONFIG[i] = _config[i];
92699
+ }
92800
92700
 
92801
- previous = now;
92802
- result = fun.apply(context, args);
92803
- if (!timeout) context = args = null;
92804
- } else if (!timeout && !trailing) {
92805
- timeout = setTimeout(later, remaining);
92806
- }
92701
+ return SHORTCUTS;
92702
+ },
92703
+ listener: function listener(key, fun) {
92704
+ (_typeof(key) != 'object' ? [key] : key).forEach(function (item) {
92705
+ SHORTCUTS_EVENT[item] = fun;
92706
+ });
92707
+ return SHORTCUTS;
92708
+ },
92709
+ stop: function stop(key) {
92710
+ (_typeof(key) != 'object' ? [key] : key).forEach(function (item) {
92711
+ delete SHORTCUTS_EVENT[item];
92712
+ });
92713
+ return SHORTCUTS;
92714
+ },
92715
+ keymap: function keymap(key, e) {
92716
+ key = (this.ctrl ? 'ctrl+' : '') + (this.shift ? 'shift+' : '') + (this.alt ? 'alt+' : '') + (dictionary[key] || key);
92807
92717
 
92808
- return result;
92809
- };
92810
- };
92718
+ if (SHORTCUTS_EVENT[key]) {
92719
+ e && e.preventDefault();
92720
+ SHORTCUTS_EVENT[key]({
92721
+ key: key
92722
+ });
92723
+ }
92811
92724
 
92812
- Vue.prototype.cookie = {
92813
- set: function set(name, value, sec) {
92814
- var t = new Date();
92815
- t.setTime(t.getTime() + sec * 1000);
92816
- document.cookie = name + '=' + value + ';expires=' + t + ';path=/';
92817
- },
92818
- get: function get(name) {
92819
- var arr = document.cookie.replace(/\s/g, '').split(";");
92725
+ return SHORTCUTS;
92726
+ }
92727
+ };
92728
+ /* harmony default export */ var shortcuts = (SHORTCUTS);
92729
+ // CONCATENATED MODULE: ./src/components/index.js
92820
92730
 
92821
- for (var i = 0; i < arr.length; i++) {
92822
- var tempArr = arr[i].split("=");
92823
92731
 
92824
- if (tempArr[0] == name) {
92825
- return decodeURIComponent(tempArr[1]);
92826
- }
92827
- }
92828
92732
 
92829
- return '';
92830
- },
92831
- remove: function remove(name) {
92832
- Vue.prototype.cookie.set(name, '', -1);
92833
- }
92834
- };
92835
- Vue.prototype.shortcutKey = shortcuts;
92836
92733
 
92837
- Vue.prototype.parsePixel = function (n) {
92838
- if (!n) return 0;
92839
92734
 
92840
- if (parseInt(n) == n) {
92841
- return n + 'px';
92842
- } else {
92843
- return n;
92844
- }
92845
- };
92846
- }
92847
- // CONCATENATED MODULE: ./src/components/index.js
92848
92735
 
92849
92736
 
92850
92737
 
@@ -92959,7 +92846,124 @@ var components_install = function install(Vue, config) {
92959
92846
  });
92960
92847
  };
92961
92848
 
92962
- /* harmony default export */ var src_components = (components_install);
92849
+ /* harmony default export */ var src_components = ({
92850
+ install: components_install,
92851
+ cryptoJs: crypto_js_default.a,
92852
+ shortcutKey: shortcuts,
92853
+
92854
+ /**
92855
+ * 函数防抖
92856
+ * @param {Function} fun [要执行的方法]
92857
+ * @param {Number} timer [间隔时间]
92858
+ * @param {Booleans} immediate [是否立即执行]
92859
+ * @return {Function} [设置防抖后方法]
92860
+ **/
92861
+ debounce: function debounce(fun) {
92862
+ var timer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
92863
+ var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
92864
+ var timeout, args, context, timestamp, result;
92865
+
92866
+ var later = function later() {
92867
+ var last = new Date().getTime() - timestamp;
92868
+
92869
+ if (last < timer && last >= 0) {
92870
+ timeout = setTimeout(later, timer - last);
92871
+ } else {
92872
+ timeout = null;
92873
+
92874
+ if (!immediate) {
92875
+ result = fun.apply(context, args);
92876
+ if (!timeout) context = args = null;
92877
+ }
92878
+ }
92879
+ };
92880
+
92881
+ return function () {
92882
+ context = this;
92883
+ args = arguments;
92884
+ timestamp = new Date().getTime();
92885
+ var callNow = immediate !== false && !timeout;
92886
+ if (!timeout) timeout = setTimeout(later, timer);
92887
+
92888
+ if (callNow) {
92889
+ result = fun.apply(context, args);
92890
+ context = args = null;
92891
+ }
92892
+
92893
+ return result;
92894
+ };
92895
+ },
92896
+
92897
+ /**
92898
+ * 函数节流
92899
+ * @param {Function} fun [执行的方法]
92900
+ * @param {Number} timer [间隔事件]
92901
+ * @param {Booleans} leading [是否立即执行一次]
92902
+ * @param {Booleabs} trailing [是否执行最后一次延时调用]
92903
+ * @return {Function} [设置节流后的方法]
92904
+ **/
92905
+ throttle: function throttle(fun) {
92906
+ var timer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
92907
+ var leading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
92908
+ var trailing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
92909
+ var context, args, result;
92910
+ var timeout = null;
92911
+ var previous = 0;
92912
+
92913
+ var later = function later() {
92914
+ previous = !leading ? 0 : new Date().getTime();
92915
+ timeout = null;
92916
+ result = fun.apply(context, args);
92917
+ if (!timeout) context = args = null;
92918
+ };
92919
+
92920
+ return function () {
92921
+ var now = new Date().getTime();
92922
+ if (!previous && !leading) previous = now;
92923
+ var remaining = timer - (now - previous);
92924
+ context = this;
92925
+ args = arguments;
92926
+
92927
+ if (remaining <= 0 || remaining > timer) {
92928
+ if (timeout) {
92929
+ clearTimeout(timeout);
92930
+ timeout = null;
92931
+ }
92932
+
92933
+ previous = now;
92934
+ result = fun.apply(context, args);
92935
+ if (!timeout) context = args = null;
92936
+ } else if (!timeout && !trailing) {
92937
+ timeout = setTimeout(later, remaining);
92938
+ }
92939
+
92940
+ return result;
92941
+ };
92942
+ },
92943
+ cookie: {
92944
+ set: function set(name, value, sec) {
92945
+ var t = new Date();
92946
+ t.setTime(t.getTime() + sec * 1000);
92947
+ document.cookie = name + '=' + value + ';expires=' + t + ';path=/';
92948
+ },
92949
+ get: function get(name) {
92950
+ var arr = document.cookie.replace(/\s/g, '').split(";");
92951
+
92952
+ for (var i = 0; i < arr.length; i++) {
92953
+ var tempArr = arr[i].split("=");
92954
+
92955
+ if (tempArr[0] == name) {
92956
+ return decodeURIComponent(tempArr[1]);
92957
+ }
92958
+ }
92959
+
92960
+ return '';
92961
+ },
92962
+ remove: function remove(name) {
92963
+ Vue.prototype.cookie.set(name, '', -1);
92964
+ }
92965
+ }
92966
+ });
92963
92967
  // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
92964
92968
 
92965
92969