@lambo-design/shared 1.0.0-beta.9 → 1.0.0-beta.91

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 (69) hide show
  1. package/config/config.js +2 -2
  2. package/config/themes/atrovirens/atrovirens.css +533 -0
  3. package/config/themes/atrovirens/atrovirens.css.map +1 -0
  4. package/config/themes/atrovirens/atrovirens.less +624 -0
  5. package/config/themes/atrovirens/var.less +627 -0
  6. package/config/themes/blue/blue.css +533 -0
  7. package/config/themes/blue/blue.css.map +1 -0
  8. package/config/themes/blue/blue.less +624 -0
  9. package/config/themes/blue/var.less +637 -0
  10. package/config/themes/default/default.css +300 -8
  11. package/config/themes/default/default.css.map +1 -0
  12. package/config/themes/default/default.less +378 -74
  13. package/config/themes/default/var.less +320 -6
  14. package/config/themes/eap/eap.css +533 -0
  15. package/config/themes/eap/eap.css.map +1 -0
  16. package/config/themes/eap/eap.less +624 -0
  17. package/config/themes/eap/var.less +628 -0
  18. package/config/themes/gold/gold.css +533 -0
  19. package/config/themes/gold/gold.css.map +1 -0
  20. package/config/themes/gold/gold.less +624 -0
  21. package/config/themes/gold/var.less +321 -6
  22. package/config/themes/index.js +12 -3
  23. package/config/themes/lime/lime.css +533 -0
  24. package/config/themes/lime/lime.css.map +1 -0
  25. package/config/themes/lime/lime.less +624 -0
  26. package/config/themes/lime/var.less +321 -6
  27. package/config/themes/orange/orange.css +533 -0
  28. package/config/themes/orange/orange.css.map +1 -0
  29. package/config/themes/orange/orange.less +624 -0
  30. package/config/themes/orange/var.less +629 -0
  31. package/config/themes/red/red.css +533 -0
  32. package/config/themes/red/red.css.map +1 -0
  33. package/config/themes/red/red.less +624 -0
  34. package/config/themes/red/var.less +628 -0
  35. package/config/themes/theme-atrovirens.js +515 -0
  36. package/config/themes/theme-blue.js +521 -0
  37. package/config/themes/theme-default.js +272 -9
  38. package/config/themes/theme-eap.js +515 -0
  39. package/config/themes/theme-gold.js +273 -10
  40. package/config/themes/theme-lime.js +273 -10
  41. package/config/themes/theme-orange.js +516 -0
  42. package/config/themes/theme-red.js +515 -0
  43. package/directives/index.js +23 -0
  44. package/directives/module/draggable.js +56 -0
  45. package/directives/module/permission.js +49 -0
  46. package/index.js +3 -1
  47. package/package.json +23 -20
  48. package/plugin/index.js +12 -0
  49. package/plugin/module/date-format.js +30 -0
  50. package/plugin/module/loading.js +26 -0
  51. package/plugin/module/warn-handler.js +11 -0
  52. package/utils/ajax/interceptors.js +13 -6
  53. package/utils/assist.js +179 -9
  54. package/utils/base64.js +126 -0
  55. package/utils/date.js +343 -300
  56. package/utils/dict/built-in-dict.js +20 -0
  57. package/utils/dict/index.js +75 -0
  58. package/utils/excel.js +122 -21
  59. package/utils/form/validate.js +30 -0
  60. package/utils/lodop.js +5 -0
  61. package/utils/menu/index.js +25 -2
  62. package/utils/modelerUtil.js +4 -1
  63. package/utils/number.js +72 -0
  64. package/utils/platform.js +120 -7
  65. package/utils/theme.js +5 -0
  66. package/config/themes/gold/default.css +0 -241
  67. package/config/themes/gold/default.less +0 -319
  68. package/config/themes/lime/default.css +0 -241
  69. package/config/themes/lime/default.less +0 -319
package/utils/platform.js CHANGED
@@ -1,8 +1,9 @@
1
-
2
- export const TOKEN_KEY = 'v8-token'
1
+ export const TOKEN_KEY = 'lambo-token'
3
2
 
4
3
  export const COOKIE_KEY = 'lambo-sso-key'
5
4
 
5
+ export const SSO_TOKEN_KEY = 'lambo-sso-token'
6
+
6
7
  export function objEqual(obj1, obj2) {
7
8
  const keysArr1 = Object.keys(obj1)
8
9
  const keysArr2 = Object.keys(obj2)
@@ -314,6 +315,12 @@ export const getTableDataFromArray = (array) => {
314
315
  }
315
316
  }
316
317
 
318
+ /**
319
+ * 寻找上级节点
320
+ * @param ele
321
+ * @param tag
322
+ * @returns {*}
323
+ */
317
324
  export const findNodeUpper = (ele, tag) => {
318
325
  if (ele.parentNode) {
319
326
  if (ele.parentNode.tagName === tag.toUpperCase()) {
@@ -324,6 +331,12 @@ export const findNodeUpper = (ele, tag) => {
324
331
  }
325
332
  }
326
333
 
334
+ /**
335
+ * 根据class寻找上级节点
336
+ * @param ele
337
+ * @param classes
338
+ * @returns {*}
339
+ */
327
340
  export const findNodeUpperByClasses = (ele, classes) => {
328
341
  let parentNode = ele.parentNode
329
342
  if (parentNode) {
@@ -336,6 +349,12 @@ export const findNodeUpperByClasses = (ele, classes) => {
336
349
  }
337
350
  }
338
351
 
352
+ /**
353
+ * 根据ele寻找下级节点
354
+ * @param ele
355
+ * @param tag
356
+ * @returns {*}
357
+ */
339
358
  export const findNodeDownward = (ele, tag) => {
340
359
  const tagName = tag.toUpperCase()
341
360
  if (ele.childNodes.length) {
@@ -349,6 +368,12 @@ export const findNodeDownward = (ele, tag) => {
349
368
  }
350
369
  }
351
370
 
371
+ /**
372
+ * @description 判断要查询的数组是否至少有一个元素包含在目标数组中
373
+ * @param access 需要查询的数组
374
+ * @param canViewAccess 目标数组
375
+ * @returns {*}
376
+ */
352
377
  export const showByAccess = (access, canViewAccess) => {
353
378
  return hasOneOf(canViewAccess, access)
354
379
  }
@@ -363,7 +388,7 @@ export const routeEqual = (route1, route2) => {
363
388
  const params2 = route2.params || {}
364
389
  const query1 = route1.query || {}
365
390
  const query2 = route2.query || {}
366
- return (route1.name === route2.name) //&& objEqual(params1, params2) && objEqual(query1, query2)
391
+ return (route1.name === route2.name) && objEqual(params1, params2) && objEqual(query1, query2)
367
392
  }
368
393
 
369
394
  /**
@@ -378,7 +403,14 @@ export const routeHasExist = (tagNavList, routeItem) => {
378
403
  return res
379
404
  }
380
405
 
381
- // scrollTop animation
406
+ /**
407
+ * scrollTop animation
408
+ * @param el
409
+ * @param from
410
+ * @param to
411
+ * @param duration
412
+ * @param endCallback
413
+ */
382
414
  export const scrollTop = (el, from = 0, to, duration = 500, endCallback) => {
383
415
  if (!window.requestAnimationFrame) {
384
416
  window.requestAnimationFrame = (
@@ -427,8 +459,16 @@ export const setTitle = (configTitle,routeItem, vm) => {
427
459
  window.document.title = resTitle
428
460
  }
429
461
 
430
- export const getUrlParams = () => {
431
- const url = location.search; //获取url中"?"符后的字串
462
+ /**
463
+ * 获取浏览器地址url中的参数
464
+ * @param url
465
+ * @returns {Object}
466
+ */
467
+ export const getUrlParams = (url) => {
468
+ if (!url){
469
+ url = location.search;
470
+ }
471
+ //const url = location.search; //获取url中"?"符后的字串
432
472
  const theRequest = new Object();
433
473
  if (url.indexOf("?") != -1) {
434
474
  const str = url.substr(1);
@@ -501,6 +541,11 @@ const hasOneOf = (targetarr, arr) => {
501
541
  return targetarr.some(_ => arr.indexOf(_) > -1)
502
542
  }
503
543
 
544
+ /**
545
+ * foreach
546
+ * @param arr
547
+ * @param fn 回调函数,参数接收arr的元素,索引,arr本身
548
+ */
504
549
  const forEach = (arr, fn) => {
505
550
  if (!arr.length || !fn) return
506
551
  let i = -1
@@ -524,6 +569,14 @@ export function oneOf (value, validList) {
524
569
  return false
525
570
  }
526
571
 
572
+ /**
573
+ * recursionKeyFindItem
574
+ * @param arr
575
+ * @param filterKey
576
+ * @param filterValue
577
+ * @param recursionKey
578
+ * @returns {*|null}
579
+ */
527
580
  export const recursionKeyFindItem = (arr, filterKey, filterValue, recursionKey) => {
528
581
  for (const item of arr) {
529
582
  if (item[filterKey] && item[filterKey] == filterValue) {
@@ -540,18 +593,42 @@ export const recursionKeyFindItem = (arr, filterKey, filterValue, recursionKey)
540
593
  return null;
541
594
  };
542
595
 
596
+ /**
597
+ * filterMenuName
598
+ * @param menuList
599
+ * @param name
600
+ * @returns {*|null}
601
+ */
543
602
  export const filterMenuName = (menuList, name) => {
544
603
  return recursionKeyFindItem(menuList, 'name', name, 'children')
545
604
  };
546
605
 
606
+ /**
607
+ * filterMenuUri
608
+ * @param menuList
609
+ * @param name
610
+ * @returns {*|null}
611
+ */
547
612
  export const filterMenuUri = (menuList, name) => {
548
613
  return recursionKeyFindItem(menuList, 'uri', name, 'children')
549
614
  };
550
615
 
616
+ /**
617
+ * tagExists
618
+ * @param taglist
619
+ * @param name
620
+ * @returns {boolean}
621
+ */
551
622
  export const tagExists = (taglist, name) => {
552
623
  return taglist && taglist.filter(item => item.name === name).length > 0;
553
624
  };
554
625
 
626
+ /**
627
+ * getPreviousTagIndex
628
+ * @param tagList
629
+ * @param name
630
+ * @returns {number}
631
+ */
555
632
  export const getPreviousTagIndex = (tagList, name) => {
556
633
  let count = 0;
557
634
  if (tagList && name) {
@@ -567,4 +644,40 @@ export const getPreviousTagIndex = (tagList, name) => {
567
644
  }
568
645
  }
569
646
  return count;
570
- }
647
+ };
648
+
649
+ /**
650
+ * getDelTagIndex
651
+ * @param tagList
652
+ * @param name
653
+ * @returns {number}
654
+ */
655
+ export const getDelTagIndex = (tagList, name) => {
656
+ let count = 1;
657
+ if (tagList && name) {
658
+ for (let i = 1 ;i < tagList.length; i++) {
659
+ let item = tagList[i];
660
+ if (item.name !== name) {
661
+ return count;
662
+ }
663
+ }
664
+ }
665
+ return count;
666
+ }
667
+
668
+ /**
669
+ * turnToPage
670
+ * @param vm
671
+ * @param name
672
+ * @param url
673
+ */
674
+ export const turnToPage = (vm, name ,url) =>{
675
+ if (window.top && window.top.location.href != window.location.href) {
676
+ sessionStorage.removeItem('activeName')
677
+ window.parent.location.href = url;
678
+ } else {
679
+ vm.$router.push({
680
+ name: name
681
+ })
682
+ }
683
+ }
package/utils/theme.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import themes from "../config/themes";
2
+ import cssVars from "css-vars-ponyfill";
2
3
  const changeByThemeKey = (themeKey) => {
3
4
  if (themeKey) {
4
5
  themes.forEach((theme) => {
@@ -14,6 +15,10 @@ const changeByThemeKey = (themeKey) => {
14
15
  }
15
16
  changeByThemeKey(themeKey);
16
17
  }
18
+ cssVars({
19
+ rootElement: document, // default
20
+ include: 'link[rel=stylesheet],style'
21
+ });
17
22
  return themeKey;
18
23
  };
19
24
 
@@ -1,241 +0,0 @@
1
- :root {
2
- --primary-color: #fa8c16;
3
- --primary-color-tint-20: #fba345;
4
- --primary-color-tint-90: #fff4e8;
5
- --primary-color-tint-80: #fee8d0;
6
- --primary-color-tint-5: #fa9222;
7
- --primary-color-tint-95-fade-50: rgba(255, 249, 243, 0.5);
8
- --primary-color-fade-20: rgba(250, 140, 22, 0.2);
9
- --primary-color-shade-5: #ee8515;
10
- --info-color: #2db7f5;
11
- --info-color-tint-20: #57c5f7;
12
- --info-color-tint-90: #eaf8fe;
13
- --info-color-tint-80: #d5f1fd;
14
- --info-color-tint-5: #38bbf6;
15
- --info-color-tint-95-fade-50: rgba(245, 251, 254, 0.5);
16
- --info-color-fade-20: rgba(45, 183, 245, 0.2);
17
- --info-color-shade-5: var(--info-color-shade-5, #2baee9);
18
- --success-color: #19be6b;
19
- --success-color-tint-20: #47cb89;
20
- --success-color-tint-90: #e8f9f0;
21
- --success-color-tint-80: #d1f2e1;
22
- --success-color-tint-5: #25c172;
23
- --success-color-tint-95-fade-50: rgba(244, 252, 248, 0.5);
24
- --success-color-fade-20: rgba(25, 190, 107, 0.2);
25
- --success-color-shade-5: #18b566;
26
- --processing-color: #fa8c16;
27
- --warning-color: #ff9900;
28
- --warning-color-tint-20: #ffad33;
29
- --warning-color-tint-90: #fff5e6;
30
- --warning-color-tint-5: #ff9e0d;
31
- --warning-color-tint-80: #ffebcc;
32
- --warning-color-tint-95-fade-50: rgba(255, 250, 242, 0.5);
33
- --warning-color-fade-20: rgba(255, 153, 0, 0.2);
34
- --warning-color-shade-5: #f29100;
35
- --error-color: #ed4014;
36
- --error-color-tint-20: #f16643;
37
- --error-color-tint-90: #fdece8;
38
- --error-color-tint-5: #ee4a20;
39
- --error-color-tint-80: #fbd9d0;
40
- --error-color-tint-95-fade-50: rgba(254, 245, 243, 0.5);
41
- --error-color-fade-20: rgba(237, 64, 20, 0.2);
42
- --error-color-shade-5: #e13d13;
43
- --normal-color: #e6ebf1;
44
- --link-color: #2D8cF0;
45
- --link-hover-color: #57a3f3;
46
- --link-active-color: #2b85e4;
47
- --selected-color: rgba(250, 140, 22, 0.9);
48
- --selected-color-shade-10: rgba(220, 123, 19, 0.91);
49
- --tooltip-color: #fff;
50
- --subsidiary-color: #808695;
51
- --rate-star-color: #f5a623;
52
- --rate-star-color-tint-20: #f7b84f;
53
- --white: #fff;
54
- --black: #000;
55
- --body-background: #fff;
56
- --component-background: #fff;
57
- --font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
58
- --code-family: Consolas, Menlo, Courier, monospace;
59
- --title-color: #17233d;
60
- --text-color: #515a6e;
61
- --text-color-secondary: rgba(0, 0, 0, 0.45);
62
- --heading-color: rgba(0, 0, 0, 0.85);
63
- --heading-color-dark: #ffffff;
64
- --font-size-base: 14px;
65
- --font-size-small: 12px;
66
- --font-size-large: 16px;
67
- --line-height-base: 1.5;
68
- --line-height-computed: 21px;
69
- --border-radius-base: 6px;
70
- --border-radius-small: 4px;
71
- --cursor-disabled: not-allowed;
72
- --padding-lg: 24px;
73
- --padding-md: 16px;
74
- --padding-sm: 12px;
75
- --padding-xs: 8px;
76
- --border-color-base: #dcdee2;
77
- --border-color-split: #e8eaec;
78
- --border-width-base: 1px;
79
- --border-style-base: solid;
80
- --background-color-base: #f7f7f7;
81
- --background-color-select-hover: #f3f3f3;
82
- --tooltip-bg: rgba(70, 76, 91, 0.9);
83
- --head-bg: #f9fafc;
84
- --table-thead-bg: #f8f8f9;
85
- --table-td-stripe-bg: #f8f8f9;
86
- --table-td-hover-bg: #ebf7ff;
87
- --table-td-highlight-bg: #ebf7ff;
88
- --menu-dark-title: #515a6e;
89
- --menu-dark-active-bg: #363e4f;
90
- --menu-dark-subsidiary-color: rgba(255, 255, 255, 0.7);
91
- --menu-dark-group-title-color: rgba(255, 255, 255, 0.36);
92
- --date-picker-cell-hover-bg: #e1f0fe;
93
- --shadow-color: rgba(0, 0, 0, 0.2);
94
- --shadow-base: 0 1px 6px rgba(0, 0, 0, 0.2);
95
- --shadow-card: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
96
- --shadow-up: 0 -1px 6px rgba(0, 0, 0, 0.2);
97
- --shadow-down: 0 1px 6px rgba(0, 0, 0, 0.2);
98
- --shadow-left: -1px 0 6px rgba(0, 0, 0, 0.2);
99
- --shadow-right: 1px 0 6px rgba(0, 0, 0, 0.2);
100
- --btn-height-base: 32px;
101
- --btn-height-large: 40px;
102
- --btn-height-small: 24px;
103
- --btn-padding-base: 0 15px;
104
- --btn-padding-large: 0 15px;
105
- --btn-padding-small: 0 7px;
106
- --btn-font-weight: normal;
107
- --btn-padding-base-icon: 5px 15px 6px;
108
- --btn-padding-large-icon: 6px 15px 6px 15px;
109
- --btn-padding-small-icon: 1px 7px 2px;
110
- --btn-font-size: 14px;
111
- --btn-font-size-large: 16px;
112
- --btn-font-size-small: 14px;
113
- --btn-border-radius: 4px;
114
- --btn-border-radius-small: 3px;
115
- --btn-group-border: #ee8515;
116
- --btn-disable-color: #c5c8ce;
117
- --btn-disable-bg: #f7f7f7;
118
- --btn-disable-border: #dcdee2;
119
- --btn-default-color: #515a6e;
120
- --btn-default-color-tint-20: #747b8b;
121
- --btn-default-color-shade-5: #4d5669;
122
- --btn-default-bg: #fff;
123
- --btn-default-bg-tint-20: #ffffff;
124
- --btn-default-bg-shade-5: #f2f2f2;
125
- --btn-default-border: #dcdee2;
126
- --btn-default-border-tint-20: #e3e5e8;
127
- --btn-default-border-shade-5: #d1d3d7;
128
- --btn-primary-color: #fff;
129
- --btn-primary-color-tint-20: #ffffff;
130
- --btn-primary-color-tint-5: #ffffff;
131
- --btn-primary-color-shade-5: #f2f2f2;
132
- --btn-primary-bg: #fa8c16;
133
- --btn-primary-bg-tint-20: #fba345;
134
- --btn-primary-bg-tint-5: #fa9222;
135
- --btn-ghost-color: #515a6e;
136
- --btn-ghost-color-tint-20: #747b8b;
137
- --btn-ghost-color-shade-5: #4d5669;
138
- --btn-ghost-bg: #fff;
139
- --btn-ghost-bg-tint-20: #ffffff;
140
- --btn-ghost-bg-shade-5: #f2f2f2;
141
- --btn-ghost-border: #dcdee2;
142
- --btn-ghost-border-tint-20: #e3e5e8;
143
- --btn-ghost-border-shade-5: #d1d3d7;
144
- --btn-circle-size: 32px;
145
- --btn-circle-size-large: 40px;
146
- --btn-circle-size-small: 24px;
147
- --btn-square-size: 32px;
148
- --btn-square-size-large: 40px;
149
- --btn-square-size-small: 24px;
150
- --grid-columns: 24;
151
- --grid-gutter-width: 0;
152
- --layout-body-background: #f5f7f9;
153
- --layout-header-background: #515a6e;
154
- --layout-header-height: 64px;
155
- --layout-header-padding: 0 50px;
156
- --layout-footer-padding: 24px 50px;
157
- --layout-footer-background: #f5f7f9;
158
- --layout-sider-background: #515a6e;
159
- --layout-sider-background-tint-10: #626b7d;
160
- --layout-trigger-height: 48px;
161
- --layout-trigger-color: #fff;
162
- --layout-zero-trigger-width: 36px;
163
- --layout-zero-trigger-height: 42px;
164
- --legend-color: #999;
165
- --input-height-base: 32px;
166
- --input-height-large: 40px;
167
- --input-height-small: 24px;
168
- --input-padding-horizontal: 7px;
169
- --input-padding-vertical-base: 4px;
170
- --input-padding-vertical-small: 1px;
171
- --input-padding-vertical-large: 6px;
172
- --input-placeholder-color: #c5c8ce;
173
- --input-color: #515a6e;
174
- --input-border-color: #dcdee2;
175
- --input-border-color-tint-20: #e3e5e8;
176
- --input-bg: #fff;
177
- --input-group-bg: #f8f8f9;
178
- --input-hover-border-color: #fa8c16;
179
- --input-hover-border-color-tint-20: #fba345;
180
- --input-hover-border-color-fade-20: rgba(250, 140, 22, 0.2);
181
- --input-focus-border-color: #fa8c16;
182
- --input-disabled-bg: #f3f3f3;
183
- --tag-font-size: 12px;
184
- --screen-xs: 480px;
185
- --screen-xs-min: 480px;
186
- --screen-xs-max: 479px;
187
- --screen-sm: 576px;
188
- --screen-sm-min: 576px;
189
- --screen-sm-max: 575px;
190
- --screen-md: 768px;
191
- --screen-md-min: 768px;
192
- --screen-md-max: 767px;
193
- --screen-lg: 992px;
194
- --screen-lg-min: 992px;
195
- --screen-lg-max: 991px;
196
- --screen-xl: 1200px;
197
- --screen-xl-min: 1200px;
198
- --screen-xl-max: 1199px;
199
- --screen-xxl: 1600px;
200
- --screen-xxl-min: 1600px;
201
- --screen-xxl-max: 1599px;
202
- --zindex-spin: 8;
203
- --zindex-affix: 10;
204
- --zindex-back-top: 10;
205
- --zindex-select: 900;
206
- --zindex-modal: 1000;
207
- --zindex-drawer: 1000;
208
- --zindex-message: 1010;
209
- --zindex-notification: 1010;
210
- --zindex-tooltip: 1060;
211
- --zindex-transfer: 1060;
212
- --zindex-loading-bar: 2000;
213
- --zindex-spin-fullscreen: 2010;
214
- --animation-time: 0.3s;
215
- --animation-time-quick: 0.15s;
216
- --transition-time: 0.2s;
217
- --ease-in-out: ease-in-out;
218
- --slider-color: #fba345;
219
- --slider-height: 4px;
220
- --slider-margin: 16px 0;
221
- --slider-button-wrap-size: 18px;
222
- --slider-button-wrap-offset: -5px;
223
- --slider-disabled-color: #ccc;
224
- --avatar-size-base: 32px;
225
- --avatar-size-lg: 40px;
226
- --avatar-size-sm: 24px;
227
- --avatar-font-size-base: 18px;
228
- --avatar-font-size-lg: 24px;
229
- --avatar-font-size-sm: 14px;
230
- --avatar-bg: #ccc;
231
- --avatar-color: #fff;
232
- --avatar-border-radius: 4px;
233
- --anchor-border-width: 2px;
234
- --list-header-background: transparent;
235
- --list-footer-background: transparent;
236
- --list-empty-text-padding: 16px;
237
- --list-item-padding: 12px 0;
238
- --list-item-meta-margin-bottom: 16px;
239
- --list-item-meta-avatar-margin-right: 16px;
240
- --list-item-meta-title-margin-bottom: 12px;
241
- }