eoss-ui 0.5.73 → 0.5.75

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 (75) hide show
  1. package/lib/button-group.js +115 -29
  2. package/lib/button.js +115 -29
  3. package/lib/checkbox-group.js +115 -29
  4. package/lib/clients.js +16 -7
  5. package/lib/data-table-form.js +115 -29
  6. package/lib/data-table.js +130 -35
  7. package/lib/date-picker.js +115 -29
  8. package/lib/dialog.js +115 -29
  9. package/lib/eoss-ui.common.js +345 -133
  10. package/lib/flow-group.js +115 -29
  11. package/lib/flow-list.js +115 -29
  12. package/lib/flow.js +115 -29
  13. package/lib/form.js +115 -29
  14. package/lib/handle-user.js +115 -29
  15. package/lib/handler.js +115 -29
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +114 -28
  18. package/lib/input.js +131 -35
  19. package/lib/login.js +147 -40
  20. package/lib/main.js +197 -51
  21. package/lib/nav.js +163 -52
  22. package/lib/page.js +115 -29
  23. package/lib/player.js +115 -29
  24. package/lib/qr-code.js +115 -29
  25. package/lib/radio-group.js +115 -29
  26. package/lib/retrial-auth.js +115 -29
  27. package/lib/select-ganged.js +115 -29
  28. package/lib/select.js +130 -34
  29. package/lib/selector-panel.js +115 -29
  30. package/lib/selector.js +115 -29
  31. package/lib/sizer.js +115 -29
  32. package/lib/steps.js +115 -29
  33. package/lib/switch.js +114 -28
  34. package/lib/table-form.js +115 -29
  35. package/lib/tabs.js +115 -29
  36. package/lib/theme-chalk/base.css +1 -1
  37. package/lib/theme-chalk/index.css +1 -1
  38. package/lib/theme-chalk/login.css +1 -1
  39. package/lib/theme-chalk/main.css +1 -1
  40. package/lib/theme-chalk/menu.css +1 -1
  41. package/lib/theme-chalk/nav.css +1 -1
  42. package/lib/theme-chalk/sizer.css +1 -1
  43. package/lib/theme-chalk/upload.css +1 -1
  44. package/lib/tips.js +115 -29
  45. package/lib/tree-group.js +115 -29
  46. package/lib/tree.js +115 -29
  47. package/lib/upload.js +115 -29
  48. package/lib/utils/util.js +98 -22
  49. package/lib/utils/webSocket.js +16 -6
  50. package/lib/wujie.js +115 -29
  51. package/lib/wxlogin.js +114 -28
  52. package/package.json +2 -2
  53. package/packages/clients/src/main.vue +3 -1
  54. package/packages/data-table/src/main.vue +10 -1
  55. package/packages/input/src/main.vue +7 -6
  56. package/packages/login/src/main.vue +13 -0
  57. package/packages/login/src/resetPassword.vue +1 -1
  58. package/packages/main/src/main.vue +44 -10
  59. package/packages/nav/src/main.vue +25 -8
  60. package/packages/select/src/main.vue +6 -5
  61. package/packages/theme-chalk/lib/base.css +1 -1
  62. package/packages/theme-chalk/lib/index.css +1 -1
  63. package/packages/theme-chalk/lib/login.css +1 -1
  64. package/packages/theme-chalk/lib/main.css +1 -1
  65. package/packages/theme-chalk/lib/menu.css +1 -1
  66. package/packages/theme-chalk/lib/nav.css +1 -1
  67. package/packages/theme-chalk/lib/sizer.css +1 -1
  68. package/packages/theme-chalk/lib/upload.css +1 -1
  69. package/packages/theme-chalk/src/base.scss +3 -0
  70. package/packages/theme-chalk/src/login.scss +175 -171
  71. package/packages/theme-chalk/src/main.scss +5 -2
  72. package/packages/theme-chalk/src/nav.scss +4 -1
  73. package/src/index.js +1 -1
  74. package/src/utils/util.js +112 -23
  75. package/src/utils/webSocket.js +14 -7
@@ -323,177 +323,181 @@
323
323
  }
324
324
  }
325
325
 
326
- @media screen and (max-width: 1600px) {
327
- & {
328
- width: 428px;
329
- padding: 0 8px;
330
- .es-login-logo {
331
- height: 42px;
332
- left: 20px;
333
- top: 20px;
334
- }
335
- .es-login-name {
336
- margin-bottom: 40px;
337
- }
338
- .es-login-main {
339
- padding: 40px 44px;
340
- .es-login-switch {
341
- right: 24px;
342
- top: 24px;
343
- .es-icon {
344
- font-size: 60px;
345
- &::after {
346
- left: -10px;
347
- border-width: 30px;
348
- }
349
- }
350
- }
351
- .es-warning {
352
- font-size: 14px;
353
- }
354
- }
355
-
356
- .es-login-title {
357
- height: 22px;
358
- margin-bottom: 36px;
359
- font-size: 18px;
360
- line-height: 22px;
361
-
362
- .es-login-title-content {
363
- margin: 0 12px;
364
- }
365
- }
366
- .es-login-form {
367
- .el-input__inner {
368
- padding-left: 40px;
369
- height: 44px;
370
- line-height: 44px;
371
- font-size: 13px;
372
-
373
- &::-webkit-input-placeholder {
374
- font-size: 13px;
375
- }
376
- }
377
-
378
- .el-input__prefix {
379
- left: 16px;
380
- line-height: 36px;
381
- }
382
-
383
- .es-label-user {
384
- font-size: 14px;
385
- }
386
-
387
- .es-label-password {
388
- font-size: 16px;
389
- top: 0;
390
- }
391
-
392
- .el-input__clear {
393
- font-size: 14px;
394
- line-height: 36px;
395
- }
396
-
397
- .es-label-code-image {
398
- font-size: 16px;
399
- line-height: 36px;
400
- }
401
-
402
- .es-label-image-code {
403
- padding-right: 100px;
404
-
405
- .el-input__suffix {
406
- padding: 2px;
407
- .es-get-code {
408
- margin-top: -2px;
409
- margin-bottom: -2px;
410
- padding: 5px 6px;
411
- }
412
- }
413
-
414
- .es-img-code {
415
- height: 32px;
416
- }
417
- }
418
-
419
- .el-form-item__error {
420
- font-size: 12px;
421
- }
422
-
423
- .es-password-handle {
424
- margin-top: 0;
425
- margin-bottom: 20px;
426
-
427
- .el-checkbox__label {
428
- font-size: 12px;
429
- }
430
-
431
- .el-checkbox__input {
432
- .el-checkbox__inner {
433
- width: 14px;
434
- height: 14px;
435
- top: 1px;
436
- padding-left: 6px;
437
-
438
- &::after {
439
- left: 4px;
440
- top: 0px;
441
- }
442
- }
443
-
444
- &.is-checked {
445
- .el-checkbox__inner::after {
446
- transform: rotate(45deg) scaleY(0.9);
447
- }
448
- }
449
- }
450
-
451
- .es-password-forget {
452
- font-size: 12px;
453
- }
454
- }
455
-
456
- .extra {
457
- margin-top: 20px;
458
- display: flex;
459
- justify-content: space-between;
460
-
461
- span {
462
- cursor: pointer;
463
- font-size: 14px;
464
- color: #12278b;
465
- }
466
- }
467
-
468
- .es-button-submit {
469
- height: 44px;
470
- line-height: 44px;
471
- font-size: 16px;
472
- padding: 0 8px;
473
- border-radius: 8px;
474
- }
475
- &.es-login-verify {
476
- .es-login-title {
477
- margin-bottom: 68px;
478
- }
479
- .el-form-item {
480
- margin-bottom: 54px;
481
- }
482
- }
483
- }
484
-
485
- .es-login-qrcode {
486
- .es-login-title {
487
- margin-bottom: 18px;
488
- }
489
- .es-qrcode-box,
490
- .es-wx-qrcode-box {
491
- padding-top: 16px;
492
- padding-bottom: 16px;
493
- }
494
- }
495
- }
496
- }
326
+ // @media screen and (max-width: 1600px) and (max-height: 900px) {
327
+ // & {
328
+ // width: 428px;
329
+ // padding: 0 8px;
330
+ // .es-login-logo {
331
+ // height: 42px;
332
+ // left: 20px;
333
+ // top: 20px;
334
+ // }
335
+ // .es-login-name {
336
+ // margin-bottom: 40px;
337
+ // }
338
+ // .es-login-main {
339
+ // padding: 40px 44px;
340
+ // .es-login-switch {
341
+ // right: 24px;
342
+ // top: 24px;
343
+ // .es-icon {
344
+ // font-size: 60px;
345
+ // &::after {
346
+ // left: -10px;
347
+ // border-width: 30px;
348
+ // }
349
+ // }
350
+ // }
351
+ // .es-warning {
352
+ // font-size: 14px;
353
+ // }
354
+ // }
355
+
356
+ // .es-login-title {
357
+ // height: 22px;
358
+ // margin-bottom: 36px;
359
+ // font-size: 18px;
360
+ // line-height: 22px;
361
+
362
+ // .es-login-title-content {
363
+ // margin: 0 12px;
364
+ // }
365
+ // }
366
+ // .es-login-form {
367
+ // .el-input__inner {
368
+ // padding-left: 40px;
369
+ // height: 44px;
370
+ // line-height: 44px;
371
+ // font-size: 13px;
372
+
373
+ // &::-webkit-input-placeholder {
374
+ // font-size: 13px;
375
+ // }
376
+ // }
377
+
378
+ // .el-input__prefix {
379
+ // left: 16px;
380
+ // line-height: 36px;
381
+ // }
382
+
383
+ // .es-label-user {
384
+ // font-size: 14px;
385
+ // }
386
+
387
+ // .es-label-password {
388
+ // font-size: 16px;
389
+ // top: 0;
390
+ // }
391
+
392
+ // .el-input__clear {
393
+ // font-size: 14px;
394
+ // line-height: 36px;
395
+ // }
396
+
397
+ // .es-label-code-image {
398
+ // font-size: 16px;
399
+ // line-height: 36px;
400
+ // }
401
+
402
+ // .es-label-image-code {
403
+ // padding-right: 100px;
404
+
405
+ // .el-input__suffix {
406
+ // padding: 2px;
407
+ // .es-get-code {
408
+ // margin-top: -2px;
409
+ // margin-bottom: -2px;
410
+ // padding: 5px 6px;
411
+ // }
412
+ // }
413
+
414
+ // .es-img-code {
415
+ // height: 32px;
416
+ // }
417
+ // }
418
+
419
+ // .el-form-item__error {
420
+ // font-size: 12px;
421
+ // }
422
+
423
+ // .es-password-handle {
424
+ // margin-top: 0;
425
+ // margin-bottom: 20px;
426
+
427
+ // .el-checkbox__label {
428
+ // font-size: 12px;
429
+ // }
430
+
431
+ // .el-checkbox__input {
432
+ // .el-checkbox__inner {
433
+ // width: 14px;
434
+ // height: 14px;
435
+ // top: 1px;
436
+ // padding-left: 6px;
437
+
438
+ // &::after {
439
+ // left: 4px;
440
+ // top: 0px;
441
+ // }
442
+ // }
443
+
444
+ // &.is-checked {
445
+ // .el-checkbox__inner::after {
446
+ // transform: rotate(45deg) scaleY(0.9);
447
+ // }
448
+ // }
449
+ // }
450
+
451
+ // .es-password-forget {
452
+ // font-size: 12px;
453
+ // }
454
+ // }
455
+
456
+ // .extra {
457
+ // margin-top: 20px;
458
+ // display: flex;
459
+ // justify-content: space-between;
460
+
461
+ // span {
462
+ // cursor: pointer;
463
+ // font-size: 14px;
464
+ // color: #12278b;
465
+ // }
466
+ // }
467
+
468
+ // .es-button-submit {
469
+ // height: 44px;
470
+ // line-height: 44px;
471
+ // font-size: 16px;
472
+ // padding: 0 8px;
473
+ // border-radius: 8px;
474
+ // }
475
+ // &.es-login-verify {
476
+ // .es-login-title {
477
+ // margin-bottom: 68px;
478
+ // }
479
+ // .el-form-item {
480
+ // margin-bottom: 54px;
481
+ // }
482
+ // }
483
+ // }
484
+
485
+ // .es-login-qrcode {
486
+ // .es-login-title {
487
+ // margin-bottom: 18px;
488
+ // }
489
+ // .es-qrcode-box,
490
+ // .es-wx-qrcode-box {
491
+ // padding-top: 16px;
492
+ // padding-bottom: 16px;
493
+ // }
494
+ // }
495
+ // }
496
+ // }
497
+ // @media screen and (max-width: 1280px) and (max-height: 720px) {
498
+ // }
499
+ // @media screen and (max-width: 1024px) and (max-height: 768px) {
500
+ // }
497
501
  }
498
502
  .es-user-info {
499
503
  .es-form-content {
@@ -21,7 +21,7 @@
21
21
 
22
22
  .es-main-logo {
23
23
  max-height: 60%;
24
- margin-left: 20px;
24
+ margin-left: 50px;
25
25
  }
26
26
 
27
27
  .es-logo-error {
@@ -185,7 +185,10 @@
185
185
  padding-top: 16px;
186
186
  padding-bottom: 16px;
187
187
  }
188
- .es-nav-main {
188
+ .es-main-left {
189
+ border-right: $--border-base;
190
+ }
191
+ .es-nav-main:not(.es-nav-overlap) {
189
192
  background-color: transparent;
190
193
  border-right: 0;
191
194
  }
@@ -13,7 +13,10 @@
13
13
  overflow: hidden;
14
14
  display: inline-block;
15
15
  height: 100%;
16
- background-color: $--color-primary-light-10;
16
+ background-color: $--color-primary-light-9;
17
+ &[biserial='true'] {
18
+ background-color: $--color-primary-light-10;
19
+ }
17
20
  &:not(.es-nav-overlap) {
18
21
  border-right: $--border-base;
19
22
  }
package/src/index.js CHANGED
@@ -121,7 +121,7 @@ if (typeof window !== 'undefined' && window.Vue) {
121
121
  }
122
122
 
123
123
  export default {
124
- version: '0.5.73',
124
+ version: '0.5.75',
125
125
  install,
126
126
  Button,
127
127
  ButtonGroup,
package/src/utils/util.js CHANGED
@@ -555,6 +555,35 @@ const calculateNetworkDays = function (start_date, end_date, holidays = []) {
555
555
  return workdays;
556
556
  };
557
557
 
558
+ /**
559
+ * chunkToChinese
560
+ * @desc 将四位数的整数转换为中文大写
561
+ * @param {number} chunk - 数字
562
+ **/
563
+ function chunkToChinese(chunk) {
564
+ const numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
565
+ const capitalDigits = ['', '拾', '佰', '仟'];
566
+
567
+ let result = '';
568
+ let digitIndex = 0;
569
+
570
+ while (chunk > 0) {
571
+ const digit = chunk % 10;
572
+ if (digit > 0) {
573
+ result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
574
+ } else {
575
+ // 当前数字是零,需要判断是否需要添加零
576
+ if (result.charAt(0) !== '零') {
577
+ result = '零' + result;
578
+ }
579
+ }
580
+ chunk = Math.floor(chunk / 10);
581
+ digitIndex++;
582
+ }
583
+
584
+ return result;
585
+ }
586
+
558
587
  /**
559
588
  * concatenate
560
589
  * @desc 指定连接符合并文本
@@ -1753,6 +1782,34 @@ const getWeekday = function (date, type = 0) {
1753
1782
  return adjustedDay === 0 ? 7 : adjustedDay;
1754
1783
  };
1755
1784
 
1785
+ /**
1786
+ * getZoom
1787
+ * @desc 获取缩放比
1788
+ * @param {number} n - 可选参数,表示星期的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
1789
+ **/
1790
+ const getZoom = function () {
1791
+ let ratio = 0;
1792
+ let screen = window.screen;
1793
+ let ua = navigator.userAgent.toLowerCase();
1794
+ if (window.devicePixelRatio !== undefined) {
1795
+ ratio = window.devicePixelRatio;
1796
+ } else if (~ua.indexOf('msie')) {
1797
+ if (screen.deviceXDPI && screen.logicalXDPI) {
1798
+ ratio = screen.deviceXDPI / screen.logicalXDPI;
1799
+ }
1800
+ } else if (
1801
+ window.outerWidth !== undefined &&
1802
+ window.innerWidth !== undefined
1803
+ ) {
1804
+ ratio = window.outerWidth / window.innerWidth;
1805
+ }
1806
+
1807
+ if (ratio) {
1808
+ ratio = Math.round(ratio * 100);
1809
+ }
1810
+
1811
+ return ratio / 100;
1812
+ };
1756
1813
  /**
1757
1814
  * handlerUrl
1758
1815
  * @desc:更新url参数中的时间戳
@@ -2525,32 +2582,63 @@ const rmbToCapital = function (number) {
2525
2582
 
2526
2583
  return result;
2527
2584
  };
2528
-
2529
- // 辅助函数,将四位数的整数转换为中文大写
2530
- function chunkToChinese(chunk) {
2531
- const numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
2532
- const capitalDigits = ['', '拾', '佰', '仟'];
2533
-
2534
- let result = '';
2535
- let digitIndex = 0;
2536
-
2537
- while (chunk > 0) {
2538
- const digit = chunk % 10;
2539
- if (digit > 0) {
2540
- result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
2585
+ /**
2586
+ * setScale
2587
+ * @desc 设置缩放
2588
+ * @param {number} width - 分辨率宽度
2589
+ * @param {number} height - 分辨率高度
2590
+ **/
2591
+ const setScale = function (width = 1920, height = 1080) {
2592
+ let n = 1;
2593
+ let isMac = /macintosh|mac os x/i.test(navigator.userAgent);
2594
+ let zoom = getZoom();
2595
+ if (isMac) {
2596
+ n = 2;
2597
+ } else {
2598
+ n = 1;
2599
+ }
2600
+ if (zoom === 1) {
2601
+ document.body.style.removeProperty('transform');
2602
+ document.body.style.removeProperty('width');
2603
+ document.body.style.removeProperty('height');
2604
+ document.body.style.removeProperty('transform-origin');
2605
+ return;
2606
+ }
2607
+ if (
2608
+ Math.abs(parseInt(width - (window.innerWidth * zoom) / n, 10)) >
2609
+ 15 &&
2610
+ (window.innerWidth * zoom) / n !== width
2611
+ ) {
2612
+ let scale =
2613
+ 'scale(' +
2614
+ (window.innerWidth * zoom) / width / zoom +
2615
+ ',' +
2616
+ (window.innerHeight * zoom) / height / zoom +
2617
+ ')';
2618
+ document.body.style.transform = scale;
2619
+ document.body.style.width = width + 'px';
2620
+ document.body.style.height = height + 'px';
2621
+ document.body.style.transformOrigin = '0 0';
2622
+ } else {
2623
+ if (isMac) {
2624
+ let scale = 'scale(' + (1 * n) / zoom + ')';
2625
+ document.body.style.transform = scale;
2626
+ document.body.style.width =
2627
+ parseInt((window.innerWidth * zoom) / n, 10) + 'px';
2628
+ document.body.style.height =
2629
+ parseInt((window.innerHeight * zoom) / n, 10) + 'px';
2630
+ document.body.style.transformOrigin = '0 0';
2541
2631
  } else {
2542
- // 当前数字是零,需要判断是否需要添加零
2543
- if (result.charAt(0) !== '零') {
2544
- result = '零' + result;
2545
- }
2632
+ let scale = 'scale(' + (1 * n) / zoom + ')';
2633
+ document.body.style.transform = scale;
2634
+ document.body.style.width =
2635
+ parseInt((window.innerWidth * zoom) / n, 10) + 'px';
2636
+ document.body.style.height =
2637
+ parseInt((window.innerHeight * zoom) / n, 10) + 'px';
2638
+ document.body.style.transformOrigin = '0 0';
2546
2639
  }
2547
- chunk = Math.floor(chunk / 10);
2548
- digitIndex++;
2549
2640
  }
2550
-
2551
- return result;
2552
- }
2553
-
2641
+ };
2554
2642
  /**
2555
2643
  * sendMessage
2556
2644
  * @desc:向iframe发送信息
@@ -3063,6 +3151,7 @@ export default {
3063
3151
  rmbToCapital,
3064
3152
  sendMessage,
3065
3153
  setFavicon,
3154
+ setScale,
3066
3155
  setStorage,
3067
3156
  socket,
3068
3157
  startWith,
@@ -15,21 +15,20 @@ class WebSocket {
15
15
  this.connects = 1;
16
16
  this.recon = false;
17
17
  this.sendTimeout = null;
18
+ this.socket = null;
19
+ this.subscription = null;
18
20
  }
19
21
 
20
22
  /** socket连接 */
21
23
  connect() {
22
24
  if (!this.client) {
23
25
  // 连接SockJS
24
- let socket = new SockJS(this.host + this.url);
25
- // 获取STOMP子协议的客户端对象
26
- this.client = Stomp.over(socket);
27
-
26
+ this.socket = new SockJS(this.host + this.url, {timeout: 60000});
27
+ this.client = Stomp.over(this.socket);
28
28
  }
29
29
 
30
30
  // 日志不打印
31
31
  if (!this.debug) {
32
- console.log(111);
33
32
  this.client.debug = () => {};
34
33
  }
35
34
 
@@ -41,9 +40,10 @@ class WebSocket {
41
40
  // 订阅消息
42
41
  this.subscribe();
43
42
  }, (error) => {
43
+ this.unsubscribe();
44
+ this.client = null;
44
45
  let diffSecond = parseInt((new Date() - this.nextDate) / 1000, 10);
45
46
  if (this.connects > 5 && diffSecond < this.interval) {
46
- this.client.disconnect();
47
47
  this.error && this.error(error);
48
48
  } else {
49
49
  this.reconTimeout = setTimeout(() => {
@@ -52,11 +52,17 @@ class WebSocket {
52
52
  }, 5000);
53
53
  }
54
54
  });
55
+ }// 清除订阅
56
+ unsubscribe() {
57
+ if (this.subscription) {
58
+ this.subscription.unsubscribe();
59
+ this.subscription = null;
60
+ }
55
61
  }
56
62
  /** 订阅服务端 */
57
63
  subscribe() {
58
64
  // 订阅服务端提供的某个topic
59
- this.client.subscribe(this.take, (response) => {
65
+ this.subscription = this.client.subscribe(this.take, (response) => {
60
66
  if (response && (this.callback || this.success)) {
61
67
  let callback = this.callback || this.success;
62
68
  callback(JSON.parse(response.body));
@@ -89,6 +95,7 @@ class WebSocket {
89
95
  /** 销毁 */
90
96
  destroy() {
91
97
  // 断开连接,清除定时器
98
+ this.unsubscribe();
92
99
  if (this.client) {
93
100
  this.client.disconnect();
94
101
  };