eoss-ui 0.7.19 → 0.7.21

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 (58) hide show
  1. package/lib/button-group.js +361 -123
  2. package/lib/button.js +210 -119
  3. package/lib/calogin.js +210 -119
  4. package/lib/checkbox-group.js +210 -119
  5. package/lib/data-table-form.js +210 -119
  6. package/lib/data-table.js +210 -119
  7. package/lib/date-picker.js +210 -119
  8. package/lib/dialog.js +210 -119
  9. package/lib/eoss-ui.common.js +803 -286
  10. package/lib/flow-group.js +210 -119
  11. package/lib/flow-list.js +210 -119
  12. package/lib/flow.js +626 -255
  13. package/lib/form.js +210 -119
  14. package/lib/handle-user.js +210 -119
  15. package/lib/handler.js +212 -122
  16. package/lib/icon.js +210 -119
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +210 -119
  19. package/lib/input.js +210 -119
  20. package/lib/login.js +210 -119
  21. package/lib/main.js +210 -119
  22. package/lib/nav.js +210 -119
  23. package/lib/page.js +210 -119
  24. package/lib/pagination.js +210 -119
  25. package/lib/player.js +210 -119
  26. package/lib/qr-code.js +210 -119
  27. package/lib/radio-group.js +210 -119
  28. package/lib/retrial-auth.js +210 -119
  29. package/lib/select-ganged.js +210 -119
  30. package/lib/select.js +210 -119
  31. package/lib/selector-panel.js +210 -119
  32. package/lib/selector.js +210 -119
  33. package/lib/sizer.js +210 -119
  34. package/lib/steps.js +210 -119
  35. package/lib/switch.js +210 -119
  36. package/lib/table-form.js +210 -119
  37. package/lib/tabs.js +210 -119
  38. package/lib/theme-chalk/flow.css +1 -1
  39. package/lib/theme-chalk/index.css +1 -1
  40. package/lib/tips.js +210 -119
  41. package/lib/tree-group.js +210 -119
  42. package/lib/tree.js +213 -122
  43. package/lib/upload.js +210 -119
  44. package/lib/utils/util.js +210 -119
  45. package/lib/wujie.js +210 -119
  46. package/lib/wxlogin.js +210 -119
  47. package/package.json +2 -2
  48. package/packages/button-group/src/main.vue +49 -1
  49. package/packages/flow/src/component/taskUnionExamine.vue +95 -6
  50. package/packages/flow/src/main.vue +81 -40
  51. package/packages/flow/src/processForm.vue +106 -27
  52. package/packages/handler/src/main.vue +0 -1
  53. package/packages/theme-chalk/lib/flow.css +1 -1
  54. package/packages/theme-chalk/lib/index.css +1 -1
  55. package/packages/theme-chalk/src/flow.scss +4 -1
  56. package/packages/tree/src/main.vue +1 -1
  57. package/src/index.js +1 -1
  58. package/src/utils/util.js +192 -145
@@ -267,7 +267,10 @@
267
267
  }
268
268
  .custom-limit-time .el-input.el-input--suffix{
269
269
  width: calc(100% + 40px) !important;
270
- }
270
+ }
271
+ .task-union-examine .custom-limit-time .el-input.el-input--suffix{
272
+ width: unset !important;
273
+ }
271
274
  .custom-limit-time .el-input-group__append{
272
275
  background-color: $--color-primary !important;
273
276
  color: #fff !important;
@@ -408,7 +408,7 @@ export default {
408
408
  },
409
409
  //获取树节点
410
410
  getTreeDatas(param) {
411
- let params = util.extend({}, this.param, this.where, param || {});
411
+ let params = util.extend({}, this.param, param || {}, this.where);
412
412
  if (!this.url || !this.isRemote) return;
413
413
  this.loading = true;
414
414
  util
package/src/index.js CHANGED
@@ -125,7 +125,7 @@ if (typeof window !== 'undefined' && window.Vue) {
125
125
  }
126
126
 
127
127
  export default {
128
- version: '0.7.19',
128
+ version: '0.7.21',
129
129
  install,
130
130
  Button,
131
131
  ButtonGroup,
package/src/utils/util.js CHANGED
@@ -75,6 +75,7 @@ const ajax = function ({
75
75
  formatConfig = {},
76
76
  mix = false,
77
77
  defaults = false,
78
+ withCredentials = true,
78
79
  loading,
79
80
  publicKey,
80
81
  secret,
@@ -127,47 +128,18 @@ const ajax = function ({
127
128
  response.headers.authorization &&
128
129
  response.headers.authorization !== getStorage('token')
129
130
  ) {
130
- if (
131
- localStorage.getItem('storage') === 'localStorage' ||
132
- localStorage.getItem('token') ||
133
- localStorage.getItem('Authorization')
134
- ) {
135
- localStorage.setItem('token', response.headers.authorization);
136
- localStorage.setItem('Authorization', response.headers.authorization);
137
- } else {
138
- sessionStorage.setItem('token', response.headers.authorization);
139
- sessionStorage.setItem(
140
- 'Authorization',
141
- response.headers.authorization
142
- );
143
- }
131
+ setStorage({
132
+ key: ['token', 'Authorization'],
133
+ value: response.headers.authorization
134
+ });
144
135
  }
145
- if (
146
- (response.headers.ssId ||
147
- response.headers.Ssid ||
148
- response.headers.ssid) &&
149
- (response.headers.ssId ||
150
- response.headers.SsId ||
151
- response.headers.ssid) !== getStorage('ssId')
152
- ) {
153
- if (
154
- localStorage.getItem('storage') === 'localStorage' ||
155
- localStorage.getItem('ssId')
156
- ) {
157
- localStorage.setItem(
158
- 'ssId',
159
- response.headers.ssId ||
160
- response.headers.SsId ||
161
- response.headers.ssid
162
- );
163
- } else {
164
- sessionStorage.setItem(
165
- 'ssId',
166
- response.headers.ssId ||
167
- response.headers.SsId ||
168
- response.headers.ssid
169
- );
170
- }
136
+ const ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
137
+
138
+ if (ssId && ssId !== getStorage('ssId')) {
139
+ setStorage({
140
+ key: 'ssId',
141
+ value: ssId
142
+ });
171
143
  }
172
144
  if (response.status === 200) {
173
145
  responses(response.data);
@@ -1759,45 +1731,6 @@ const getSecond = function (datetime) {
1759
1731
  return datetimeObj.getSeconds();
1760
1732
  };
1761
1733
 
1762
- /**
1763
- * getStorage
1764
- * @desc:获取本地储存数据
1765
- * @author huangbo
1766
- * @date 2022年5月7日
1767
- * @param {String} [key] - 获取的名称
1768
- **/
1769
- const getStorage = function (key) {
1770
- if (key) {
1771
- let res =
1772
- sessionStorage.getItem(key) || localStorage.getItem(key) || win[key];
1773
- if (key === 'host' && !res) {
1774
- return win.location.origin;
1775
- }
1776
- return res;
1777
- }
1778
- let defaults = {};
1779
- const token =
1780
- sessionStorage.getItem('token') ||
1781
- localStorage.getItem('token') ||
1782
- win.token;
1783
- const ssId =
1784
- sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || win.ssId;
1785
- const deviceUnique =
1786
- sessionStorage.getItem('deviceUnique') ||
1787
- localStorage.getItem('deviceUnique') ||
1788
- win.deviceUnique;
1789
- if (token) {
1790
- defaults.Authorization = token;
1791
- }
1792
- if (ssId) {
1793
- defaults.ssId = ssId;
1794
- }
1795
- if (deviceUnique) {
1796
- defaults.deviceUnique = deviceUnique;
1797
- }
1798
- return defaults;
1799
- };
1800
-
1801
1734
  /**
1802
1735
  * getStyle
1803
1736
  * @desc:获取元素样式(含非行内样式)
@@ -2319,9 +2252,7 @@ const isLogined = async function ({
2319
2252
  let { results } = res;
2320
2253
  switch (results.statusCode) {
2321
2254
  case 0:
2322
- const storage = getStorage('storage');
2323
2255
  setStorage({
2324
- type: storage,
2325
2256
  key: {
2326
2257
  ssId: results.ssId,
2327
2258
  token: results.token,
@@ -2721,28 +2652,6 @@ const receiveMessage = function ({ data = {}, url, callback }) {
2721
2652
  });
2722
2653
  };
2723
2654
 
2724
- /**
2725
- * removeStorage
2726
- * @desc:删除本地储存数据
2727
- * @author huangbo
2728
- * @date 2022年5月7日
2729
- * @param {String, Array} [key] - 获取的名称
2730
- **/
2731
- const removeStorage = function (key) {
2732
- if (Array.isArray(key)) {
2733
- for (let i = 0; i < key.length; i++) {
2734
- sessionStorage.removeItem(key[i]);
2735
- localStorage.removeItem(key[i]);
2736
- }
2737
- } else if (key) {
2738
- sessionStorage.removeItem(key);
2739
- localStorage.removeItem(key);
2740
- } else {
2741
- sessionStorage.clear();
2742
- localStorage.clear();
2743
- }
2744
- };
2745
-
2746
2655
  /**
2747
2656
  * replenish
2748
2657
  * @desc:补全小数位数
@@ -3091,48 +3000,6 @@ const setFavicon = function (url) {
3091
3000
  }
3092
3001
  };
3093
3002
 
3094
- /**
3095
- * setStorage
3096
- * @desc:设置本地储存数据
3097
- * @author huangbo
3098
- * @date 2022年5月7日
3099
- * @param {String} [type] - 储存类型
3100
- * @param {String, Array, Object} [key] - 数据的名称,array类型表示多个key保存同一个value,object类型时对象的属性名称作为key属性值作为value
3101
- * @param {String} [value] - 数据的值
3102
- **/
3103
- const setStorage = function ({ type, key, value }) {
3104
- if (value && typeof value === 'object') {
3105
- value = JSON.stringify(value);
3106
- }
3107
- if (type === 'localStorage') {
3108
- if (typeof key === 'string') {
3109
- localStorage.setItem(key, value);
3110
- } else if (Array.isArray(key)) {
3111
- for (let i in key) {
3112
- localStorage.setItem(key[i], value);
3113
- }
3114
- } else {
3115
- for (let i in key) {
3116
- let val = typeof key[i] === 'object' ? JSON.stringify(key[i]) : key[i];
3117
- localStorage.setItem(i, val);
3118
- }
3119
- }
3120
- } else {
3121
- if (typeof key === 'string') {
3122
- sessionStorage.setItem(key, value);
3123
- } else if (Array.isArray(key)) {
3124
- for (let i in key) {
3125
- sessionStorage.setItem(key[i], value);
3126
- }
3127
- } else {
3128
- for (let i in key) {
3129
- let val = typeof key[i] === 'object' ? JSON.stringify(key[i]) : key[i];
3130
- sessionStorage.setItem(i, val);
3131
- }
3132
- }
3133
- }
3134
- };
3135
-
3136
3003
  /**
3137
3004
  * socket
3138
3005
  * @desc:webSocket
@@ -3556,6 +3423,183 @@ const watermark = function (option) {
3556
3423
  };
3557
3424
  };
3558
3425
 
3426
+ /**
3427
+ * setStorage
3428
+ * @desc:设置本地储存数据
3429
+ * @author huangbo
3430
+ * @date 2022年5月7日
3431
+ * @param {String} [type] - 储存类型
3432
+ * @param {String, Array, Object} [key] - 数据的名称,array类型表示多个key保存同一个value,object类型时对象的属性名称作为key属性值作为value
3433
+ * @param {String} [value] - 数据的值
3434
+ **/
3435
+ const setStorage = function ({ type, key, value }) {
3436
+ type = type || getStorage('storage');
3437
+
3438
+ if (value && typeof value === 'object') {
3439
+ value = JSON.stringify(value);
3440
+ }
3441
+ if (type === 'localStorage') {
3442
+ if (typeof key === 'string') {
3443
+ localStorage.setItem(key, value);
3444
+ if (key === 'token') {
3445
+ setCookie('token', value);
3446
+ }
3447
+ } else if (Array.isArray(key)) {
3448
+ for (let i in key) {
3449
+ localStorage.setItem(key[i], value);
3450
+ if (key[i] === 'token') {
3451
+ setCookie('token', value);
3452
+ }
3453
+ }
3454
+ } else {
3455
+ for (let i in key) {
3456
+ let val = typeof key[i] === 'object' ? JSON.stringify(key[i]) : key[i];
3457
+ localStorage.setItem(i, val);
3458
+ if (i === 'token') {
3459
+ setCookie('token', val);
3460
+ }
3461
+ }
3462
+ }
3463
+ } else {
3464
+ if (typeof key === 'string') {
3465
+ sessionStorage.setItem(key, value);
3466
+ if (key === 'token') {
3467
+ setCookie('token', value);
3468
+ }
3469
+ } else if (Array.isArray(key)) {
3470
+ for (let i in key) {
3471
+ sessionStorage.setItem(key[i], value);
3472
+ if (key[i] === 'token') {
3473
+ setCookie('token', value);
3474
+ }
3475
+ }
3476
+ } else {
3477
+ for (let i in key) {
3478
+ let val = typeof key[i] === 'object' ? JSON.stringify(key[i]) : key[i];
3479
+ sessionStorage.setItem(i, val);
3480
+ if (i === 'token') {
3481
+ setCookie('token', val);
3482
+ }
3483
+ }
3484
+ }
3485
+ }
3486
+ };
3487
+
3488
+ /**
3489
+ * getStorage
3490
+ * @desc:获取本地储存数据
3491
+ * @author huangbo
3492
+ * @date 2022年5月7日
3493
+ * @param {String} [key] - 获取的名称
3494
+ **/
3495
+ const getStorage = function (key) {
3496
+ if (key) {
3497
+ let res =
3498
+ sessionStorage.getItem(key) || localStorage.getItem(key) || win[key];
3499
+ if (key === 'host' && !res) {
3500
+ return win.location.origin;
3501
+ }
3502
+ return res;
3503
+ }
3504
+ let defaults = {};
3505
+ const token =
3506
+ sessionStorage.getItem('token') ||
3507
+ localStorage.getItem('token') || getCookie('token') ||
3508
+ win.token;
3509
+ const ssId =
3510
+ sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId') || win.ssId;
3511
+
3512
+ const deviceUnique =
3513
+ sessionStorage.getItem('deviceUnique') ||
3514
+ localStorage.getItem('deviceUnique') || getCookie('deviceUnique') ||
3515
+ win.deviceUnique;
3516
+ if (token) {
3517
+ defaults.Authorization = token;
3518
+ }
3519
+ if (ssId) {
3520
+ defaults.ssId = ssId;
3521
+ }
3522
+ if (deviceUnique) {
3523
+ defaults.deviceUnique = deviceUnique;
3524
+ }
3525
+ return defaults;
3526
+ };
3527
+
3528
+ /**
3529
+ * removeStorage
3530
+ * @desc:删除本地储存数据
3531
+ * @author huangbo
3532
+ * @date 2022年5月7日
3533
+ * @param {String, Array} [key] - 获取的名称
3534
+ **/
3535
+ const removeStorage = function (key) {
3536
+ if (Array.isArray(key)) {
3537
+ for (let i = 0; i < key.length; i++) {
3538
+ sessionStorage.removeItem(key[i]);
3539
+ localStorage.removeItem(key[i]);
3540
+ if (key[i] === 'token') {
3541
+ removeCookie('token');
3542
+ }
3543
+ }
3544
+ } else if (key) {
3545
+ sessionStorage.removeItem(key);
3546
+ localStorage.removeItem(key);
3547
+ if (key === 'token') {
3548
+ removeCookie('token');
3549
+ }
3550
+ } else {
3551
+ sessionStorage.clear();
3552
+ localStorage.clear();
3553
+ removeCookie('token');
3554
+ }
3555
+ };
3556
+
3557
+ /**
3558
+ * setCookie
3559
+ * @desc 设置cookie
3560
+ * @author huangbo
3561
+ * @param {string} [name] cookie名称
3562
+ * @return {string} [value] cookie值
3563
+ **/
3564
+ const setCookie = function (name, value) {
3565
+ // 不设置 expires 或 max-age,默认为会话 Cookie
3566
+ document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}; path=/`;
3567
+ };
3568
+
3569
+ /**
3570
+ * getCookie
3571
+ * @desc 获取cookie中指定名称的值
3572
+ * @author huangbo
3573
+ * @param {string} [name] cookie名称
3574
+ **/
3575
+ const getCookie = function (name) {
3576
+ const cookies = document.cookie.split(';');
3577
+ for (const cookie of cookies) {
3578
+ const [cookieName, cookieValue] = cookie.trim().split('=');
3579
+ if (decodeURIComponent(cookieName) === name) {
3580
+ return decodeURIComponent(cookieValue);
3581
+ }
3582
+ }
3583
+ return null;
3584
+ };
3585
+
3586
+ /**
3587
+ * removeCookie
3588
+ * @desc:删除cookie
3589
+ * @author huangbo
3590
+ * @date 2022年5月7日
3591
+ * @param {String, Array} [key] - 获取的名称
3592
+ **/
3593
+ const removeCookie = function (key) {
3594
+ if (Array.isArray(key)) {
3595
+ for (let i = 0; i < key.length; i++) {
3596
+ document.cookie = `${encodeURIComponent(key[i])}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
3597
+ }
3598
+ } else {
3599
+ document.cookie = `${encodeURIComponent(key)}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
3600
+ }
3601
+ };
3602
+
3559
3603
  export default {
3560
3604
  ajax,
3561
3605
  ajaxStream,
@@ -3582,6 +3626,7 @@ export default {
3582
3626
  formatDate,
3583
3627
  getCurrentDate,
3584
3628
  getCurrentDateTime,
3629
+ getCookie,
3585
3630
  getHour,
3586
3631
  getMyWinTop,
3587
3632
  getWeekNumber,
@@ -3619,6 +3664,7 @@ export default {
3619
3664
  mixColor,
3620
3665
  overbrim,
3621
3666
  queryParams,
3667
+ removeCookie,
3622
3668
  receiveMessage,
3623
3669
  removeStorage,
3624
3670
  replenish,
@@ -3626,6 +3672,7 @@ export default {
3626
3672
  rgbToHsv,
3627
3673
  rmbToCapital,
3628
3674
  sendMessage,
3675
+ setCookie,
3629
3676
  setFavicon,
3630
3677
  setScale,
3631
3678
  setStorage,