@lambo-design/shared 1.0.0-beta.33 → 1.0.0-beta.331

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 (241) hide show
  1. package/config/config.js +20 -3
  2. package/config/index.js +7 -2
  3. package/config/locale.js +61 -0
  4. package/config/themes/atrovirens/atrovirens.css +589 -0
  5. package/config/themes/atrovirens/atrovirens.css.map +1 -0
  6. package/config/themes/atrovirens/atrovirens.less +680 -0
  7. package/config/themes/atrovirens/var.less +688 -0
  8. package/config/themes/blue/blue.css +589 -0
  9. package/config/themes/blue/blue.css.map +1 -0
  10. package/config/themes/blue/blue.less +683 -0
  11. package/config/themes/blue/var.less +691 -0
  12. package/config/themes/blue-digital/blue-digital.css +589 -0
  13. package/config/themes/blue-digital/blue-digital.css.map +1 -0
  14. package/config/themes/blue-digital/blue-digital.less +683 -0
  15. package/config/themes/blue-digital/var.less +691 -0
  16. package/config/themes/blue-white/blue-white.css +589 -0
  17. package/config/themes/blue-white/blue-white.css.map +1 -0
  18. package/config/themes/blue-white/blue-white.less +684 -0
  19. package/config/themes/blue-white/var.less +690 -0
  20. package/config/themes/blue-white-big/blue-white-big.css +589 -0
  21. package/config/themes/blue-white-big/blue-white-big.css.map +1 -0
  22. package/config/themes/blue-white-big/blue-white-big.less +684 -0
  23. package/config/themes/blue-white-big/var.less +690 -0
  24. package/config/themes/blue-white-tight/blue-white-tight.css +590 -0
  25. package/config/themes/blue-white-tight/blue-white-tight.css.map +1 -0
  26. package/config/themes/blue-white-tight/blue-white-tight.less +684 -0
  27. package/config/themes/blue-white-tight/var.less +692 -0
  28. package/config/themes/canglan/canglan.css +588 -0
  29. package/config/themes/canglan/canglan.css.map +1 -0
  30. package/config/themes/canglan/canglan.less +681 -0
  31. package/config/themes/canglan/var.less +692 -0
  32. package/config/themes/cuiwei/cuiwei.css +589 -0
  33. package/config/themes/cuiwei/cuiwei.css.map +1 -0
  34. package/config/themes/cuiwei/cuiwei.less +681 -0
  35. package/config/themes/cuiwei/var.less +690 -0
  36. package/config/themes/danqing/danqing.css +578 -0
  37. package/config/themes/danqing/danqing.css.map +1 -0
  38. package/config/themes/danqing/danqing.less +681 -0
  39. package/config/themes/danqing/danqing.wxss +576 -0
  40. package/config/themes/danqing/var.less +695 -0
  41. package/config/themes/deep/deep.css +589 -0
  42. package/config/themes/deep/deep.css.map +1 -0
  43. package/config/themes/deep/deep.less +681 -0
  44. package/config/themes/deep/var.less +693 -0
  45. package/config/themes/default/default.css +403 -57
  46. package/config/themes/default/default.css.map +1 -1
  47. package/config/themes/default/default.less +380 -16
  48. package/config/themes/default/var.less +389 -11
  49. package/config/themes/eap/eap.css +589 -0
  50. package/config/themes/eap/eap.css.map +1 -0
  51. package/config/themes/eap/eap.less +684 -0
  52. package/config/themes/eap/var.less +692 -0
  53. package/config/themes/gold/gold.css +589 -0
  54. package/config/themes/gold/gold.css.map +1 -0
  55. package/config/themes/gold/gold.less +684 -0
  56. package/config/themes/gold/var.less +385 -5
  57. package/config/themes/index.js +28 -4
  58. package/config/themes/lime/lime.css +589 -0
  59. package/config/themes/lime/lime.css.map +1 -0
  60. package/config/themes/lime/lime.less +684 -0
  61. package/config/themes/lime/var.less +384 -5
  62. package/config/themes/orange/orange.css +353 -7
  63. package/config/themes/orange/orange.css.map +1 -1
  64. package/config/themes/orange/orange.less +365 -0
  65. package/config/themes/orange/var.less +385 -5
  66. package/config/themes/red/red.css +353 -7
  67. package/config/themes/red/red.css.map +1 -1
  68. package/config/themes/red/red.less +365 -0
  69. package/config/themes/red/var.less +385 -5
  70. package/config/themes/sichuan/sichuan.css +589 -0
  71. package/config/themes/sichuan/sichuan.css.map +1 -0
  72. package/config/themes/sichuan/sichuan.less +684 -0
  73. package/config/themes/sichuan/var.less +690 -0
  74. package/config/themes/theme-atrovirens.js +571 -0
  75. package/config/themes/theme-bd.js +571 -0
  76. package/config/themes/theme-blue.js +571 -0
  77. package/config/themes/theme-bw.js +571 -0
  78. package/config/themes/theme-bwb.js +571 -0
  79. package/config/themes/theme-bwt.js +572 -0
  80. package/config/themes/theme-canglan.js +573 -0
  81. package/config/themes/theme-cuiwei.js +573 -0
  82. package/config/themes/theme-danqing.js +574 -0
  83. package/config/themes/theme-deep.js +571 -0
  84. package/config/themes/theme-default.js +378 -60
  85. package/config/themes/theme-eap.js +571 -0
  86. package/config/themes/theme-gold.js +326 -8
  87. package/config/themes/theme-lime.js +326 -8
  88. package/config/themes/theme-orange.js +560 -29
  89. package/config/themes/theme-red.js +563 -33
  90. package/config/themes/theme-sichuan.js +571 -0
  91. package/config/themes/theme-white.js +571 -0
  92. package/config/themes/white/var.less +691 -0
  93. package/config/themes/white/white.css +589 -0
  94. package/config/themes/white/white.css.map +1 -0
  95. package/config/themes/white/white.less +684 -0
  96. package/directives/module/print.js +1 -0
  97. package/directives/module/vue-print-nb/README.md +63 -0
  98. package/directives/module/vue-print-nb/print.js +94 -0
  99. package/directives/module/vue-print-nb/printarea.js +532 -0
  100. package/index.js +7 -1
  101. package/nstyles/common.less +197 -0
  102. package/nstyles/components/404.less +46 -0
  103. package/nstyles/components/button.less +34 -0
  104. package/nstyles/components/date-picker.less +41 -0
  105. package/nstyles/components/drawer.less +20 -0
  106. package/nstyles/components/dropdown.less +18 -0
  107. package/nstyles/components/excel-flow.less +72 -0
  108. package/nstyles/components/form.less +314 -0
  109. package/nstyles/components/index.less +23 -0
  110. package/nstyles/components/layout/collect.less +10 -0
  111. package/nstyles/components/layout/detail-view.less +107 -0
  112. package/nstyles/components/layout/full-screen.less +7 -0
  113. package/nstyles/components/layout/index.less +7 -0
  114. package/nstyles/components/layout/other-menu.less +142 -0
  115. package/nstyles/components/layout/page-view.less +101 -0
  116. package/nstyles/components/layout/sider-trigger.less +41 -0
  117. package/nstyles/components/layout/tags-nav.less +113 -0
  118. package/nstyles/components/modal.less +90 -0
  119. package/nstyles/components/n-button.less +131 -0
  120. package/nstyles/components/n-image-preview.less +131 -0
  121. package/nstyles/components/n-model/index.less +19 -0
  122. package/nstyles/components/n-model/report-index.less +43 -0
  123. package/nstyles/components/n-panel.less +41 -0
  124. package/nstyles/components/n-picker.less +37 -0
  125. package/nstyles/components/n-sign.less +17 -0
  126. package/nstyles/components/n-tooltip.less +10 -0
  127. package/nstyles/components/panel.less +31 -0
  128. package/nstyles/components/select.less +3 -0
  129. package/nstyles/components/sign.less +27 -0
  130. package/nstyles/components/table.less +413 -0
  131. package/nstyles/components/tree.less +166 -0
  132. package/nstyles/components/upload.less +174 -0
  133. package/nstyles/index.less +5 -0
  134. package/nstyles/reset.less +73 -0
  135. package/nstyles/third/ag.less +226 -0
  136. package/nstyles/third/icons/sort-desc.svg +1 -0
  137. package/nstyles/third/icons/sort-up.svg +1 -0
  138. package/nstyles/third/icons/sorting.svg +1 -0
  139. package/nstyles/third/index.less +11 -0
  140. package/nstyles/third/view-design.less +378 -0
  141. package/nstyles/variables/base.less +143 -0
  142. package/nstyles/variables/index.less +4 -0
  143. package/nstyles/variables/theme/default/button.less +7 -0
  144. package/nstyles/variables/theme/default/common.less +60 -0
  145. package/nstyles/variables/theme/default/index.less +7 -0
  146. package/nstyles/variables/theme/default/layout.less +40 -0
  147. package/nstyles/variables/theme/default/table.less +37 -0
  148. package/nstyles/variables/theme/default/tag.less +3 -0
  149. package/nstyles/variables/theme/default/upload.less +3 -0
  150. package/nstyles/variables/theme/index.less +13 -0
  151. package/nstyles/variables/theme/lsv/button.less +7 -0
  152. package/nstyles/variables/theme/lsv/common.less +39 -0
  153. package/nstyles/variables/theme/lsv/index.less +5 -0
  154. package/nstyles/variables/theme/lsv/layout.less +21 -0
  155. package/nstyles/variables/theme/lsv/table.less +20 -0
  156. package/nstyles/variables/theme/lsv/tag.less +3 -0
  157. package/nstyles/variables/theme/small/button.less +7 -0
  158. package/nstyles/variables/theme/small/common.less +41 -0
  159. package/nstyles/variables/theme/small/index.less +5 -0
  160. package/nstyles/variables/theme/small/layout.less +21 -0
  161. package/nstyles/variables/theme/small/table.less +17 -0
  162. package/nstyles/variables/theme/small/tag.less +3 -0
  163. package/package.json +28 -7
  164. package/plugin/index.js +12 -0
  165. package/plugin/module/date-format.js +30 -0
  166. package/plugin/module/loading.js +26 -0
  167. package/plugin/module/warn-handler.js +11 -0
  168. package/styles/image/indicator-card-header.png +0 -0
  169. package/styles/image/inspur.png +0 -0
  170. package/styles/image/lan_navigator.png +0 -0
  171. package/styles/image/layout-header-bg-canglan.png +0 -0
  172. package/styles/image/layout-header-bg-cuiwei.png +0 -0
  173. package/styles/image/lv_navigator.png +0 -0
  174. package/utils/ajax/abort-controller.js +70 -0
  175. package/utils/ajax/cancel-reason.js +25 -0
  176. package/utils/ajax/cancel-token.js +83 -0
  177. package/utils/ajax/content-type.js +30 -0
  178. package/utils/ajax/headers.js +11 -0
  179. package/utils/ajax/interceptors.js +45 -10
  180. package/utils/ajax/sseFetchUtil.js +118 -0
  181. package/utils/ajax/throttle.js +49 -0
  182. package/utils/assist.js +155 -27
  183. package/utils/base64.js +126 -0
  184. package/utils/blob.js +47 -0
  185. package/utils/context-menu.js +65 -0
  186. package/utils/crypto/aes.js +23 -0
  187. package/utils/crypto/index.js +10 -0
  188. package/utils/crypto/rsa.js +23 -0
  189. package/utils/date.js +334 -305
  190. package/utils/dict/built-in-dict.js +20 -0
  191. package/utils/dict/index.js +191 -0
  192. package/utils/event.js +72 -0
  193. package/utils/excel.js +502 -290
  194. package/utils/file.js +19 -0
  195. package/utils/form/validate.js +29 -0
  196. package/utils/half-year.js +68 -0
  197. package/utils/index.js +37 -0
  198. package/utils/json.js +44 -0
  199. package/utils/locale/en-US.js +175 -0
  200. package/utils/locale/zh-CN.js +175 -0
  201. package/utils/lodop.js +5 -0
  202. package/utils/menu/index.js +292 -15
  203. package/utils/mime_type.js +67 -0
  204. package/utils/modelerUtil.js +4 -1
  205. package/utils/n/api.js +38 -0
  206. package/utils/n/date.js +57 -0
  207. package/utils/n/index.js +10 -0
  208. package/utils/n/is-type.js +176 -0
  209. package/utils/n/number.js +144 -0
  210. package/utils/n/permission-cache.js +11 -0
  211. package/utils/n/reuqest/axiosN.js +17 -0
  212. package/utils/n/reuqest/content-type.js +19 -0
  213. package/utils/n/reuqest/interceptors.js +95 -0
  214. package/utils/n/reuqest/url-params.js +12 -0
  215. package/utils/n/storage.js +51 -0
  216. package/utils/n/token.js +51 -0
  217. package/utils/n/user-cache.js +11 -0
  218. package/utils/n/user.js +34 -0
  219. package/utils/n/uuid.js +16 -0
  220. package/utils/n-generator-routers.js +208 -0
  221. package/utils/n-router.js +205 -0
  222. package/utils/n-theme.js +30 -0
  223. package/utils/number.js +72 -15
  224. package/utils/oss.js +57 -0
  225. package/utils/platform.js +824 -33
  226. package/utils/quarter.js +58 -0
  227. package/utils/storage.js +198 -0
  228. package/utils/style.js +24 -0
  229. package/utils/theme.js +98 -3
  230. package/utils/transfer-queue.js +7 -0
  231. package/utils/transform.js +205 -0
  232. package/utils/type.js +102 -0
  233. package/utils/util.js +795 -0
  234. package/utils/vForm.js +349 -0
  235. package/utils/validator.js +181 -0
  236. package/config/themes/gold/default.css +0 -243
  237. package/config/themes/gold/default.css.map +0 -1
  238. package/config/themes/gold/default.less +0 -320
  239. package/config/themes/lime/default.css +0 -243
  240. package/config/themes/lime/default.css.map +0 -1
  241. package/config/themes/lime/default.less +0 -320
@@ -0,0 +1,7 @@
1
+ :root,.ind-lsv-theme {
2
+ --ind-button-height-md: 30px;
3
+ --ind-button-padding-md: 7px;
4
+
5
+ --ind-button-height-sm: 24px;
6
+ --ind-button-padding-sm: 7px; // 3px;
7
+ }
@@ -0,0 +1,39 @@
1
+ :root,.ind-lsv-theme {
2
+ --ind-menu-desc-margin-top: 0px;
3
+ --ind-sc-padding-top: 10px; // 值来自四川
4
+
5
+ // 压缩padding
6
+ // --ind-padding-xs: 4px;
7
+ --ind-padding-sm: 8px;
8
+
9
+ // card的样式
10
+ --ivu-card-head-padding: 6px 12px;
11
+ --ivu-card-head-line-height: 36px;
12
+ --ivu-card-head-height: 36px;
13
+ --ivu-card-body-padding: 6px;
14
+
15
+ // 表单的样式
16
+ --input-height: 26px; //30px; // 24px; // small 24px // 值来自四川 // 又改一版
17
+ --ivu-form-item-label-padding: 6px 8px 6px 0; // 6px 8px 6px 0; 值来自四川 // 又改一版
18
+ --ivu-form-v6stle-item-label-paddingleft: 12px;
19
+ --ivu-form-item-content-padding: 4px 6px;
20
+ --ivu-form-item-label-before-left: 4px;
21
+ --ivu-form-item-content-line-height: 26px; //30px; //24px; // 值来自四川 // 又改一版
22
+
23
+ // tree样式
24
+ --ind-tree-wrapper-width: 100%;
25
+ --tree-content-padding: var(--ind-padding-xs);
26
+ --ivu-tree-margin: var(--ind-padding-xs) 0;
27
+
28
+ // drawer样式
29
+ --ind-drawer-content-padding: 6px;
30
+ --ind-drawer-footer-padding: 10px 16px;
31
+
32
+ // 报表指标样式
33
+ --report-index-model-panel-padding: var(--tree-content-padding);
34
+ --report-index-options-padding-right: var(--tree-content-padding);
35
+
36
+ // 表格
37
+ --ind-table-button-padding: 6px; // var(--ind-padding-xs);
38
+ --input-height-table: 24px; // 表格输入框的高度
39
+ }
@@ -0,0 +1,5 @@
1
+ @import './button.less';
2
+ @import './common.less';
3
+ @import './layout.less';
4
+ @import './table.less';
5
+ @import './tag.less';
@@ -0,0 +1,21 @@
1
+ :root,.ind-lsv-theme {
2
+ // basic layout 系统布局变量 -begin
3
+ --ivu-menu-item-font-size: var(--ind-font-size-md);
4
+
5
+ --menu-icon-margin-right: var(--ind-padding-xs);
6
+ // basic layout 系统布局变量 -end
7
+
8
+ // page-view layout 系统布局变量 -begin
9
+ --ind-panel-vertical-margin: var(--ind-padding-xs); // 12px;
10
+ --ind-panel-horizon-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
11
+ // page-view layout 系统布局变量 -end
12
+
13
+ // --input-height: 30px; // 24px; // small 24px 挪common.less去了
14
+ --search-margin-bottom: var(--ind-padding-xs); // var(--ind-padding-sm); // 24px; // 6px;
15
+ --search-button-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
16
+
17
+ --menu-name-padding: 0 14px 0 10px; // var(--ind-padding-xs) 14px var(--ind-padding-xs) 10px; // 标题行padding
18
+ --menu-title-font-size: 16px;
19
+ --menu-title-color: #17233d;
20
+ --page-content-padding: var(--ind-padding-xs); // 12px;
21
+ }
@@ -0,0 +1,20 @@
1
+ :root,
2
+ .ind-lsv-theme {
3
+ --ind-table-padding: var(--ind-padding-sm);
4
+ --ind-ag-cell-widget-spacing: 12px;
5
+
6
+ --ind-ag-grid-size: 4px;
7
+ --ind-ag-font-size: var(--ind-font-size-md); // var(--ind-font-size-sm);
8
+ --ind-ag-list-item-height: calc(var(--ag-grid-size) * 6);
9
+ --ind-ag-cell-horizontal-padding: 3px; // 0px
10
+ --ag-header-background-color: black;
11
+
12
+
13
+ // 以下是 ag 没有的
14
+ --ind-ag-cell-icon-margin-left: 3px;
15
+ --ind-ag-cell-header-horizontal-padding: 0px;
16
+ --ind-ag-cell-line-height: 14px;
17
+
18
+ --ind-unit-switch-bottom: 10px;
19
+ --ind-other-button-top: 2px;
20
+ }
@@ -0,0 +1,3 @@
1
+ :root,.ind-lsv-theme {
2
+ --ind-tag-height: 18px; //22px // 16px;; // 值来自四川 // 又改一版
3
+ }
@@ -0,0 +1,7 @@
1
+ :root,.ind-small-theme {
2
+ --ind-button-height-md: 30px;
3
+ --ind-button-padding-md: 7px;
4
+
5
+ --ind-button-height-sm: 24px;
6
+ --ind-button-padding-sm: 7px; // 3px;
7
+ }
@@ -0,0 +1,41 @@
1
+ :root,.ind-small-theme {
2
+ --ind-menu-desc-margin-top: 0px;
3
+ --ind-sc-padding-top: 10px; // 值来自四川
4
+
5
+ // 压缩padding
6
+ // --ind-padding-xs: 4px;
7
+ --ind-padding-sm: 8px;
8
+
9
+ // card的样式
10
+ --ivu-card-head-padding: 6px 12px;
11
+ --ivu-card-head-line-height: 36px;
12
+ --ivu-card-head-height: 36px;
13
+ --ivu-card-body-padding: 6px;
14
+
15
+ // 表单的样式
16
+ --input-height: 26px; //30px; // 24px; // small 24px // 值来自四川 // 又改一版
17
+ --ivu-form-item-label-padding: 6px 8px 6px 0; // 6px 8px 6px 0; 值来自四川 // 又改一版
18
+ --ivu-form-v6stle-item-label-paddingleft: 12px;
19
+ --ivu-form-item-content-padding: 4px 6px;
20
+ --ivu-form-item-label-before-left: 4px;
21
+ --ivu-form-item-content-line-height: 26px; //30px; //24px; // 值来自四川 // 又改一版
22
+
23
+ // tree样式
24
+ --ind-tree-wrapper-width: 100%;
25
+ --tree-content-padding: var(--ind-padding-xs);
26
+ --ivu-tree-margin: var(--ind-padding-xs) 0;
27
+
28
+ // drawer样式
29
+ --ind-drawer-content-padding: 6px;
30
+ --ind-drawer-footer-padding: 10px 16px;
31
+
32
+ // 报表指标样式
33
+ --report-index-model-panel-padding: var(--tree-content-padding);
34
+ --report-index-options-padding-right: var(--tree-content-padding);
35
+
36
+ // 表格
37
+ --ind-table-button-padding: 6px; // var(--ind-padding-xs);
38
+ --input-height-table: 24px; // 表格输入框的高度
39
+
40
+ --ivu-tree-ul-padding: 0px 0px 0px 18px; // 树形左侧错落的间距
41
+ }
@@ -0,0 +1,5 @@
1
+ @import './button.less';
2
+ @import './common.less';
3
+ @import './layout.less';
4
+ @import './table.less';
5
+ @import './tag.less';
@@ -0,0 +1,21 @@
1
+ :root,.ind-small-theme {
2
+ // basic layout 系统布局变量 -begin
3
+ --ivu-menu-item-font-size: var(--ind-font-size-md);
4
+
5
+ --menu-icon-margin-right: var(--ind-padding-xs);
6
+ // basic layout 系统布局变量 -end
7
+
8
+ // page-view layout 系统布局变量 -begin
9
+ --ind-panel-vertical-margin: var(--ind-padding-xs); // 12px;
10
+ --ind-panel-horizon-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
11
+ // page-view layout 系统布局变量 -end
12
+
13
+ // --input-height: 30px; // 24px; // small 24px 挪common.less去了
14
+ --search-margin-bottom: var(--ind-padding-xs); // var(--ind-padding-sm); // 24px; // 6px;
15
+ --search-button-margin: var(--ind-padding-xs); // var(--ind-padding-sm);
16
+
17
+ --menu-name-padding: 0 14px 0 10px; // var(--ind-padding-xs) 14px var(--ind-padding-xs) 10px; // 标题行padding
18
+ --menu-title-font-size: 16px;
19
+ --menu-title-color: #17233d;
20
+ --page-content-padding: var(--ind-padding-xs); // 12px;
21
+ }
@@ -0,0 +1,17 @@
1
+ :root,.ind-small-theme {
2
+ --ind-table-padding: var(--ind-padding-sm);
3
+ --ind-ag-cell-widget-spacing: 12px;
4
+
5
+ --ind-ag-grid-size: 4px;
6
+ --ind-ag-font-size: var(--ind-font-size-md); // var(--ind-font-size-sm);
7
+ --ind-ag-list-item-height: calc(var(--ag-grid-size) * 6);
8
+ --ind-ag-cell-horizontal-padding: 3px; // 0px
9
+
10
+ // 以下是 ag 没有的
11
+ --ind-ag-cell-icon-margin-left: 3px;
12
+ --ind-ag-cell-header-horizontal-padding: 0px;
13
+ --ind-ag-cell-line-height: 14px;
14
+
15
+ --ind-unit-switch-bottom: 10px;
16
+ --ind-other-button-top: 2px;
17
+ }
@@ -0,0 +1,3 @@
1
+ :root,.ind-small-theme {
2
+ --ind-tag-height: 18px; //22px // 16px;; // 值来自四川 // 又改一版
3
+ }
package/package.json CHANGED
@@ -1,22 +1,43 @@
1
1
  {
2
2
  "name": "@lambo-design/shared",
3
- "version": "1.0.0-beta.33",
3
+ "version": "1.0.0-beta.331",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
7
7
  "license": "ISC",
8
8
  "publishConfig": {
9
9
  "access": "public",
10
- "registry": "https://registry.npmjs.org/"
10
+ "registry": "https://registry.npmjs.org/",
11
+ "files": [
12
+ "!**/.*",
13
+ "!**/CHANGELOG.md",
14
+ "**/*"
15
+ ]
11
16
  },
12
17
  "dependencies": {
13
18
  "axios": "^0.24.0",
14
19
  "axios-cache-plugin": "^0.1.0",
15
- "qs": "^6.11.0",
16
- "xlsx": "http://cicd.lambo.top/package/cdn/xlsx-0.19.1.tgz",
17
20
  "classnames": "^2.3.1",
18
- "xlsx-style": "^0.8.13",
19
- "moment": "2.29.4"
21
+ "crypto-js": "^4.2.0",
22
+ "css-vars-ponyfill": "^2.4.8",
23
+ "dayjs": "^1.11.9",
24
+ "lodash": "^4.17.21",
25
+ "moment": "2.29.4",
26
+ "nanoid": "^3.3.7",
27
+ "node-rsa": "^1.1.1",
28
+ "qs": "^6.11.0",
29
+ "@lambo-design/xlsx": "^1.0.0-beta.2",
30
+ "@lambo-design/xlsx-style": "^1.0.0-beta.9"
31
+ },
32
+ "devDependencies": {
33
+ "vue": "^2.6.12"
20
34
  },
21
- "scripts": {}
35
+ "scripts": {
36
+ "release-shared": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
37
+ "release-major": "standard-version --release-as major",
38
+ "release-minor": "standard-version --release-as minor",
39
+ "release-patch": "standard-version --release-as patch",
40
+ "release-beta": "standard-version --prerelease beta",
41
+ "re-publish": "pnpm publish --access public --no-git-checks"
42
+ }
22
43
  }
@@ -0,0 +1,12 @@
1
+ import DateFormat from "./module/date-format";
2
+ import Loading from "./module/loading";
3
+ import WarnHandler from "./module/warn-handler";
4
+ export default {
5
+ install : function (Vue, options) {
6
+ DateFormat.install(Vue,options);
7
+ Loading.install(Vue,options);
8
+ WarnHandler.install(Vue,options);
9
+ }
10
+
11
+ }
12
+ export { DateFormat , Loading , WarnHandler}
@@ -0,0 +1,30 @@
1
+ export default {
2
+ /**
3
+ * 对Date的扩展,将 Date 转化为指定格式的String
4
+ * 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
5
+ * 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
6
+ * 例:
7
+ * (new Date()).Format("yyyy-MM-dd HH:mm:ss.S") ==> 2006-07-02 08:09:04.423
8
+ * (new Date()).Format("yyyy-M-d H:m:s.S") ==> 2006-7-2 8:9:4.18
9
+ */
10
+ install: function (Vue, options) {
11
+ Date.prototype.Format = function (fmt) {
12
+ let o = {
13
+ "M+": this.getMonth() + 1, //月份
14
+ "d+": this.getDate(), //日
15
+ "H+": this.getHours(), //小时
16
+ "m+": this.getMinutes(), //分
17
+ "s+": this.getSeconds(), //秒
18
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
19
+ "S": this.getMilliseconds() //毫秒
20
+ };
21
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
22
+ for (let k in o)
23
+ if (new RegExp("(" + k + ")").test(fmt)) {
24
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)))
25
+ }
26
+ return fmt;
27
+ }
28
+
29
+ }
30
+ }
@@ -0,0 +1,26 @@
1
+ export default {
2
+ install : function (Vue, options) {
3
+ //通用Loading
4
+ Vue.prototype.$ShowLoading = function(text){
5
+ this.$Spin.show({
6
+ render: (h) => {
7
+ return h('div', [
8
+ h('Icon', {
9
+ 'class': 'demo-spin-icon-load',
10
+ props: {
11
+ type: 'ios-loading',
12
+ size: 24
13
+ }
14
+ }),
15
+ h('div', text||'Loading')
16
+ ])
17
+ }
18
+ });
19
+ }
20
+
21
+ Vue.prototype.$CloseLoading = function(){
22
+ this.$Spin.hide();
23
+ }
24
+ }
25
+
26
+ }
@@ -0,0 +1,11 @@
1
+ export default {
2
+ install : function (Vue, options) {
3
+ Vue.config.warnHandler = function (err, vm, info) {
4
+ if (err.toString().indexOf("Component names should conform to valid custom element name in html5 specification")>0){
5
+ console.warn("[Lambo warn]: " + err + info);
6
+ }else{
7
+ console.error("[Vue warn]: " + err + info);
8
+ }
9
+ }
10
+ }
11
+ }
Binary file
Binary file
Binary file
@@ -0,0 +1,70 @@
1
+ // 用于存储每个请求的标识和取消函数
2
+ import qs from "qs";
3
+
4
+ const pendingMap = new Map();
5
+
6
+ const getPendingUrl = (config) => {
7
+ const { url, method, data, headers } = config;
8
+
9
+ // 生成请求唯一标识
10
+ return headers['is-cancel-token']
11
+ ? headers['is-cancel-token']
12
+ : [url, method, qs.stringify(data)].join('&');
13
+ };
14
+
15
+ /**
16
+ * 添加请求
17
+ * @param config 请求配置
18
+ */
19
+ function addPending(config) {
20
+ removePending(config);
21
+ const url = getPendingUrl(config);
22
+ const controller = new AbortController();
23
+ config.signal = config.signal || controller.signal;
24
+ if (!pendingMap.has(url)) {
25
+ // 如果当前请求不在等待中,将其添加到等待中
26
+ pendingMap.set(url, controller);
27
+ }
28
+ }
29
+
30
+ /**
31
+ * 移除请求
32
+ * @param config 请求配置
33
+ */
34
+ function removePending(config) {
35
+ const url = getPendingUrl(config);
36
+ if (pendingMap.has(url)) {
37
+ // 如果当前请求在等待中,取消它并将其从等待中移除
38
+ const abortController = pendingMap.get(url);
39
+ if (abortController) {
40
+ abortController.abort();
41
+ }
42
+ pendingMap.delete(url);
43
+ }
44
+ }
45
+
46
+ /**
47
+ * 重置
48
+ */
49
+ function reset() {
50
+ pendingMap.clear();
51
+ }
52
+
53
+ /**
54
+ * 清除所有等待中的请求
55
+ */
56
+ function removeAllPending() {
57
+ pendingMap.forEach((abortController) => {
58
+ if (abortController) {
59
+ abortController.abort();
60
+ }
61
+ });
62
+ reset();
63
+ }
64
+
65
+
66
+ export default {
67
+ addPending,
68
+ removePending,
69
+ removeAllPending
70
+ }
@@ -0,0 +1,25 @@
1
+ // 自定义取消原因枚举
2
+ import Vue from "vue";
3
+
4
+ export const CancelReason = {
5
+ USER_ACTION: 'user_action',
6
+ NAVIGATION: 'navigation',
7
+ TIMEOUT: 'timeout',
8
+ DUPLICATE: 'duplicate'
9
+ };
10
+
11
+ export const showReason = (reason)=>{
12
+ switch (reason) {
13
+ case CancelReason.USER_ACTION:
14
+ Vue.prototype.$Message.info('操作已取消')
15
+ break;
16
+ case CancelReason.TIMEOUT:
17
+ Vue.prototype.$Message.error('请求超时,请重试');
18
+ break;
19
+ case CancelReason.DUPLICATE:
20
+ Vue.prototype.$Message.warning('重复请求已取消');
21
+ break;
22
+ default:
23
+ Vue.prototype.$Message.error('请求已取消');
24
+ }
25
+ }
@@ -0,0 +1,83 @@
1
+ // axios 0.22.0 版本以后推荐使用abort-controller
2
+ import axios from "axios";
3
+ import qs from 'qs'
4
+ import {CancelReason} from "./cancel-reason";
5
+ // 存储所有请求的取消函数
6
+ const cancelTokenMap = {};
7
+
8
+ const getPendingUrl = (config) => {
9
+ const { url, method, data, headers } = config;
10
+
11
+ // 生成请求唯一标识
12
+ return headers['is-cancel-token']
13
+ ? headers['is-cancel-token']
14
+ : [url, method, qs.stringify(data)].join('&');
15
+ };
16
+ /**
17
+ * 生成请求唯一标识并注册取消函数
18
+ * @param {Object} config - 请求配置
19
+ * @returns {Object} 增强后的请求配置
20
+ */
21
+ function addPending(config) {
22
+
23
+ // 生成请求唯一标识
24
+ const requestId = getPendingUrl(config);
25
+
26
+ // 获取已存在的取消函数
27
+ const existingCancel = cancelTokenMap[requestId];
28
+
29
+ // 注册取消令牌
30
+ config.cancelToken = config.cancelToken || new axios.CancelToken(cancel => {
31
+ if (!existingCancel) {
32
+ cancelTokenMap[requestId] = cancel;
33
+ }
34
+ });
35
+
36
+ return config;
37
+ }
38
+
39
+ /**
40
+ * 取消指定请求
41
+ * @param {Object} config - 要取消的请求配置
42
+ */
43
+ function removePending(config) {
44
+ const { url, method, data, headers } = config;
45
+
46
+ const requestId = getPendingUrl(config);
47
+
48
+ const cancelFn = cancelTokenMap[requestId];
49
+
50
+ if (cancelFn && typeof cancelFn === 'function') {
51
+ cancelFn({
52
+ type: 'cancel',
53
+ url: requestId,
54
+ reason: CancelReason.DUPLICATE,
55
+ message: '数据正在处理,请勿重复提交'
56
+ }); // 执行取消
57
+ delete cancelTokenMap[requestId]; // 清理
58
+ }
59
+ }
60
+
61
+ /**
62
+ * 取消所有未完成的请求
63
+ */
64
+ function removeAllPending() {
65
+ Object.keys(cancelTokenMap).forEach(key => {
66
+ const cancelFn = cancelTokenMap[key];
67
+ if (cancelFn && typeof cancelFn === 'function') {
68
+ cancelFn({
69
+ type: 'cancel',
70
+ url: key,
71
+ reason: CancelReason.NAVIGATION,
72
+ message: '请求已取消'
73
+ }); // 执行取消
74
+ delete cancelTokenMap[key]; // 清理
75
+ }
76
+ });
77
+ }
78
+
79
+ export default {
80
+ addPending,
81
+ removePending,
82
+ removeAllPending
83
+ }
@@ -0,0 +1,30 @@
1
+ const contentTypeKey = 'Content-Type'
2
+
3
+ export function getContentType(config) {
4
+ // let type = config?.[contentTypeKey] || config?.['content-type'] || ''
5
+ let type = '';
6
+
7
+ if (config && config[contentTypeKey]) {
8
+ type = config[contentTypeKey];
9
+ } else if (config && config['content-type']) {
10
+ type = config['content-type'];
11
+ }
12
+ const suffixIdx = type.indexOf(';')
13
+ if (suffixIdx !== -1) {
14
+ type = type.substring(0, suffixIdx)
15
+ }
16
+
17
+ return type
18
+ }
19
+
20
+ export function setContentType(headers, type) {
21
+ headers[contentTypeKey] = type
22
+ }
23
+
24
+ export const CONTENT_TYPE = {
25
+ form: 'application/x-www-form-urlencoded',
26
+ multiForm: 'multipart/form-data',
27
+ body: 'application/json',
28
+ os: 'application/octet-stream',
29
+ json: 'application/json',
30
+ }
@@ -0,0 +1,11 @@
1
+ let headers = {}
2
+ headers.tenant = {
3
+ tenantCode: 'tenant-code',
4
+ systemType: 'system-type',
5
+ }
6
+
7
+ headers.auth = {
8
+ token: 'token'
9
+ }
10
+
11
+ export default headers