eoss-ui 0.6.12 → 0.6.13

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.
Files changed (64) hide show
  1. package/lib/button-group.js +104 -88
  2. package/lib/button.js +104 -88
  3. package/lib/checkbox-group.js +104 -88
  4. package/lib/data-table-form.js +104 -88
  5. package/lib/data-table.js +104 -88
  6. package/lib/date-picker.js +104 -88
  7. package/lib/dialog.js +104 -88
  8. package/lib/eoss-ui.common.js +212 -168
  9. package/lib/flow-group.js +104 -88
  10. package/lib/flow-list.js +104 -88
  11. package/lib/flow.js +104 -88
  12. package/lib/form.js +104 -88
  13. package/lib/handle-user.js +104 -88
  14. package/lib/handler.js +104 -88
  15. package/lib/icon.js +113 -91
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +104 -88
  18. package/lib/input.js +104 -88
  19. package/lib/login.js +104 -88
  20. package/lib/main.js +164 -141
  21. package/lib/nav.js +104 -88
  22. package/lib/page.js +104 -88
  23. package/lib/pagination.js +104 -88
  24. package/lib/player.js +104 -88
  25. package/lib/qr-code.js +104 -88
  26. package/lib/radio-group.js +104 -88
  27. package/lib/retrial-auth.js +104 -88
  28. package/lib/select-ganged.js +104 -88
  29. package/lib/select.js +104 -88
  30. package/lib/selector-panel.js +104 -88
  31. package/lib/selector.js +104 -88
  32. package/lib/sizer.js +104 -88
  33. package/lib/steps.js +104 -88
  34. package/lib/switch.js +104 -88
  35. package/lib/table-form.js +104 -88
  36. package/lib/tabs.js +104 -88
  37. package/lib/theme-chalk/index.css +1 -1
  38. package/lib/theme-chalk/main.css +1 -1
  39. package/lib/theme-chalk/simplicity.css +1 -1
  40. package/lib/tips.js +104 -88
  41. package/lib/tree-group.js +104 -88
  42. package/lib/tree.js +104 -88
  43. package/lib/upload.js +130 -99
  44. package/lib/utils/util.js +104 -88
  45. package/lib/wujie.js +104 -88
  46. package/lib/wxlogin.js +104 -88
  47. package/package.json +1 -1
  48. package/packages/.DS_Store +0 -0
  49. package/packages/dialog/.DS_Store +0 -0
  50. package/packages/icon/src/main.vue +7 -1
  51. package/packages/main/.DS_Store +0 -0
  52. package/packages/main/src/default/index.vue +4 -4
  53. package/packages/main/src/main.vue +16 -10
  54. package/packages/main/src/simplicity/avatar.vue +6 -2
  55. package/packages/main/src/simplicity/index.vue +4 -4
  56. package/packages/main/src/simplicity/message.vue +0 -1
  57. package/packages/theme-chalk/lib/index.css +1 -1
  58. package/packages/theme-chalk/lib/main.css +1 -1
  59. package/packages/theme-chalk/lib/simplicity.css +1 -1
  60. package/packages/theme-chalk/src/simplicity.scss +1 -0
  61. package/packages/upload/src/main.vue +28 -8
  62. package/src/.DS_Store +0 -0
  63. package/src/index.js +1 -1
  64. package/src/utils/util.js +12 -1
package/lib/utils/util.js CHANGED
@@ -472,7 +472,6 @@ var average = function average() {
472
472
 
473
473
  return average;
474
474
  };
475
-
476
475
  /**
477
476
  * browser
478
477
  * @desc:浏览器类型
@@ -487,6 +486,22 @@ var browser = function browser() {
487
486
  }
488
487
  }
489
488
  };
489
+ /**
490
+ * busEmit
491
+ * @desc:发送事件
492
+ * @author huangbo
493
+ * @date 2022年5月7日
494
+ **/
495
+ var busEmit = function busEmit() {
496
+ var vm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this;
497
+ var _ref2 = arguments[1];
498
+ var method = _ref2.method,
499
+ args = _ref2.args;
500
+
501
+ var bus = win.$wujie ? win.$wujie.bus : vm.bus || vm.$root.Bus;
502
+ bus && bus.$emit(method, args);
503
+ window.postMessage({ method: method, query: args }, '*');
504
+ };
490
505
 
491
506
  /**
492
507
  * calculateNetworkDays
@@ -711,9 +726,9 @@ var debounce = function debounce(callback, wait) {
711
726
  * @param {String} [url] - url地址
712
727
  * @param {String,Array} [key] - 参数名
713
728
  **/
714
- var delUrlParam = function delUrlParam(_ref2) {
715
- var url = _ref2.url,
716
- key = _ref2.key;
729
+ var delUrlParam = function delUrlParam(_ref3) {
730
+ var url = _ref3.url,
731
+ key = _ref3.key;
717
732
 
718
733
  var pUrl = '';
719
734
  try {
@@ -839,10 +854,10 @@ var esDecode = function esDecode(value) {
839
854
  * @param {string} [data] - 被加密的字符串
840
855
  * @param {string} [key] - 公钥
841
856
  **/
842
- var esmEncrypt = function esmEncrypt(_ref3) {
843
- var data = _ref3.data,
844
- key = _ref3.key,
845
- mode = _ref3.mode;
857
+ var esmEncrypt = function esmEncrypt(_ref4) {
858
+ var data = _ref4.data,
859
+ key = _ref4.key,
860
+ mode = _ref4.mode;
846
861
 
847
862
  var cipherMode = mode ? mode : 1;
848
863
  if (!new RegExp('^04').test(key)) {
@@ -860,10 +875,10 @@ var esmEncrypt = function esmEncrypt(_ref3) {
860
875
  * @param {string} [data] - 被解密的加密字符串
861
876
  * @param {string} [key] - 私钥
862
877
  **/
863
- var esmDecode = function esmDecode(_ref4) {
864
- var data = _ref4.data,
865
- key = _ref4.key,
866
- mode = _ref4.mode;
878
+ var esmDecode = function esmDecode(_ref5) {
879
+ var data = _ref5.data,
880
+ key = _ref5.key,
881
+ mode = _ref5.mode;
867
882
 
868
883
  var cipherMode = mode ? mode : 1;
869
884
  if (new RegExp('^04').test(key)) {
@@ -880,10 +895,10 @@ var esmDecode = function esmDecode(_ref4) {
880
895
  * @date 2022年5月7日
881
896
  * @param {String/Array} [attrs] - 要排除的属性
882
897
  **/
883
- var exclAttribute = function exclAttribute(_ref5) {
884
- var _ref5$attrs = _ref5.attrs,
885
- attrs = _ref5$attrs === undefined ? 'value' : _ref5$attrs,
886
- data = _ref5.data;
898
+ var exclAttribute = function exclAttribute(_ref6) {
899
+ var _ref6$attrs = _ref6.attrs,
900
+ attrs = _ref6$attrs === undefined ? 'value' : _ref6$attrs,
901
+ data = _ref6.data;
887
902
 
888
903
  var obj = extend(true, {}, data);
889
904
  if (Array.isArray(attrs)) {
@@ -908,14 +923,14 @@ var exclAttribute = function exclAttribute(_ref5) {
908
923
  * @param {name} [string] - 导出文件名
909
924
  * @param {numbers} [boolean] - 序号
910
925
  **/
911
- var exportXls = function exportXls(_ref6) {
912
- var _ref6$thead = _ref6.thead,
913
- thead = _ref6$thead === undefined ? [] : _ref6$thead,
914
- _ref6$data = _ref6.data,
915
- data = _ref6$data === undefined ? [] : _ref6$data,
916
- name = _ref6.name,
917
- numbers = _ref6.numbers,
918
- option = _ref6.option;
926
+ var exportXls = function exportXls(_ref7) {
927
+ var _ref7$thead = _ref7.thead,
928
+ thead = _ref7$thead === undefined ? [] : _ref7$thead,
929
+ _ref7$data = _ref7.data,
930
+ data = _ref7$data === undefined ? [] : _ref7$data,
931
+ name = _ref7.name,
932
+ numbers = _ref7.numbers,
933
+ option = _ref7.option;
919
934
 
920
935
  var tbody = '';
921
936
  var aligns = [];
@@ -964,15 +979,15 @@ var exportXls = function exportXls(_ref6) {
964
979
  var _loop2 = function _loop2(_i5) {
965
980
  tbody += '<tr>';
966
981
 
967
- var _loop3 = function _loop3(_x2) {
982
+ var _loop3 = function _loop3(_x3) {
968
983
  var field = '';
969
- var valueKey = keys[fields[_x2]] && keys[fields[_x2]].valueKey ? keys[fields[_x2]].valueKey : 'value';
970
- var labelKey = keys[fields[_x2]] && keys[fields[_x2]].labelKey ? keys[fields[_x2]].labelKey : 'name';
971
- if (option[fields[_x2]]) {
972
- if (Array.isArray(data[_i5][fields[_x2]])) {
984
+ var valueKey = keys[fields[_x3]] && keys[fields[_x3]].valueKey ? keys[fields[_x3]].valueKey : 'value';
985
+ var labelKey = keys[fields[_x3]] && keys[fields[_x3]].labelKey ? keys[fields[_x3]].labelKey : 'name';
986
+ if (option[fields[_x3]]) {
987
+ if (Array.isArray(data[_i5][fields[_x3]])) {
973
988
  field = [];
974
- data[_i5][fields[_x2]].forEach(function (ele) {
975
- option[fields[_x2]].forEach(function (item) {
989
+ data[_i5][fields[_x3]].forEach(function (ele) {
990
+ option[fields[_x3]].forEach(function (item) {
976
991
  // eslint-disable-next-line eqeqeq
977
992
  if (item[valueKey] == ele) {
978
993
  field.push(item[labelKey]);
@@ -981,10 +996,10 @@ var exportXls = function exportXls(_ref6) {
981
996
  });
982
997
  });
983
998
  field = field.join(' ');
984
- } else if (typeof data[_i5][fields[_x2]] === 'string' && keys[fields[_x2]] && keys[fields[_x2]].multiple) {
999
+ } else if (typeof data[_i5][fields[_x3]] === 'string' && keys[fields[_x3]] && keys[fields[_x3]].multiple) {
985
1000
  field = [];
986
- data[_i5][fields[_x2]].split(',').forEach(function (ele) {
987
- option[fields[_x2]].forEach(function (item) {
1001
+ data[_i5][fields[_x3]].split(',').forEach(function (ele) {
1002
+ option[fields[_x3]].forEach(function (item) {
988
1003
  // eslint-disable-next-line eqeqeq
989
1004
  if (item[valueKey] == ele) {
990
1005
  field.push(item[labelKey]);
@@ -994,32 +1009,32 @@ var exportXls = function exportXls(_ref6) {
994
1009
  });
995
1010
  field = field.join(' ');
996
1011
  } else {
997
- option[fields[_x2]].forEach(function (item) {
1012
+ option[fields[_x3]].forEach(function (item) {
998
1013
  // eslint-disable-next-line eqeqeq
999
- if (item[valueKey] == data[_i5][fields[_x2]]) {
1014
+ if (item[valueKey] == data[_i5][fields[_x3]]) {
1000
1015
  field = item[labelKey];
1001
1016
  return;
1002
1017
  }
1003
1018
  });
1004
1019
  }
1005
- } else if (_typeof(data[_i5][fields[_x2]]) === 'object' && keys[fields[_x2]]) {
1006
- if (Array.isArray(data[_i5][fields[_x2]])) {
1007
- data[_i5][fields[_x2]].forEach(function (item) {
1020
+ } else if (_typeof(data[_i5][fields[_x3]]) === 'object' && keys[fields[_x3]]) {
1021
+ if (Array.isArray(data[_i5][fields[_x3]])) {
1022
+ data[_i5][fields[_x3]].forEach(function (item) {
1008
1023
  field = [];
1009
1024
  field.push({}.toString.call(item) === '[object Object]' ? item[labelKey] : item);
1010
1025
  });
1011
1026
  field = field.join(' ');
1012
1027
  } else {
1013
- field = data[_i5][fields[_x2]][labelKey];
1028
+ field = data[_i5][fields[_x3]][labelKey];
1014
1029
  }
1015
1030
  } else {
1016
- field = data[_i5][fields[_x2]];
1031
+ field = data[_i5][fields[_x3]];
1017
1032
  }
1018
- tbody += '<td align="' + aligns[_x2] + '">' + field + '</td>';
1033
+ tbody += '<td align="' + aligns[_x3] + '">' + field + '</td>';
1019
1034
  };
1020
1035
 
1021
- for (var _x2 in fields) {
1022
- _loop3(_x2);
1036
+ for (var _x3 in fields) {
1037
+ _loop3(_x3);
1023
1038
  }
1024
1039
  tbody += '</tr>';
1025
1040
  };
@@ -1903,11 +1918,11 @@ var hsvTorgb = function hsvTorgb($h, $s, $v) {
1903
1918
  * @param {value} [array] - 需要对比的值的数组集合
1904
1919
  * @param {callback} [function] - 回调函数
1905
1920
  **/
1906
- var identical = function identical(_ref7) {
1907
- var value = _ref7.value,
1908
- callback = _ref7.callback,
1909
- _ref7$msg = _ref7.msg,
1910
- msg = _ref7$msg === undefined ? ['请输入值', '请再次输入', '输入不一致!'] : _ref7$msg;
1921
+ var identical = function identical(_ref8) {
1922
+ var value = _ref8.value,
1923
+ callback = _ref8.callback,
1924
+ _ref8$msg = _ref8.msg,
1925
+ msg = _ref8$msg === undefined ? ['请输入值', '请再次输入', '输入不一致!'] : _ref8$msg;
1911
1926
 
1912
1927
  if (value && value.length > 1) {
1913
1928
  var val = value[0];
@@ -2044,15 +2059,15 @@ var isFunction = function isFunction(obj) {
2044
2059
  * @param {sting} [loginPage] - 第三方登录页面地址
2045
2060
  * @param {boolean} [redirect] - 是否重定向(用于新脚手架)
2046
2061
  **/
2047
- var isLogined = function isLogined(_ref8) {
2048
- var to = _ref8.to,
2049
- from = _ref8.from,
2050
- next = _ref8.next,
2051
- _ref8$exclude = _ref8.exclude,
2052
- exclude = _ref8$exclude === undefined ? [] : _ref8$exclude,
2053
- cookie = _ref8.cookie,
2054
- loginPage = _ref8.loginPage,
2055
- redirect = _ref8.redirect;
2062
+ var isLogined = function isLogined(_ref9) {
2063
+ var to = _ref9.to,
2064
+ from = _ref9.from,
2065
+ next = _ref9.next,
2066
+ _ref9$exclude = _ref9.exclude,
2067
+ exclude = _ref9$exclude === undefined ? [] : _ref9$exclude,
2068
+ cookie = _ref9.cookie,
2069
+ loginPage = _ref9.loginPage,
2070
+ redirect = _ref9.redirect;
2056
2071
 
2057
2072
  if (cookie === undefined) {
2058
2073
  cookie = getParams({ name: 'cookie' });
@@ -2280,9 +2295,9 @@ var isObjectEqual = function isObjectEqual(obj, _obj) {
2280
2295
  * @param {string/array} [url] - 地址
2281
2296
  * @param {boolean} [single] - 是否做js沙箱隔离
2282
2297
  **/
2283
- var jointUrl = function jointUrl(_ref9) {
2284
- var url = _ref9.url,
2285
- reg = _ref9.reg;
2298
+ var jointUrl = function jointUrl(_ref10) {
2299
+ var url = _ref10.url,
2300
+ reg = _ref10.reg;
2286
2301
 
2287
2302
  if (startWith(url, ['https', 'http', 'blob:'], true) || !reg || !reg.length) {
2288
2303
  return url;
@@ -2297,13 +2312,13 @@ var jointUrl = function jointUrl(_ref9) {
2297
2312
  return startWith(url, reg) ? url : reg + url;
2298
2313
  };
2299
2314
 
2300
- var loadJs = function loadJs(_ref10) {
2301
- var url = _ref10.url,
2302
- _ref10$type = _ref10.type,
2303
- type = _ref10$type === undefined ? 'text/javascript' : _ref10$type,
2304
- id = _ref10.id,
2305
- _ref10$single = _ref10.single,
2306
- single = _ref10$single === undefined ? true : _ref10$single;
2315
+ var loadJs = function loadJs(_ref11) {
2316
+ var url = _ref11.url,
2317
+ _ref11$type = _ref11.type,
2318
+ type = _ref11$type === undefined ? 'text/javascript' : _ref11$type,
2319
+ id = _ref11.id,
2320
+ _ref11$single = _ref11.single,
2321
+ single = _ref11$single === undefined ? true : _ref11$single;
2307
2322
 
2308
2323
  return new Promise(function (resolve, reject) {
2309
2324
  var script = document.getElementById(id) || document.createElement('script');
@@ -2438,11 +2453,11 @@ var queryParams = function queryParams(obj) {
2438
2453
  * @param {string} [url] - 消息源的 URI
2439
2454
  * @param {function} [callback] - 回调函数
2440
2455
  **/
2441
- var receiveMessage = function receiveMessage(_ref11) {
2442
- var _ref11$data = _ref11.data,
2443
- data = _ref11$data === undefined ? {} : _ref11$data,
2444
- url = _ref11.url,
2445
- callback = _ref11.callback;
2456
+ var receiveMessage = function receiveMessage(_ref12) {
2457
+ var _ref12$data = _ref12.data,
2458
+ data = _ref12$data === undefined ? {} : _ref12$data,
2459
+ url = _ref12.url,
2460
+ callback = _ref12.callback;
2446
2461
 
2447
2462
  win.addEventListener('message', function (e) {
2448
2463
  if (url !== undefined) {
@@ -2486,9 +2501,9 @@ var removeStorage = function removeStorage(key) {
2486
2501
  * @param {string、number} [data] - 数字或字符串型数字
2487
2502
  * @param {number} [precision] - 需要的小数位数
2488
2503
  **/
2489
- var replenish = function replenish(_ref12) {
2490
- var data = _ref12.data,
2491
- precision = _ref12.precision;
2504
+ var replenish = function replenish(_ref13) {
2505
+ var data = _ref13.data,
2506
+ precision = _ref13.precision;
2492
2507
 
2493
2508
  if (data && precision && precision > 0) {
2494
2509
  var power = Math.pow(10, precision);
@@ -2634,10 +2649,10 @@ var setScale = function setScale() {
2634
2649
  * @param {object} [data] - 数据---其中type必须表示操作类型
2635
2650
  * @param {string} [url] - 指定的消息发送URI地址
2636
2651
  **/
2637
- var sendMessage = function sendMessage(_ref13) {
2638
- var _ref13$data = _ref13.data,
2639
- data = _ref13$data === undefined ? {} : _ref13$data,
2640
- url = _ref13.url;
2652
+ var sendMessage = function sendMessage(_ref14) {
2653
+ var _ref14$data = _ref14.data,
2654
+ data = _ref14$data === undefined ? {} : _ref14$data,
2655
+ url = _ref14.url;
2641
2656
 
2642
2657
  var iframes = document.getElementsByTagName('iframe');
2643
2658
  for (var i = 0; i < iframes.length; i++) {
@@ -2681,10 +2696,10 @@ var setFavicon = function setFavicon(url) {
2681
2696
  * @param {String, Array, Object} [key] - 数据的名称,array类型表示多个key保存同一个value,object类型时对象的属性名称作为key属性值作为value
2682
2697
  * @param {String} [value] - 数据的值
2683
2698
  **/
2684
- var setStorage = function setStorage(_ref14) {
2685
- var type = _ref14.type,
2686
- key = _ref14.key,
2687
- value = _ref14.value;
2699
+ var setStorage = function setStorage(_ref15) {
2700
+ var type = _ref15.type,
2701
+ key = _ref15.key,
2702
+ value = _ref15.value;
2688
2703
 
2689
2704
  if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
2690
2705
  value = JSON.stringify(value);
@@ -2978,10 +2993,10 @@ var upperCase = function upperCase(text) {
2978
2993
  * @param {Object} [url] - url地址
2979
2994
  * @param {Object} [param] - 被转换的对象
2980
2995
  **/
2981
- var urlJoinParams = function urlJoinParams(_ref15) {
2982
- var url = _ref15.url,
2983
- param = _ref15.param,
2984
- timestamp = _ref15.timestamp;
2996
+ var urlJoinParams = function urlJoinParams(_ref16) {
2997
+ var url = _ref16.url,
2998
+ param = _ref16.param,
2999
+ timestamp = _ref16.timestamp;
2985
3000
 
2986
3001
  var arry = decodeURI(url).split('?');
2987
3002
  var times = new Date().getTime();
@@ -3102,6 +3117,7 @@ exports.default = {
3102
3117
  arrUnique: arrUnique,
3103
3118
  average: average,
3104
3119
  browser: browser,
3120
+ busEmit: busEmit,
3105
3121
  calculateNetworkDays: calculateNetworkDays,
3106
3122
  concatenate: concatenate,
3107
3123
  dateAddDays: dateAddDays,