@lambo-design/shared 1.0.0-beta.21 → 1.0.0-beta.210

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 (183) hide show
  1. package/config/config.js +16 -2
  2. package/config/index.js +7 -2
  3. package/config/themes/atrovirens/atrovirens.css +571 -0
  4. package/config/themes/atrovirens/atrovirens.css.map +1 -0
  5. package/config/themes/atrovirens/atrovirens.less +660 -0
  6. package/config/themes/atrovirens/var.less +666 -0
  7. package/config/themes/blue/blue.css +571 -0
  8. package/config/themes/blue/blue.css.map +1 -0
  9. package/config/themes/blue/blue.less +663 -0
  10. package/config/themes/blue/var.less +669 -0
  11. package/config/themes/blue-white/blue-white.css +571 -0
  12. package/config/themes/blue-white/blue-white.css.map +1 -0
  13. package/config/themes/blue-white/blue-white.less +663 -0
  14. package/config/themes/blue-white/var.less +669 -0
  15. package/config/themes/blue-white-tight/blue-white-tight.css +572 -0
  16. package/config/themes/blue-white-tight/blue-white-tight.css.map +1 -0
  17. package/config/themes/blue-white-tight/blue-white-tight.less +664 -0
  18. package/config/themes/blue-white-tight/var.less +670 -0
  19. package/config/themes/deep/deep.css +571 -0
  20. package/config/themes/deep/deep.css.map +1 -0
  21. package/config/themes/deep/deep.less +662 -0
  22. package/config/themes/deep/var.less +669 -0
  23. package/config/themes/default/default.css +387 -57
  24. package/config/themes/default/default.css.map +1 -0
  25. package/config/themes/default/default.less +432 -88
  26. package/config/themes/default/var.less +368 -12
  27. package/config/themes/eap/eap.css +571 -0
  28. package/config/themes/eap/eap.css.map +1 -0
  29. package/config/themes/eap/eap.less +663 -0
  30. package/config/themes/eap/var.less +670 -0
  31. package/config/themes/gold/gold.css +571 -0
  32. package/config/themes/gold/gold.css.map +1 -0
  33. package/config/themes/gold/gold.less +663 -0
  34. package/config/themes/gold/var.less +363 -7
  35. package/config/themes/green-tobacco/greentobacco.css +571 -0
  36. package/config/themes/green-tobacco/greentobacco.less +661 -0
  37. package/config/themes/green-tobacco/var.less +669 -0
  38. package/config/themes/index.js +16 -4
  39. package/config/themes/lime/lime.css +571 -0
  40. package/config/themes/lime/lime.css.map +1 -0
  41. package/config/themes/lime/lime.less +663 -0
  42. package/config/themes/lime/var.less +363 -7
  43. package/config/themes/orange/orange.css +571 -0
  44. package/config/themes/orange/orange.css.map +1 -0
  45. package/config/themes/orange/orange.less +663 -0
  46. package/config/themes/orange/var.less +671 -0
  47. package/config/themes/red/red.css +571 -0
  48. package/config/themes/red/red.css.map +1 -0
  49. package/config/themes/red/red.less +663 -0
  50. package/config/themes/red/var.less +670 -0
  51. package/config/themes/theme-atrovirens.js +554 -0
  52. package/config/themes/theme-blue.js +554 -0
  53. package/config/themes/theme-bw.js +554 -0
  54. package/config/themes/theme-bwt.js +555 -0
  55. package/config/themes/theme-deep.js +554 -0
  56. package/config/themes/theme-default.js +361 -59
  57. package/config/themes/theme-eap.js +554 -0
  58. package/config/themes/theme-gold.js +313 -11
  59. package/config/themes/theme-greentobacco.js +554 -0
  60. package/config/themes/theme-lime.js +313 -11
  61. package/config/themes/theme-orange.js +542 -27
  62. package/config/themes/theme-red.js +546 -32
  63. package/directives/module/print.js +1 -0
  64. package/directives/module/vue-print-nb/README.md +63 -0
  65. package/directives/module/vue-print-nb/print.js +94 -0
  66. package/directives/module/vue-print-nb/printarea.js +532 -0
  67. package/index.js +7 -1
  68. package/nstyles/common.less +197 -0
  69. package/nstyles/components/404.less +46 -0
  70. package/nstyles/components/button.less +34 -0
  71. package/nstyles/components/date-picker.less +37 -0
  72. package/nstyles/components/drawer.less +20 -0
  73. package/nstyles/components/dropdown.less +18 -0
  74. package/nstyles/components/excel-flow.less +72 -0
  75. package/nstyles/components/form.less +303 -0
  76. package/nstyles/components/index.less +23 -0
  77. package/nstyles/components/layout/collect.less +10 -0
  78. package/nstyles/components/layout/detail-view.less +107 -0
  79. package/nstyles/components/layout/full-screen.less +7 -0
  80. package/nstyles/components/layout/index.less +7 -0
  81. package/nstyles/components/layout/other-menu.less +142 -0
  82. package/nstyles/components/layout/page-view.less +101 -0
  83. package/nstyles/components/layout/sider-trigger.less +41 -0
  84. package/nstyles/components/layout/tags-nav.less +113 -0
  85. package/nstyles/components/modal.less +85 -0
  86. package/nstyles/components/n-button.less +131 -0
  87. package/nstyles/components/n-image-preview.less +131 -0
  88. package/nstyles/components/n-model/index.less +19 -0
  89. package/nstyles/components/n-model/report-index.less +43 -0
  90. package/nstyles/components/n-panel.less +41 -0
  91. package/nstyles/components/n-picker.less +37 -0
  92. package/nstyles/components/n-sign.less +17 -0
  93. package/nstyles/components/n-tooltip.less +10 -0
  94. package/nstyles/components/panel.less +31 -0
  95. package/nstyles/components/select.less +3 -0
  96. package/nstyles/components/sign.less +27 -0
  97. package/nstyles/components/table.less +315 -0
  98. package/nstyles/components/tree.less +159 -0
  99. package/nstyles/components/upload.less +164 -0
  100. package/nstyles/index.less +5 -0
  101. package/nstyles/reset.less +65 -0
  102. package/nstyles/third/ag.less +174 -0
  103. package/nstyles/third/icons/sort-desc.svg +1 -0
  104. package/nstyles/third/icons/sort-up.svg +1 -0
  105. package/nstyles/third/icons/sorting.svg +1 -0
  106. package/nstyles/third/index.less +11 -0
  107. package/nstyles/third/view-design.less +363 -0
  108. package/nstyles/variables/base.less +143 -0
  109. package/nstyles/variables/index.less +4 -0
  110. package/nstyles/variables/theme/default/button.less +7 -0
  111. package/nstyles/variables/theme/default/common.less +57 -0
  112. package/nstyles/variables/theme/default/index.less +7 -0
  113. package/nstyles/variables/theme/default/layout.less +40 -0
  114. package/nstyles/variables/theme/default/table.less +37 -0
  115. package/nstyles/variables/theme/default/tag.less +3 -0
  116. package/nstyles/variables/theme/default/upload.less +3 -0
  117. package/nstyles/variables/theme/index.less +13 -0
  118. package/nstyles/variables/theme/small/button.less +7 -0
  119. package/nstyles/variables/theme/small/common.less +39 -0
  120. package/nstyles/variables/theme/small/index.less +5 -0
  121. package/nstyles/variables/theme/small/layout.less +21 -0
  122. package/nstyles/variables/theme/small/table.less +17 -0
  123. package/nstyles/variables/theme/small/tag.less +3 -0
  124. package/package.json +27 -7
  125. package/plugin/index.js +12 -0
  126. package/plugin/module/date-format.js +30 -0
  127. package/plugin/module/loading.js +26 -0
  128. package/plugin/module/warn-handler.js +11 -0
  129. package/styles/image/inspur.png +0 -0
  130. package/styles/image/lan_navigator.png +0 -0
  131. package/styles/image/lv_navigator.png +0 -0
  132. package/utils/ajax/content-type.js +30 -0
  133. package/utils/assist.js +88 -25
  134. package/utils/base64.js +126 -0
  135. package/utils/blob.js +47 -0
  136. package/utils/crypto/index.js +10 -0
  137. package/utils/date.js +334 -305
  138. package/utils/dict/built-in-dict.js +20 -0
  139. package/utils/dict/index.js +133 -0
  140. package/utils/event.js +72 -0
  141. package/utils/excel.js +369 -237
  142. package/utils/file.js +19 -0
  143. package/utils/form/validate.js +29 -0
  144. package/utils/half-year.js +68 -0
  145. package/utils/index.js +37 -0
  146. package/utils/json.js +29 -0
  147. package/utils/lodop.js +5 -0
  148. package/utils/menu/index.js +267 -11
  149. package/utils/mime_type.js +67 -0
  150. package/utils/modelerUtil.js +4 -1
  151. package/utils/n/api.js +22 -0
  152. package/utils/n/date.js +57 -0
  153. package/utils/n/index.js +10 -0
  154. package/utils/n/is-type.js +176 -0
  155. package/utils/n/number.js +144 -0
  156. package/utils/n/permission-cache.js +11 -0
  157. package/utils/n/reuqest/axiosN.js +17 -0
  158. package/utils/n/reuqest/content-type.js +19 -0
  159. package/utils/n/reuqest/interceptors.js +95 -0
  160. package/utils/n/reuqest/url-params.js +12 -0
  161. package/utils/n/storage.js +51 -0
  162. package/utils/n/token.js +51 -0
  163. package/utils/n/user-cache.js +11 -0
  164. package/utils/n/user.js +34 -0
  165. package/utils/n/uuid.js +16 -0
  166. package/utils/n-generator-routers.js +208 -0
  167. package/utils/n-router.js +205 -0
  168. package/utils/n-theme.js +30 -0
  169. package/utils/number.js +72 -15
  170. package/utils/oss.js +57 -0
  171. package/utils/platform.js +719 -22
  172. package/utils/quarter.js +58 -0
  173. package/utils/storage.js +198 -0
  174. package/utils/style.js +24 -0
  175. package/utils/theme.js +97 -3
  176. package/utils/transfer-queue.js +7 -0
  177. package/utils/type.js +102 -0
  178. package/utils/util.js +795 -0
  179. package/utils/validator.js +181 -0
  180. package/config/themes/gold/default.css +0 -241
  181. package/config/themes/gold/default.less +0 -319
  182. package/config/themes/lime/default.css +0 -241
  183. package/config/themes/lime/default.less +0 -319
@@ -0,0 +1,4 @@
1
+ // 基础变量
2
+ @import './base.less';
3
+ // 主题变量
4
+ @import './theme/index.less';
@@ -0,0 +1,7 @@
1
+ :root {
2
+ --ind-button-height-md: 32px;
3
+ --ind-button-padding-md: 15px;
4
+
5
+ --ind-button-height-sm: 32px;
6
+ --ind-button-padding-sm: 7px;
7
+ }
@@ -0,0 +1,57 @@
1
+ :root {
2
+ // 颜色
3
+ --ind-primary-color: var(--ind-blue);
4
+ --ind-primary-color-tint20: tint(@ind-blue, 20%);
5
+ --ind-primary-color-tint70: tint(@ind-blue, 70%);
6
+ --ind-primary-color-tint80: tint(@ind-blue, 80%);
7
+ --ind-primary-color-tint90: tint(@ind-blue, 90%);
8
+ --ind-primary-color-fade20: fade(@ind-blue, 20%);
9
+ --ind-primary-color-fade90: fade(@ind-blue, 90%);
10
+ --ind-primary-color-tint95-fade50: fade(tint(@ind-blue, 95%), 50%);
11
+ --ind-primary-color-shade5: shade(@ind-blue, 5%);
12
+ --ind-primary-color-fade90-shade10: shade(fade(@ind-blue, 90%), 10%);
13
+
14
+ --ind-bg-color-light: var(--ind-white);
15
+ --ind-bg-color-dark: var(--ind-gray-1);
16
+ --ind-text-color: var(--ind-black);
17
+ --ind-link-hover-color: var(--ind-primary-color-tint20);
18
+ --ind-link-active-color: var(--ind-primary-color-shade5);
19
+ --ind-desc-color: var(--ind-gray-6);
20
+
21
+ --ind-border-color: #ebedf2;
22
+
23
+ // 页面的边距
24
+ --ind-page-padding: var(--ind-padding-xs);
25
+ --ind-sc-padding-top: var(--ind-padding-xs);
26
+ --ind-menu-desc-margin-top: 4px;
27
+
28
+ // card的样式
29
+ --ivu-card-head-padding: 12px 16px;
30
+ --ivu-card-head-line-height: 28px;
31
+ --ivu-card-head-height: 52px;
32
+ --ivu-card-body-padding: 16px;
33
+
34
+ // 表单的样式
35
+ --ivu-form-item-label-padding: 10px 12px 10px 0;
36
+ --ivu-form-v6stle-item-label-paddingleft: 20px;
37
+ --ivu-form-item-content-padding: 6px 12px;
38
+ --ivu-form-item-label-before-left: 8px;
39
+ --ivu-form-item-content-line-height: 32px;
40
+
41
+ // tree样式
42
+ --ind-tree-wrapper-width: 98%;
43
+ --tree-content-padding: 8px;
44
+ --ivu-tree-margin: 8px 0;
45
+
46
+ // drawer样式
47
+ --ind-drawer-content-padding: 16px;
48
+ --ind-drawer-footer-padding: 10px 16px;
49
+
50
+ // 报表指标样式
51
+ --report-index-model-panel-padding: 8px;
52
+ --report-index-options-padding-right: 18px;
53
+
54
+ // 表格
55
+ --ind-table-button-padding: var(--ind-padding-base);
56
+ --input-height-table: var(--input-height); // 表格输入框的高度
57
+ }
@@ -0,0 +1,7 @@
1
+ @import './common.less';
2
+
3
+ @import './button.less';
4
+ @import './layout.less';
5
+ @import './table.less';
6
+ @import './tag.less';
7
+ @import './upload.less';
@@ -0,0 +1,40 @@
1
+ :root {
2
+ // basic layout 系统布局变量 -begin
3
+ --main-color: var(--ind-blue);
4
+ --deep-mian-color: #2b85e4;
5
+ --selected-background: #1890ff;
6
+ --selected-background-hover: #384568;
7
+ --header-height: 48px;
8
+ --header-bg: linear-gradient(90deg, #1d42ab, #2173dc, #1e93ff);
9
+ --header-color: hsla(0, 0%, 100%, 0.7);
10
+ --header-color-hover: var(--ind-white);
11
+ --header-border-bottom-color: #4fe3c1;
12
+
13
+ --ind-main-sider-width: 200px;
14
+ --ind-main-sider-collapsed-width: 68px;
15
+ --menu-black-active-bg: var(--ind-white); //#263353;
16
+ --menu-white-group-title-color: var(--ind-text-color); //#B6B6B8;
17
+ --ivu-menu-item-font-size: var(--ind-font-size-md);
18
+
19
+ --menu-select-bg: #f0faff;
20
+ --deep-menu-color: var(--ind-primary-color); //@text-color; //#F3F2F0;
21
+ --selected-background: var(--menu-select-bg); //@primary-color;
22
+ --selected-background-hover: var(--menu-select-bg); //#384568;
23
+ --menu-icon-margin-right: 8px;
24
+ --menu-white-group-title-color: #b6b6b8;
25
+ // basic layout 系统布局变量 -end
26
+
27
+ // page-view layout 系统布局变量 -begin
28
+ --ind-panel-vertical-margin: 12px;
29
+ --ind-panel-horizon-margin: 16px;
30
+ // page-view layout 系统布局变量 -end
31
+
32
+ --input-height: 32px; // small 24px
33
+ --search-margin-bottom: 24px; // small 16px
34
+ --search-button-margin: 16px;
35
+
36
+ --menu-name-padding: 15px 28px 15px 30px; // 标题行padding
37
+ --menu-title-font-size: 20px;
38
+ --menu-title-color: #17233d;
39
+ --page-content-padding: 12px;
40
+ }
@@ -0,0 +1,37 @@
1
+ :root {
2
+ // table layout 系统布局变量 -begin
3
+ --check-border: #dcdee2;
4
+
5
+ --table-td-hover-bg: tint(#488aff, 90%);
6
+
7
+ /*
8
+ * ag-grid合计行颜色变量
9
+ */
10
+ --ag-sum-row-color-10: #cccfd7;
11
+ --ag-sum-row-color-5: #dcdfe6;
12
+ --ag-sum-row-color-1: #ebedf2;
13
+ --ind-table-padding: 16px;
14
+ // table layout 系统布局变量 -end
15
+
16
+ --ind-ag-grid-size: 6px;
17
+ --ind-ag-cell-widget-spacing: 12px;
18
+ --ind-ag-font-size: var(--ind-font-size-md);
19
+ // --ind-ag-list-item-height: 42px;
20
+ --ind-ag-odd-row-background-color: #fcfdfe;
21
+ --ind-ag-row-hover-color: rgba(0, 0, 0, 0.05);
22
+ --ind-ag-column-hover-color: rgba(0, 0, 0, 0.05);
23
+ --ind-ag-cell-header-horizontal-padding: 12px;
24
+ --ind-ag-cell-horizontal-padding: 13px;
25
+ --ind-ag-row-group-indent-size: 28px;
26
+ --ind-ag-selected-row-background-color: #c8dcff;
27
+ --ind-ag-header-background-color: #f8f8f9;
28
+ --ind-ag-odd-row-background-color: #fff;
29
+
30
+ // 以下是 ag 没有的
31
+ --ind-ag-cell-icon-margin-left: var(--ind-ag-grid-size);
32
+ // --ind-ag-cell-header-horizontal-padding: var(--ag-cell-horizontal-padding);
33
+ --ind-ag-cell-line-height: 20px;
34
+
35
+ --ind-unit-switch-bottom: 6px;
36
+ --ind-other-button-top: 6px;
37
+ }
@@ -0,0 +1,3 @@
1
+ :root {
2
+ --ind-tag-height: 24px;
3
+ }
@@ -0,0 +1,3 @@
1
+ :root {
2
+ --file-line-height: 41px;
3
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * 定义不同主题变量,其中default基本等于全局变量
3
+ * 别的主题应在default基础上更改
4
+ * 若已有主题变量不满足情况,应在default里添加原样式的变量后,在新主题里更改对应的值
5
+ *
6
+ * @Author: huxuetong
7
+ * @Date: 2024-03-12 20:10:04
8
+ * @Last Modified by: huxuetong
9
+ * @Last Modified time: 2024-03-12 20:11:26
10
+ */
11
+
12
+ @import './default/index.less';
13
+ @import './small/index.less';
@@ -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,39 @@
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
+ }
@@ -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,42 @@
1
1
  {
2
2
  "name": "@lambo-design/shared",
3
- "version": "1.0.0-beta.21",
3
+ "version": "1.0.0-beta.210",
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://10.110.34.38/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
+ "css-vars-ponyfill": "^2.4.8",
22
+ "dayjs": "^1.11.9",
23
+ "lodash": "^4.17.21",
24
+ "moment": "2.29.4",
25
+ "nanoid": "^3.3.7",
26
+ "node-rsa": "^1.1.1",
27
+ "qs": "^6.11.0",
28
+ "xlsx": "http://cicd.lambo.top/package/cdn/xlsx-0.19.1.tgz",
29
+ "xlsx-style": "^0.8.13"
30
+ },
31
+ "devDependencies": {
32
+ "vue": "^2.6.12"
20
33
  },
21
- "scripts": {}
34
+ "scripts": {
35
+ "release-shared": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
36
+ "release-major": "standard-version --release-as major",
37
+ "release-minor": "standard-version --release-as minor",
38
+ "release-patch": "standard-version --release-as patch",
39
+ "release-beta": "standard-version --prerelease beta",
40
+ "re-publish": "pnpm publish --access public --no-git-checks"
41
+ }
22
42
  }
@@ -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
+ }
package/utils/assist.js CHANGED
@@ -25,6 +25,23 @@ export function deepCopy(data) {
25
25
  }
26
26
  return o;
27
27
  }
28
+ export function deepMerge(target, ...sources) {
29
+ if (!sources.length) return target;
30
+ const source = sources.shift();
31
+
32
+ if (isObject(target) && isObject(source)) {
33
+ for (const key in source) {
34
+ if (isObject(source[key])) {
35
+ if (!target[key]) Object.assign(target, { [key]: {} });
36
+ deepMerge(target[key], source[key]);
37
+ } else {
38
+ Object.assign(target, { [key]: source[key] });
39
+ }
40
+ }
41
+ }
42
+
43
+ return deepMerge(target, ...sources);
44
+ }
28
45
 
29
46
  export function typeOf(obj) {
30
47
  const toString = Object.prototype.toString;
@@ -43,42 +60,88 @@ export function typeOf(obj) {
43
60
  return map[toString.call(obj)];
44
61
  }
45
62
 
46
- export function operateBtn(vm, h, currentRow, operationName, operation, type, permission) {
47
- return h('Button', {
48
- props: {
49
- type: type,
50
- size: "small",
51
- ghost: true,
52
- },
53
- directives: [(permission === '' || permission === null) ? '' : {
54
- name: "permission",
55
- value: permission
56
- }],
57
- style: {
58
- margin: '0 2px'
59
- },
60
- on: {
61
- 'click': () => {
62
- operation(vm, currentRow);
63
- }
63
+ export function operateBtn(vm, h, currentRow, operationName, operation, type, permission, disabled = false) {
64
+ let renderOption = {
65
+ props: {
66
+ type: type,
67
+ size: "small",
68
+ ghost: true,
69
+ disabled: disabled
70
+ },
71
+ style: {
72
+ margin: '0 2px'
73
+ },
74
+ on: {
75
+ 'click': () => {
76
+ operation(vm, currentRow);
64
77
  }
65
- }, operationName);
78
+ }
79
+ }
80
+ if(permission){
81
+ renderOption['directives'] = [{
82
+ name: "permission",
83
+ value: permission
84
+ }]
85
+ }
86
+
87
+ return h('Button', renderOption, operationName);
66
88
 
67
89
  }
68
90
 
69
- export function operateHref(vm, h, currentRow, operationName, operation) {
70
- return h('a', {
71
- style: {
72
- margin: '0 4px'
73
- },
91
+ export function operateHref(vm, h, currentRow, operationName, operation, type, permission) {
92
+ let renderOption = {
93
+ style: {
94
+ margin: '0 4px'
95
+ },
74
96
  on: {
75
97
  'click': () => {
76
98
  operation(vm, currentRow);
77
99
  }
78
100
  }
79
- }, operationName);
101
+ }
102
+ if(permission){
103
+ renderOption['directives'] = [{
104
+ name: "permission",
105
+ value: permission
106
+ }]
107
+ }
108
+
109
+ return h('a', renderOption, operationName);
110
+ }
111
+
112
+ export function operateMore(vm, h, operation) {
113
+ return h("Dropdown", {
114
+ style: {
115
+ marginLeft: "4px",
116
+ },
117
+ props: {
118
+ transfer: true,
119
+ }
120
+ }, [
121
+ h("a", {
122
+ style: {
123
+ margin: '0 4px',
124
+ borderBottom: '0px solid #CC9900',
125
+ }
126
+ }, [
127
+ h("span", "更多"),
128
+ h("Icon", {
129
+ props: {
130
+ type: "ios-arrow-down"
131
+ },
132
+ })
133
+ ]),
134
+ h('DropdownMenu', {
135
+ slot: "list",
136
+ }, operation)
137
+ ]);
80
138
  }
81
139
 
82
140
  export function isJson(arg) {
83
141
  return typeof (arg) == "object" && Object.prototype.toString.call(arg).toLowerCase() == "[object object]" && !arg.length
84
142
  };
143
+
144
+
145
+ export function isObject(item) {
146
+ return (item && typeof item === 'object' && !Array.isArray(item));
147
+ }