neo-cmp-cli 1.8.3 → 1.8.6

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 (189) hide show
  1. package/package.json +3 -3
  2. package/src/utils/cmpUtils/createCmpByTemplate.js +1 -1
  3. package/src/utils/projectUtils/createCmpProjectByTemplate.js +1 -1
  4. package/template/antd-custom-cmp-template/.prettierrc.js +12 -0
  5. package/template/antd-custom-cmp-template/README.md +153 -0
  6. package/template/antd-custom-cmp-template/commitlint.config.js +59 -0
  7. package/template/antd-custom-cmp-template/neo.config.js +144 -0
  8. package/template/antd-custom-cmp-template/package.json +60 -0
  9. package/template/antd-custom-cmp-template/public/css/base.css +283 -0
  10. package/template/antd-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  11. package/template/antd-custom-cmp-template/public/template.html +13 -0
  12. package/template/antd-custom-cmp-template/src/assets/css/common.scss +127 -0
  13. package/template/antd-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  14. package/template/antd-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  15. package/template/antd-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  16. package/template/antd-custom-cmp-template/src/assets/img/favicon.png +0 -0
  17. package/template/antd-custom-cmp-template/src/components/dataDashboard/README.md +39 -0
  18. package/template/antd-custom-cmp-template/src/components/dataDashboard/index.tsx +462 -0
  19. package/template/antd-custom-cmp-template/src/components/dataDashboard/model.ts +75 -0
  20. package/template/antd-custom-cmp-template/src/components/dataDashboard/style.scss +1667 -0
  21. package/template/antd-custom-cmp-template/src/components/infoCard/index.tsx +87 -0
  22. package/template/antd-custom-cmp-template/src/components/infoCard/model.ts +80 -0
  23. package/template/antd-custom-cmp-template/src/components/infoCard/style.scss +105 -0
  24. package/template/antd-custom-cmp-template/tsconfig.json +68 -0
  25. package/template/develop/neo-custom-cmp-template/.prettierrc.js +12 -0
  26. package/template/develop/neo-custom-cmp-template/README.md +48 -0
  27. package/template/develop/neo-custom-cmp-template/commitlint.config.js +59 -0
  28. package/template/develop/neo-custom-cmp-template/docs/README.md +13 -0
  29. package/template/develop/neo-custom-cmp-template/neo.config.js +121 -0
  30. package/template/develop/neo-custom-cmp-template/package.json +63 -0
  31. package/template/develop/neo-custom-cmp-template/public/css/base.css +283 -0
  32. package/template/develop/neo-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  33. package/template/develop/neo-custom-cmp-template/public/template.html +13 -0
  34. package/template/develop/neo-custom-cmp-template/src/assets/css/common.scss +127 -0
  35. package/template/develop/neo-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  36. package/template/develop/neo-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  37. package/template/develop/neo-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  38. package/template/develop/neo-custom-cmp-template/src/assets/img/favicon.png +0 -0
  39. package/template/develop/neo-custom-cmp-template/src/assets/img/table.svg +1 -0
  40. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/README.md +65 -0
  41. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/index.tsx +180 -0
  42. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +50 -0
  43. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/style.scss +260 -0
  44. package/template/develop/neo-custom-cmp-template/src/components/contactForm/README.md +94 -0
  45. package/template/develop/neo-custom-cmp-template/src/components/contactForm/index.tsx +251 -0
  46. package/template/develop/neo-custom-cmp-template/src/components/contactForm/model.ts +56 -0
  47. package/template/develop/neo-custom-cmp-template/src/components/contactForm/style.scss +120 -0
  48. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/README.md +115 -0
  49. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/index.tsx +304 -0
  50. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/model.ts +87 -0
  51. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/style.scss +127 -0
  52. package/template/develop/neo-custom-cmp-template/src/utils/axiosFetcher.ts +29 -0
  53. package/template/develop/neo-custom-cmp-template/src/utils/queryObjectData.ts +39 -0
  54. package/template/develop/neo-custom-cmp-template/src/utils/xobjects.ts +203 -0
  55. package/template/develop/neo-custom-cmp-template/tsconfig.json +68 -0
  56. package/template/echarts-custom-cmp-template/.prettierrc.js +12 -0
  57. package/template/echarts-custom-cmp-template/README.md +198 -0
  58. package/template/echarts-custom-cmp-template/commitlint.config.js +59 -0
  59. package/template/echarts-custom-cmp-template/neo.config.js +140 -0
  60. package/template/echarts-custom-cmp-template/package.json +61 -0
  61. package/template/echarts-custom-cmp-template/public/css/base.css +283 -0
  62. package/template/echarts-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  63. package/template/echarts-custom-cmp-template/public/template.html +13 -0
  64. package/template/echarts-custom-cmp-template/src/assets/css/common.scss +127 -0
  65. package/template/echarts-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  66. package/template/echarts-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  67. package/template/echarts-custom-cmp-template/src/assets/img/chart.svg +1 -0
  68. package/template/echarts-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  69. package/template/echarts-custom-cmp-template/src/assets/img/favicon.png +0 -0
  70. package/template/echarts-custom-cmp-template/src/components/chartWidget/README.md +186 -0
  71. package/template/echarts-custom-cmp-template/src/components/chartWidget/index.tsx +724 -0
  72. package/template/echarts-custom-cmp-template/src/components/chartWidget/model.ts +151 -0
  73. package/template/echarts-custom-cmp-template/src/components/chartWidget/style.scss +209 -0
  74. package/template/echarts-custom-cmp-template/src/components/mapWidget/README.md +125 -0
  75. package/template/echarts-custom-cmp-template/src/components/mapWidget/USAGE.md +190 -0
  76. package/template/echarts-custom-cmp-template/src/components/mapWidget/index.tsx +385 -0
  77. package/template/echarts-custom-cmp-template/src/components/mapWidget/model.ts +107 -0
  78. package/template/echarts-custom-cmp-template/src/components/mapWidget/style.scss +192 -0
  79. package/template/echarts-custom-cmp-template/src/utils/url.ts +82 -0
  80. package/template/echarts-custom-cmp-template/tsconfig.json +68 -0
  81. package/template/empty-cmp/index.tsx +58 -0
  82. package/template/empty-cmp/model.ts +79 -0
  83. package/template/empty-cmp/style.scss +72 -0
  84. package/template/empty-custom-cmp-template/.prettierrc.js +12 -0
  85. package/template/empty-custom-cmp-template/README.md +154 -0
  86. package/template/empty-custom-cmp-template/commitlint.config.js +59 -0
  87. package/template/empty-custom-cmp-template/neo.config.js +138 -0
  88. package/template/empty-custom-cmp-template/package.json +58 -0
  89. package/template/empty-custom-cmp-template/public/css/base.css +283 -0
  90. package/template/empty-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  91. package/template/empty-custom-cmp-template/public/template.html +13 -0
  92. package/template/empty-custom-cmp-template/src/assets/css/common.scss +127 -0
  93. package/template/empty-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  94. package/template/empty-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  95. package/template/empty-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  96. package/template/empty-custom-cmp-template/src/assets/img/favicon.png +0 -0
  97. package/template/empty-custom-cmp-template/src/assets/img/map.svg +1 -0
  98. package/template/empty-custom-cmp-template/src/components/README.md +3 -0
  99. package/template/empty-custom-cmp-template/tsconfig.json +68 -0
  100. package/template/neo-custom-cmp-template/.prettierrc.js +12 -0
  101. package/template/neo-custom-cmp-template/README.md +155 -0
  102. package/template/neo-custom-cmp-template/commitlint.config.js +59 -0
  103. package/template/neo-custom-cmp-template/docs/README.md +244 -0
  104. package/template/neo-custom-cmp-template/neo.config.js +140 -0
  105. package/template/neo-custom-cmp-template/package.json +66 -0
  106. package/template/neo-custom-cmp-template/public/css/base.css +283 -0
  107. package/template/neo-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  108. package/template/neo-custom-cmp-template/public/template.html +13 -0
  109. package/template/neo-custom-cmp-template/src/assets/css/common.scss +127 -0
  110. package/template/neo-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  111. package/template/neo-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  112. package/template/neo-custom-cmp-template/src/assets/img/card-list.svg +1 -0
  113. package/template/neo-custom-cmp-template/src/assets/img/contact-form.svg +1 -0
  114. package/template/neo-custom-cmp-template/src/assets/img/custom-form.svg +1 -0
  115. package/template/neo-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  116. package/template/neo-custom-cmp-template/src/assets/img/data-list.svg +1 -0
  117. package/template/neo-custom-cmp-template/src/assets/img/detail.svg +1 -0
  118. package/template/neo-custom-cmp-template/src/assets/img/table.svg +1 -0
  119. package/template/neo-custom-cmp-template/src/components/entityCardList/README.md +61 -0
  120. package/template/neo-custom-cmp-template/src/components/entityCardList/index.tsx +202 -0
  121. package/template/neo-custom-cmp-template/src/components/entityCardList/model.ts +74 -0
  122. package/template/neo-custom-cmp-template/src/components/entityCardList/style.scss +260 -0
  123. package/template/neo-custom-cmp-template/src/components/entityDetail/README.md +176 -0
  124. package/template/neo-custom-cmp-template/src/components/entityDetail/index.tsx +334 -0
  125. package/template/neo-custom-cmp-template/src/components/entityDetail/model.ts +123 -0
  126. package/template/neo-custom-cmp-template/src/components/entityDetail/style.scss +292 -0
  127. package/template/neo-custom-cmp-template/src/components/entityForm/README.md +176 -0
  128. package/template/neo-custom-cmp-template/src/components/entityForm/index.tsx +615 -0
  129. package/template/neo-custom-cmp-template/src/components/entityForm/model.ts +107 -0
  130. package/template/neo-custom-cmp-template/src/components/entityForm/style.scss +370 -0
  131. package/template/neo-custom-cmp-template/src/components/entityTable/README.md +92 -0
  132. package/template/neo-custom-cmp-template/src/components/entityTable/index.tsx +784 -0
  133. package/template/neo-custom-cmp-template/src/components/entityTable/model.ts +134 -0
  134. package/template/neo-custom-cmp-template/src/components/entityTable/style.scss +304 -0
  135. package/template/neo-custom-cmp-template/src/utils/axiosFetcher.ts +37 -0
  136. package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +76 -0
  137. package/template/neo-custom-cmp-template/src/utils/xobjects.ts +162 -0
  138. package/template/neo-custom-cmp-template/tsconfig.json +49 -0
  139. package/template/react-custom-cmp-template/.prettierrc.js +12 -0
  140. package/template/react-custom-cmp-template/README.md +154 -0
  141. package/template/react-custom-cmp-template/commitlint.config.js +59 -0
  142. package/template/react-custom-cmp-template/neo.config.js +137 -0
  143. package/template/react-custom-cmp-template/package.json +57 -0
  144. package/template/react-custom-cmp-template/public/css/base.css +283 -0
  145. package/template/react-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  146. package/template/react-custom-cmp-template/public/template.html +13 -0
  147. package/template/react-custom-cmp-template/src/assets/css/common.scss +127 -0
  148. package/template/react-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  149. package/template/react-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  150. package/template/react-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  151. package/template/react-custom-cmp-template/src/assets/img/favicon.png +0 -0
  152. package/template/react-custom-cmp-template/src/components/infoCard/index.jsx +45 -0
  153. package/template/react-custom-cmp-template/src/components/infoCard/model.js +81 -0
  154. package/template/react-custom-cmp-template/src/components/infoCard/style.scss +67 -0
  155. package/template/react-ts-custom-cmp-template/.prettierrc.js +12 -0
  156. package/template/react-ts-custom-cmp-template/README.md +154 -0
  157. package/template/react-ts-custom-cmp-template/commitlint.config.js +59 -0
  158. package/template/react-ts-custom-cmp-template/neo.config.js +138 -0
  159. package/template/react-ts-custom-cmp-template/package.json +59 -0
  160. package/template/react-ts-custom-cmp-template/public/css/base.css +283 -0
  161. package/template/react-ts-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  162. package/template/react-ts-custom-cmp-template/public/template.html +13 -0
  163. package/template/react-ts-custom-cmp-template/src/assets/css/common.scss +127 -0
  164. package/template/react-ts-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  165. package/template/react-ts-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  166. package/template/react-ts-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  167. package/template/react-ts-custom-cmp-template/src/assets/img/favicon.png +0 -0
  168. package/template/react-ts-custom-cmp-template/src/assets/img/map.svg +1 -0
  169. package/template/react-ts-custom-cmp-template/src/components/listWidget/README.md +2 -0
  170. package/template/react-ts-custom-cmp-template/src/components/listWidget/index.tsx +208 -0
  171. package/template/react-ts-custom-cmp-template/src/components/listWidget/model.ts +92 -0
  172. package/template/react-ts-custom-cmp-template/src/components/listWidget/style.scss +350 -0
  173. package/template/react-ts-custom-cmp-template/tsconfig.json +68 -0
  174. package/template/vue2-custom-cmp-template/.prettierrc.js +12 -0
  175. package/template/vue2-custom-cmp-template/README.md +154 -0
  176. package/template/vue2-custom-cmp-template/commitlint.config.js +59 -0
  177. package/template/vue2-custom-cmp-template/neo.config.js +146 -0
  178. package/template/vue2-custom-cmp-template/package.json +59 -0
  179. package/template/vue2-custom-cmp-template/public/css/base.css +283 -0
  180. package/template/vue2-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  181. package/template/vue2-custom-cmp-template/public/template.html +13 -0
  182. package/template/vue2-custom-cmp-template/src/assets/css/common.scss +126 -0
  183. package/template/vue2-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  184. package/template/vue2-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  185. package/template/vue2-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  186. package/template/vue2-custom-cmp-template/src/assets/img/favicon.png +0 -0
  187. package/template/vue2-custom-cmp-template/src/components/vueInfoCard/index.vue +131 -0
  188. package/template/vue2-custom-cmp-template/src/components/vueInfoCard/model.js +81 -0
  189. package/test/deprecate-versions.js +1 -1
@@ -0,0 +1,13 @@
1
+ <html lang="en">
2
+ <head>
3
+ <meta charset="UTF-8">
4
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
5
+ <meta name="format-detection" content="telephone=no"/>
6
+ <meta name="viewport" content="initial-scale=1.0,user-scalable=no,width=device-width,viewport-fit=cover">
7
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
+ <title>自定义组件预览页</title>
9
+ </head>
10
+ <body>
11
+ <div id="root"></div>
12
+ </body>
13
+ </html>
@@ -0,0 +1,127 @@
1
+ /* 公共的自定义函数 */
2
+
3
+ @function px2vw($px, $screen-width: 750) {
4
+ @return ($px / $screen-width) * 100vw;
5
+ }
6
+
7
+ @function px2rem($px, $remRate: 100) {
8
+ @return ($px / $remRate) + rem;
9
+ }
10
+
11
+ @function px2vmin($px, $screen-width: 750) {
12
+ @return ($px / $screen-width) * 100vmin;
13
+ }
14
+
15
+ @mixin fillBox {
16
+ width: 100%;
17
+ height: 100%;
18
+ }
19
+
20
+ /* 头部细线 */
21
+ @mixin borderTop {
22
+ content: '';
23
+ position: absolute;
24
+ left: 0;
25
+ right: 0;
26
+ top: 0;
27
+ width: 100%;
28
+ height: 1px;
29
+ background: #ddd;
30
+ transform: scaleY(0.5);
31
+ }
32
+
33
+ /* 底部细线 */
34
+ @mixin borderBtm {
35
+ content: '';
36
+ position: absolute;
37
+ left: 0;
38
+ right: 0;
39
+ bottom: 0;
40
+ width: 100%;
41
+ height: 1px;
42
+ background: #ddd;
43
+ transform: scaleY(0.5);
44
+ }
45
+
46
+ /* 统一的内边距 */
47
+ @mixin unifiedPadding($value: 40) {
48
+ padding: 0 px2rem($value) 0 px2rem($value);
49
+ }
50
+
51
+ /* 统一的左内边距 */
52
+ @mixin unifiedLeftPadding($value: 40) {
53
+ padding-left: px2rem($value);
54
+ }
55
+
56
+ /* 统一的右内边距 */
57
+ @mixin unifiedRightPadding($value: 40) {
58
+ padding-right: px2rem($value);
59
+ }
60
+
61
+ /* 统一的底部边框样式 */
62
+ @mixin unifiedBottomBorder {
63
+ border-bottom: 1px solid #ddd;
64
+ }
65
+
66
+ /* 统一的上边框样式 */
67
+ @mixin unifiedTopBorder {
68
+ border-top: 1px solid #ddd;
69
+ }
70
+
71
+ /* 统一的Item高度 */
72
+ @mixin unifiedItemHeight {
73
+ line-height: px2rem(120);
74
+ height: px2rem(120);
75
+ }
76
+
77
+ /* 设置行高样式 */
78
+ @mixin setItemHeight($value: 120) {
79
+ line-height: px2rem($value);
80
+ height: px2rem($value);
81
+ }
82
+
83
+ /* 统一的Item样式 */
84
+ @mixin unifiedItemStyle {
85
+ font-family: PingFangSC-Regular;
86
+ font-size: px2rem(28);
87
+ color: #828282;
88
+ letter-spacing: 0;
89
+ }
90
+
91
+ /* 统一的弹性盒子样式 */
92
+ @mixin unifiedFlexBoxStyle {
93
+ display: flex;
94
+ flex-wrap: nowrap;
95
+ justify-content: center;
96
+ align-items: center;
97
+ }
98
+
99
+ /* 统一的Title样式 */
100
+ @mixin unifiedTitleStyle {
101
+ font-family: PingFangSC-Regular;
102
+ font-size: px2rem(40);
103
+ color: #1e1e1e;
104
+ }
105
+
106
+ /* 统一的内容样式 */
107
+ @mixin unifiedContentStyle {
108
+ font-family: PingFangSC-Regular;
109
+ font-size: px2rem(28);
110
+ color: #1e1e1e;
111
+ letter-spacing: 0;
112
+ text-align: right;
113
+ line-height: px2rem(28);
114
+ }
115
+
116
+ /* 底部导航盒子样式 */
117
+ @mixin fixedBottomBox {
118
+ position: fixed;
119
+ left: 0;
120
+ bottom: 0;
121
+ width: 100%;
122
+ }
123
+
124
+ // 常用的变量
125
+ $background-color: #fafafa;
126
+ $border-color: #f7f7f7;
127
+ $page-padding-top: px2rem(20);
@@ -0,0 +1,47 @@
1
+ // 通用mixin
2
+ $borderColor: #ddd;
3
+
4
+ // type 为top 或者 bottom
5
+ @mixin borderTopOrBtm($type) {
6
+ &::after {
7
+ content: '';
8
+ position: absolute;
9
+ left: 0;
10
+ right: 0;
11
+ #{$type}: 0;
12
+ width: 100%;
13
+ height: 1px;
14
+ background: $borderColor;
15
+ transform: scaleY(0.5);
16
+ }
17
+ }
18
+
19
+ // type为 right 或者 left
20
+ @mixin borderRtOrLt($type) {
21
+ &::after {
22
+ content: '';
23
+ position: absolute;
24
+ top: 0;
25
+ bottom: 0;
26
+ #{$type}: 0;
27
+ height: 100%;
28
+ width: 1px;
29
+ background: $borderColor;
30
+ transform: scaleX(0.5);
31
+ }
32
+ }
33
+
34
+ //超出1行显示...
35
+ @mixin ellipsis1 {
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap;
39
+ }
40
+
41
+ // 超出多行显示...
42
+ @mixin ellipsis($num) {
43
+ overflow: hidden;
44
+ display: -webkit-box;
45
+ -webkit-line-clamp: $num;
46
+ -webkit-box-orient: vertical;
47
+ }
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756957113315" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5395" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M288 768v115.2c0 25.6 19.2 44.8 44.8 44.8h556.8c25.6 0 44.8-19.2 44.8-44.8v-198.4s0-6.4-6.4-6.4h-83.2c-38.4 0-70.4-32-70.4-70.4 0-38.4 32-70.4 70.4-70.4h83.2s6.4 0 6.4-6.4V332.8c0-25.6-19.2-44.8-44.8-44.8H768C768 198.4 697.6 128 608 128S448 198.4 448 288H332.8c-25.6 0-44.8 19.2-44.8 44.8V448C198.4 448 128 518.4 128 608S198.4 768 288 768z m0-249.6h70.4V358.4h160V288c0-51.2 38.4-89.6 89.6-89.6 51.2 0 89.6 38.4 89.6 89.6v70.4h160v108.8h-19.2c-76.8 0-140.8 64-140.8 140.8 0 76.8 64 140.8 140.8 140.8h19.2v108.8H358.4v-160H288c-51.2 0-89.6-38.4-89.6-89.6 0-51.2 38.4-89.6 89.6-89.6z" p-id="5396" fill="#0764f5"></path></svg>
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import './style.scss'; // 组件内容样式
3
+
4
+ export default class InfoCard extends React.PureComponent {
5
+ constructor() {
6
+ super();
7
+ this.agreeDataFormat = this.agreeDataFormat.bind(this);
8
+ }
9
+ agreeDataFormat(agreeData) {
10
+ if (agreeData && agreeData <= 9999) {
11
+ return agreeData;
12
+ }
13
+ if (agreeData && agreeData > 9999) {
14
+ return `${Math.floor(agreeData / 1000) / 10}w`;
15
+ }
16
+ }
17
+ render() {
18
+ const { title, backgroundImage, imgCount, commentCount } = this.props;
19
+ const curBackgroundImage =
20
+ backgroundImage || 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg';
21
+ return (
22
+ <div className="info-card-container">
23
+ <div className="news-title">
24
+ {title ||
25
+ '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。'}
26
+ </div>
27
+ <div className="item-imgbox">
28
+ <div
29
+ className="news-img"
30
+ style={{ backgroundImage: `url(${curBackgroundImage})` }}
31
+ ></div>
32
+ {imgCount > 0 && <div className="img-count">{imgCount}</div>}
33
+ </div>
34
+ <div className="news-info">
35
+ <div className="left media-mark">NeoCRM · 低代码平台</div>
36
+ {commentCount && commentCount > 0 && (
37
+ <div className="cmt-num right">
38
+ {this.agreeDataFormat(commentCount)}评
39
+ </div>
40
+ )}
41
+ </div>
42
+ </div>
43
+ );
44
+ }
45
+ }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @file 自定义组件对接编辑器的描述文件
3
+ */
4
+ export class InfoCardModel {
5
+ /**
6
+ * cmpType 为自定义组件名称,用于标识组件的唯一性
7
+ * 在构建时根据当前组件目录名称自动生成
8
+ */
9
+ // cmpType: string = 'infoCard';
10
+
11
+ // 组件名称,用于设置在编辑器左侧组件面板中展示的名称
12
+ label = '信息卡片';
13
+
14
+ // 组件描述,用于设置在编辑器左侧组件面板中展示的描述
15
+ description = '信息展示卡片';
16
+
17
+ // 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
18
+ // tags: string[] = ['自定义组件'];
19
+
20
+ /**
21
+ * 用于设置组件支持的页面类型
22
+ *
23
+ * 当前 NeoCRM 平台存在的页面类型:
24
+ * all: 1 全页面
25
+ * indexPage: 2 首页
26
+ * entityListPage: 3 实体列表页
27
+ * entityFormPage: 4 实体表单页
28
+ * entityDetailPage: 5 实体详情页
29
+ * customPage: 6 自定义页面
30
+ * bizPage: 7 业务页面
31
+ */
32
+ // targetPage: string[] = ['customPage'];
33
+
34
+ // 组件图标,用于设置在编辑器左侧组件面板中展示的图标
35
+ // iconSrc = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
36
+ iconSrc = 'https://neo-widgets.bj.bcebos.com/favicon.png';
37
+
38
+ // 初次插入页面的默认属性数据
39
+ defaultComProps = {
40
+ title:
41
+ '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。',
42
+ label: '信息卡片',
43
+ backgroundImage: 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg',
44
+ imgCount: 3,
45
+ commentCount: 2025,
46
+ };
47
+
48
+ /**
49
+ * 组件面板配置,用于生成编辑器右侧属性配置面板内容
50
+ * 备注:自定义组件中可用的配置项类型 请见 [当前可用表单项](https://github.com/wibetter/neo-register/blob/master/docs/FormItemType.md
51
+ */
52
+ propsSchema = [
53
+ {
54
+ type: 'textarea',
55
+ name: 'title',
56
+ label: '卡片title',
57
+ value:
58
+ '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。',
59
+ },
60
+ {
61
+ type: 'text',
62
+ name: 'backgroundImage',
63
+ label: '展示图片',
64
+ value: 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg',
65
+ },
66
+ {
67
+ type: 'number',
68
+ name: 'imgCount',
69
+ label: '图片数量',
70
+ value: 3,
71
+ },
72
+ {
73
+ type: 'number',
74
+ name: 'commentCount',
75
+ label: '评论数',
76
+ value: 2025,
77
+ },
78
+ ];
79
+ }
80
+
81
+ export default InfoCardModel;
@@ -0,0 +1,67 @@
1
+ .info-card-container {
2
+ position: relative;
3
+ box-sizing: border-box;
4
+ // border-bottom: 1px solid #ececec;
5
+ margin: 6px 12px;
6
+ padding: 6px 12px;
7
+ background-color: #fff;
8
+
9
+ .news-title {
10
+ padding: 6px 0;
11
+ font-family: PingFangSC-Regular;
12
+ font-size: 16px;
13
+ line-height: 22px;
14
+ color: #5f5e5e;
15
+ }
16
+
17
+ .item-imgbox {
18
+ position: relative;
19
+ height: 395px;
20
+ background: #f0f0f0;
21
+ cursor: pointer;
22
+ box-sizing: border-box;
23
+ text-align: center;
24
+ overflow: hidden;
25
+
26
+ .news-img {
27
+ width: 100%;
28
+ height: 100%;
29
+ box-sizing: border-box;
30
+ background-size: contain;
31
+ }
32
+
33
+ .img-count {
34
+ position: absolute;
35
+ top: 0;
36
+ right: 0;
37
+ padding: 6px 8px;
38
+ color: #fff;
39
+ min-width: 60px;
40
+ text-align: center;
41
+ line-height: 1.2;
42
+ background: rgba(0, 0, 0, 0.4);
43
+ font-size: 25px;
44
+ box-sizing: border-box;
45
+ overflow: hidden;
46
+ }
47
+ }
48
+
49
+ .news-info {
50
+ font-family: PingFangSC-Light;
51
+ height: 28px;
52
+ box-sizing: border-box;
53
+ display: flex;
54
+ justify-content: space-between;
55
+ align-items: center;
56
+ }
57
+
58
+ .media-mark,
59
+ .cmt-num {
60
+ display: inline-block;
61
+ height: 28px;
62
+ line-height: 28px;
63
+ font-family: PingFangSC-Light;
64
+ font-size: 18px;
65
+ color: #828282;
66
+ }
67
+ }
@@ -0,0 +1,12 @@
1
+ /*
2
+ prettier 配置文件
3
+ 更多配置信息:https://prettier.io/docs/en/options.html
4
+ */
5
+ module.exports = {
6
+ semi: true, // Semicolons 分号,默认需要分号
7
+ tabWidth: 2, // 空格,默认 2,
8
+ useTabs: false,
9
+ singleQuote: true, // 单引号还是双引号,默认为false 双引号
10
+ trailingComma: 'all', // 逗号
11
+ jsxBracketSameLine: false, // 默认为false,Put the > of a multi-line JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements).
12
+ };
@@ -0,0 +1,154 @@
1
+ ### 目录说明
2
+ - src: 自定义组件源码;
3
+ - src/assets: 存放组件静态资源,比如 css、img等;
4
+ - src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
5
+ - src/components/xxCmp/index: 自定义组件的内容文件;
6
+ - src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
7
+ - neo.config.js: neo-cmp-cli 配置文件。
8
+
9
+ ### 组件开发规范
10
+ - 存放在 src/components 目录下的自定义组件,默认 index 为自定义组件源码入口文件,register.[tj]s 为注册 自定义组件的脚本文件,model.[tj]s 为自定义组件的模型文件(对接页面设计器需要);
11
+ - 当 neo.config.js 中的 entry 为空或者不存在时,cli 将根据 src/components 目录下的自定义组件结构生成对应的 entry 配置(可在命令控制台查看生成的 entry 配置);
12
+ - 自定义组件中可用的配置项类型 请见 [当前可用表单项](https://github.com/wibetter/neo-register/blob/master/docs/FormItemType.md);
13
+ - 自定义组件最外层请设置一个唯一的 ClassName(比如 xx-cmpType-container),所有内容样式请放在该 ClassName 中,避免自定义组件样式相互干扰;
14
+ - 默认开启代码规范检测(含样式内容),如需关闭,请调整 neo.config.js 相关配置;
15
+ - 请使用 react 16版本。
16
+
17
+ ### 自定义组件注册器使用说明
18
+ - [neo-register 使用说明](https://www.npmjs.com/package/neo-register?activeTab=readme)
19
+ 备注:预览、调试(linkDebug)和构建发布时 cli 会自动创建对应的注册文件(含 neo-register 的使用),用户无需关注 neo-register。
20
+
21
+ ### 开发说明
22
+
23
+ 1. **安装依赖**
24
+ ```bash
25
+ $ npm i 或者 yarn
26
+ ```
27
+
28
+ 2. **preview: 组件预览模式(带热更新)**
29
+ > preview模式:用于预览自定义组件内容。
30
+ ```bash
31
+ $ npm run preview
32
+ ```
33
+
34
+ 3. **linkDebug: 外链调试(在线上页面设计器端预览自定义组件)**
35
+ > linkDebug模式:用于在线上页面设计器中预览和调试自定义组件。
36
+ ```bash
37
+ $ npm run linkDebug
38
+ ```
39
+
40
+ 4. **发布到 NeoCRM 平台**
41
+ > 需要确保 package.json 中的 name 值唯一,version 值不重复。
42
+ ```bash
43
+ $ npm run pushCmp
44
+ ```
45
+
46
+
47
+ ### 🔐 授权配置
48
+
49
+ 使用 `neo push cmp`、`neo pull cmp`、`neo delete cmp` 等命令与 NeoCRM 平台交互时,需要配置授权信息。
50
+
51
+ #### 方式一:OAuth2 登录授权(推荐)
52
+
53
+ OAuth2 授权码模式更加安全可靠,无需用户配置账户名和密码。
54
+
55
+ ##### 使用步骤
56
+
57
+ 1. **登录 NeoCRM 平台**
58
+ ```bash
59
+ neo login
60
+ ```
61
+
62
+ 执行流程:
63
+ - 自动打开浏览器访问授权页面
64
+ - 在浏览器中输入 NeoCRM 账号密码进行登录(需选择对应的租户)
65
+ - 授权成功后自动跳转回本地(附带 code)
66
+ - cli 端 通过 code 获取 Token,并自动保存到项目的 `.neo-cli/token.json` 文件中
67
+
68
+ 2. **登出 NeoCRM 平台**
69
+ ```bash
70
+ neo logout
71
+ ```
72
+
73
+ 功能:清除本地保存的 token 文件,下次使用需要重新登录。
74
+
75
+ ##### 配置示例
76
+
77
+ ```javascript
78
+ // neo.config.js
79
+ module.exports = {
80
+ neoConfig: {
81
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
82
+ // 登录授权 URL(用于获取 code)
83
+ loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth',
84
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址
85
+ },
86
+ }
87
+ ```
88
+
89
+ ##### Token 有效期
90
+
91
+ - **access_token**:默认有效期 2 小时
92
+ - **refresh_token**:默认有效期 30 天
93
+ - 系统会在 access_token 过期前 5 分钟自动刷新
94
+ - 如果 refresh_token 也过期,需要重新执行 `neo login`
95
+
96
+ ##### 常见问题
97
+
98
+ **Q1: 浏览器无法自动打开怎么办?**
99
+ A: 命令行会输出授权 URL,手动复制到浏览器中打开即可。
100
+
101
+ **Q2: Token 刷新失败怎么办?**
102
+ A: 如果 refresh_token 也过期(默认 30 天),需要重新执行 `neo login`。同时检查网络连接是否正常。
103
+
104
+ **Q3: 授权登录后没有正常跳回 redirect_uri**
105
+ A: 可能被浏览器安装的插件影响,目前已知会影响授权登录的浏览器插件有:Neo UI Extension,请关闭插件后重试。
106
+
107
+ #### 方式二:密码授权配置
108
+
109
+ 在项目根目录的 `neo.config.js` 文件中添加 NeoCRM 平台授权配置:
110
+
111
+ ```javascript
112
+ module.exports = {
113
+ neoConfig: {
114
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
115
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址
116
+ // NeoCRM 授权配置
117
+ auth: {
118
+ client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
119
+ client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
120
+ username: 'xx', // 用户在销售易系统中的用户名
121
+ /**
122
+ * password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
123
+ * 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
124
+ */
125
+ password: 'xx xx' // 用户账户密码 + 8 位安全令牌
126
+ },
127
+ },
128
+ }
129
+ ```
130
+
131
+ ##### 授权配置获取方式
132
+
133
+ 1. **客户端 ID 和客户端秘钥**:需通过创建连接器获取
134
+ - 访问 [销售易文档中心](https://doc.xiaoshouyi.com) / 创建连接器
135
+ - 创建连接器后,从客户端信息中获取 `Client_Id` 和 `Client_Secret`
136
+
137
+ 2. **安全令牌**:如何获取安全令牌
138
+ - 访问 [销售易文档中心](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌
139
+ - 按照文档说明获取 8 位安全令牌
140
+ - `password` 字段 = 用户账户密码 + 8 位安全令牌(直接拼接,无空格或分隔符)
141
+
142
+ #### OAuth2 模式 vs 密码模式
143
+
144
+ | 特性 | OAuth2 授权码模式 | 密码模式 |
145
+ |------|------------------|---------|
146
+ | 安全性 | ✅ 高(无需在配置文件中存储密码) | ⚠️ 较低(需要配置密码和安全令牌) |
147
+ | Token 刷新 | ✅ 自动刷新 | ✅ 自动刷新 |
148
+ | 有效期 | 2 小时(可自动刷新) | 永不过期 |
149
+ | 推荐程度 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
150
+
151
+ ---
152
+
153
+ ### 配置项说明(neo-cmp-cli)
154
+ [请查看neo-cmp-cli](https://www.npmjs.com/package/neo-cmp-cli)
@@ -0,0 +1,59 @@
1
+ /**
2
+ * https://www.npmjs.com/package/@commitlint/config-conventional\
3
+ *
4
+ * Git提交规范-配置文件
5
+ * Commit message 由Header、Body 和 Footer三个部分组成,其格式如下:
6
+ * <type>(<scope>): <subject>
7
+ * <BLANK LINE>
8
+ * <body>
9
+ * <BLANK LINE>
10
+ * <footer>
11
+ *
12
+ *【备注】
13
+ * type 用于说明 commit 的类别,常用下面 7 个标识:
14
+ * scope 用于说明当前功能点作用于哪个页面或者哪个功能模块;
15
+ * subject 用于简短的描述当前commit,不超过50个字符;
16
+ * body 用于填写对本次 commit 的详细描述,可以分成多行;
17
+ * footer 不兼容变动声明,或者关闭 Issue。
18
+ *
19
+ * 【type类型取值类型】
20
+ * feat:新功能(feature)
21
+ * fix:功能优化
22
+ * bug:修补bug
23
+ * docs:文档(documentation)
24
+ * style:格式(不影响代码运行的变动)
25
+ * refactor:重构(即不是新增功能,也不是修改bug的代码变动)
26
+ * test:增加测试
27
+ * chore:构建过程或辅助工具的变动
28
+ * build:影响构建系统或外部依赖项的更改(示例范围:gulp,broccoli,npm)
29
+ * ci:对 CI 配置文件和脚本的更改(示例范围:Travis,Circle,BrowserStack,SauceLabs)
30
+ * perf:改进性能的代码更改
31
+ *
32
+ */
33
+
34
+ module.exports = {
35
+ extends: ['@commitlint/config-conventional'],
36
+ rules: {
37
+ 'type-enum': [
38
+ 2,
39
+ 'always',
40
+ [
41
+ 'feat',
42
+ 'fix',
43
+ 'bug',
44
+ 'docs',
45
+ 'style',
46
+ 'refactor',
47
+ 'test',
48
+ 'chore',
49
+ 'perf',
50
+ 'build',
51
+ 'ci',
52
+ ],
53
+ ],
54
+ 'type-empty': [2, 'never'],
55
+ 'scope-empty': [1, 'never'],
56
+ 'subject-full-stop': [0, 'never'],
57
+ 'subject-case': [0, 'never'],
58
+ },
59
+ };