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 @@
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="1760670196857" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4651" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M485.888 626.496 512 663.488l26.112-36.992c1.088-1.472 107.392-151.68 140.864-189.184C715.776 396.224 736 343.168 736 288 736 164.544 635.52 64 512 64s-224 100.48-224 224c0 55.232 20.224 108.288 57.088 149.376C378.624 474.816 484.8 625.024 485.888 626.496zM512 128c88.256 0 160 71.808 160 160 0 39.424-14.464 77.312-40.768 106.688C606.016 422.912 546.624 504.64 512 552.896 477.44 504.64 418.048 422.912 392.768 394.688 366.528 365.376 352 327.488 352 288 352 199.808 423.744 128 512 128zM512 384c52.928 0 96-43.072 96-96S564.928 192 512 192 416 235.072 416 288 459.072 384 512 384zM512 256c17.6 0 32 14.336 32 32S529.6 320 512 320 480 305.664 480 288 494.4 256 512 256zM960 129.024l0 703.168L680 960 384 832l-320 127.36L64 258.176l168.256-67.904C227.264 211.456 224 233.28 224 256c0 2.176 0.512 4.224 0.576 6.4L128 301.376l0 563.648 192-76.416L320 476.032c18.048 23.36 41.472 55.104 64 86.144l0 200.96 1.024-0.384 24.384 10.56L640 872.96 640 562.304c22.976-31.616 46.208-63.168 64-86.144l0 402.56 192-87.68L896 228.608l-97.536 44.544C798.784 267.392 800 261.76 800 256c0-17.664-2.176-34.752-5.184-51.584L960 129.024z" p-id="4652" fill="#0764f5"></path></svg>
@@ -0,0 +1,2 @@
1
+ ### 特别说明
2
+ - 这是通过 Cursor 生成的一个自定义组件示例
@@ -0,0 +1,208 @@
1
+ import * as React from 'react';
2
+ import './style.scss';
3
+
4
+ interface ListItem {
5
+ id: string;
6
+ title: string;
7
+ description: string;
8
+ image: string;
9
+ author: string;
10
+ createTime: string;
11
+ views: number;
12
+ likes: number;
13
+ comments: number;
14
+ tags: string[];
15
+ status: 'published' | 'draft' | 'archived';
16
+ }
17
+
18
+ interface ListWidgetProps {
19
+ title: string;
20
+ showImage: boolean;
21
+ showTags: boolean;
22
+ itemCount: number;
23
+ listType: 'default' | 'card' | 'simple';
24
+ data?: any;
25
+ }
26
+
27
+ /**
28
+ * 通过 Cursor 生成的一个自定义组件示例
29
+ * 组件名:ListWidget
30
+ * 组件描述:支持配置的列表展示组件,内置模拟数据
31
+ */
32
+ export default class ListWidget extends React.PureComponent<ListWidgetProps> {
33
+ constructor(props: ListWidgetProps) {
34
+ super(props);
35
+ this.generateMockData = this.generateMockData.bind(this);
36
+ this.formatNumber = this.formatNumber.bind(this);
37
+ this.renderListItem = this.renderListItem.bind(this);
38
+ }
39
+
40
+ // 生成模拟数据
41
+ generateMockData(count: number): ListItem[] {
42
+ const mockTitles = [
43
+ '营销服全场景智能CRM解决方案',
44
+ '企业数字化转型最佳实践',
45
+ '客户关系管理新趋势分析',
46
+ '数字化营销策略深度解析',
47
+ '智能客服系统优化方案',
48
+ '数据驱动的客户洞察',
49
+ '全渠道客户体验提升',
50
+ 'AI赋能销售管理创新',
51
+ ];
52
+
53
+ const mockDescriptions = [
54
+ '帮助企业搭建数字化客户经营平台,实现业绩高质量增长,提升客户满意度和忠诚度。',
55
+ '通过数据分析和智能算法,为企业提供精准的客户画像和个性化服务方案。',
56
+ '整合多渠道客户触点,打造无缝的客户体验,提升品牌价值和市场竞争力。',
57
+ '运用人工智能技术,优化销售流程,提高转化率,降低获客成本。',
58
+ '建立完善的客户数据体系,实现精准营销和个性化推荐,提升客户价值。',
59
+ '通过智能分析客户行为,预测客户需求,提前制定营销策略。',
60
+ '构建全生命周期客户管理体系,从获客到留存的全流程优化。',
61
+ '利用大数据和机器学习技术,实现客户价值的最大化挖掘。',
62
+ ];
63
+
64
+ const mockAuthors = [
65
+ '张三',
66
+ '李四',
67
+ '王五',
68
+ '赵六',
69
+ '钱七',
70
+ '孙八',
71
+ '周九',
72
+ '吴十',
73
+ ];
74
+ const mockTags = [
75
+ 'CRM',
76
+ '营销',
77
+ '数字化',
78
+ 'AI',
79
+ '数据分析',
80
+ '客户管理',
81
+ '智能客服',
82
+ '企业服务',
83
+ ];
84
+ const mockImages = [
85
+ 'https://picsum.photos/400/200?random=1',
86
+ 'https://picsum.photos/400/200?random=2',
87
+ 'https://picsum.photos/400/200?random=3',
88
+ 'https://picsum.photos/400/200?random=4',
89
+ 'https://picsum.photos/400/200?random=5',
90
+ 'https://picsum.photos/400/200?random=6',
91
+ 'https://picsum.photos/400/200?random=7',
92
+ 'https://picsum.photos/400/200?random=8',
93
+ ];
94
+
95
+ return Array.from({ length: count }, (_, index) => ({
96
+ id: `item-${index + 1}`,
97
+ title: mockTitles[index % mockTitles.length],
98
+ description: mockDescriptions[index % mockDescriptions.length],
99
+ image: mockImages[index % mockImages.length],
100
+ author: mockAuthors[index % mockAuthors.length],
101
+ createTime: new Date(
102
+ Date.now() - Math.random() * 30 * 24 * 60 * 60 * 1000,
103
+ ).toLocaleDateString(),
104
+ views: Math.floor(Math.random() * 1000) + 100,
105
+ likes: Math.floor(Math.random() * 500) + 50,
106
+ comments: Math.floor(Math.random() * 200) + 10,
107
+ tags: mockTags.slice(0, Math.floor(Math.random() * 3) + 1),
108
+ status: ['published', 'draft', 'archived'][
109
+ Math.floor(Math.random() * 3)
110
+ ] as 'published' | 'draft' | 'archived',
111
+ }));
112
+ }
113
+
114
+ // 格式化数字显示
115
+ formatNumber(num: number): string {
116
+ if (num < 1000) return num.toString();
117
+ if (num < 10000) return `${(num / 1000).toFixed(1)}k`;
118
+ return `${(num / 10000).toFixed(1)}w`;
119
+ }
120
+
121
+ // 获取状态标签颜色
122
+ getStatusColor(status: string): string {
123
+ const statusMap: { [key: string]: string } = {
124
+ published: 'green',
125
+ draft: 'orange',
126
+ archived: 'gray',
127
+ };
128
+ return statusMap[status] || 'default';
129
+ }
130
+
131
+ // 获取状态文本
132
+ getStatusText(status: string): string {
133
+ const statusMap: { [key: string]: string } = {
134
+ published: '已发布',
135
+ draft: '草稿',
136
+ archived: '已归档',
137
+ };
138
+ return statusMap[status] || '未知';
139
+ }
140
+
141
+ // 渲染列表项内容
142
+ renderListItem(item: ListItem) {
143
+ const { showImage, showTags } = this.props;
144
+
145
+ return (
146
+ <div key={item.id} className="list-item">
147
+ {showImage && (
148
+ <div className="item-image">
149
+ <img src={item.image} alt={item.title} />
150
+ </div>
151
+ )}
152
+ <div className="item-content">
153
+ <div className="item-header">
154
+ <h3 className="item-title">{item.title}</h3>
155
+ <span
156
+ className={`item-status status-${this.getStatusColor(
157
+ item.status,
158
+ )}`}
159
+ >
160
+ {this.getStatusText(item.status)}
161
+ </span>
162
+ </div>
163
+ <div className="item-description">{item.description}</div>
164
+ <div className="item-meta">
165
+ <div className="item-meta-info">
166
+ <span className="meta-item">作者:{item.author}</span>
167
+ <span className="meta-separator">·</span>
168
+ <span className="meta-item">发布时间:{item.createTime}</span>
169
+ </div>
170
+ {showTags && item.tags.length > 0 && (
171
+ <div className="item-tags">
172
+ {item.tags.map((tag, index) => (
173
+ <span key={index} className="tag">
174
+ {tag}
175
+ </span>
176
+ ))}
177
+ </div>
178
+ )}
179
+ </div>
180
+ </div>
181
+ </div>
182
+ );
183
+ }
184
+
185
+ render() {
186
+ const { title, itemCount, listType, data } = this.props;
187
+
188
+ const curAmisData = data || {};
189
+ const systemInfo = curAmisData.__NeoSystemInfo || {};
190
+
191
+ const mockData = this.generateMockData(itemCount);
192
+
193
+ return (
194
+ <div className="list-widget-container">
195
+ <div className="list-header">
196
+ <h2 className="list-title">
197
+ {title || '内容列表'}
198
+ {systemInfo.tenantName ? `【${systemInfo.tenantName}】` : ''}
199
+ </h2>
200
+ </div>
201
+
202
+ <div className={`list-content list-${listType}`}>
203
+ {mockData.map((item) => this.renderListItem(item))}
204
+ </div>
205
+ </div>
206
+ );
207
+ }
208
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @file 列表组件对接编辑器的描述文件
3
+ */
4
+ export class ListWidgetModel {
5
+ /**
6
+ * cmpType 为自定义组件名称,用于标识组件的唯一性
7
+ * 在构建时根据当前组件目录名称自动生成
8
+ */
9
+ // cmpType: string = 'listWidget';
10
+
11
+ // 组件名称,用于设置在编辑器左侧组件面板中展示的名称
12
+ label: string = '列表组件';
13
+
14
+ // 组件描述,用于设置在编辑器左侧组件面板中展示的描述
15
+ description: string = '支持配置的列表展示组件,内置模拟数据';
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: string = 'https://neo-widgets.bj.bcebos.com/favicon.png';
36
+ // iconSrc: string = 'https://custom-widgets.bj.bcebos.com/custom-icon1.svg'; // custom-icon2
37
+
38
+ // 初次插入页面的默认属性数据
39
+ defaultComProps = {
40
+ title: '内容列表',
41
+ label: '列表组件',
42
+ showImage: true,
43
+ showTags: true,
44
+ itemCount: 8,
45
+ listType: 'default',
46
+ };
47
+
48
+ /**
49
+ * 组件面板配置,用于生成编辑器右侧属性配置面板内容
50
+ */
51
+ propsSchema = [
52
+ {
53
+ type: 'text',
54
+ name: 'title',
55
+ label: '列表标题',
56
+ value: '内容列表',
57
+ },
58
+ {
59
+ type: 'switch',
60
+ name: 'showImage',
61
+ label: '显示图片',
62
+ value: true,
63
+ },
64
+ {
65
+ type: 'switch',
66
+ name: 'showTags',
67
+ label: '显示标签',
68
+ value: true,
69
+ },
70
+ {
71
+ type: 'number',
72
+ name: 'itemCount',
73
+ label: '列表项数量',
74
+ value: 8,
75
+ min: 1,
76
+ max: 50,
77
+ },
78
+ {
79
+ type: 'radios',
80
+ name: 'listType',
81
+ label: '列表样式',
82
+ value: 'default',
83
+ options: [
84
+ { label: '默认样式', value: 'default' },
85
+ { label: '卡片样式', value: 'card' },
86
+ { label: '简洁样式', value: 'simple' },
87
+ ],
88
+ },
89
+ ];
90
+ }
91
+
92
+ export default ListWidgetModel;