neo-cmp-cli 1.10.13 → 1.10.16
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/dist/package.json.js +1 -1
- package/dist/utils/projectUtils/createCmpProjectZip.js +1 -1
- package/package.json +1 -1
- package/template/antd-custom-cmp-template/src/components/dataDashboard__c/index.tsx +3 -2
- package/template/echarts-custom-cmp-template/src/components/chartWidget__c/index.tsx +3 -2
- package/template/neo-bi-cmps/README.md +8 -64
- package/template/neo-bi-cmps/lib/customStyleConfig.css +15 -0
- package/template/neo-bi-cmps/lib/customStyleConfig.js +2 -0
- package/template/neo-bi-cmps/lib/customStyleConfig.js.LICENSE.txt +61 -0
- package/template/neo-bi-cmps/lib/img/unlink.99e3018.99e3018.svg +8 -0
- package/template/neo-bi-cmps/lib/targetNumber.css +7 -0
- package/template/neo-bi-cmps/lib/targetNumber.js +2 -0
- package/template/neo-bi-cmps/lib/targetNumber.js.LICENSE.txt +9 -0
- package/template/neo-bi-cmps/neo.config.js +3 -24
- package/template/neo-bi-cmps/package.json +4 -3
- package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/configSchema.ts +201 -226
- package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.tsx +15 -19
- package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +69 -42
- package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +11 -8
- package/template/neo-bi-cmps/src/components/targetNumber__c/style.scss +6 -0
- package/template/neo-custom-cmp-template/README.md +8 -63
- package/template/neo-custom-cmp-template/neo.config.js +0 -22
- package/template/neo-custom-cmp-template/src/components/entityForm__c/index.tsx +9 -2
- package/template/neo-h5-cmps/neo.config.js +0 -22
- package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +1 -0
- package/template/neo-h5-cmps/src/components/openChatPageBtn__c/index.tsx +2 -1
- package/template/neo-order-cmps/README.md +8 -64
- package/template/neo-order-cmps.zip +0 -0
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.10.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.10.15";const o={version:e};exports.default=o,exports.version=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("fs-extra"),r=require("node:path"),s=require("adm-zip"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("fs-extra"),r=require("node:path"),s=require("adm-zip"),o=require("lodash"),i=require("../neoParams.js"),n=require("./hasNeoProject.js");var t,c;exports.__require=function(){if(c)return t;c=1;const a=e,u=r,l=s,d=o,{consoleTag:p}=i.__require(),f=n.__require();return t=function(e,r,s){const o=r||process.cwd(),i=s||u.join(o,"dist");f(r)||(console.error(`${p}当前目录不是自定义组件项目,请在自定义组件项目目录下执行。`),process.exit(1)),e||(console.error(`${p}自定义组件名称不能为空`),process.exit(1));const n=new l,t=["node_modules",".neo-cli",".git",".idea","dist","lib","esm"],c=[".eslintcache","auth.config.js","package-lock.json","yarn.lock","pnpm-lock.yaml"],m=(r,s="")=>{try{a.readdirSync(r).forEach(o=>{const i=u.join(r,o),l=s?u.join(s,o):o;if(((r,s)=>{const o=u.basename(r),i=a.statSync(r);if(i.isDirectory()&&t.includes(o))return!0;if(i.isFile()&&c.includes(o))return!0;if(s.startsWith("src/components")){const r=u.relative("src/components",s);if(r&&"."!==r&&r.split(u.sep)[0]!==e)return!0}return!1})(i,l))return;const d=a.statSync(i);if(d.isDirectory())m(i,l);else if(d.isFile()){const e=a.readFileSync(i);n.addFile(l,e)}})}catch(e){console.error(`${p}遍历目录失败 (${r}):`,e.message||e.msg)}};m(o);const y=`${d.camelCase(e)}Source.zip`,j=u.join(i,y);return a.existsSync(j)&&a.removeSync(j),n.writeZip(j),j}};
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ interface DataDashboardProps {
|
|
|
31
31
|
theme: 'dark' | 'light' | 'gradient';
|
|
32
32
|
showAnimations: boolean;
|
|
33
33
|
data?: any;
|
|
34
|
+
className?: string;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
interface MockData {
|
|
@@ -174,7 +175,7 @@ export default class DataDashboard extends React.PureComponent<DataDashboardProp
|
|
|
174
175
|
};
|
|
175
176
|
|
|
176
177
|
render() {
|
|
177
|
-
const { title, theme, showAnimations } = this.props;
|
|
178
|
+
const { title, theme, className, showAnimations } = this.props;
|
|
178
179
|
const { currentData, isAnimating, loading } = this.state as any;
|
|
179
180
|
const curAmisData = this.props.data || {};
|
|
180
181
|
|
|
@@ -183,7 +184,7 @@ export default class DataDashboard extends React.PureComponent<DataDashboardProp
|
|
|
183
184
|
|
|
184
185
|
return (
|
|
185
186
|
<div
|
|
186
|
-
className={`dataDashboard__c ${theme} ${
|
|
187
|
+
className={`dataDashboard__c ${theme} ${className} ${
|
|
187
188
|
isAnimating ? 'animating' : ''
|
|
188
189
|
}`}
|
|
189
190
|
>
|
|
@@ -37,6 +37,7 @@ interface ChartWidgetProps {
|
|
|
37
37
|
dataConfig: any;
|
|
38
38
|
/** AMIS 数据对象,包含用户信息和系统信息 */
|
|
39
39
|
data?: any;
|
|
40
|
+
className?: string;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -693,13 +694,13 @@ export default class ChartWidget extends React.PureComponent<ChartWidgetProps> {
|
|
|
693
694
|
* @returns JSX 元素
|
|
694
695
|
*/
|
|
695
696
|
render() {
|
|
696
|
-
const { width, height } = this.props;
|
|
697
|
+
const { width, height, className } = this.props;
|
|
697
698
|
const curAmisData = this.props.data || {};
|
|
698
699
|
const userInfo = curAmisData.__NeoCurrentUser;
|
|
699
700
|
const systemInfo = curAmisData.__NeoSystemInfo || {};
|
|
700
701
|
|
|
701
702
|
return (
|
|
702
|
-
<div className=
|
|
703
|
+
<div className={`chartWidget__c ${className}`}>
|
|
703
704
|
{/* 显示当前用户信息 */}
|
|
704
705
|
{userInfo && userInfo.name && (
|
|
705
706
|
<div className="user-info">
|
|
@@ -26,34 +26,22 @@
|
|
|
26
26
|
$ npm i 或者 yarn
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
2. **
|
|
30
|
-
> preview模式:用于预览自定义组件内容。
|
|
31
|
-
```bash
|
|
32
|
-
$ npm run preview
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
3. **linkDebug: 外链调试(在线上页面设计器端预览自定义组件)**
|
|
29
|
+
2. **linkDebug: 外链调试(在线上页面设计器端预览自定义组件)**
|
|
36
30
|
> linkDebug模式:用于在线上页面设计器中预览和调试自定义组件。
|
|
37
31
|
```bash
|
|
38
32
|
$ npm run linkDebug
|
|
39
33
|
```
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
3. **发布到 NeoCRM 平台**
|
|
42
36
|
> 需要确保 package.json 中的 name 值唯一,version 值不重复。
|
|
43
37
|
```bash
|
|
44
38
|
$ npm run pushCmp
|
|
45
39
|
```
|
|
46
40
|
|
|
41
|
+
### OAuth2 登录授权
|
|
42
|
+
使用 `neo push cmp`、`neo pull cmp`、`neo delete cmp` 等命令与 NeoCRM 平台交互时,需要进行授权登录。
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
使用 `neo push cmp`、`neo pull cmp`、`neo delete cmp` 等命令与 NeoCRM 平台交互时,需要配置授权信息。
|
|
51
|
-
|
|
52
|
-
#### 方式一:OAuth2 登录授权(推荐)
|
|
53
|
-
|
|
54
|
-
OAuth2 授权码模式更加安全可靠,无需用户配置账户名和密码。
|
|
55
|
-
|
|
56
|
-
##### 使用步骤
|
|
44
|
+
#### 使用步骤
|
|
57
45
|
|
|
58
46
|
1. **登录 NeoCRM 平台**
|
|
59
47
|
```bash
|
|
@@ -73,7 +61,7 @@ OAuth2 授权码模式更加安全可靠,无需用户配置账户名和密码
|
|
|
73
61
|
|
|
74
62
|
功能:清除本地保存的 token 文件,下次使用需要重新登录。
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
#### neo login 选择「自定义环境」时的授权配置示例
|
|
77
65
|
|
|
78
66
|
```javascript
|
|
79
67
|
// neo.config.js
|
|
@@ -87,14 +75,14 @@ module.exports = {
|
|
|
87
75
|
}
|
|
88
76
|
```
|
|
89
77
|
|
|
90
|
-
|
|
78
|
+
#### Token 有效期
|
|
91
79
|
|
|
92
80
|
- **access_token**:默认有效期 2 小时
|
|
93
81
|
- **refresh_token**:默认有效期 30 天
|
|
94
82
|
- 系统会在 access_token 过期前 5 分钟自动刷新
|
|
95
83
|
- 如果 refresh_token 也过期,需要重新执行 `neo login`
|
|
96
84
|
|
|
97
|
-
|
|
85
|
+
#### 常见问题
|
|
98
86
|
|
|
99
87
|
**Q1: 浏览器无法自动打开怎么办?**
|
|
100
88
|
A: 命令行会输出授权 URL,手动复制到浏览器中打开即可。
|
|
@@ -105,50 +93,6 @@ A: 如果 refresh_token 也过期(默认 30 天),需要重新执行 `neo l
|
|
|
105
93
|
**Q3: 授权登录后没有正常跳回 redirect_uri**
|
|
106
94
|
A: 可能被浏览器安装的插件影响,目前已知会影响授权登录的浏览器插件有:Neo UI Extension,请关闭插件后重试。
|
|
107
95
|
|
|
108
|
-
#### 方式二:密码授权配置
|
|
109
|
-
|
|
110
|
-
在项目根目录的 `neo.config.js` 文件中添加 NeoCRM 平台授权配置:
|
|
111
|
-
|
|
112
|
-
```javascript
|
|
113
|
-
module.exports = {
|
|
114
|
-
neoConfig: {
|
|
115
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
116
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址
|
|
117
|
-
// NeoCRM 授权配置
|
|
118
|
-
auth: {
|
|
119
|
-
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
120
|
-
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
121
|
-
username: 'xx', // 用户在销售易系统中的用户名
|
|
122
|
-
/**
|
|
123
|
-
* password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
124
|
-
* 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
125
|
-
*/
|
|
126
|
-
password: 'xx xx' // 用户账户密码 + 8 位安全令牌
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
##### 授权配置获取方式
|
|
133
|
-
|
|
134
|
-
1. **客户端 ID 和客户端秘钥**:需通过创建连接器获取
|
|
135
|
-
- 访问 [销售易文档中心](https://doc.xiaoshouyi.com) / 创建连接器
|
|
136
|
-
- 创建连接器后,从客户端信息中获取 `Client_Id` 和 `Client_Secret`
|
|
137
|
-
|
|
138
|
-
2. **安全令牌**:如何获取安全令牌
|
|
139
|
-
- 访问 [销售易文档中心](https://doc.xiaoshouyi.com) / OAuth安全认证 / 密码模式 / 获取令牌
|
|
140
|
-
- 按照文档说明获取 8 位安全令牌
|
|
141
|
-
- `password` 字段 = 用户账户密码 + 8 位安全令牌(直接拼接,无空格或分隔符)
|
|
142
|
-
|
|
143
|
-
#### OAuth2 模式 vs 密码模式
|
|
144
|
-
|
|
145
|
-
| 特性 | OAuth2 授权码模式 | 密码模式 |
|
|
146
|
-
|------|------------------|---------|
|
|
147
|
-
| 安全性 | ✅ 高(无需在配置文件中存储密码) | ⚠️ 较低(需要配置密码和安全令牌) |
|
|
148
|
-
| Token 刷新 | ✅ 自动刷新 | ✅ 自动刷新 |
|
|
149
|
-
| 有效期 | 2 小时(可自动刷新) | 永不过期 |
|
|
150
|
-
| 推荐程度 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
|
|
151
|
-
|
|
152
96
|
---
|
|
153
97
|
|
|
154
98
|
### 配置项说明(neo-cmp-cli)
|