eoss-ui 0.5.49 → 0.5.50

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 (54) hide show
  1. package/lib/button-group.js +59 -44
  2. package/lib/button.js +59 -44
  3. package/lib/checkbox-group.js +59 -44
  4. package/lib/data-table-form.js +59 -44
  5. package/lib/data-table.js +75 -53
  6. package/lib/date-picker.js +59 -44
  7. package/lib/dialog.js +59 -44
  8. package/lib/eoss-ui.common.js +139 -111
  9. package/lib/flow-group.js +59 -44
  10. package/lib/flow-list.js +59 -44
  11. package/lib/flow.js +59 -44
  12. package/lib/form.js +72 -51
  13. package/lib/handle-user.js +59 -44
  14. package/lib/handler.js +59 -44
  15. package/lib/index.js +1 -1
  16. package/lib/input-number.js +59 -44
  17. package/lib/input.js +59 -44
  18. package/lib/login.js +59 -44
  19. package/lib/main.js +74 -59
  20. package/lib/nav.js +59 -44
  21. package/lib/page.js +59 -44
  22. package/lib/player.js +59 -44
  23. package/lib/qr-code.js +59 -44
  24. package/lib/radio-group.js +59 -44
  25. package/lib/retrial-auth.js +59 -44
  26. package/lib/select-ganged.js +59 -44
  27. package/lib/select.js +59 -44
  28. package/lib/selector-panel.js +59 -44
  29. package/lib/selector.js +59 -44
  30. package/lib/sizer.js +59 -44
  31. package/lib/steps.js +59 -44
  32. package/lib/switch.js +59 -44
  33. package/lib/table-form.js +59 -44
  34. package/lib/tabs.js +59 -44
  35. package/lib/theme-chalk/index.css +1 -1
  36. package/lib/theme-chalk/tree.css +1 -1
  37. package/lib/tips.js +59 -44
  38. package/lib/tree-group.js +59 -44
  39. package/lib/tree.js +77 -62
  40. package/lib/upload.js +59 -44
  41. package/lib/utils/util.js +59 -44
  42. package/lib/wujie.js +59 -44
  43. package/lib/wxlogin.js +59 -44
  44. package/package.json +1 -1
  45. package/packages/data-table/src/main.vue +9 -0
  46. package/packages/form/src/main.vue +9 -1
  47. package/packages/main/src/main.vue +1 -1
  48. package/packages/main/src/userinfo.vue +5 -5
  49. package/packages/theme-chalk/lib/index.css +1 -1
  50. package/packages/theme-chalk/lib/tree.css +1 -1
  51. package/packages/theme-chalk/src/tree.scss +7 -1
  52. package/packages/tree/src/main.vue +6 -6
  53. package/src/index.js +1 -1
  54. package/src/utils/util.js +20 -6
package/lib/dialog.js CHANGED
@@ -150,6 +150,7 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
150
150
  * @param {Object} [loading] - loading加载对象
151
151
  * @param {String} [publicKey] - sm2加密公钥
152
152
  * @param {Array} [secret] - 要加密的字段属性名称,默认所有
153
+ * @param {Array} [encodes] - 需要对参数值进行encodeURIComponent编码的参数值名称
153
154
  **/
154
155
  // 请求
155
156
  var pendingRequest = new Map();
@@ -185,7 +186,9 @@ var ajax = function ajax(_ref) {
185
186
  defaults = _ref$defaults === undefined ? false : _ref$defaults,
186
187
  loading = _ref.loading,
187
188
  publicKey = _ref.publicKey,
188
- secret = _ref.secret;
189
+ secret = _ref.secret,
190
+ _ref$encodes = _ref.encodes,
191
+ encodes = _ref$encodes === undefined ? ['cd'] : _ref$encodes;
189
192
 
190
193
  var header = headers || {};
191
194
  if (!method) {
@@ -415,6 +418,17 @@ var ajax = function ajax(_ref) {
415
418
  if (!mix) {
416
419
  if (method === 'get') {
417
420
  data = {};
421
+ // params = qs.stringify(params, {arrayFormat: 'brackets'});
422
+ if (encodes && encodes.length) {
423
+ var other = {};
424
+ for (var i in params) {
425
+ if (encodes.includes(i)) {
426
+ other[i] = encodeURIComponent(params[i]);
427
+ delete params[i];
428
+ }
429
+ }
430
+ url = urlJoinParams({ url: url, param: other });
431
+ }
418
432
  } else {
419
433
  params = {};
420
434
  }
@@ -431,10 +445,10 @@ var ajax = function ajax(_ref) {
431
445
  }
432
446
  });
433
447
  } else {
434
- for (var i in params) {
435
- if (params[i] !== '' && params[i] !== null) {
436
- params[i] = esmEncrypt({
437
- data: params[i],
448
+ for (var _i in params) {
449
+ if (params[_i] !== '' && params[_i] !== null) {
450
+ params[_i] = esmEncrypt({
451
+ data: params[_i],
438
452
  key: publicKey
439
453
  });
440
454
  }
@@ -452,10 +466,10 @@ var ajax = function ajax(_ref) {
452
466
  }
453
467
  });
454
468
  } else {
455
- for (var _i in data) {
456
- if (data[_i] !== '' && data[_i] !== null) {
457
- data[_i] = esmEncrypt({
458
- data: data[_i],
469
+ for (var _i2 in data) {
470
+ if (data[_i2] !== '' && data[_i2] !== null) {
471
+ data[_i2] = esmEncrypt({
472
+ data: data[_i2],
459
473
  key: publicKey
460
474
  });
461
475
  }
@@ -502,10 +516,10 @@ var arrUnique = function arrUnique(data, key) {
502
516
  }
503
517
  } else {
504
518
  var obj = {};
505
- for (var _i2 = 0; _i2 < data.length; _i2++) {
506
- if (!obj[data[_i2][key]]) {
507
- newArr.push(data[_i2]);
508
- obj[data[_i2][key]] = true;
519
+ for (var _i3 = 0; _i3 < data.length; _i3++) {
520
+ if (!obj[data[_i3][key]]) {
521
+ newArr.push(data[_i3]);
522
+ obj[data[_i3][key]] = true;
509
523
  }
510
524
  }
511
525
  }
@@ -984,12 +998,12 @@ var exportXls = function exportXls(_ref6) {
984
998
  }
985
999
  tbody += '</tr>';
986
1000
  }
987
- for (var _i3 in others) {
988
- fields.splice(_i3, 0, others[_i3][0]);
989
- aligns.splice(_i3, 0, others[_i3][1]);
1001
+ for (var _i4 in others) {
1002
+ fields.splice(_i4, 0, others[_i4][0]);
1003
+ aligns.splice(_i4, 0, others[_i4][1]);
990
1004
  }
991
1005
 
992
- var _loop2 = function _loop2(_i4) {
1006
+ var _loop2 = function _loop2(_i5) {
993
1007
  tbody += '<tr>';
994
1008
 
995
1009
  var _loop3 = function _loop3(_x2) {
@@ -997,9 +1011,9 @@ var exportXls = function exportXls(_ref6) {
997
1011
  var valueKey = keys[fields[_x2]] && keys[fields[_x2]].valueKey ? keys[fields[_x2]].valueKey : 'value';
998
1012
  var labelKey = keys[fields[_x2]] && keys[fields[_x2]].labelKey ? keys[fields[_x2]].labelKey : 'name';
999
1013
  if (option[fields[_x2]]) {
1000
- if (Array.isArray(data[_i4][fields[_x2]])) {
1014
+ if (Array.isArray(data[_i5][fields[_x2]])) {
1001
1015
  field = [];
1002
- data[_i4][fields[_x2]].forEach(function (ele) {
1016
+ data[_i5][fields[_x2]].forEach(function (ele) {
1003
1017
  option[fields[_x2]].forEach(function (item) {
1004
1018
  // eslint-disable-next-line eqeqeq
1005
1019
  if (item[valueKey] == ele) {
@@ -1009,9 +1023,9 @@ var exportXls = function exportXls(_ref6) {
1009
1023
  });
1010
1024
  });
1011
1025
  field = field.join(' ');
1012
- } else if (typeof data[_i4][fields[_x2]] === 'string' && keys[fields[_x2]] && keys[fields[_x2]].multiple) {
1026
+ } else if (typeof data[_i5][fields[_x2]] === 'string' && keys[fields[_x2]] && keys[fields[_x2]].multiple) {
1013
1027
  field = [];
1014
- data[_i4][fields[_x2]].split(',').forEach(function (ele) {
1028
+ data[_i5][fields[_x2]].split(',').forEach(function (ele) {
1015
1029
  option[fields[_x2]].forEach(function (item) {
1016
1030
  // eslint-disable-next-line eqeqeq
1017
1031
  if (item[valueKey] == ele) {
@@ -1024,24 +1038,24 @@ var exportXls = function exportXls(_ref6) {
1024
1038
  } else {
1025
1039
  option[fields[_x2]].forEach(function (item) {
1026
1040
  // eslint-disable-next-line eqeqeq
1027
- if (item[valueKey] == data[_i4][fields[_x2]]) {
1041
+ if (item[valueKey] == data[_i5][fields[_x2]]) {
1028
1042
  field = item[labelKey];
1029
1043
  return;
1030
1044
  }
1031
1045
  });
1032
1046
  }
1033
- } else if (_typeof(data[_i4][fields[_x2]]) === 'object' && keys[fields[_x2]]) {
1034
- if (Array.isArray(data[_i4][fields[_x2]])) {
1035
- data[_i4][fields[_x2]].forEach(function (item) {
1047
+ } else if (_typeof(data[_i5][fields[_x2]]) === 'object' && keys[fields[_x2]]) {
1048
+ if (Array.isArray(data[_i5][fields[_x2]])) {
1049
+ data[_i5][fields[_x2]].forEach(function (item) {
1036
1050
  field = [];
1037
1051
  field.push({}.toString.call(item) === '[object Object]' ? item[labelKey] : item);
1038
1052
  });
1039
1053
  field = field.join(' ');
1040
1054
  } else {
1041
- field = data[_i4][fields[_x2]][labelKey];
1055
+ field = data[_i5][fields[_x2]][labelKey];
1042
1056
  }
1043
1057
  } else {
1044
- field = data[_i4][fields[_x2]];
1058
+ field = data[_i5][fields[_x2]];
1045
1059
  }
1046
1060
  tbody += '<td align="' + aligns[_x2] + '">' + field + '</td>';
1047
1061
  };
@@ -1052,8 +1066,8 @@ var exportXls = function exportXls(_ref6) {
1052
1066
  tbody += '</tr>';
1053
1067
  };
1054
1068
 
1055
- for (var _i4 = 0; _i4 < data.length; _i4++) {
1056
- _loop2(_i4);
1069
+ for (var _i5 = 0; _i5 < data.length; _i5++) {
1070
+ _loop2(_i5);
1057
1071
  }
1058
1072
  if (!name) {
1059
1073
  name = 'table_' + new Date().getTime();
@@ -1509,8 +1523,8 @@ var getRgb = function getRgb($color) {
1509
1523
  $color = colorNew;
1510
1524
  }
1511
1525
  // 处理六位的颜色值,转为RGB
1512
- for (var _i5 = 1; _i5 < 7; _i5 += 2) {
1513
- rgb.push(parseInt('0x' + $color.slice(_i5, _i5 + 2), 16));
1526
+ for (var _i6 = 1; _i6 < 7; _i6 += 2) {
1527
+ rgb.push(parseInt('0x' + $color.slice(_i6, _i6 + 2), 16));
1514
1528
  }
1515
1529
  } else {
1516
1530
  rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
@@ -2599,22 +2613,22 @@ var setStorage = function setStorage(_ref14) {
2599
2613
  localStorage.setItem(key[i], value);
2600
2614
  }
2601
2615
  } else {
2602
- for (var _i6 in key) {
2603
- var val = _typeof(key[_i6]) === 'object' ? JSON.stringify(key[_i6]) : key[_i6];
2604
- localStorage.setItem(_i6, val);
2616
+ for (var _i7 in key) {
2617
+ var val = _typeof(key[_i7]) === 'object' ? JSON.stringify(key[_i7]) : key[_i7];
2618
+ localStorage.setItem(_i7, val);
2605
2619
  }
2606
2620
  }
2607
2621
  } else {
2608
2622
  if (typeof key === 'string') {
2609
2623
  sessionStorage.setItem(key, value);
2610
2624
  } else if (Array.isArray(key)) {
2611
- for (var _i7 in key) {
2612
- sessionStorage.setItem(key[_i7], value);
2625
+ for (var _i8 in key) {
2626
+ sessionStorage.setItem(key[_i8], value);
2613
2627
  }
2614
2628
  } else {
2615
- for (var _i8 in key) {
2616
- var _val = _typeof(key[_i8]) === 'object' ? JSON.stringify(key[_i8]) : key[_i8];
2617
- sessionStorage.setItem(_i8, _val);
2629
+ for (var _i9 in key) {
2630
+ var _val = _typeof(key[_i9]) === 'object' ? JSON.stringify(key[_i9]) : key[_i9];
2631
+ sessionStorage.setItem(_i9, _val);
2618
2632
  }
2619
2633
  }
2620
2634
  }
@@ -2832,17 +2846,18 @@ var toFunction = function toFunction(str) {
2832
2846
  * @date 2022年5月7日
2833
2847
  * @param {string} [$color] - 颜色值
2834
2848
  **/
2835
- var updateTheme = function updateTheme($color, send) {
2836
- $color = $color ? $color : '#409eff';
2849
+ var updateTheme = function updateTheme(color, send) {
2850
+ color = color ? color : '#409eff';
2837
2851
  if (send === undefined) {
2838
2852
  send = true;
2839
2853
  }
2840
- document.documentElement.style.setProperty('--theme-primary', $color);
2854
+ localStorage.setItem('theme', color);
2855
+ document.documentElement.style.setProperty('--theme-primary', color);
2841
2856
  for (var i = 1; i < 11; i++) {
2842
2857
  if (i === 6) {
2843
- document.documentElement.style.setProperty('--theme-primary-light-' + i, $color);
2858
+ document.documentElement.style.setProperty('--theme-primary-light-' + i, color);
2844
2859
  } else {
2845
- var light = getColor($color, i);
2860
+ var light = getColor(color, i);
2846
2861
  document.documentElement.style.setProperty('--theme-primary-light-' + i, light);
2847
2862
  }
2848
2863
  }