neo-cmp-cli 1.7.15 → 1.8.0
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/neoLogin.js +6 -6
- package/src/neo/neoService.js +131 -22
- package/src/template/antd-custom-cmp-template/package.json +2 -2
- package/src/template/antd-custom-cmp-template/src/components/dataDashboard/model.ts +15 -16
- package/src/template/antd-custom-cmp-template/src/components/infoCard/model.ts +15 -13
- package/src/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +1 -7
- 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/neo.config.js +1 -1
- package/src/template/echarts-custom-cmp-template/package.json +2 -2
- package/src/template/echarts-custom-cmp-template/src/components/chartWidget/model.ts +15 -17
- package/src/template/echarts-custom-cmp-template/src/components/mapWidget/model.ts +15 -13
- package/src/template/empty-cmp/model.ts +15 -13
- package/src/template/empty-custom-cmp-template/package.json +2 -2
- package/src/template/neo-custom-cmp-template/neo.config.js +4 -10
- package/src/template/neo-custom-cmp-template/package.json +5 -3
- package/src/template/neo-custom-cmp-template/src/components/entityCardList/model.ts +15 -14
- package/src/template/neo-custom-cmp-template/src/components/entityDetail/model.ts +15 -19
- package/src/template/neo-custom-cmp-template/src/components/entityForm/model.ts +15 -17
- package/src/template/neo-custom-cmp-template/src/components/entityTable/model.ts +15 -17
- package/src/template/neo-custom-cmp-template/tsconfig.json +42 -64
- package/src/template/react-custom-cmp-template/package.json +2 -2
- package/src/template/react-custom-cmp-template/src/components/infoCard/model.js +15 -13
- package/src/template/react-ts-custom-cmp-template/package.json +2 -2
- package/src/template/react-ts-custom-cmp-template/src/components/listWidget/model.ts +15 -13
- package/src/template/vue2-custom-cmp-template/package.json +2 -2
- package/src/template/vue2-custom-cmp-template/src/components/vueInfoCard/model.js +15 -13
- package/src/utils/cmpUtils/createCmpByZip.js +17 -6
- package/src/utils/cmpUtils/pullCmp.js +10 -9
- package/src/utils/cmpUtils/pushCmp.js +30 -11
- package/test/deprecate-versions.js +2 -2
|
@@ -7,12 +7,6 @@ function resolve(dir) {
|
|
|
7
7
|
return path.resolve(__dirname, dir);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
let auth = {}; // NeoCRM 授权配置
|
|
11
|
-
if (fs.existsSync('./auth.config.js')) {
|
|
12
|
-
// 加载 NeoCRM 授权配置
|
|
13
|
-
auth = require('./auth.config');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
10
|
// 包括生产和开发的环境配置信息
|
|
17
11
|
module.exports = {
|
|
18
12
|
settings: {
|
|
@@ -121,12 +115,12 @@ module.exports = {
|
|
|
121
115
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
122
116
|
// 当 authType 为 password 时,auth 配置项必填
|
|
123
117
|
auth: {
|
|
124
|
-
client_id:
|
|
125
|
-
client_secret:
|
|
126
|
-
username:
|
|
118
|
+
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
119
|
+
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
120
|
+
username: 'xx', // 用户在销售易系统中的用户名
|
|
127
121
|
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
128
122
|
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
129
|
-
password:
|
|
123
|
+
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
130
124
|
},
|
|
131
125
|
},
|
|
132
126
|
*/
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"preview": "neo preview",
|
|
15
15
|
"linkDebug": "neo linkDebug",
|
|
16
16
|
"pushCmp": "neo push cmp",
|
|
17
|
+
"pullCmp": "neo pull cmp",
|
|
18
|
+
"deleteCmp": "neo delete cmp",
|
|
17
19
|
"format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
|
|
18
20
|
},
|
|
19
21
|
"files": [
|
|
@@ -38,13 +40,13 @@
|
|
|
38
40
|
"url": "https://github.com/wibetter/neo-custom-cmp-template/issues"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
|
-
"neo-register": "^1.0.
|
|
43
|
+
"neo-register": "^1.0.8",
|
|
42
44
|
"react": "^16.9.0",
|
|
43
45
|
"react-dom": "^16.9.0",
|
|
44
46
|
"axios": "^0.27.2",
|
|
45
47
|
"antd": "^4.9.4",
|
|
46
48
|
"lodash": "^4.17.21",
|
|
47
|
-
"neo-open-api": "^1.0
|
|
49
|
+
"neo-open-api": "^1.1.0"
|
|
48
50
|
},
|
|
49
51
|
"devDependencies": {
|
|
50
52
|
"@commitlint/cli": "^8.3.5",
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
"@types/react": "^16.9.11",
|
|
53
55
|
"@types/react-dom": "^16.9.15",
|
|
54
56
|
"@types/axios": "^0.14.0",
|
|
55
|
-
"neo-cmp-cli": "^1.
|
|
57
|
+
"neo-cmp-cli": "^1.8.0",
|
|
56
58
|
"husky": "^4.2.5",
|
|
57
59
|
"lint-staged": "^10.2.9",
|
|
58
60
|
"prettier": "^2.0.5"
|
|
@@ -15,7 +15,21 @@ export class EntityCardListModel {
|
|
|
15
15
|
description: string = '展示实体数据信息的卡片列表组件,支持姓名和手机号展示';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
tags: string[] = ['自定义组件'];
|
|
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'];
|
|
19
33
|
|
|
20
34
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
21
35
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/data-list.svg';
|
|
@@ -30,12 +44,6 @@ export class EntityCardListModel {
|
|
|
30
44
|
},
|
|
31
45
|
};
|
|
32
46
|
|
|
33
|
-
// 设计器端预览时展示的默认数据
|
|
34
|
-
previewComProps = {
|
|
35
|
-
label: '数据卡片列表',
|
|
36
|
-
title: '数据卡片列表',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
47
|
/**
|
|
40
48
|
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
41
49
|
*/
|
|
@@ -61,13 +69,6 @@ export class EntityCardListModel {
|
|
|
61
69
|
*/
|
|
62
70
|
},
|
|
63
71
|
];
|
|
64
|
-
|
|
65
|
-
// 支持 函数式写法:propsSchemaCreator,com 为组件实例。优先级比 propsSchema 高
|
|
66
|
-
/*
|
|
67
|
-
propsSchemaCreator = (com: any) => {
|
|
68
|
-
return [];
|
|
69
|
-
};
|
|
70
|
-
*/
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export default EntityCardListModel;
|
|
@@ -17,7 +17,21 @@ export class EntityDetailModel {
|
|
|
17
17
|
description: string = '展示实体数据详情信息,支持多列布局和字段类型识别';
|
|
18
18
|
|
|
19
19
|
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
|
|
20
|
-
tags: string[] = ['自定义组件'];
|
|
20
|
+
// tags: string[] = ['自定义组件'];
|
|
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'];
|
|
21
35
|
|
|
22
36
|
/** 组件图标,用于设置在编辑器左侧组件面板中展示的图标 */
|
|
23
37
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/detail.svg';
|
|
@@ -33,13 +47,6 @@ export class EntityDetailModel {
|
|
|
33
47
|
showTitle: true,
|
|
34
48
|
};
|
|
35
49
|
|
|
36
|
-
/** 设计器端预览时展示的默认数据 */
|
|
37
|
-
previewComProps = {
|
|
38
|
-
title: '实体数据详情',
|
|
39
|
-
columnCount: 3,
|
|
40
|
-
showTitle: true,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
50
|
/**
|
|
44
51
|
* 组件属性配置模式
|
|
45
52
|
* 定义组件在编辑器中可配置的属性
|
|
@@ -111,17 +118,6 @@ export class EntityDetailModel {
|
|
|
111
118
|
description: '详情页面的列数布局',
|
|
112
119
|
},
|
|
113
120
|
];
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* 支持函数式写法:propsSchemaCreator
|
|
117
|
-
* com 为组件实例,优先级比 propsSchema 高
|
|
118
|
-
* 可以根据组件实例动态生成属性配置
|
|
119
|
-
*/
|
|
120
|
-
/*
|
|
121
|
-
propsSchemaCreator = (com: any) => {
|
|
122
|
-
return [];
|
|
123
|
-
};
|
|
124
|
-
*/
|
|
125
121
|
}
|
|
126
122
|
|
|
127
123
|
export default EntityDetailModel;
|
|
@@ -19,7 +19,21 @@ export class EntityFormModel {
|
|
|
19
19
|
description: string = '基于 XObject 的对象表单组件,用于新增数据';
|
|
20
20
|
|
|
21
21
|
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
|
|
22
|
-
tags: string[] = ['自定义组件'];
|
|
22
|
+
// tags: string[] = ['自定义组件'];
|
|
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'];
|
|
23
37
|
|
|
24
38
|
/** 组件图标,用于设置在编辑器左侧组件面板中展示的图标 */
|
|
25
39
|
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/custom-form.svg';
|
|
@@ -35,11 +49,6 @@ export class EntityFormModel {
|
|
|
35
49
|
},
|
|
36
50
|
};
|
|
37
51
|
|
|
38
|
-
/** 设计器端预览时展示的默认数据 */
|
|
39
|
-
previewComProps = {
|
|
40
|
-
formTitle: '新增数据表单',
|
|
41
|
-
};
|
|
42
|
-
|
|
43
52
|
/**
|
|
44
53
|
* 组件属性配置模式
|
|
45
54
|
* 支持静态配置:propsSchema,优先级比 propsSchemaCreator 低
|
|
@@ -93,17 +102,6 @@ export class EntityFormModel {
|
|
|
93
102
|
value: true,
|
|
94
103
|
},
|
|
95
104
|
];
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 支持函数式写法:propsSchemaCreator
|
|
99
|
-
* com 为组件实例,优先级比 propsSchema 高
|
|
100
|
-
* 可以根据组件实例动态生成属性配置
|
|
101
|
-
*/
|
|
102
|
-
/*
|
|
103
|
-
propsSchemaCreator = (com: any) => {
|
|
104
|
-
return [];
|
|
105
|
-
};
|
|
106
|
-
*/
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
export default EntityFormModel;
|
|
@@ -19,11 +19,25 @@ export class EntityTableModel {
|
|
|
19
19
|
description: string = '基于 XObject 的数据表格组件,支持增删改查操作';
|
|
20
20
|
|
|
21
21
|
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
|
|
22
|
-
tags: string[] = ['自定义组件'];
|
|
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
|
+
|
|
27
41
|
/** 初次插入页面的默认属性数据 */
|
|
28
42
|
defaultComProps = {
|
|
29
43
|
title: '实体数据表格',
|
|
@@ -36,11 +50,6 @@ export class EntityTableModel {
|
|
|
36
50
|
},
|
|
37
51
|
};
|
|
38
52
|
|
|
39
|
-
/** 设计器端预览时展示的默认数据 */
|
|
40
|
-
previewComProps = {
|
|
41
|
-
title: '实体数据表格',
|
|
42
|
-
};
|
|
43
|
-
|
|
44
53
|
/**
|
|
45
54
|
* 组件属性配置模式
|
|
46
55
|
* 支持静态配置:propsSchema,优先级比 propsSchemaCreator 低
|
|
@@ -120,17 +129,6 @@ export class EntityTableModel {
|
|
|
120
129
|
value: true,
|
|
121
130
|
},
|
|
122
131
|
];
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 支持函数式写法:propsSchemaCreator
|
|
126
|
-
* com 为组件实例,优先级比 propsSchema 高
|
|
127
|
-
* 可以根据组件实例动态生成属性配置
|
|
128
|
-
*/
|
|
129
|
-
/*
|
|
130
|
-
propsSchemaCreator = (com: any) => {
|
|
131
|
-
return [];
|
|
132
|
-
};
|
|
133
|
-
*/
|
|
134
132
|
}
|
|
135
133
|
|
|
136
134
|
export default EntityTableModel;
|
|
@@ -1,71 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"experimentalDecorators": true,
|
|
4
|
-
/* Basic Options */
|
|
5
4
|
"target": "esnext",
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"importHelpers": true /* 指定是否引入tslib里的复制工具函数,默认为false */,
|
|
22
|
-
// "downlevelIteration": true, /* 当target为"ES5"或"ES3"时,为"for-of" "spread"和"destructuring"中的迭代器提供完全支持 */
|
|
23
|
-
"isolatedModules": false /* 指定是否将每个文件作为单独的模块,默认为true */,
|
|
24
|
-
|
|
25
|
-
/* Strict Type-Checking Options */
|
|
26
|
-
"strict": false /* 指定是否启动所有类型检查 */,
|
|
27
|
-
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
|
|
28
|
-
"strictNullChecks": true /* Enable strict null checks. */,
|
|
29
|
-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
30
|
-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
31
|
-
"noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
|
|
32
|
-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
33
|
-
|
|
34
|
-
/* Additional Checks */
|
|
35
|
-
"noUnusedLocals": false /* Report errors on unused locals. */,
|
|
36
|
-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
37
|
-
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
|
|
38
|
-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
39
|
-
|
|
40
|
-
/* Module Resolution Options */
|
|
41
|
-
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
|
42
|
-
"baseUrl": "./" /* Base directory to resolve non-absolute module names. */,
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"allowJs": false,
|
|
7
|
+
"jsx": "react",
|
|
8
|
+
"declaration": false,
|
|
9
|
+
"noEmit": false,
|
|
10
|
+
"importHelpers": true,
|
|
11
|
+
"isolatedModules": false,
|
|
12
|
+
"strict": false,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"strictNullChecks": true,
|
|
15
|
+
"noImplicitThis": true,
|
|
16
|
+
"noUnusedLocals": false,
|
|
17
|
+
"noImplicitReturns": true,
|
|
18
|
+
"moduleResolution": "node",
|
|
19
|
+
"baseUrl": "./",
|
|
43
20
|
"paths": {
|
|
44
|
-
"@": [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
65
|
-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
66
|
-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
67
|
-
// "suppressImplicitAnyIndexErrors": true /* Suppress --noImplicitAny errors for indexing objects lacking index signatures. See issue #1232 for more details. */
|
|
21
|
+
"@": [
|
|
22
|
+
"./src"
|
|
23
|
+
],
|
|
24
|
+
"@assets/*": [
|
|
25
|
+
"src/assets/*"
|
|
26
|
+
],
|
|
27
|
+
"@components/*": [
|
|
28
|
+
"src/components/*"
|
|
29
|
+
],
|
|
30
|
+
"$utils/*": [
|
|
31
|
+
"src/utils/*"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"typeRoots": [
|
|
35
|
+
"./@types",
|
|
36
|
+
"./node_modules/@types"
|
|
37
|
+
],
|
|
38
|
+
"allowSyntheticDefaultImports": true,
|
|
39
|
+
"esModuleInterop": true,
|
|
40
|
+
"forceConsistentCasingInFileNames": true
|
|
68
41
|
},
|
|
69
|
-
"include": [
|
|
70
|
-
|
|
42
|
+
"include": [
|
|
43
|
+
"src",
|
|
44
|
+
"test"
|
|
45
|
+
],
|
|
46
|
+
"exclude": [
|
|
47
|
+
"node_modules"
|
|
48
|
+
]
|
|
71
49
|
}
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"url": "https://github.com/wibetter/react-custom-cmp-template/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"neo-register": "^1.0.
|
|
41
|
+
"neo-register": "^1.0.7",
|
|
42
42
|
"react": "^16.9.0",
|
|
43
43
|
"react-dom": "^16.9.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@commitlint/cli": "^8.3.5",
|
|
47
47
|
"@commitlint/config-conventional": "^9.1.1",
|
|
48
|
-
"neo-cmp-cli": "^1.
|
|
48
|
+
"neo-cmp-cli": "^1.8.0",
|
|
49
49
|
"husky": "^4.2.5",
|
|
50
50
|
"lint-staged": "^10.2.9",
|
|
51
51
|
"prettier": "^2.0.5"
|
|
@@ -15,7 +15,21 @@ export class InfoCardModel {
|
|
|
15
15
|
description = '信息展示卡片';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
tags = ['自定义组件'];
|
|
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'];
|
|
19
33
|
|
|
20
34
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
21
35
|
// iconSrc = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
|
@@ -31,11 +45,6 @@ export class InfoCardModel {
|
|
|
31
45
|
commentCount: 2025,
|
|
32
46
|
};
|
|
33
47
|
|
|
34
|
-
// 设计器端预览时展示的默认数据
|
|
35
|
-
previewComProps = {
|
|
36
|
-
label: '信息卡片',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
48
|
/**
|
|
40
49
|
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
41
50
|
* 备注:自定义组件中可用的配置项类型 请见 [当前可用表单项](https://github.com/wibetter/neo-register/blob/master/docs/FormItemType.md
|
|
@@ -67,13 +76,6 @@ export class InfoCardModel {
|
|
|
67
76
|
value: 2025,
|
|
68
77
|
},
|
|
69
78
|
];
|
|
70
|
-
|
|
71
|
-
// 支持 函数式写法:propsSchemaCreator,com 为页面设计器中的组件实例。优先级比 propsSchema 高
|
|
72
|
-
/*
|
|
73
|
-
propsSchemaCreator = (com: any, data: any) => {
|
|
74
|
-
return [];
|
|
75
|
-
};
|
|
76
|
-
*/
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
export default InfoCardModel;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/wibetter/react-ts-custom-cmp-template/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"neo-register": "^1.0.
|
|
41
|
+
"neo-register": "^1.0.7",
|
|
42
42
|
"react": "^16.9.0",
|
|
43
43
|
"react-dom": "^16.9.0"
|
|
44
44
|
},
|
|
@@ -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.
|
|
50
|
+
"neo-cmp-cli": "^1.8.0",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
@@ -15,7 +15,21 @@ export class ListWidgetModel {
|
|
|
15
15
|
description: string = '支持配置的列表展示组件,内置模拟数据';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
tags: string[] = ['自定义组件'];
|
|
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'];
|
|
19
33
|
|
|
20
34
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
21
35
|
iconSrc: string = 'https://neo-widgets.bj.bcebos.com/favicon.png';
|
|
@@ -31,11 +45,6 @@ export class ListWidgetModel {
|
|
|
31
45
|
listType: 'default',
|
|
32
46
|
};
|
|
33
47
|
|
|
34
|
-
// 设计器端预览时展示的默认数据
|
|
35
|
-
previewComProps = {
|
|
36
|
-
label: '列表组件',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
48
|
/**
|
|
40
49
|
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
41
50
|
*/
|
|
@@ -78,13 +87,6 @@ export class ListWidgetModel {
|
|
|
78
87
|
],
|
|
79
88
|
},
|
|
80
89
|
];
|
|
81
|
-
|
|
82
|
-
// 支持 函数式写法:propsSchemaCreator,com 为组件实例。优先级比 propsSchema 高
|
|
83
|
-
/*
|
|
84
|
-
propsSchemaCreator = (com: any) => {
|
|
85
|
-
return [];
|
|
86
|
-
};
|
|
87
|
-
*/
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
export default ListWidgetModel;
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"url": "https://github.com/wibetter/vue2-custom-cmp-template/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"neo-register": "^1.0.
|
|
41
|
+
"neo-register": "^1.0.7",
|
|
42
42
|
"vue": "^2.6.14",
|
|
43
43
|
"element-ui": "^2.15.12"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@commitlint/cli": "^8.3.5",
|
|
47
47
|
"@commitlint/config-conventional": "^9.1.1",
|
|
48
|
-
"neo-cmp-cli": "^1.
|
|
48
|
+
"neo-cmp-cli": "^1.8.0",
|
|
49
49
|
"husky": "^4.2.5",
|
|
50
50
|
"lint-staged": "^10.2.9",
|
|
51
51
|
"prettier": "^2.0.5",
|
|
@@ -15,7 +15,21 @@ export class InfoCardModel {
|
|
|
15
15
|
description = '信息展示卡片';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
tags = ['自定义组件'];
|
|
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'];
|
|
19
33
|
|
|
20
34
|
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
21
35
|
iconSrc = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
|
@@ -31,11 +45,6 @@ export class InfoCardModel {
|
|
|
31
45
|
comment_count: 2025,
|
|
32
46
|
};
|
|
33
47
|
|
|
34
|
-
// 设计器端预览时展示的默认数据
|
|
35
|
-
previewComProps = {
|
|
36
|
-
label: 'vue 信息卡片',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
48
|
/**
|
|
40
49
|
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
41
50
|
* 备注:自定义组件中可用的配置项类型 请见 [当前可用表单项](https://github.com/wibetter/neo-register/blob/master/docs/FormItemType.md
|
|
@@ -67,13 +76,6 @@ export class InfoCardModel {
|
|
|
67
76
|
value: 2025,
|
|
68
77
|
},
|
|
69
78
|
];
|
|
70
|
-
|
|
71
|
-
// 支持 函数式写法:propsSchemaCreator,com 为页面设计器中的组件实例。优先级比 propsSchema 高
|
|
72
|
-
/*
|
|
73
|
-
propsSchemaCreator = (com: any) => {
|
|
74
|
-
return [];
|
|
75
|
-
};
|
|
76
|
-
*/
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
export default InfoCardModel;
|
|
@@ -120,7 +120,8 @@ function formatConfigObject(obj, indent = 0, fileDir = '') {
|
|
|
120
120
|
* 3、对于 组件源码中的 tsconfig.json 文件内容 和 当前项目 tsconfig 进行 非覆盖式 merge 处理;
|
|
121
121
|
* 4、对于 组件源码中的 package.json 文件内容 和 当前项目 package.json 进行 非覆盖式 merge 处理,并识别新增 依赖,提示用户 重新安装依赖
|
|
122
122
|
*/
|
|
123
|
-
module.exports = async function (cmpZipUrl,
|
|
123
|
+
module.exports = async function (cmpZipUrl, option = {}) {
|
|
124
|
+
const { token, cmpName, componentBaseDir = './src/components' } = option || {};
|
|
124
125
|
const finalCmpName = cmpName;
|
|
125
126
|
|
|
126
127
|
if (!hasNeoProject()) {
|
|
@@ -154,16 +155,26 @@ module.exports = async function (cmpZipUrl, cmpName, componentBaseDir = './src/c
|
|
|
154
155
|
// 下载 zip 文件
|
|
155
156
|
let response;
|
|
156
157
|
try {
|
|
157
|
-
response = await axios({
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
response = await axios.get(cmpZipUrl, {
|
|
159
|
+
headers: {
|
|
160
|
+
Authorization: `Bearer ${token}`,
|
|
161
|
+
'xsy-inner-source': 'bff',
|
|
162
|
+
},
|
|
160
163
|
responseType: 'arraybuffer',
|
|
161
164
|
timeout: 60000, // 60秒超时
|
|
162
165
|
maxContentLength: Infinity,
|
|
163
|
-
maxBodyLength: Infinity
|
|
166
|
+
maxBodyLength: Infinity,
|
|
167
|
+
maxRedirects: 5, // 支持重定向
|
|
168
|
+
validateStatus: function (status) {
|
|
169
|
+
// 接受 2xx 和 3xx 状态码(重定向)
|
|
170
|
+
return status >= 200 && status < 400;
|
|
171
|
+
}
|
|
164
172
|
});
|
|
165
173
|
} catch (axiosError) {
|
|
166
|
-
|
|
174
|
+
const errorMessage = axiosError.response
|
|
175
|
+
? `下载文件失败: HTTP ${axiosError.response.status} - ${axiosError.message}`
|
|
176
|
+
: `下载文件失败: ${axiosError.message}`;
|
|
177
|
+
errorLog(errorMessage, spinner);
|
|
167
178
|
throw axiosError;
|
|
168
179
|
}
|
|
169
180
|
|