neo-cmp-cli 1.5.6 → 1.6.0-beta.3
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/README.md +62 -47
- package/package.json +1 -1
- package/src/module/index.js +74 -19
- package/src/module/main.js +167 -267
- package/src/module/neoInit.js +1 -0
- package/src/neo/NeoUMDContent.js +6 -5
- package/src/neo/neoService.js +150 -43
- package/src/oss/publish2oss.js +174 -71
- package/src/template/antd-custom-cmp-template/README.md +26 -2
- package/src/template/antd-custom-cmp-template/neo.config.js +7 -4
- package/src/template/antd-custom-cmp-template/package.json +1 -0
- package/src/template/echarts-custom-cmp-template/README.md +26 -2
- package/src/template/echarts-custom-cmp-template/neo.config.js +9 -5
- package/src/template/echarts-custom-cmp-template/package.json +1 -0
- package/src/template/empty-custom-cmp-template/README.md +26 -0
- package/src/template/empty-custom-cmp-template/neo.config.js +7 -4
- package/src/template/empty-custom-cmp-template/package.json +1 -0
- package/src/template/neo-custom-cmp-template/README.md +26 -2
- package/src/template/neo-custom-cmp-template/neo.config.js +12 -9
- package/src/template/neo-custom-cmp-template/package.json +2 -1
- package/src/template/react-custom-cmp-template/README.md +26 -2
- package/src/template/react-custom-cmp-template/neo.config.js +7 -4
- package/src/template/react-custom-cmp-template/package.json +1 -0
- package/src/template/react-ts-custom-cmp-template/README.md +26 -2
- package/src/template/react-ts-custom-cmp-template/neo.config.js +7 -4
- package/src/template/react-ts-custom-cmp-template/package.json +1 -0
- package/src/template/vue2-custom-cmp-template/README.md +26 -2
- package/src/template/vue2-custom-cmp-template/neo.config.js +7 -4
- package/src/template/vue2-custom-cmp-template/package.json +1 -0
- package/src/{cmpUtils → utils/cmpUtils}/createCmpByTemplate.js +8 -6
- package/src/utils/cmpUtils/createCmpByZip.js +90 -0
- package/src/{cmpUtils → utils/cmpUtils}/createCommonModulesCode.js +2 -2
- package/src/{cmpUtils → utils/cmpUtils}/getCmpModelRegisterCode.js +1 -1
- package/src/{cmpUtils → utils/cmpUtils}/getCmpPreviewCode.js +1 -1
- package/src/{cmpUtils → utils/cmpUtils}/getCmpRegisterCode.js +1 -1
- package/src/{cmpUtils → utils/cmpUtils}/getCmpTypeByDir.js +2 -2
- package/src/{cmpUtils → utils/cmpUtils}/hasCmpTypeByDir.js +1 -1
- package/src/{cmpUtils → utils/cmpUtils}/previewCmp.js +3 -3
- package/src/utils/cmpUtils/pullCmp.js +96 -0
- package/src/{cmpUtils → utils/cmpUtils}/pushCmp.js +82 -71
- package/src/utils/common.js +48 -0
- package/src/utils/generateEntries.js +73 -0
- package/src/{projectUtils → utils/projectUtils}/createCmpProjectByTemplate.js +10 -6
- package/src/{projectUtils → utils/projectUtils}/createCmpProjectZip.js +18 -20
- package/src/{projectUtils → utils/projectUtils}/getEntries.js +2 -2
- package/src/{projectUtils → utils/projectUtils}/getEntriesWithAutoRegister.js +2 -2
- package/src/{projectUtils → utils/projectUtils}/hasNeoProject.js +2 -2
- package/src/{projectUtils → utils/projectUtils}/updatePublishLog.js +1 -1
|
@@ -97,12 +97,12 @@ module.exports = {
|
|
|
97
97
|
}
|
|
98
98
|
*/
|
|
99
99
|
},
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// NeoCRM 平台配置
|
|
101
|
+
neoConfig: {
|
|
102
102
|
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
103
103
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
104
104
|
// NeoCRM 授权配置
|
|
105
|
-
|
|
105
|
+
auth: {
|
|
106
106
|
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
107
107
|
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
108
108
|
username: 'xx', // 用户在销售易系统中的用户名
|
|
@@ -110,8 +110,11 @@ module.exports = {
|
|
|
110
110
|
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
111
111
|
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
112
112
|
*/
|
|
113
|
-
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
113
|
+
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
114
114
|
},
|
|
115
|
+
},
|
|
116
|
+
pushCmp: {
|
|
117
|
+
// 用于构建并发布至 NeoCRM 的相关配置
|
|
115
118
|
/*
|
|
116
119
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
117
120
|
NODE_ENV: 'production',
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
- src: 自定义组件源码;
|
|
3
3
|
- src/assets: 存放组件静态资源,比如 css、img等;
|
|
4
4
|
- src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
|
|
5
|
-
- src/components/
|
|
6
|
-
- src/components/
|
|
5
|
+
- src/components/xxCmp/index: 自定义组件的内容文件;
|
|
6
|
+
- src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
|
|
7
7
|
- neo.config.js: neo-cmp-cli 配置文件。
|
|
8
8
|
|
|
9
9
|
### 🎨 酷炫图表组件 (Chart Widget)
|
|
@@ -87,5 +87,29 @@ $ npm run linkDebug
|
|
|
87
87
|
$ npm run pushCmp
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
##### 需自行添加 NeoCRM 授权配置
|
|
91
|
+
```javascript
|
|
92
|
+
module.exports = {
|
|
93
|
+
neoConfig: {
|
|
94
|
+
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
95
|
+
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
96
|
+
// NeoCRM 授权配置
|
|
97
|
+
auth: {
|
|
98
|
+
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
99
|
+
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
100
|
+
username: 'xx', // 用户在销售易系统中的用户名
|
|
101
|
+
/**
|
|
102
|
+
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
103
|
+
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
104
|
+
*/
|
|
105
|
+
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
1、客户端 ID 和 客户端秘钥 需通过 创建连接器 获取,获取方式见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / 创建连接器;
|
|
111
|
+
2、如何获取 安全令牌 见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌;
|
|
112
|
+
3、发布成功后即可在 NeoCRM 对应租户环境的页面设计器和表单设计器中使用此自定义组件。
|
|
113
|
+
|
|
90
114
|
### 配置项说明(neo-cmp-cli)
|
|
91
115
|
[请查看neo-cmp-cli](https://github.com/wibetter/neo-cmp-cli)
|
|
@@ -42,7 +42,8 @@ module.exports = {
|
|
|
42
42
|
///*
|
|
43
43
|
neoCommonModule: {
|
|
44
44
|
// neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
|
|
45
|
-
neoExports: {
|
|
45
|
+
neoExports: {
|
|
46
|
+
// 对象写法
|
|
46
47
|
'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
|
|
47
48
|
'neo-register': 'neo-register', // 导出 Neo 注册模块
|
|
48
49
|
},
|
|
@@ -98,12 +99,12 @@ module.exports = {
|
|
|
98
99
|
}
|
|
99
100
|
*/
|
|
100
101
|
},
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
// NeoCRM 平台配置
|
|
103
|
+
neoConfig: {
|
|
103
104
|
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
104
105
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
105
106
|
// NeoCRM 授权配置
|
|
106
|
-
|
|
107
|
+
auth: {
|
|
107
108
|
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
108
109
|
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
109
110
|
username: 'xx', // 用户在销售易系统中的用户名
|
|
@@ -111,8 +112,11 @@ module.exports = {
|
|
|
111
112
|
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
112
113
|
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
113
114
|
*/
|
|
114
|
-
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
115
|
+
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
115
116
|
},
|
|
117
|
+
},
|
|
118
|
+
pushCmp: {
|
|
119
|
+
// 用于构建并发布至 NeoCRM 的相关配置
|
|
116
120
|
/*
|
|
117
121
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
118
122
|
NODE_ENV: 'production',
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
- src: 自定义组件源码;
|
|
3
3
|
- src/assets: 存放组件静态资源,比如 css、img等;
|
|
4
4
|
- src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
|
|
5
|
+
- src/components/xxCmp/index: 自定义组件的内容文件;
|
|
6
|
+
- src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
|
|
5
7
|
- neo.config.js: neo-cmp-cli 配置文件。
|
|
6
8
|
|
|
7
9
|
### 组件开发规范
|
|
@@ -41,5 +43,29 @@ $ npm run linkDebug
|
|
|
41
43
|
$ npm run pushCmp
|
|
42
44
|
```
|
|
43
45
|
|
|
46
|
+
##### 需自行添加 NeoCRM 授权配置
|
|
47
|
+
```javascript
|
|
48
|
+
module.exports = {
|
|
49
|
+
neoConfig: {
|
|
50
|
+
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
51
|
+
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
52
|
+
// NeoCRM 授权配置
|
|
53
|
+
auth: {
|
|
54
|
+
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
55
|
+
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
56
|
+
username: 'xx', // 用户在销售易系统中的用户名
|
|
57
|
+
/**
|
|
58
|
+
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
59
|
+
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
60
|
+
*/
|
|
61
|
+
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
1、客户端 ID 和 客户端秘钥 需通过 创建连接器 获取,获取方式见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / 创建连接器;
|
|
67
|
+
2、如何获取 安全令牌 见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌;
|
|
68
|
+
3、发布成功后即可在 NeoCRM 对应租户环境的页面设计器和表单设计器中使用此自定义组件。
|
|
69
|
+
|
|
44
70
|
### 配置项说明(neo-cmp-cli)
|
|
45
71
|
[请查看neo-cmp-cli](https://github.com/wibetter/neo-cmp-cli)
|
|
@@ -97,12 +97,12 @@ module.exports = {
|
|
|
97
97
|
}
|
|
98
98
|
*/
|
|
99
99
|
},
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// NeoCRM 平台配置
|
|
101
|
+
neoConfig: {
|
|
102
102
|
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
103
103
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
104
104
|
// NeoCRM 授权配置
|
|
105
|
-
|
|
105
|
+
auth: {
|
|
106
106
|
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
107
107
|
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
108
108
|
username: 'xx', // 用户在销售易系统中的用户名
|
|
@@ -110,8 +110,11 @@ module.exports = {
|
|
|
110
110
|
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
111
111
|
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
112
112
|
*/
|
|
113
|
-
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
113
|
+
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
114
114
|
},
|
|
115
|
+
},
|
|
116
|
+
pushCmp: {
|
|
117
|
+
// 用于构建并发布至 NeoCRM 的相关配置
|
|
115
118
|
/*
|
|
116
119
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
117
120
|
NODE_ENV: 'production',
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
- src: 自定义组件源码;
|
|
3
3
|
- src/assets: 存放组件静态资源,比如 css、img等;
|
|
4
4
|
- src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
|
|
5
|
-
- src/components/
|
|
6
|
-
- src/components/
|
|
5
|
+
- src/components/xxCmp/index: 自定义组件的内容文件;
|
|
6
|
+
- src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
|
|
7
7
|
- neo.config.js: neo-cmp-cli 配置文件。
|
|
8
8
|
|
|
9
9
|
### 组件开发规范
|
|
@@ -44,5 +44,29 @@ $ npm run linkDebug
|
|
|
44
44
|
$ npm run pushCmp
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
##### 需自行添加 NeoCRM 授权配置
|
|
48
|
+
```javascript
|
|
49
|
+
module.exports = {
|
|
50
|
+
neoConfig: {
|
|
51
|
+
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
52
|
+
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
53
|
+
// NeoCRM 授权配置
|
|
54
|
+
auth: {
|
|
55
|
+
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
56
|
+
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
57
|
+
username: 'xx', // 用户在销售易系统中的用户名
|
|
58
|
+
/**
|
|
59
|
+
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
60
|
+
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
61
|
+
*/
|
|
62
|
+
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
1、客户端 ID 和 客户端秘钥 需通过 创建连接器 获取,获取方式见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / 创建连接器;
|
|
68
|
+
2、如何获取 安全令牌 见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌;
|
|
69
|
+
3、发布成功后即可在 NeoCRM 对应租户环境的页面设计器和表单设计器中使用此自定义组件。
|
|
70
|
+
|
|
47
71
|
### 前端工程配置项说明(neo-cmp-cli)
|
|
48
72
|
[请查看neo-cmp-cli](https://github.com/wibetter/neo-cmp-cli)
|
|
@@ -7,10 +7,10 @@ function resolve(dir) {
|
|
|
7
7
|
return path.resolve(__dirname, dir);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
let
|
|
10
|
+
let auth = {}; // NeoCRM 授权配置
|
|
11
11
|
if (fs.existsSync('./auth.config.js')) {
|
|
12
12
|
// 加载 NeoCRM 授权配置
|
|
13
|
-
|
|
13
|
+
auth = require('./auth.config');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// 包括生产和开发的环境配置信息
|
|
@@ -105,21 +105,24 @@ module.exports = {
|
|
|
105
105
|
}
|
|
106
106
|
*/
|
|
107
107
|
},
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
// NeoCRM 平台配置
|
|
109
|
+
neoConfig: {
|
|
110
110
|
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
111
111
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
112
112
|
// NeoCRM 授权配置
|
|
113
|
-
|
|
114
|
-
client_id:
|
|
115
|
-
client_secret:
|
|
116
|
-
username:
|
|
113
|
+
auth: {
|
|
114
|
+
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
115
|
+
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
116
|
+
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
117
117
|
/**
|
|
118
118
|
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
119
119
|
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
120
120
|
*/
|
|
121
|
-
password:
|
|
121
|
+
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
122
122
|
},
|
|
123
|
+
},
|
|
124
|
+
pushCmp: {
|
|
125
|
+
// 用于构建并发布至 NeoCRM 的相关配置
|
|
123
126
|
/*
|
|
124
127
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
125
128
|
NODE_ENV: 'production',
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
- src: 自定义组件源码;
|
|
3
3
|
- src/assets: 存放组件静态资源,比如 css、img等;
|
|
4
4
|
- src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
|
|
5
|
-
- src/components/
|
|
6
|
-
- src/components/
|
|
5
|
+
- src/components/xxCmp/index: 自定义组件的内容文件;
|
|
6
|
+
- src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
|
|
7
7
|
- neo.config.js: neo-cmp-cli 配置文件。
|
|
8
8
|
|
|
9
9
|
### 组件开发规范
|
|
@@ -43,5 +43,29 @@ $ npm run linkDebug
|
|
|
43
43
|
$ npm run pushCmp
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
##### 需自行添加 NeoCRM 授权配置
|
|
47
|
+
```javascript
|
|
48
|
+
module.exports = {
|
|
49
|
+
neoConfig: {
|
|
50
|
+
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
51
|
+
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
52
|
+
// NeoCRM 授权配置
|
|
53
|
+
auth: {
|
|
54
|
+
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
55
|
+
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
56
|
+
username: 'xx', // 用户在销售易系统中的用户名
|
|
57
|
+
/**
|
|
58
|
+
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
59
|
+
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
60
|
+
*/
|
|
61
|
+
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
1、客户端 ID 和 客户端秘钥 需通过 创建连接器 获取,获取方式见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / 创建连接器;
|
|
67
|
+
2、如何获取 安全令牌 见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌;
|
|
68
|
+
3、发布成功后即可在 NeoCRM 对应租户环境的页面设计器和表单设计器中使用此自定义组件。
|
|
69
|
+
|
|
46
70
|
### 配置项说明(neo-cmp-cli)
|
|
47
71
|
[请查看neo-cmp-cli](https://github.com/wibetter/neo-cmp-cli)
|
|
@@ -96,12 +96,12 @@ module.exports = {
|
|
|
96
96
|
}
|
|
97
97
|
*/
|
|
98
98
|
},
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
// NeoCRM 平台配置
|
|
100
|
+
neoConfig: {
|
|
101
101
|
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
102
102
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
103
103
|
// NeoCRM 授权配置
|
|
104
|
-
|
|
104
|
+
auth: {
|
|
105
105
|
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
106
106
|
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
107
107
|
username: 'xx', // 用户在销售易系统中的用户名
|
|
@@ -109,8 +109,11 @@ module.exports = {
|
|
|
109
109
|
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
110
110
|
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
111
111
|
*/
|
|
112
|
-
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
112
|
+
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
113
113
|
},
|
|
114
|
+
},
|
|
115
|
+
pushCmp: {
|
|
116
|
+
// 用于构建并发布至 NeoCRM 的相关配置
|
|
114
117
|
/*
|
|
115
118
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
116
119
|
NODE_ENV: 'production',
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
- src: 自定义组件源码;
|
|
3
3
|
- src/assets: 存放组件静态资源,比如 css、img等;
|
|
4
4
|
- src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
|
|
5
|
-
- src/components/
|
|
6
|
-
- src/components/
|
|
5
|
+
- src/components/xxCmp/index: 自定义组件的内容文件;
|
|
6
|
+
- src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
|
|
7
7
|
- neo.config.js: neo-cmp-cli 配置文件。
|
|
8
8
|
|
|
9
9
|
### 组件开发规范
|
|
@@ -43,5 +43,29 @@ $ npm run linkDebug
|
|
|
43
43
|
$ npm run pushCmp
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
##### 需自行添加 NeoCRM 授权配置
|
|
47
|
+
```javascript
|
|
48
|
+
module.exports = {
|
|
49
|
+
neoConfig: {
|
|
50
|
+
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
51
|
+
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
52
|
+
// NeoCRM 授权配置
|
|
53
|
+
auth: {
|
|
54
|
+
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
55
|
+
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
56
|
+
username: 'xx', // 用户在销售易系统中的用户名
|
|
57
|
+
/**
|
|
58
|
+
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
59
|
+
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
60
|
+
*/
|
|
61
|
+
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
1、客户端 ID 和 客户端秘钥 需通过 创建连接器 获取,获取方式见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / 创建连接器;
|
|
67
|
+
2、如何获取 安全令牌 见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌;
|
|
68
|
+
3、发布成功后即可在 NeoCRM 对应租户环境的页面设计器和表单设计器中使用此自定义组件。
|
|
69
|
+
|
|
46
70
|
### 配置项说明(neo-cmp-cli)
|
|
47
71
|
[请查看neo-cmp-cli](https://github.com/wibetter/neo-cmp-cli)
|
|
@@ -97,12 +97,12 @@ module.exports = {
|
|
|
97
97
|
}
|
|
98
98
|
*/
|
|
99
99
|
},
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// NeoCRM 平台配置
|
|
101
|
+
neoConfig: {
|
|
102
102
|
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
103
103
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
104
104
|
// NeoCRM 授权配置
|
|
105
|
-
|
|
105
|
+
auth: {
|
|
106
106
|
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
107
107
|
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
108
108
|
username: 'xx', // 用户在销售易系统中的用户名
|
|
@@ -110,8 +110,11 @@ module.exports = {
|
|
|
110
110
|
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
111
111
|
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
112
112
|
*/
|
|
113
|
-
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
113
|
+
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
114
114
|
},
|
|
115
|
+
},
|
|
116
|
+
pushCmp: {
|
|
117
|
+
// 用于构建并发布至 NeoCRM 的相关配置
|
|
115
118
|
/*
|
|
116
119
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
117
120
|
NODE_ENV: 'production',
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
- src: 自定义组件源码;
|
|
3
3
|
- src/assets: 存放组件静态资源,比如 css、img等;
|
|
4
4
|
- src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
|
|
5
|
-
- src/components/
|
|
6
|
-
- src/components/
|
|
5
|
+
- src/components/xxCmp/index: 自定义组件的内容文件;
|
|
6
|
+
- src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
|
|
7
7
|
- neo.config.js: neo-cmp-cli 配置文件。
|
|
8
8
|
|
|
9
9
|
### 组件开发规范
|
|
@@ -43,5 +43,29 @@ $ npm run linkDebug
|
|
|
43
43
|
$ npm run pushCmp
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
##### 需自行添加 NeoCRM 授权配置
|
|
47
|
+
```javascript
|
|
48
|
+
module.exports = {
|
|
49
|
+
neoConfig: {
|
|
50
|
+
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
51
|
+
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
52
|
+
// NeoCRM 授权配置
|
|
53
|
+
auth: {
|
|
54
|
+
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
55
|
+
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
56
|
+
username: 'xx', // 用户在销售易系统中的用户名
|
|
57
|
+
/**
|
|
58
|
+
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
59
|
+
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
60
|
+
*/
|
|
61
|
+
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
1、客户端 ID 和 客户端秘钥 需通过 创建连接器 获取,获取方式见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / 创建连接器;
|
|
67
|
+
2、如何获取 安全令牌 见:[https://doc.xiaoshouyi.com](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌;
|
|
68
|
+
3、发布成功后即可在 NeoCRM 对应租户环境的页面设计器和表单设计器中使用此自定义组件。
|
|
69
|
+
|
|
46
70
|
### 配置项说明(neo-cmp-cli)
|
|
47
71
|
[请查看neo-cmp-cli](https://github.com/wibetter/neo-cmp-cli)
|
|
@@ -105,12 +105,12 @@ module.exports = {
|
|
|
105
105
|
cssSourceMap: true
|
|
106
106
|
*/
|
|
107
107
|
},
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
// NeoCRM 平台配置
|
|
109
|
+
neoConfig: {
|
|
110
110
|
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
111
111
|
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
112
112
|
// NeoCRM 授权配置
|
|
113
|
-
|
|
113
|
+
auth: {
|
|
114
114
|
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
115
115
|
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
116
116
|
username: 'xx', // 用户在销售易系统中的用户名
|
|
@@ -118,8 +118,11 @@ module.exports = {
|
|
|
118
118
|
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
119
119
|
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
120
120
|
*/
|
|
121
|
-
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
121
|
+
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
122
122
|
},
|
|
123
|
+
},
|
|
124
|
+
pushCmp: {
|
|
125
|
+
// 用于构建并发布至 NeoCRM 的相关配置
|
|
123
126
|
/*
|
|
124
127
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
125
128
|
NODE_ENV: 'production',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const _ = require('lodash');
|
|
4
|
-
const { consoleTag } = require('../
|
|
5
|
-
const replaceInFilesByMap = require('../
|
|
4
|
+
const { consoleTag } = require('../neoParams'); // 输出标记
|
|
5
|
+
const replaceInFilesByMap = require('../replaceInFilesByMap');
|
|
6
6
|
const hasCmpTypeByDir = require('./hasCmpTypeByDir');
|
|
7
7
|
const hasNeoProject = require('../projectUtils/hasNeoProject');
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ const curCmpTemplate = {
|
|
|
14
14
|
modelName: 'CmpModel',
|
|
15
15
|
cmpClassName: 'custom-cmp-container',
|
|
16
16
|
cmpType: 'xx-custom-cmp',
|
|
17
|
-
cmpLabel: 'xx组件'
|
|
17
|
+
cmpLabel: 'xx组件'
|
|
18
18
|
},
|
|
19
19
|
dir: path.resolve(__dirname, '../template/empty-cmp')
|
|
20
20
|
};
|
|
@@ -29,12 +29,14 @@ module.exports = function (cmpName, componentBaseDir = './src/components') {
|
|
|
29
29
|
const finalCmpPath = path.resolve(process.cwd(), componentBaseDir, finalCmpName);
|
|
30
30
|
|
|
31
31
|
if (!hasNeoProject()) {
|
|
32
|
-
console.error(
|
|
32
|
+
console.error(
|
|
33
|
+
`${consoleTag}当前(${process.cwd()})还不是自定义组件项目,请先创建一个自定义组件项目(neo init / neo createProject)。`
|
|
34
|
+
);
|
|
33
35
|
process.exit(1);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
if (hasCmpTypeByDir(finalCmpName)) {
|
|
37
|
-
console.error(`${consoleTag}
|
|
39
|
+
console.error(`${consoleTag}创建自定义组件失败,当前项目已经存在${finalCmpName}自定义组件。`);
|
|
38
40
|
process.exit(1);
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -49,7 +51,7 @@ module.exports = function (cmpName, componentBaseDir = './src/components') {
|
|
|
49
51
|
[curCmpTemplate.widgetInfo.cmpName]: curCmpName,
|
|
50
52
|
[curCmpTemplate.widgetInfo.cmpClassName]: `${cmpType}-container`,
|
|
51
53
|
[curCmpTemplate.widgetInfo.cmpType]: cmpType,
|
|
52
|
-
[curCmpTemplate.widgetInfo.cmpLabel]: `${cmpType}
|
|
54
|
+
[curCmpTemplate.widgetInfo.cmpLabel]: `${cmpType}组件`
|
|
53
55
|
});
|
|
54
56
|
|
|
55
57
|
console.log(`${consoleTag}已创建自定义组件(${finalCmpName})!`);
|