neo-cmp-cli 1.7.15-beta.1 → 1.7.15
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/neo/neoService.js +7 -75
- package/src/template/antd-custom-cmp-template/package.json +1 -1
- package/src/template/antd-custom-cmp-template/src/components/dataDashboard/model.ts +1 -15
- package/src/template/antd-custom-cmp-template/src/components/infoCard/model.ts +1 -15
- package/src/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +1 -1
- package/src/template/develop/neo-custom-cmp-template/src/components/contactForm/model.ts +1 -1
- package/src/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/model.ts +1 -1
- package/src/template/echarts-custom-cmp-template/package.json +1 -1
- package/src/template/echarts-custom-cmp-template/src/components/chartWidget/model.ts +1 -15
- package/src/template/echarts-custom-cmp-template/src/components/mapWidget/model.ts +1 -15
- package/src/template/empty-cmp/model.ts +1 -15
- package/src/template/empty-custom-cmp-template/package.json +1 -1
- package/src/template/neo-custom-cmp-template/package.json +3 -3
- package/src/template/neo-custom-cmp-template/src/components/entityCardList/model.ts +1 -15
- package/src/template/neo-custom-cmp-template/src/components/entityDetail/model.ts +1 -15
- package/src/template/neo-custom-cmp-template/src/components/entityForm/model.ts +1 -15
- package/src/template/neo-custom-cmp-template/src/components/entityTable/model.ts +1 -15
- package/src/template/react-custom-cmp-template/package.json +1 -1
- package/src/template/react-custom-cmp-template/src/components/infoCard/model.js +1 -15
- package/src/template/react-ts-custom-cmp-template/package.json +1 -1
- package/src/template/react-ts-custom-cmp-template/src/components/listWidget/model.ts +1 -15
- package/src/template/vue2-custom-cmp-template/package.json +1 -1
- package/src/template/vue2-custom-cmp-template/src/components/vueInfoCard/model.js +1 -15
- package/src/utils/cmpUtils/pushCmp.js +5 -22
package/package.json
CHANGED
package/src/neo/neoService.js
CHANGED
|
@@ -14,14 +14,11 @@ const NeoCrmAPI = {
|
|
|
14
14
|
neoBaseURL: 'https://crm.xiaoshouyi.com', // 平台根地址
|
|
15
15
|
loginAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // code 获取接口地址
|
|
16
16
|
tokenAPI: 'https://login.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址
|
|
17
|
+
uploadAPI: '/rest/metadata/v3.0/ui/customComponents/actions/upload', // 文件上传接口地址
|
|
17
18
|
delete: '/rest/metadata/v3.0/ui/customComponents',
|
|
18
|
-
|
|
19
|
-
queryAll: '/rest/metadata/v3.0/ui/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
uploadAPI: '/rest/metadata/v3.0/ui/customComponents/actions/upload', // 文件上传接口地址(已废弃)
|
|
23
|
-
query: '/rest/metadata/v3.0/ui/customComponents/actions/queryCustomComponents' // 带分页(暂未使用)
|
|
24
|
-
// queryAll_v1: '/rest/metadata/v3.0/ui/customComponents/actions/queryAllCustomComponents', // 不带分页(已废弃)
|
|
19
|
+
query: '/rest/metadata/v3.0/ui/customComponents/actions/queryCustomComponents', // 带分页
|
|
20
|
+
queryAll: '/rest/metadata/v3.0/ui/customComponents/actions/queryAllCustomComponents', // 不带分页
|
|
21
|
+
saveAPI: '/rest/metadata/v3.0/ui/customComponents/actions/saveOrUpdateComponent' // 创建或者保存接口地址
|
|
25
22
|
};
|
|
26
23
|
|
|
27
24
|
const cmpFields = [
|
|
@@ -297,8 +294,7 @@ class NeoService {
|
|
|
297
294
|
}
|
|
298
295
|
|
|
299
296
|
/**
|
|
300
|
-
* 上传文件到 Neo
|
|
301
|
-
* 备注:已废弃,改为 保存时直接上传组件资源文件
|
|
297
|
+
* 上传文件到 Neo 平台
|
|
302
298
|
* @param {string} filePath 文件路径
|
|
303
299
|
* @param {object} options 可选配置
|
|
304
300
|
* @param {string} options.fieldName 表单字段名,默认为 'customComponentCode'
|
|
@@ -327,7 +323,7 @@ class NeoService {
|
|
|
327
323
|
}
|
|
328
324
|
|
|
329
325
|
// 检查文件大小
|
|
330
|
-
const maxSize = options.maxSize ||
|
|
326
|
+
const maxSize = options.maxSize || 50 * 1024 * 1024; // 默认 50MB
|
|
331
327
|
if (fileStat.size > maxSize) {
|
|
332
328
|
const sizeMB = (fileStat.size / 1024 / 1024).toFixed(2);
|
|
333
329
|
const maxSizeMB = (maxSize / 1024 / 1024).toFixed(2);
|
|
@@ -458,8 +454,7 @@ class NeoService {
|
|
|
458
454
|
}
|
|
459
455
|
|
|
460
456
|
/**
|
|
461
|
-
* 将构建产物上传到 NeoCRM
|
|
462
|
-
* 备注:已废弃,改为 保存时直接上传组件资源文件
|
|
457
|
+
* 将构建产物上传到 NeoCRM 平台端
|
|
463
458
|
*
|
|
464
459
|
* @param {object} cmpType 自定义组件名称
|
|
465
460
|
* @param {array} fileExtensions 需要上传的文件类型,默认 ['.js', '.css', '.zip']
|
|
@@ -526,69 +521,6 @@ class NeoService {
|
|
|
526
521
|
return curCmpInfo;
|
|
527
522
|
}
|
|
528
523
|
|
|
529
|
-
/**
|
|
530
|
-
* 处理组件构建产物
|
|
531
|
-
*
|
|
532
|
-
* @param {object} cmpType 自定义组件名称
|
|
533
|
-
* @param {array} fileExtensions 需要处理的文件类型,默认 ['.js', '.css', '.zip']
|
|
534
|
-
*/
|
|
535
|
-
async getCmpAssets(cmpType, fileExtensions = ['.js', '.css', '.zip']) {
|
|
536
|
-
if (!cmpType) {
|
|
537
|
-
errorLog(`自定义组件名称不能为空: ${cmpType}`);
|
|
538
|
-
return;
|
|
539
|
-
}
|
|
540
|
-
if (!fs.existsSync(this.assetsRoot)) {
|
|
541
|
-
errorLog(`未找到自定义组件资源目录: ${this.assetsRoot}`);
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
// 当前组件信息
|
|
546
|
-
const curCmpInfo = {
|
|
547
|
-
cmpType
|
|
548
|
-
};
|
|
549
|
-
|
|
550
|
-
const files = fs.readdirSync(this.assetsRoot); // 读取构建目录下的所有文件
|
|
551
|
-
|
|
552
|
-
// 处理构建产物目录下所有指定类型的文件
|
|
553
|
-
files.forEach((file) => {
|
|
554
|
-
const filePath = path.join(this.assetsRoot, file);
|
|
555
|
-
// 获取文件状态
|
|
556
|
-
const fileStat = fs.statSync(filePath);
|
|
557
|
-
// 检查文件扩展名
|
|
558
|
-
// const fileExt = path.extname(file);
|
|
559
|
-
const fileInfo = path.parse(filePath);
|
|
560
|
-
if (fileStat.isFile() && fileExtensions.includes(fileInfo.ext)) {
|
|
561
|
-
let widgetName = _.camelCase(cmpType);
|
|
562
|
-
|
|
563
|
-
if (file.indexOf(widgetName) < 0) {
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
// 检查文件大小
|
|
568
|
-
const maxSize = 5 * 1024 * 1024; // 默认 5MB
|
|
569
|
-
if (fileStat.size > maxSize) {
|
|
570
|
-
const sizeMB = (fileStat.size / 1024 / 1024).toFixed(2);
|
|
571
|
-
const maxSizeMB = (maxSize / 1024 / 1024).toFixed(2);
|
|
572
|
-
throw new Error(`${file} 文件大小超过限制: ${sizeMB}MB > ${maxSizeMB}MB`);
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
const fileContent = fs.createReadStream(filePath);
|
|
576
|
-
if (file.indexOf('Model') > -1) {
|
|
577
|
-
// 使用文件流而不是读取整个文件到内存(对大文件更友好)
|
|
578
|
-
curCmpInfo.modelAssetFile = fileContent;
|
|
579
|
-
} else if (file.endsWith('.css')) {
|
|
580
|
-
curCmpInfo.cssAssetFile = fileContent;
|
|
581
|
-
} else if (file.endsWith('.zip')) {
|
|
582
|
-
curCmpInfo.codeLibFile = fileContent;
|
|
583
|
-
} else {
|
|
584
|
-
curCmpInfo.assetFile = fileContent;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
|
-
|
|
589
|
-
return curCmpInfo;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
524
|
/**
|
|
593
525
|
* 更新自定义组件
|
|
594
526
|
* @param {object} componentData 组件数据
|
|
@@ -15,21 +15,7 @@ export class DataDashboardModel {
|
|
|
15
15
|
description: string = '酷炫的数据展示仪表板,支持动态数据更新和动画效果';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags: string[] = ['仪表板'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
iconSrc: string = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
|
@@ -15,21 +15,7 @@ export class InfoCardModel {
|
|
|
15
15
|
description: string = '信息展示卡片';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags: string[] = ['自定义组件'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
iconSrc: string = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
package/src/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts
CHANGED
|
@@ -15,7 +15,7 @@ export class ContactCardListModel {
|
|
|
15
15
|
description: string = '展示联系人信息的卡片列表组件,支持姓名和手机号展示';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
18
|
+
tags: string[] = ['自定义组件'];
|
|
19
19
|
|
|
20
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
21
21
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/card-list.svg';
|
|
@@ -16,7 +16,7 @@ export class ContactFormModel {
|
|
|
16
16
|
'基于 Ant Design 的联系人表单组件,支持姓名、所有人、业务类型、所属部门、手机号等字段';
|
|
17
17
|
|
|
18
18
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
19
|
-
|
|
19
|
+
tags: string[] = ['自定义组件'];
|
|
20
20
|
|
|
21
21
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
22
22
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/contact-form.svg';
|
|
@@ -15,7 +15,7 @@ export class NeoEntityGridModel {
|
|
|
15
15
|
description: string = 'Neo 实体表格组件';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
18
|
+
tags: string[] = ['自定义组件'];
|
|
19
19
|
|
|
20
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
21
21
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/table.svg';
|
|
@@ -16,21 +16,7 @@ export class ChartWidgetModel {
|
|
|
16
16
|
'支持多种图表类型切换的专业图表组件,支持丰富的配置选项';
|
|
17
17
|
|
|
18
18
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 用于设置组件支持的页面类型
|
|
23
|
-
*
|
|
24
|
-
* 当前 NeoCRM 平台存在的页面类型:
|
|
25
|
-
* all: 1 全页面
|
|
26
|
-
* indexPage: 2 首页
|
|
27
|
-
* entityListPage: 3 实体列表页
|
|
28
|
-
* entityFormPage: 4 实体表单页
|
|
29
|
-
* entityDetailPage: 5 实体详情页
|
|
30
|
-
* customPage: 6 自定义页面
|
|
31
|
-
* bizPage: 7 业务页面
|
|
32
|
-
*/
|
|
33
|
-
// targetPage: string[] = ['customPage'];
|
|
19
|
+
tags: string[] = ['自定义组件'];
|
|
34
20
|
|
|
35
21
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
36
22
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/chart.svg';
|
|
@@ -15,21 +15,7 @@ export class MapWidgetModel {
|
|
|
15
15
|
description: string = '地图展示组件,支持传入经纬度或地址名称';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags: string[] = ['自定义组件'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/map.svg';
|
|
@@ -15,21 +15,7 @@ export class CmpModel {
|
|
|
15
15
|
description: string = 'xx组件详细描述';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags: string[] = ['自定义组件'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
iconSrc: string = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"url": "https://github.com/wibetter/neo-custom-cmp-template/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"neo-register": "^1.0.
|
|
41
|
+
"neo-register": "^1.0.6",
|
|
42
42
|
"react": "^16.9.0",
|
|
43
43
|
"react-dom": "^16.9.0",
|
|
44
44
|
"axios": "^0.27.2",
|
|
45
45
|
"antd": "^4.9.4",
|
|
46
46
|
"lodash": "^4.17.21",
|
|
47
|
-
"neo-open-api": "^1.
|
|
47
|
+
"neo-open-api": "^1.0.11"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@commitlint/cli": "^8.3.5",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/react": "^16.9.11",
|
|
53
53
|
"@types/react-dom": "^16.9.15",
|
|
54
54
|
"@types/axios": "^0.14.0",
|
|
55
|
-
"neo-cmp-cli": "^1.7.
|
|
55
|
+
"neo-cmp-cli": "^1.7.5",
|
|
56
56
|
"husky": "^4.2.5",
|
|
57
57
|
"lint-staged": "^10.2.9",
|
|
58
58
|
"prettier": "^2.0.5"
|
|
@@ -15,21 +15,7 @@ export class EntityCardListModel {
|
|
|
15
15
|
description: string = '展示实体数据信息的卡片列表组件,支持姓名和手机号展示';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags: string[] = ['自定义组件'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/data-list.svg';
|
|
@@ -17,21 +17,7 @@ export class EntityDetailModel {
|
|
|
17
17
|
description: string = '展示实体数据详情信息,支持多列布局和字段类型识别';
|
|
18
18
|
|
|
19
19
|
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 用于设置组件支持的页面类型
|
|
24
|
-
*
|
|
25
|
-
* 当前 NeoCRM 平台存在的页面类型:
|
|
26
|
-
* all: 1 全页面
|
|
27
|
-
* indexPage: 2 首页
|
|
28
|
-
* entityListPage: 3 实体列表页
|
|
29
|
-
* entityFormPage: 4 实体表单页
|
|
30
|
-
* entityDetailPage: 5 实体详情页
|
|
31
|
-
* customPage: 6 自定义页面
|
|
32
|
-
* bizPage: 7 业务页面
|
|
33
|
-
*/
|
|
34
|
-
// targetPage: string[] = ['customPage'];
|
|
20
|
+
tags: string[] = ['自定义组件'];
|
|
35
21
|
|
|
36
22
|
/** 组件图标,用于设置在编辑器左侧组件面板中展示的图标 */
|
|
37
23
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/detail.svg';
|
|
@@ -19,21 +19,7 @@ export class EntityFormModel {
|
|
|
19
19
|
description: string = '基于 XObject 的对象表单组件,用于新增数据';
|
|
20
20
|
|
|
21
21
|
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 用于设置组件支持的页面类型
|
|
26
|
-
*
|
|
27
|
-
* 当前 NeoCRM 平台存在的页面类型:
|
|
28
|
-
* all: 1 全页面
|
|
29
|
-
* indexPage: 2 首页
|
|
30
|
-
* entityListPage: 3 实体列表页
|
|
31
|
-
* entityFormPage: 4 实体表单页
|
|
32
|
-
* entityDetailPage: 5 实体详情页
|
|
33
|
-
* customPage: 6 自定义页面
|
|
34
|
-
* bizPage: 7 业务页面
|
|
35
|
-
*/
|
|
36
|
-
// targetPage: string[] = ['customPage'];
|
|
22
|
+
tags: string[] = ['自定义组件'];
|
|
37
23
|
|
|
38
24
|
/** 组件图标,用于设置在编辑器左侧组件面板中展示的图标 */
|
|
39
25
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/custom-form.svg';
|
|
@@ -19,25 +19,11 @@ export class EntityTableModel {
|
|
|
19
19
|
description: string = '基于 XObject 的数据表格组件,支持增删改查操作';
|
|
20
20
|
|
|
21
21
|
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
|
|
22
|
-
|
|
22
|
+
tags: string[] = ['自定义组件'];
|
|
23
23
|
|
|
24
24
|
/** 组件图标,用于设置在编辑器左侧组件面板中展示的图标 */
|
|
25
25
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/table.svg';
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* 用于设置组件支持的页面类型
|
|
29
|
-
*
|
|
30
|
-
* 当前 NeoCRM 平台存在的页面类型:
|
|
31
|
-
* all: 1 全页面
|
|
32
|
-
* indexPage: 2 首页
|
|
33
|
-
* entityListPage: 3 实体列表页
|
|
34
|
-
* entityFormPage: 4 实体表单页
|
|
35
|
-
* entityDetailPage: 5 实体详情页
|
|
36
|
-
* customPage: 6 自定义页面
|
|
37
|
-
* bizPage: 7 业务页面
|
|
38
|
-
*/
|
|
39
|
-
// targetPage: string[] = ['customPage'];
|
|
40
|
-
|
|
41
27
|
/** 初次插入页面的默认属性数据 */
|
|
42
28
|
defaultComProps = {
|
|
43
29
|
title: '实体数据表格',
|
|
@@ -15,21 +15,7 @@ export class InfoCardModel {
|
|
|
15
15
|
description = '信息展示卡片';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags = ['自定义组件'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
// iconSrc = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
|
@@ -15,21 +15,7 @@ export class ListWidgetModel {
|
|
|
15
15
|
description: string = '支持配置的列表展示组件,内置模拟数据';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags: string[] = ['自定义组件'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
iconSrc: string = 'https://neo-widgets.bj.bcebos.com/favicon.png';
|
|
@@ -15,21 +15,7 @@ export class InfoCardModel {
|
|
|
15
15
|
description = '信息展示卡片';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
|
|
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'];
|
|
18
|
+
tags = ['自定义组件'];
|
|
33
19
|
|
|
34
20
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
35
21
|
iconSrc = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
|
@@ -12,18 +12,6 @@ const createCmpProjectZip = require('../projectUtils/createCmpProjectZip');
|
|
|
12
12
|
const currentPackageJsonDir = catchCurPackageJson();
|
|
13
13
|
const currentPackageJson = getConfigObj(currentPackageJsonDir);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
// 获取属性 propsSchema 数据结构
|
|
17
|
-
const getPropsSchema = (propsSchema = []) => {
|
|
18
|
-
return propsSchema.map((item) => {
|
|
19
|
-
return {
|
|
20
|
-
label: item.label,
|
|
21
|
-
description: item.description,
|
|
22
|
-
propSchema: item
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
15
|
/**
|
|
28
16
|
* 构建组件数据映射
|
|
29
17
|
* @param {string} assetsRoot 构建产物的目录
|
|
@@ -98,14 +86,13 @@ const buildComponentData = async (assetsRoot, cmpInfo) => {
|
|
|
98
86
|
// 从模型实例中提取并设置组件信息
|
|
99
87
|
label: modelInstance.label || cmpType,
|
|
100
88
|
description: modelInstance.description || '',
|
|
101
|
-
componentCategory: (modelInstance.tags || [
|
|
102
|
-
|
|
103
|
-
iconUrl: modelInstance.iconSrc,
|
|
89
|
+
componentCategory: (modelInstance.tags || []).join(','),
|
|
90
|
+
icon: modelInstance.iconSrc,
|
|
104
91
|
defaultProps: JSON.stringify(modelInstance.defaultComProps || {}),
|
|
105
92
|
previewProps: JSON.stringify(modelInstance.previewComProps || {}),
|
|
106
|
-
|
|
93
|
+
propsSchema: JSON.stringify(modelInstance.propsSchema || []),
|
|
107
94
|
events: modelInstance.events || [],
|
|
108
|
-
|
|
95
|
+
actions: modelInstance.actions || [],
|
|
109
96
|
// 如果模型实例中有其他属性,也可以添加
|
|
110
97
|
exposedToDesigner:
|
|
111
98
|
modelInstance.exposedToDesigner !== undefined ? modelInstance.exposedToDesigner : true,
|
|
@@ -164,8 +151,7 @@ const pushCmp = async (config, cmpType) => {
|
|
|
164
151
|
errorLog(`[1/4] 源码文件打包失败。`, spinner);
|
|
165
152
|
}
|
|
166
153
|
|
|
167
|
-
|
|
168
|
-
// 步骤 3: 上传构建后资源文件(改放在保存时直接上传组件资源文件)
|
|
154
|
+
// 步骤 3: 上传构建后资源文件
|
|
169
155
|
spinner.start(`[2/4] 上传自定义组件构建产物到 OSS...`);
|
|
170
156
|
let cmpInfo;
|
|
171
157
|
try {
|
|
@@ -178,9 +164,6 @@ const pushCmp = async (config, cmpType) => {
|
|
|
178
164
|
} catch (error) {
|
|
179
165
|
errorLog(`[2/4] 构建产物上传失败。`, spinner);
|
|
180
166
|
}
|
|
181
|
-
*/
|
|
182
|
-
spinner.start(`[2/4] 获取自定义组件构建产物...`);
|
|
183
|
-
const cmpInfo = await neoService.getCmpAssets(cmpType);
|
|
184
167
|
|
|
185
168
|
// 步骤 4: 构建组件数据
|
|
186
169
|
spinner.start(`[3/4] 构建组件数据...`);
|