@lambo-design/shared 1.0.0-beta.30 → 1.0.0-beta.301

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 (227) 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-white/blue-white.css +589 -0
  13. package/config/themes/blue-white/blue-white.css.map +1 -0
  14. package/config/themes/blue-white/blue-white.less +684 -0
  15. package/config/themes/blue-white/var.less +690 -0
  16. package/config/themes/blue-white-big/blue-white-big.css +589 -0
  17. package/config/themes/blue-white-big/blue-white-big.css.map +1 -0
  18. package/config/themes/blue-white-big/blue-white-big.less +684 -0
  19. package/config/themes/blue-white-big/var.less +690 -0
  20. package/config/themes/blue-white-tight/blue-white-tight.css +590 -0
  21. package/config/themes/blue-white-tight/blue-white-tight.css.map +1 -0
  22. package/config/themes/blue-white-tight/blue-white-tight.less +684 -0
  23. package/config/themes/blue-white-tight/var.less +692 -0
  24. package/config/themes/canglan/canglan.css +588 -0
  25. package/config/themes/canglan/canglan.css.map +1 -0
  26. package/config/themes/canglan/canglan.less +681 -0
  27. package/config/themes/canglan/var.less +692 -0
  28. package/config/themes/cuiwei/cuiwei.css +589 -0
  29. package/config/themes/cuiwei/cuiwei.css.map +1 -0
  30. package/config/themes/cuiwei/cuiwei.less +681 -0
  31. package/config/themes/cuiwei/var.less +690 -0
  32. package/config/themes/danqing/danqing.css +589 -0
  33. package/config/themes/danqing/danqing.css.map +1 -0
  34. package/config/themes/danqing/danqing.less +681 -0
  35. package/config/themes/danqing/danqing.wxss +576 -0
  36. package/config/themes/danqing/var.less +695 -0
  37. package/config/themes/deep/deep.css +589 -0
  38. package/config/themes/deep/deep.css.map +1 -0
  39. package/config/themes/deep/deep.less +681 -0
  40. package/config/themes/deep/var.less +693 -0
  41. package/config/themes/default/default.css +403 -57
  42. package/config/themes/default/default.css.map +1 -1
  43. package/config/themes/default/default.less +380 -16
  44. package/config/themes/default/var.less +389 -11
  45. package/config/themes/eap/eap.css +589 -0
  46. package/config/themes/eap/eap.css.map +1 -0
  47. package/config/themes/eap/eap.less +684 -0
  48. package/config/themes/eap/var.less +692 -0
  49. package/config/themes/gold/gold.css +589 -0
  50. package/config/themes/gold/gold.css.map +1 -0
  51. package/config/themes/gold/gold.less +684 -0
  52. package/config/themes/gold/var.less +385 -5
  53. package/config/themes/index.js +24 -4
  54. package/config/themes/lime/lime.css +589 -0
  55. package/config/themes/lime/lime.css.map +1 -0
  56. package/config/themes/lime/lime.less +684 -0
  57. package/config/themes/lime/var.less +384 -5
  58. package/config/themes/orange/orange.css +353 -7
  59. package/config/themes/orange/orange.css.map +1 -1
  60. package/config/themes/orange/orange.less +365 -0
  61. package/config/themes/orange/var.less +385 -5
  62. package/config/themes/red/red.css +353 -7
  63. package/config/themes/red/red.css.map +1 -1
  64. package/config/themes/red/red.less +365 -0
  65. package/config/themes/red/var.less +385 -5
  66. package/config/themes/theme-atrovirens.js +571 -0
  67. package/config/themes/theme-blue.js +571 -0
  68. package/config/themes/theme-bw.js +571 -0
  69. package/config/themes/theme-bwb.js +571 -0
  70. package/config/themes/theme-bwt.js +572 -0
  71. package/config/themes/theme-canglan.js +573 -0
  72. package/config/themes/theme-cuiwei.js +573 -0
  73. package/config/themes/theme-danqing.js +574 -0
  74. package/config/themes/theme-deep.js +571 -0
  75. package/config/themes/theme-default.js +378 -60
  76. package/config/themes/theme-eap.js +571 -0
  77. package/config/themes/theme-gold.js +326 -8
  78. package/config/themes/theme-lime.js +326 -8
  79. package/config/themes/theme-orange.js +560 -29
  80. package/config/themes/theme-red.js +563 -33
  81. package/config/themes/theme-white.js +571 -0
  82. package/config/themes/white/var.less +691 -0
  83. package/config/themes/white/white.css +589 -0
  84. package/config/themes/white/white.css.map +1 -0
  85. package/config/themes/white/white.less +684 -0
  86. package/directives/module/print.js +1 -0
  87. package/directives/module/vue-print-nb/README.md +63 -0
  88. package/directives/module/vue-print-nb/print.js +94 -0
  89. package/directives/module/vue-print-nb/printarea.js +532 -0
  90. package/index.js +7 -1
  91. package/nstyles/common.less +197 -0
  92. package/nstyles/components/404.less +46 -0
  93. package/nstyles/components/button.less +34 -0
  94. package/nstyles/components/date-picker.less +41 -0
  95. package/nstyles/components/drawer.less +20 -0
  96. package/nstyles/components/dropdown.less +18 -0
  97. package/nstyles/components/excel-flow.less +72 -0
  98. package/nstyles/components/form.less +313 -0
  99. package/nstyles/components/index.less +23 -0
  100. package/nstyles/components/layout/collect.less +10 -0
  101. package/nstyles/components/layout/detail-view.less +107 -0
  102. package/nstyles/components/layout/full-screen.less +7 -0
  103. package/nstyles/components/layout/index.less +7 -0
  104. package/nstyles/components/layout/other-menu.less +142 -0
  105. package/nstyles/components/layout/page-view.less +101 -0
  106. package/nstyles/components/layout/sider-trigger.less +41 -0
  107. package/nstyles/components/layout/tags-nav.less +113 -0
  108. package/nstyles/components/modal.less +90 -0
  109. package/nstyles/components/n-button.less +131 -0
  110. package/nstyles/components/n-image-preview.less +131 -0
  111. package/nstyles/components/n-model/index.less +19 -0
  112. package/nstyles/components/n-model/report-index.less +43 -0
  113. package/nstyles/components/n-panel.less +41 -0
  114. package/nstyles/components/n-picker.less +37 -0
  115. package/nstyles/components/n-sign.less +17 -0
  116. package/nstyles/components/n-tooltip.less +10 -0
  117. package/nstyles/components/panel.less +31 -0
  118. package/nstyles/components/select.less +3 -0
  119. package/nstyles/components/sign.less +27 -0
  120. package/nstyles/components/table.less +412 -0
  121. package/nstyles/components/tree.less +166 -0
  122. package/nstyles/components/upload.less +174 -0
  123. package/nstyles/index.less +5 -0
  124. package/nstyles/reset.less +73 -0
  125. package/nstyles/third/ag.less +206 -0
  126. package/nstyles/third/icons/sort-desc.svg +1 -0
  127. package/nstyles/third/icons/sort-up.svg +1 -0
  128. package/nstyles/third/icons/sorting.svg +1 -0
  129. package/nstyles/third/index.less +11 -0
  130. package/nstyles/third/view-design.less +378 -0
  131. package/nstyles/variables/base.less +143 -0
  132. package/nstyles/variables/index.less +4 -0
  133. package/nstyles/variables/theme/default/button.less +7 -0
  134. package/nstyles/variables/theme/default/common.less +60 -0
  135. package/nstyles/variables/theme/default/index.less +7 -0
  136. package/nstyles/variables/theme/default/layout.less +40 -0
  137. package/nstyles/variables/theme/default/table.less +37 -0
  138. package/nstyles/variables/theme/default/tag.less +3 -0
  139. package/nstyles/variables/theme/default/upload.less +3 -0
  140. package/nstyles/variables/theme/index.less +13 -0
  141. package/nstyles/variables/theme/lsv/button.less +7 -0
  142. package/nstyles/variables/theme/lsv/common.less +39 -0
  143. package/nstyles/variables/theme/lsv/index.less +5 -0
  144. package/nstyles/variables/theme/lsv/layout.less +21 -0
  145. package/nstyles/variables/theme/lsv/table.less +20 -0
  146. package/nstyles/variables/theme/lsv/tag.less +3 -0
  147. package/nstyles/variables/theme/small/button.less +7 -0
  148. package/nstyles/variables/theme/small/common.less +41 -0
  149. package/nstyles/variables/theme/small/index.less +5 -0
  150. package/nstyles/variables/theme/small/layout.less +21 -0
  151. package/nstyles/variables/theme/small/table.less +17 -0
  152. package/nstyles/variables/theme/small/tag.less +3 -0
  153. package/package.json +28 -7
  154. package/plugin/index.js +12 -0
  155. package/plugin/module/date-format.js +30 -0
  156. package/plugin/module/loading.js +26 -0
  157. package/plugin/module/warn-handler.js +11 -0
  158. package/styles/image/indicator-card-header.png +0 -0
  159. package/styles/image/inspur.png +0 -0
  160. package/styles/image/lan_navigator.png +0 -0
  161. package/styles/image/layout-header-bg-canglan.png +0 -0
  162. package/styles/image/layout-header-bg-cuiwei.png +0 -0
  163. package/styles/image/lv_navigator.png +0 -0
  164. package/utils/ajax/content-type.js +30 -0
  165. package/utils/ajax/headers.js +11 -0
  166. package/utils/ajax/interceptors.js +12 -4
  167. package/utils/ajax/sseFetchUtil.js +118 -0
  168. package/utils/assist.js +155 -27
  169. package/utils/base64.js +126 -0
  170. package/utils/blob.js +47 -0
  171. package/utils/context-menu.js +65 -0
  172. package/utils/crypto/aes.js +23 -0
  173. package/utils/crypto/index.js +10 -0
  174. package/utils/crypto/rsa.js +23 -0
  175. package/utils/date.js +334 -305
  176. package/utils/dict/built-in-dict.js +20 -0
  177. package/utils/dict/index.js +191 -0
  178. package/utils/event.js +72 -0
  179. package/utils/excel.js +373 -241
  180. package/utils/file.js +19 -0
  181. package/utils/form/validate.js +29 -0
  182. package/utils/half-year.js +68 -0
  183. package/utils/index.js +37 -0
  184. package/utils/json.js +44 -0
  185. package/utils/locale/en-US.js +171 -0
  186. package/utils/locale/zh-CN.js +171 -0
  187. package/utils/lodop.js +5 -0
  188. package/utils/menu/index.js +292 -15
  189. package/utils/mime_type.js +67 -0
  190. package/utils/modelerUtil.js +4 -1
  191. package/utils/n/api.js +38 -0
  192. package/utils/n/date.js +57 -0
  193. package/utils/n/index.js +10 -0
  194. package/utils/n/is-type.js +176 -0
  195. package/utils/n/number.js +144 -0
  196. package/utils/n/permission-cache.js +11 -0
  197. package/utils/n/reuqest/axiosN.js +17 -0
  198. package/utils/n/reuqest/content-type.js +19 -0
  199. package/utils/n/reuqest/interceptors.js +95 -0
  200. package/utils/n/reuqest/url-params.js +12 -0
  201. package/utils/n/storage.js +51 -0
  202. package/utils/n/token.js +51 -0
  203. package/utils/n/user-cache.js +11 -0
  204. package/utils/n/user.js +34 -0
  205. package/utils/n/uuid.js +16 -0
  206. package/utils/n-generator-routers.js +208 -0
  207. package/utils/n-router.js +205 -0
  208. package/utils/n-theme.js +30 -0
  209. package/utils/number.js +72 -15
  210. package/utils/oss.js +57 -0
  211. package/utils/platform.js +824 -31
  212. package/utils/quarter.js +58 -0
  213. package/utils/storage.js +198 -0
  214. package/utils/style.js +24 -0
  215. package/utils/theme.js +98 -3
  216. package/utils/transfer-queue.js +7 -0
  217. package/utils/transform.js +205 -0
  218. package/utils/type.js +102 -0
  219. package/utils/util.js +795 -0
  220. package/utils/vForm.js +349 -0
  221. package/utils/validator.js +181 -0
  222. package/config/themes/gold/default.css +0 -243
  223. package/config/themes/gold/default.css.map +0 -1
  224. package/config/themes/gold/default.less +0 -320
  225. package/config/themes/lime/default.css +0 -243
  226. package/config/themes/lime/default.css.map +0 -1
  227. 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.30",
3
+ "version": "1.0.0-beta.301",
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": {
18
+ "@e965/xlsx": "0.20.3",
13
19
  "axios": "^0.24.0",
14
20
  "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
21
  "classnames": "^2.3.1",
18
- "xlsx-style": "^0.8.13",
19
- "moment": "2.29.4"
22
+ "crypto-js": "^4.2.0",
23
+ "css-vars-ponyfill": "^2.4.8",
24
+ "dayjs": "^1.11.9",
25
+ "lodash": "^4.17.21",
26
+ "moment": "2.29.4",
27
+ "nanoid": "^3.3.7",
28
+ "node-rsa": "^1.1.1",
29
+ "qs": "^6.11.0"
20
30
  },
21
- "scripts": {}
31
+ "devDependencies": {
32
+ "vue": "^2.6.12",
33
+ "@lambo-design/xlsx-style": "^1.0.0-beta.7"
34
+ },
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,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
@@ -1,8 +1,8 @@
1
1
  import qs from 'qs'
2
2
  import cacheRules from "./cacheconf";
3
- import {getToken,getUrlParams} from '../platform'
3
+ import {getLocalStorage, getToken, getUrlParams} from '../platform'
4
4
  import Bus from '../bus';
5
-
5
+ import headers from './headers';
6
6
 
7
7
  let timer1, timer2;
8
8
  let hasDialog = false;
@@ -12,13 +12,21 @@ function requestInterceptors(config) {
12
12
 
13
13
  let token = getToken();
14
14
  if (token) {
15
- config.headers.token = token;
15
+ config.headers[headers.auth.token] = token;
16
+ }
17
+
18
+ let systemType = getLocalStorage('systemType')
19
+ let tenantCode = getLocalStorage('tenantCode')
20
+
21
+ if(systemType && tenantCode){
22
+ config.headers[headers.tenant.tenantCode] = tenantCode;
23
+ config.headers[headers.tenant.systemType] = systemType;
16
24
  }
17
25
 
18
26
  //sso_token认证
19
27
  if (params.hasOwnProperty('sso_token')||sessionStorage.getItem('sso_token')) {
20
28
  config.params = Object.assign({
21
- sso_token: params.sso_token||sessionStorage.getItem('sso_token') ,
29
+ sso_token: params.sso_token||sessionStorage.getItem('sso_token'),
22
30
  sso_id: params.sso_id
23
31
  }, config.params)
24
32
  }
@@ -0,0 +1,118 @@
1
+ class CustomEventSource {
2
+ constructor(url, options) {
3
+ this.url = url;
4
+ this.options = options || {};
5
+ this.listeners = {};
6
+ this.awaitConnect()
7
+ }
8
+
9
+ async awaitConnect() {
10
+ const response = await fetch(this.url, { ...this.options, method: 'POST' });
11
+ const reader = response.body.getReader();
12
+ await this.readStream(reader);
13
+ }
14
+
15
+ async readStream(reader) {
16
+ let done, value, chunk = '';
17
+ const decoder = new TextDecoder('utf-8');
18
+ do {
19
+ ({done, value} = await reader.read());
20
+ if (done) {
21
+ this.dispatchEvent('message_finished');
22
+ } else {
23
+ chunk += decoder.decode(value, { stream: true })
24
+ if (chunk && chunk.trim().endsWith("}")) {
25
+ const lines = chunk.split('\n');
26
+ // chunk = '';
27
+ for (let line of lines) {
28
+ if (line.startsWith('data:')) {
29
+ const data = line.substring(5).trim(); // 去掉 'data:' 前缀
30
+ if (data) {
31
+ try {
32
+ const jsonData = JSON.parse(data);
33
+ }catch (e) {
34
+ // 解析失败,说明数据可能不完整,等待更多数据
35
+ console.warn("JSON 解析失败,等待更多数据:", e);
36
+ break;
37
+ }
38
+ this.dispatchEvent('message', { data: data });
39
+ }
40
+ } else if (line.startsWith("{") && line.endsWith("}")) {
41
+ try {
42
+ const jsonData = JSON.parse(line);
43
+ }catch (e) {
44
+ console.warn("JSON 解析失败,等待更多数据:", e);
45
+ break;
46
+ }
47
+ this.dispatchEvent('message', { data: line });
48
+ }
49
+ }
50
+ chunk = '';
51
+ }
52
+ }
53
+ } while (!done);
54
+ }
55
+
56
+ connect() {
57
+ fetch(this.url, { ...this.options, method: 'POST' })
58
+ .then(response => {
59
+ if (response.ok && response.body) {
60
+ const reader = response.body.getReader();
61
+ this.read(reader);
62
+ } else {
63
+ throw new Error('Failed to connect to the SSE endpoint.');
64
+ }
65
+ })
66
+ .catch(error => {
67
+ console.error('Connection error:', error);
68
+ this.dispatchEvent('message_finished',error);
69
+ });
70
+ }
71
+
72
+ read(reader) {
73
+ reader.read().then(({done,value}) => {
74
+ if (done) {
75
+ this.dispatchEvent('message_finished');
76
+ } else {
77
+ const decoder = new TextDecoder('utf-8');
78
+ const chunk = decoder.decode(value, { stream: true });
79
+ if (chunk) {
80
+ const lines = chunk.split('\n');
81
+ for (let line of lines) {
82
+ if (line.startsWith('data:')) {
83
+ const data = line.substring(5).trim(); // 去掉 'data:' 前缀
84
+ if (data) {
85
+ this.dispatchEvent('message', { data: data });
86
+ }
87
+ } else if (line.startsWith("{") && line.endsWith("}")) {
88
+ this.dispatchEvent('message', { data: line });
89
+ }
90
+ }
91
+ }
92
+
93
+ this.read(reader);
94
+ }
95
+ }).catch(error => {
96
+ console.error('Read error:', error);
97
+ this.dispatchEvent('message_finished',error);
98
+ });
99
+ }
100
+
101
+ addEventListener(type, listener) {
102
+ if (!this.listeners[type]) {
103
+ this.listeners[type] = [];
104
+ }
105
+ this.listeners[type].push(listener);
106
+ }
107
+
108
+ dispatchEvent(type, event) {
109
+ if (this.listeners[type]) {
110
+ this.listeners[type].forEach(listener => listener(event));
111
+ }
112
+ }
113
+ }
114
+
115
+ export default CustomEventSource;
116
+ export {
117
+ CustomEventSource
118
+ }