neo-cmp-cli 1.1.10 → 1.1.12
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.
- package/package.json +1 -1
- package/src/module/index.js +2 -0
- package/src/neo/neoRequire.js +2 -2
- package/src/template/antd-custom-cmp-template/neo.config.js +3 -3
- package/src/template/antd-custom-cmp-template/package.json +2 -2
- package/src/template/antd-custom-cmp-template/src/components/data-dashboard/style.scss +20 -20
- package/src/template/antd-custom-cmp-template/src/components/info-card/index.tsx +20 -0
- package/src/template/echarts-custom-cmp-template/neo.config.js +7 -4
- package/src/template/echarts-custom-cmp-template/package.json +2 -2
- package/src/template/neo-custom-cmp-template/package.json +1 -1
- package/src/template/neo-custom-cmp-template/src/components/neo-entity-grid/README.md +0 -13
- package/src/template/react-custom-cmp-template/package.json +1 -1
- package/src/template/react-ts-custom-cmp-template/package.json +1 -1
- package/src/template/vue2-custom-cmp-template/package.json +1 -1
package/package.json
CHANGED
package/src/module/index.js
CHANGED
package/src/neo/neoRequire.js
CHANGED
|
@@ -28,8 +28,8 @@ const getExternalsByNeoCommonModules = (cmpNeoExternals) => {
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
// 如果自定义组件有共享的依赖模块,则合并到 neoExternals 中
|
|
31
|
-
if (cmpNeoExternals &&
|
|
32
|
-
|
|
31
|
+
if (cmpNeoExternals && cmpNeoExternals.length > 0) {
|
|
32
|
+
cmpNeoExternals.forEach(moduleName => {
|
|
33
33
|
neoExternals[moduleName] = `commonjs ${moduleName}`;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -40,9 +40,9 @@ module.exports = {
|
|
|
40
40
|
},
|
|
41
41
|
// Neo 共享依赖模块
|
|
42
42
|
neoCommonModule: {
|
|
43
|
-
// neoExports: ['echarts'], // 自定义组件
|
|
44
|
-
// neoExports: {},
|
|
45
|
-
neoExternals: ['neo-register'], // 自定义组件 需要剔除的模块,仅支持数组写法
|
|
43
|
+
// neoExports: ['echarts'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
44
|
+
// neoExports: {}, // 对象写法
|
|
45
|
+
// neoExternals: ['neo-register', 'chart-widget'], // 自定义组件 需要剔除的模块,仅支持数组写法
|
|
46
46
|
},
|
|
47
47
|
preview: {
|
|
48
48
|
// 用于开启本地预览模式的相关配置信息
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-custom-cmp-template",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "neo自定义组件模板(react&ts技术栈)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"自定义组件模板",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@commitlint/config-conventional": "^9.1.1",
|
|
48
48
|
"@types/react": "^16.9.11",
|
|
49
49
|
"@types/react-dom": "^16.9.15",
|
|
50
|
-
"neo-cmp-cli": "^1.1.
|
|
50
|
+
"neo-cmp-cli": "^1.1.12",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
@@ -254,11 +254,11 @@
|
|
|
254
254
|
border: 1px solid rgba(51, 65, 85, 0.5);
|
|
255
255
|
backdrop-filter: blur(20px);
|
|
256
256
|
color: var(--text-inverse);
|
|
257
|
-
|
|
257
|
+
|
|
258
258
|
.dashboard-title {
|
|
259
259
|
color: var(--text-inverse);
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
|
|
262
262
|
.user-info {
|
|
263
263
|
.user-name {
|
|
264
264
|
color: var(--text-inverse);
|
|
@@ -275,86 +275,86 @@
|
|
|
275
275
|
border: 1px solid rgba(51, 65, 85, 0.5);
|
|
276
276
|
color: var(--text-inverse);
|
|
277
277
|
backdrop-filter: blur(20px);
|
|
278
|
-
|
|
278
|
+
|
|
279
279
|
.ant-card-head-title {
|
|
280
280
|
color: var(--text-inverse);
|
|
281
281
|
}
|
|
282
|
-
|
|
282
|
+
|
|
283
283
|
.ant-statistic-title {
|
|
284
284
|
color: var(--text-inverse);
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
|
|
287
287
|
.ant-statistic-content-value {
|
|
288
288
|
color: var(--text-inverse);
|
|
289
289
|
}
|
|
290
|
-
|
|
290
|
+
|
|
291
291
|
.metric-trend {
|
|
292
292
|
.trend-text {
|
|
293
293
|
color: var(--text-inverse);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
|
|
297
297
|
.product-name {
|
|
298
298
|
color: var(--text-inverse);
|
|
299
299
|
}
|
|
300
|
-
|
|
300
|
+
|
|
301
301
|
.product-sales {
|
|
302
302
|
color: rgba(255, 255, 255, 0.7);
|
|
303
303
|
}
|
|
304
|
-
|
|
304
|
+
|
|
305
305
|
.activity-text {
|
|
306
306
|
.user-name {
|
|
307
307
|
color: var(--primary-light);
|
|
308
308
|
}
|
|
309
|
-
|
|
309
|
+
|
|
310
310
|
.action {
|
|
311
311
|
color: var(--text-inverse);
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
|
|
314
|
+
|
|
315
315
|
.activity-time {
|
|
316
316
|
color: rgba(255, 255, 255, 0.7);
|
|
317
317
|
}
|
|
318
|
-
|
|
318
|
+
|
|
319
319
|
.performance-header {
|
|
320
320
|
.metric-name {
|
|
321
321
|
color: var(--text-inverse);
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
|
|
324
324
|
.metric-value {
|
|
325
325
|
color: var(--primary-light);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
|
|
329
329
|
.performance-target {
|
|
330
330
|
color: rgba(255, 255, 255, 0.7);
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
|
|
333
333
|
.active-users-description {
|
|
334
334
|
color: rgba(255, 255, 255, 0.7);
|
|
335
335
|
}
|
|
336
|
-
|
|
336
|
+
|
|
337
337
|
.active-users-number {
|
|
338
338
|
.unit {
|
|
339
339
|
color: rgba(255, 255, 255, 0.7);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
|
|
343
343
|
.ant-btn {
|
|
344
344
|
color: var(--text-inverse);
|
|
345
345
|
border-color: rgba(255, 255, 255, 0.3);
|
|
346
|
-
|
|
346
|
+
|
|
347
347
|
&:hover {
|
|
348
348
|
color: var(--text-inverse);
|
|
349
349
|
border-color: var(--primary-light);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
|
|
353
353
|
.ant-tag {
|
|
354
354
|
color: var(--text-inverse);
|
|
355
355
|
border-color: rgba(255, 255, 255, 0.3);
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
|
|
358
358
|
.ant-progress-text {
|
|
359
359
|
color: var(--text-inverse);
|
|
360
360
|
}
|
|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { Avatar } from 'antd';
|
|
3
3
|
import { UserOutlined } from '@ant-design/icons';
|
|
4
4
|
import './style.scss'; // 组件内容样式
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
// import ChartWidget from 'chart-widget'; // 另一个自定义组件导出的模块
|
|
5
7
|
|
|
6
8
|
interface InfoCardProps {
|
|
7
9
|
title: string;
|
|
@@ -66,6 +68,24 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
|
|
|
66
68
|
</div>
|
|
67
69
|
)}
|
|
68
70
|
</div>
|
|
71
|
+
{/*
|
|
72
|
+
<ChartWidget
|
|
73
|
+
chartType="line"
|
|
74
|
+
title="销售趋势"
|
|
75
|
+
subtitle="2025年数据"
|
|
76
|
+
width={800}
|
|
77
|
+
height={400}
|
|
78
|
+
mockData={{
|
|
79
|
+
xAxis: ['1月', '2月', '3月', '4月', '5月', '6月'],
|
|
80
|
+
series: [
|
|
81
|
+
{
|
|
82
|
+
name: '销售额',
|
|
83
|
+
data: [120, 200, 150, 80, 70, 110],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
*/}
|
|
69
89
|
</div>
|
|
70
90
|
);
|
|
71
91
|
}
|
|
@@ -38,14 +38,17 @@ module.exports = {
|
|
|
38
38
|
// plugins: [],
|
|
39
39
|
// babelPlugins: [],
|
|
40
40
|
},
|
|
41
|
+
// Neo 共享依赖模块
|
|
42
|
+
/*
|
|
41
43
|
neoCommonModule: {
|
|
42
|
-
// neoExports: [
|
|
44
|
+
// neoExports: [], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
43
45
|
neoExports: {
|
|
44
|
-
|
|
45
|
-
'neo-register': 'neo-register',
|
|
46
|
+
'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
|
|
47
|
+
'neo-register': 'neo-register', // 导出 Neo 注册模块
|
|
46
48
|
},
|
|
47
|
-
neoExternals: [
|
|
49
|
+
// neoExternals: [], // 自定义组件 需要剔除的模块,仅支持数组写法
|
|
48
50
|
},
|
|
51
|
+
*/
|
|
49
52
|
preview: {
|
|
50
53
|
// 用于开启本地预览模式的相关配置信息
|
|
51
54
|
/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echarts-custom-cmp-template",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "neo自定义组件模板(react&ts技术栈)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"自定义组件模板",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@commitlint/config-conventional": "^9.1.1",
|
|
48
48
|
"@types/react": "^16.9.11",
|
|
49
49
|
"@types/react-dom": "^16.9.15",
|
|
50
|
-
"neo-cmp-cli": "^1.1.
|
|
50
|
+
"neo-cmp-cli": "^1.1.12",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5",
|
|
@@ -35,16 +35,9 @@ import NeoEntityGrid from './components/neo-entity-grid';
|
|
|
35
35
|
| objectApiKey | string | 'account' | 实体API Key |
|
|
36
36
|
| tableType | string | 'lookup' | 表格类型 (lookup/list/related) |
|
|
37
37
|
| selectionMode | string | 'multiple' | 选择模式 (single/multiple/none) |
|
|
38
|
-
| showFooter | boolean | true | 是否显示底部 (分页、操作按钮等) |
|
|
39
38
|
| showHeader | boolean | true | 是否显示头部 (工具栏、筛选等) |
|
|
40
39
|
| data | any | - | 组件数据 |
|
|
41
40
|
|
|
42
|
-
### 表格类型说明
|
|
43
|
-
|
|
44
|
-
- **lookup**: 查找模式,用于选择数据
|
|
45
|
-
- **list**: 列表模式,用于展示数据列表
|
|
46
|
-
- **related**: 关联模式,用于展示关联数据
|
|
47
|
-
|
|
48
41
|
### 选择模式说明
|
|
49
42
|
|
|
50
43
|
- **single**: 单选模式
|
|
@@ -52,8 +45,6 @@ import NeoEntityGrid from './components/neo-entity-grid';
|
|
|
52
45
|
- **none**: 无选择模式
|
|
53
46
|
|
|
54
47
|
### 显示控制说明
|
|
55
|
-
|
|
56
|
-
- **showFooter**: 控制是否显示表格底部,包括分页信息、操作按钮等
|
|
57
48
|
- **showHeader**: 控制是否显示表格头部,包括工具栏、筛选条件等
|
|
58
49
|
|
|
59
50
|
### 使用示例
|
|
@@ -65,7 +56,6 @@ import NeoEntityGrid from './components/neo-entity-grid';
|
|
|
65
56
|
objectApiKey="account"
|
|
66
57
|
tableType="lookup"
|
|
67
58
|
selectionMode="multiple"
|
|
68
|
-
showFooter={true}
|
|
69
59
|
showHeader={true}
|
|
70
60
|
/>
|
|
71
61
|
```
|
|
@@ -77,7 +67,6 @@ import NeoEntityGrid from './components/neo-entity-grid';
|
|
|
77
67
|
objectApiKey="account"
|
|
78
68
|
tableType="list"
|
|
79
69
|
selectionMode="none"
|
|
80
|
-
showFooter={false}
|
|
81
70
|
showHeader={true}
|
|
82
71
|
/>
|
|
83
72
|
```
|
|
@@ -89,7 +78,6 @@ import NeoEntityGrid from './components/neo-entity-grid';
|
|
|
89
78
|
objectApiKey="account"
|
|
90
79
|
tableType="list"
|
|
91
80
|
selectionMode="none"
|
|
92
|
-
showFooter={false}
|
|
93
81
|
showHeader={false}
|
|
94
82
|
/>
|
|
95
83
|
```
|
|
@@ -124,5 +112,4 @@ const entityGridStore = EntityGridStore.create({
|
|
|
124
112
|
|
|
125
113
|
## 注意事项
|
|
126
114
|
1. 组件需要在 Neo 环境中使用,需要相应的上下文支持
|
|
127
|
-
2. EntityGrid 组件需要 render 函数来渲染 amis 组件
|
|
128
115
|
3. 确保有相应的权限配置
|