cloudcc-cli 2.2.9 → 2.3.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/.cursor/skills/cloudcc-cli-dev/CUSTOM-SETTING-API.md +241 -0
- package/README.md +12 -1
- package/bin/index.js +4 -0
- package/classes/CCdd/CCdd.java +22 -0
- package/classes/CCdd/CCddTest.java +11 -0
- package/classes/CCdd/config.json +1 -0
- package/package.json +1 -1
- package/schedule/CCdd/CCdd.java +11 -0
- package/schedule/CCdd/config.json +1 -0
- package/src/classes/index.js +6 -1
- package/src/customPage/create.js +77 -0
- package/src/customPage/delete.js +65 -0
- package/src/customPage/get.js +85 -0
- package/src/customPage/index.js +10 -0
- package/src/customSetting/doc.js +196 -0
- package/src/customSetting/index.js +7 -0
- package/target/classes/CCdd/CCdd.class +0 -0
- package/target/classes/CCdd/CCddTest.class +0 -0
- package/target/classes/CCdd/config.json +1 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# 自定义设置相关接口
|
|
2
|
+
|
|
3
|
+
## 指导文档
|
|
4
|
+
|
|
5
|
+
直接使用以下命令查看指导文档:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cc doc customSetting
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 查询自定义设置列表
|
|
15
|
+
|
|
16
|
+
路径:`{服务名称}/api/customsetting/list`
|
|
17
|
+
|
|
18
|
+
方法:POST
|
|
19
|
+
|
|
20
|
+
接口描述:分页/查询自定义设置主列表,返回 `objList` 等。
|
|
21
|
+
|
|
22
|
+
### 请求参数
|
|
23
|
+
|
|
24
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
25
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
26
|
+
| (请求体) | object | 非必须 | {} | 当前前端传空对象 |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 新建/更新自定义设置(保存主对象)
|
|
31
|
+
|
|
32
|
+
路径:`{服务名称}/api/customsetting/save`
|
|
33
|
+
|
|
34
|
+
方法:POST
|
|
35
|
+
|
|
36
|
+
接口描述:新建或编辑自定义设置主记录(标签、对象 API 名、类型、可见性、描述等)。
|
|
37
|
+
|
|
38
|
+
### 请求参数
|
|
39
|
+
|
|
40
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
41
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
42
|
+
| tpSysObjectVO | object | 必须 | — | 主对象载体,见下表子字段 |
|
|
43
|
+
|
|
44
|
+
**tpSysObjectVO 子字段:**
|
|
45
|
+
|
|
46
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
47
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
48
|
+
| accessable | string | 视业务 | — | 可见性(如 `"2"` 表示公用等,与表单选项一致) |
|
|
49
|
+
| dataType | string | 视业务 | — | 设置类型:`L` 列表,`H` 层次结构 |
|
|
50
|
+
| id | string | 视业务 | `""` | 新建传空字符串;编辑传记录 id |
|
|
51
|
+
| label | string | 视业务 | — | 标签 |
|
|
52
|
+
| remark | string | 非必须 | — | 描述 |
|
|
53
|
+
| schemetableName | string | 视业务 | — | 对象名(编辑时前端通常禁用修改) |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 编辑前回显(自定义设置主对象)
|
|
58
|
+
|
|
59
|
+
路径:`{服务名称}/api/customsetting/modify`
|
|
60
|
+
|
|
61
|
+
方法:POST
|
|
62
|
+
|
|
63
|
+
接口描述:根据主记录 id 拉取表单回显数据。
|
|
64
|
+
|
|
65
|
+
### 请求参数
|
|
66
|
+
|
|
67
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
68
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
69
|
+
| objid | string | 必须 | — | 记录id |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 删除自定义设置主对象
|
|
74
|
+
|
|
75
|
+
路径:`{服务名称}/api/customsetting/deleteobj`
|
|
76
|
+
|
|
77
|
+
方法:POST
|
|
78
|
+
|
|
79
|
+
接口描述:删除一条自定义设置主记录。
|
|
80
|
+
|
|
81
|
+
### 请求参数
|
|
82
|
+
|
|
83
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
84
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
85
|
+
| objid | string | 必须 | — | 记录id |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 查询自定义设置详情(含字段列表)
|
|
90
|
+
|
|
91
|
+
路径:`{服务名称}/api/customsetting/detail`
|
|
92
|
+
|
|
93
|
+
方法:POST
|
|
94
|
+
|
|
95
|
+
接口描述:详情页使用,返回主对象信息及 `cusFields` 字段列表。
|
|
96
|
+
|
|
97
|
+
### 请求参数
|
|
98
|
+
|
|
99
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
100
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
101
|
+
| objid | string | 必须 | — | 记录id |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 进入字段编辑(取字段编辑所需数据)
|
|
106
|
+
|
|
107
|
+
路径:`{服务名称}/api/customsetting/editfile`
|
|
108
|
+
|
|
109
|
+
方法:POST
|
|
110
|
+
|
|
111
|
+
接口描述:点击某字段「编辑」时调用,用于打开字段编辑器。
|
|
112
|
+
|
|
113
|
+
### 请求参数
|
|
114
|
+
|
|
115
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
116
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
117
|
+
| queryrecordid | string | 必须 | — | 字段行 id |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 删除自定义字段
|
|
122
|
+
|
|
123
|
+
路径:`{服务名称}/api/customsetting/deletefield`
|
|
124
|
+
|
|
125
|
+
方法:POST
|
|
126
|
+
|
|
127
|
+
接口描述:在详情页删除某条自定义字段。
|
|
128
|
+
|
|
129
|
+
### 请求参数
|
|
130
|
+
|
|
131
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
132
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
133
|
+
| id | string | 必须 | — | 字段行 id |
|
|
134
|
+
| objid | string | 必须 | — | 所属自定义设置 id |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## 自定义字段类型静态配置
|
|
140
|
+
> 前端静态配置,非后端接口返回)
|
|
141
|
+
```json
|
|
142
|
+
[
|
|
143
|
+
{
|
|
144
|
+
"id": "0001",
|
|
145
|
+
"name": "URL",
|
|
146
|
+
"type": "U",
|
|
147
|
+
"address": "允许用户输入任何有效的网址。如果用户单击该字段,将根据用户选择的模式在浏览器的新窗口或当前窗口中打开该 URL。系统默认在浏览器的新窗口中打开该URL。"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "0002",
|
|
151
|
+
"name": "百分比",
|
|
152
|
+
"type": "P",
|
|
153
|
+
"address": "允许用户输入百分比数字(例如,10),并自动向数字添加百分号。"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "0003",
|
|
157
|
+
"name": "币种",
|
|
158
|
+
"type": "c",
|
|
159
|
+
"address": "币种"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": "0004",
|
|
163
|
+
"name": "电话",
|
|
164
|
+
"type": "H",
|
|
165
|
+
"address": "允许用户输入任何电话号码。自动将其转换为电话号码格式。"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"id": "0005",
|
|
169
|
+
"name": "电子邮件",
|
|
170
|
+
"type": "E",
|
|
171
|
+
"address": "允许用户输入电子邮件地址,对其进行验证以确保格式正确。如果对于一个联系人和潜在客户指定了此字段,则用户单击“发送电子邮件”时可以选择地址。注意,自定义电子邮件地址无法用于批量电子邮件。"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "0006",
|
|
175
|
+
"name": "复选框",
|
|
176
|
+
"type": "B",
|
|
177
|
+
"address": "允许用户选择“真”(选取)或“假”(不选取)值。"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"id": "0007",
|
|
181
|
+
"name": "日期",
|
|
182
|
+
"type": "D",
|
|
183
|
+
"address": "允许用户输入日期或从弹出式日历中选择日期。"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"id": "0008",
|
|
187
|
+
"name": "日期和时间",
|
|
188
|
+
"type": "F",
|
|
189
|
+
"address": "允许用户输入日期和时间,或从弹出式日历中选择日期。当用户单击弹出式日历中的某个日期后,该日期和当前时间将输入到日期/时间字段。"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"id": "0009",
|
|
193
|
+
"name": "数字",
|
|
194
|
+
"type": "N",
|
|
195
|
+
"address": "允许用户输入任何数字。将删除前置零。"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"id": "0010",
|
|
199
|
+
"name": "文本",
|
|
200
|
+
"type": "S",
|
|
201
|
+
"address": "允许用户输入任何字母和数字组合。"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "0011",
|
|
205
|
+
"name": "长文本",
|
|
206
|
+
"type": "X",
|
|
207
|
+
"address": "允许用户输入多行文本,最多可输入 4000 个字符。"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## 保存字段(新增/编辑字段)
|
|
213
|
+
路径:`{服务名称}/api/customsetting/saveField`
|
|
214
|
+
方法:POST
|
|
215
|
+
接口描述:在自定义设置详情页中保存字段定义(字段新建或编辑)。
|
|
216
|
+
### 请求参数
|
|
217
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
218
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
219
|
+
| tpSysSchemetableVO | object | 必须 | — | 字段对象,见下方子字段表 |
|
|
220
|
+
| fdtype | string | 必须 | — | 字段类型代码(如 `U` 表示 URL) |
|
|
221
|
+
**tpSysSchemetableVO 子字段:**
|
|
222
|
+
| 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
|
|
223
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
224
|
+
| schemetableId | string | 必须 | — | 所属自定义设置(对象)id |
|
|
225
|
+
| id | string | 非必须 | — | 字段 id;编辑时传,新增可不传或传空 |
|
|
226
|
+
| nameLabel | string | 必须 | — | 字段显示名称(标签) |
|
|
227
|
+
| apiname | string | 必须 | — | 字段 API 名 |
|
|
228
|
+
| edittype | string | 非必须 | — | 字段编辑类型(例如 URL 打开方式 `_blank`) |
|
|
229
|
+
| schemefieldLength | string | 非必须 | — | 字段长度 |
|
|
230
|
+
| defaultValue | string | 非必须 | — | 默认值 |
|
|
231
|
+
| datafieldRef | string | 非必须 | — | 数据字段引用名 |
|
|
232
|
+
| isDeleted | string | 非必须 | `"0"` | 删除标记 |
|
|
233
|
+
| fieldState | string | 非必须 | `"enable"` | 字段状态 |
|
|
234
|
+
| iscustom | string | 非必须 | `"1"` | 是否自定义字段 |
|
|
235
|
+
| schemefieldType | string | 必须 | — | 字段类型代码(例如 `U`) |
|
|
236
|
+
| schemefieldName | string | 必须 | — | 字段物理名/存储名 |
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
package/README.md
CHANGED
|
@@ -22,6 +22,17 @@ sudo npm i -g cloudcc-cli
|
|
|
22
22
|
}
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
# ReleaseV2.3.0
|
|
26
|
+
|
|
27
|
+
#### Release Date: 2026-3-25
|
|
28
|
+
|
|
29
|
+
#### Release Scope: Full
|
|
30
|
+
|
|
31
|
+
#### Release Content
|
|
32
|
+
|
|
33
|
+
- Optimization
|
|
34
|
+
- Fix class management commands
|
|
35
|
+
|
|
25
36
|
# ReleaseV2.2.9
|
|
26
37
|
|
|
27
38
|
#### Release Date: 2026-3-25
|
|
@@ -31,7 +42,7 @@ sudo npm i -g cloudcc-cli
|
|
|
31
42
|
#### Release Content
|
|
32
43
|
|
|
33
44
|
- Optimization
|
|
34
|
-
-
|
|
45
|
+
- Add delete component command
|
|
35
46
|
|
|
36
47
|
# ReleaseV2.2.8
|
|
37
48
|
|
package/bin/index.js
CHANGED
|
@@ -6,6 +6,10 @@ cc.plugin = require("../src/plugin/index")
|
|
|
6
6
|
|
|
7
7
|
cc.classes = require("../src/classes/index")
|
|
8
8
|
|
|
9
|
+
cc.customSetting = require("../src/customSetting/index")
|
|
10
|
+
|
|
11
|
+
cc.customPage = require("../src/customPage/index")
|
|
12
|
+
|
|
9
13
|
cc.schedule = require("../src/timer/index")
|
|
10
14
|
|
|
11
15
|
cc.triggers = require("../src/triggers/index")
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package classes.CCdd;
|
|
2
|
+
|
|
3
|
+
import com.cloudcc.core.*;
|
|
4
|
+
// @SOURCE_CONTENT_START
|
|
5
|
+
public class CCdd{
|
|
6
|
+
private UserInfo userInfo;
|
|
7
|
+
private CCService cs;
|
|
8
|
+
|
|
9
|
+
public CCdd(UserInfo userInfo){
|
|
10
|
+
this(userInfo,new CCService(userInfo));
|
|
11
|
+
}
|
|
12
|
+
public CCdd(UserInfo userInfo,CCService cs){
|
|
13
|
+
this.userInfo = userInfo;
|
|
14
|
+
this.cs=cs;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public String getName(String str){
|
|
18
|
+
str = "demo";
|
|
19
|
+
return str;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// @SOURCE_CONTENT_END
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"CCdd","version":"2","id":"ccp20269AAF29D2SqHiD"}
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"CCdd","version":"2"}
|
package/src/classes/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
const cc = {}
|
|
2
|
-
|
|
2
|
+
cc.create = require("./create")
|
|
3
|
+
cc.publish = require("./publish")
|
|
4
|
+
cc.pull = require("./pull")
|
|
5
|
+
cc.get = require("./get")
|
|
6
|
+
cc.pullList = require("./pullList")
|
|
7
|
+
cc.detail = require("./detail")
|
|
3
8
|
cc.doc = require("./doc")
|
|
4
9
|
function Classes(action, argvs) {
|
|
5
10
|
cc[action](argvs[2], argvs[3])
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const { getPackageJson } = require('../../utils/config');
|
|
3
|
+
const { post } = require('../../utils/http');
|
|
4
|
+
const BaseUrl = 'https://developer.apis.cloudcc.cn';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 新建自定义页面
|
|
8
|
+
*
|
|
9
|
+
* 用法:cc customPage create <pageLabel> <pageApi> [projectPath]
|
|
10
|
+
*/
|
|
11
|
+
async function createCustomPage(argvs) {
|
|
12
|
+
const pageLabel = argvs[2];
|
|
13
|
+
const pageApi = argvs[3];
|
|
14
|
+
const projectPath = argvs[4] || process.cwd();
|
|
15
|
+
|
|
16
|
+
if (!pageLabel || !pageApi) {
|
|
17
|
+
console.error();
|
|
18
|
+
console.error(chalk.red('Error: pageLabel and pageApi are required'));
|
|
19
|
+
console.error(chalk.yellow('Usage: cc customPage create <pageLabel> <pageApi> [projectPath]'));
|
|
20
|
+
console.error();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const config = await getPackageJson(projectPath);
|
|
25
|
+
if (!config || !config.accessToken) {
|
|
26
|
+
console.error();
|
|
27
|
+
console.error(chalk.red('Error: Configuration not found or accessToken is missing'));
|
|
28
|
+
console.error();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const devSvcDispatch = config.devSvcDispatch || '/devconsole';
|
|
33
|
+
const baseUrl = config.baseUrl || BaseUrl;
|
|
34
|
+
|
|
35
|
+
const header = {
|
|
36
|
+
appType: 'lightning-devconsole',
|
|
37
|
+
accessToken: config.accessToken,
|
|
38
|
+
source: 'lightning-devconsole',
|
|
39
|
+
version: 'public',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const body = {
|
|
43
|
+
id: '',
|
|
44
|
+
pageLabel,
|
|
45
|
+
pageApi,
|
|
46
|
+
pageContent: '[]',
|
|
47
|
+
orgId: config.orgId || '',
|
|
48
|
+
renderVersion: '',
|
|
49
|
+
compList: [],
|
|
50
|
+
canvasStyleData: JSON.stringify({ width: 100, height: 100, scale: 100, unit: '%' }),
|
|
51
|
+
isTemplate: 0,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
console.error();
|
|
55
|
+
console.error(chalk.green(`Creating custom page "${pageLabel}" (api: ${pageApi}), please wait...`));
|
|
56
|
+
|
|
57
|
+
const res = await post(
|
|
58
|
+
`${baseUrl}${devSvcDispatch}/custom/pc/1.0/post/insertCustomPage`,
|
|
59
|
+
body,
|
|
60
|
+
header
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
if (res && res.returnCode == 200) {
|
|
64
|
+
const id = res.data?.id || res.data || '';
|
|
65
|
+
console.error(chalk.green(`Success! Custom page created.${id ? ' ID: ' + id : ''}`));
|
|
66
|
+
console.error();
|
|
67
|
+
} else {
|
|
68
|
+
const errMsg = res?.returnInfo || 'Unknown error';
|
|
69
|
+
console.error(chalk.red(`Fail: ${errMsg}`));
|
|
70
|
+
console.error();
|
|
71
|
+
throw new Error('Create Custom Page Failed: ' + errMsg);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return res;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = createCustomPage;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const { getPackageJson } = require('../../utils/config');
|
|
3
|
+
const { post } = require('../../utils/http');
|
|
4
|
+
const BaseUrl = 'https://developer.apis.cloudcc.cn';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 删除自定义页面
|
|
8
|
+
*
|
|
9
|
+
* 用法:cc customPage delete <id> [projectPath]
|
|
10
|
+
*/
|
|
11
|
+
async function deleteCustomPage(argvs) {
|
|
12
|
+
const id = argvs[2];
|
|
13
|
+
const projectPath = argvs[3] || process.cwd();
|
|
14
|
+
|
|
15
|
+
if (!id) {
|
|
16
|
+
console.error();
|
|
17
|
+
console.error(chalk.red('Error: Custom page ID is required'));
|
|
18
|
+
console.error(chalk.yellow('Usage: cc customPage delete <id> [projectPath]'));
|
|
19
|
+
console.error();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const config = await getPackageJson(projectPath);
|
|
24
|
+
if (!config || !config.accessToken) {
|
|
25
|
+
console.error();
|
|
26
|
+
console.error(chalk.red('Error: Configuration not found or accessToken is missing'));
|
|
27
|
+
console.error();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const devSvcDispatch = config.devSvcDispatch || '/devconsole';
|
|
32
|
+
const baseUrl = config.baseUrl || BaseUrl;
|
|
33
|
+
|
|
34
|
+
const header = {
|
|
35
|
+
appType: 'lightning-devconsole',
|
|
36
|
+
accessToken: config.accessToken,
|
|
37
|
+
source: 'lightning-devconsole',
|
|
38
|
+
version: 'public',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const body = { id };
|
|
42
|
+
|
|
43
|
+
console.error();
|
|
44
|
+
console.error(chalk.green(`Deleting custom page (ID: ${id}), please wait...`));
|
|
45
|
+
|
|
46
|
+
const res = await post(
|
|
47
|
+
`${baseUrl}${devSvcDispatch}/custom/pc/1.0/post/deleteCustomPage`,
|
|
48
|
+
body,
|
|
49
|
+
header
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
if (res && res.returnCode == 200) {
|
|
53
|
+
console.error(chalk.green(`Success! Custom page (ID: ${id}) deleted.`));
|
|
54
|
+
console.error();
|
|
55
|
+
} else {
|
|
56
|
+
const errMsg = res?.returnInfo || 'Unknown error';
|
|
57
|
+
console.error(chalk.red(`Fail: ${errMsg}`));
|
|
58
|
+
console.error();
|
|
59
|
+
throw new Error('Delete Custom Page Failed: ' + errMsg);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return res;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = deleteCustomPage;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const { getPackageJson } = require('../../utils/config');
|
|
3
|
+
const { post } = require('../../utils/http');
|
|
4
|
+
const BaseUrl = 'https://developer.apis.cloudcc.cn';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 获取自定义页面列表
|
|
8
|
+
*
|
|
9
|
+
* 用法:cc customPage list [pageNo] [pageSize] [projectPath]
|
|
10
|
+
*/
|
|
11
|
+
async function listCustomPage(argvs) {
|
|
12
|
+
const pageNo = parseInt(argvs[2], 10) || 1;
|
|
13
|
+
const pageSize = parseInt(argvs[3], 10) || 20;
|
|
14
|
+
const projectPath = argvs[4] || process.cwd();
|
|
15
|
+
|
|
16
|
+
const config = await getPackageJson(projectPath);
|
|
17
|
+
if (!config || !config.accessToken) {
|
|
18
|
+
console.error();
|
|
19
|
+
console.error(chalk.red('Error: Configuration not found or accessToken is missing'));
|
|
20
|
+
console.error();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const devSvcDispatch = config.devSvcDispatch || '/devconsole';
|
|
25
|
+
const baseUrl = config.baseUrl || BaseUrl;
|
|
26
|
+
|
|
27
|
+
const header = {
|
|
28
|
+
appType: 'lightning-devconsole',
|
|
29
|
+
accessToken: config.accessToken,
|
|
30
|
+
source: 'lightning-devconsole',
|
|
31
|
+
version: 'public',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const body = {
|
|
35
|
+
pageNo,
|
|
36
|
+
pageSize,
|
|
37
|
+
condition: {
|
|
38
|
+
pageLabel: '',
|
|
39
|
+
dtBegin: '',
|
|
40
|
+
dtEnd: '',
|
|
41
|
+
pageApi: '',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
console.error();
|
|
46
|
+
console.error(chalk.green(`Fetching custom page list (page ${pageNo}, size ${pageSize})...`));
|
|
47
|
+
|
|
48
|
+
const res = await post(
|
|
49
|
+
`${baseUrl}${devSvcDispatch}/custom/pc/1.0/post/pageCustomPage`,
|
|
50
|
+
body,
|
|
51
|
+
header
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
if (res && res.returnCode == 200) {
|
|
55
|
+
const data = res.data || {};
|
|
56
|
+
const records = data.records || data.list || data || [];
|
|
57
|
+
const total = data.total ?? (Array.isArray(records) ? records.length : 0);
|
|
58
|
+
|
|
59
|
+
console.error(chalk.green(`Success! Total: ${total}`));
|
|
60
|
+
console.error();
|
|
61
|
+
|
|
62
|
+
if (Array.isArray(records) && records.length > 0) {
|
|
63
|
+
records.forEach((item, index) => {
|
|
64
|
+
console.log(
|
|
65
|
+
chalk.cyan(`[${index + 1}]`) +
|
|
66
|
+
` ID: ${item.id || '-'}` +
|
|
67
|
+
` Label: ${item.pageLabel || '-'}` +
|
|
68
|
+
` API: ${item.pageApi || '-'}`
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
console.log(chalk.yellow('No custom pages found.'));
|
|
73
|
+
}
|
|
74
|
+
console.error();
|
|
75
|
+
} else {
|
|
76
|
+
const errMsg = res?.returnInfo || 'Unknown error';
|
|
77
|
+
console.error(chalk.red(`Fail: ${errMsg}`));
|
|
78
|
+
console.error();
|
|
79
|
+
throw new Error('List Custom Page Failed: ' + errMsg);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return res;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
module.exports = listCustomPage;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* customSetting 文档统一入口(全量一次性输出)
|
|
3
|
+
*/
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
function generateFullMarkdownDoc() {
|
|
8
|
+
const lines = [
|
|
9
|
+
"# CloudCC 自定义设置操作指南",
|
|
10
|
+
"",
|
|
11
|
+
"> 本文档按实际页面操作顺序整理,覆盖你提供的 7 个步骤图:",
|
|
12
|
+
"> 列表 -> 新建 -> 编辑 -> 详情建字段 -> 字段类型选择 -> 字段属性填写 -> 字段编辑。",
|
|
13
|
+
"",
|
|
14
|
+
"直接查看 CLI 文档:`cc doc customSetting`",
|
|
15
|
+
"",
|
|
16
|
+
"---",
|
|
17
|
+
"",
|
|
18
|
+
"## 1. 入口与列表页(图一)",
|
|
19
|
+
"",
|
|
20
|
+
"进入路径:`设置 -> 开发者空间 -> 自定义设置`。",
|
|
21
|
+
"",
|
|
22
|
+
"在列表页可看到:",
|
|
23
|
+
"- 标签",
|
|
24
|
+
"- 可见性",
|
|
25
|
+
"- 设置类型",
|
|
26
|
+
"- 描述",
|
|
27
|
+
"",
|
|
28
|
+
"右上角点击「新建」进入自定义设置创建弹窗。",
|
|
29
|
+
"",
|
|
30
|
+
"---",
|
|
31
|
+
"",
|
|
32
|
+
"## 2. 新建自定义设置(图二)",
|
|
33
|
+
"",
|
|
34
|
+
"点击图一右上角「新建」,弹出「自定义设置:新建」窗口,需要填写:",
|
|
35
|
+
"",
|
|
36
|
+
"- `标签`(必填)",
|
|
37
|
+
"- `对象名`(必填)",
|
|
38
|
+
"- `设置类型`(如:列表)",
|
|
39
|
+
"- `可见性`(如:公用)",
|
|
40
|
+
"- `描述`(可选)",
|
|
41
|
+
"",
|
|
42
|
+
"填写后保存,返回列表可看到新建记录。",
|
|
43
|
+
"",
|
|
44
|
+
"---",
|
|
45
|
+
"",
|
|
46
|
+
"## 3. 编辑自定义设置基础信息(图三)",
|
|
47
|
+
"",
|
|
48
|
+
"在列表中选择一条记录进入编辑弹窗「自定义设置:编辑」。",
|
|
49
|
+
"",
|
|
50
|
+
"常见行为:",
|
|
51
|
+
"- 可编辑:标签、可见性、描述等",
|
|
52
|
+
"- 对象名、设置类型通常按产品规则受限(常见为不可改)",
|
|
53
|
+
"",
|
|
54
|
+
"保存后回到列表,确认信息更新成功。",
|
|
55
|
+
"",
|
|
56
|
+
"---",
|
|
57
|
+
"",
|
|
58
|
+
"## 4. 进入详情并管理字段(图四)",
|
|
59
|
+
"",
|
|
60
|
+
"点击某条自定义设置后进入详情页,页面分为两块:",
|
|
61
|
+
"",
|
|
62
|
+
"1. 自定义设置详细信息(头部)",
|
|
63
|
+
"2. 自定义设置字段列表(下半区)",
|
|
64
|
+
"",
|
|
65
|
+
"在字段列表区域可点击「新建」,为当前自定义设置新增字段。",
|
|
66
|
+
"",
|
|
67
|
+
"---",
|
|
68
|
+
"",
|
|
69
|
+
"## 5. 新建字段 - 选择数据类型(图五)",
|
|
70
|
+
"",
|
|
71
|
+
"点击图四的「新建」后,进入「自定义字段」向导第一步:",
|
|
72
|
+
"",
|
|
73
|
+
"- 选择字段数据类型(如 URL、百分比、货币、电话、电子邮件、文本、日期等)",
|
|
74
|
+
"- 该步骤决定下一步字段属性表单内容",
|
|
75
|
+
"",
|
|
76
|
+
"选择完成后点击「下一步」。",
|
|
77
|
+
"",
|
|
78
|
+
"---",
|
|
79
|
+
"",
|
|
80
|
+
"## 6. 新建字段 - 填写字段属性并保存(图六)",
|
|
81
|
+
"",
|
|
82
|
+
"在第二步填写字段属性(示例为文本字段):",
|
|
83
|
+
"",
|
|
84
|
+
"- 字段标签(必填)",
|
|
85
|
+
"- 长度(如文本长度 255)",
|
|
86
|
+
"- 字段名 / API 名称(必填)",
|
|
87
|
+
"- 独有配置(如不允许重复值,按需开启)",
|
|
88
|
+
"",
|
|
89
|
+
"点击「保存」后,即在当前自定义设置下创建了一个新字段。",
|
|
90
|
+
"",
|
|
91
|
+
"---",
|
|
92
|
+
"",
|
|
93
|
+
"## 7. 编辑已有字段(图七)",
|
|
94
|
+
"",
|
|
95
|
+
"保存成功后回到字段列表,可看到新字段。点击某字段的操作菜单(如「...」)可进行:",
|
|
96
|
+
"",
|
|
97
|
+
"- 编辑:修改字段属性(可修改范围受字段类型和系统规则限制)",
|
|
98
|
+
"- 删除:移除该字段(建议先确认是否已有业务依赖)",
|
|
99
|
+
"",
|
|
100
|
+
"编辑保存后,字段列表会展示最新结果。",
|
|
101
|
+
"",
|
|
102
|
+
"---",
|
|
103
|
+
"",
|
|
104
|
+
"## 8. 新建字段支持的所有字段类型",
|
|
105
|
+
"",
|
|
106
|
+
"自定义设置详情页「新建字段」当前支持以下字段类型(与前端字段类型选择一致):",
|
|
107
|
+
"",
|
|
108
|
+
"| 类型代码(fdtype) | 类型名称 | 说明 |",
|
|
109
|
+
"|---|---|---|",
|
|
110
|
+
"| `U` | URL | 允许输入有效网址;点击后按打开方式在新/当前窗口打开 |",
|
|
111
|
+
"| `P` | 百分比 | 输入数字并自动添加百分号(如 10 -> 10%) |",
|
|
112
|
+
"| `c` | 币种 | 金额/币种类型字段 |",
|
|
113
|
+
"| `H` | 电话 | 输入电话号码并按电话格式展示 |",
|
|
114
|
+
"| `E` | 电子邮件 | 输入邮箱并校验格式(可用于“发送电子邮件”选择地址) |",
|
|
115
|
+
"| `B` | 复选框 | 布尔值(真/假) |",
|
|
116
|
+
"| `D` | 日期 | 输入或选择日期 |",
|
|
117
|
+
"| `F` | 日期和时间 | 输入或选择日期时间 |",
|
|
118
|
+
"| `N` | 数字 | 输入数字(会删除前置零) |",
|
|
119
|
+
"| `S` | 文本 | 字母数字组合文本 |",
|
|
120
|
+
"| `X` | 长文本 | 多行文本,最多 4000 字符 |",
|
|
121
|
+
"",
|
|
122
|
+
"在接口层面:新建/编辑字段使用 `POST /api/customsetting/saveField`,其中 `fdtype` 与 `tpSysSchemetableVO.schemefieldType` 建议保持一致(例如文本为 `S`,百分比为 `P`)。",
|
|
123
|
+
"",
|
|
124
|
+
"---",
|
|
125
|
+
"",
|
|
126
|
+
"## 9. Java 侧读取自定义设置(CCService)",
|
|
127
|
+
"",
|
|
128
|
+
"### 9.1 列表类型(List)",
|
|
129
|
+
"",
|
|
130
|
+
"```java",
|
|
131
|
+
"// 某 API 名称下的全部数据",
|
|
132
|
+
"Map listSettings = cs.getListCustomSetting(\"MyListSettingApiName\");",
|
|
133
|
+
"",
|
|
134
|
+
"// 指定 Name 的单条",
|
|
135
|
+
"Map singleSetting = cs.getListCustomSetting(\"MyListSettingApiName\", \"SomeName\");",
|
|
136
|
+
"```",
|
|
137
|
+
"",
|
|
138
|
+
"### 9.2 层次结构类型(Hierarchy)",
|
|
139
|
+
"",
|
|
140
|
+
"```java",
|
|
141
|
+
"// id 为简档 ID 或用户 ID",
|
|
142
|
+
"Map hiSetting = cs.getCustomSetting(\"MyHierarchySettingApiName\", profileOrUserId);",
|
|
143
|
+
"```",
|
|
144
|
+
"",
|
|
145
|
+
"---",
|
|
146
|
+
"",
|
|
147
|
+
"## 10. 操作 Checklist",
|
|
148
|
+
"",
|
|
149
|
+
"- [ ] 已在列表页确认目标自定义设置(标签/对象名)",
|
|
150
|
+
"- [ ] 新建时已正确选择设置类型与可见性",
|
|
151
|
+
"- [ ] 进入详情后通过字段向导完成字段新增",
|
|
152
|
+
"- [ ] 字段 `标签`、`API 名称`、`长度` 等配置符合规范",
|
|
153
|
+
"- [ ] 保存后已在字段列表验证新增或编辑结果",
|
|
154
|
+
"- [ ] 代码侧读取时,API 名称与平台配置保持一致",
|
|
155
|
+
"",
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
const base = lines.join("\n");
|
|
159
|
+
const apiPath = path.join(
|
|
160
|
+
__dirname,
|
|
161
|
+
"..",
|
|
162
|
+
"..",
|
|
163
|
+
"cloudcc-cli-dev",
|
|
164
|
+
"CUSTOM-SETTING-API.md"
|
|
165
|
+
);
|
|
166
|
+
let apiContent = "";
|
|
167
|
+
try {
|
|
168
|
+
apiContent = fs.readFileSync(apiPath, "utf8");
|
|
169
|
+
} catch (e) {
|
|
170
|
+
apiContent = `# 自定义设置相关接口\n\n(未找到文件:${apiPath})\n`;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return [
|
|
174
|
+
base,
|
|
175
|
+
"",
|
|
176
|
+
"---",
|
|
177
|
+
"",
|
|
178
|
+
"## 附录:自定义设置 Setup 接口速查",
|
|
179
|
+
"",
|
|
180
|
+
"> 来源:`cloudcc-cli-dev/CUSTOM-SETTING-API.md`",
|
|
181
|
+
"",
|
|
182
|
+
apiContent.trim(),
|
|
183
|
+
"",
|
|
184
|
+
].join("\n");
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function doc() {
|
|
188
|
+
const content = generateFullMarkdownDoc();
|
|
189
|
+
console.log(content);
|
|
190
|
+
return content;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
doc.getClassEditorDoc = doc;
|
|
194
|
+
doc.getEditGuide = doc;
|
|
195
|
+
|
|
196
|
+
module.exports = doc;
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"CCdd","version":"2","id":"ccp20269AAF29D2SqHiD"}
|