cloudcc-cli 2.3.2 → 2.3.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/.claude/settings.json +12 -2
- package/.cursor/skills/cloudcc-cli-usage/SKILL.md +2 -1
- package/README.md +11 -0
- package/package.json +2 -1
- package/src/classes/docs/devguide.md +90 -0
- package/src/globalSelectList/docs/devguide.md +0 -59
- package/src/menu/docs/devguide.md +57 -131
- package/src/pagelayout/create.js +2 -2
- package/src/pagelayout/delete.js +57 -0
- package/src/pagelayout/docs/devguide.md +17 -229
- package/src/pagelayout/get.js +9 -9
- package/src/pagelayout/index.js +1 -0
- package/src/plugin/docs/devguide.md +90 -17
- package/src/profile/docs/devguide.md +3 -258
- package/src/role/docs/devguide.md +5 -311
- package/src/timer/docs/devguide.md +83 -1
- package/src/triggers/docs/devguide.md +108 -0
- package/src/user/docs/devguide.md +22 -534
- package/tmp_customsetting_detail.json +0 -1
package/.claude/settings.json
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(node bin/cc.js
|
|
4
|
+
"Bash(node bin/cc.js *)",
|
|
5
5
|
"Bash(python3 -m json.tool)",
|
|
6
6
|
"Bash(node bin/cc.js get pagelayout . Contact)",
|
|
7
|
-
"Bash(node bin/cc.js get pagelayout . 003)"
|
|
7
|
+
"Bash(node bin/cc.js get pagelayout . 003)",
|
|
8
|
+
"Bash(cc login:*)",
|
|
9
|
+
"Bash(cc config:*)",
|
|
10
|
+
"Bash(node bin/cc.js get pagelayout . Account)",
|
|
11
|
+
"Bash(node bin/cc.js config use dev)",
|
|
12
|
+
"Bash(node bin/cc.js get pagelayout . 001)",
|
|
13
|
+
"Bash(node bin/cc.js get pagelayout .)",
|
|
14
|
+
"Bash(. ~/.nvm/nvm.sh)",
|
|
15
|
+
"Bash(nvm use:*)",
|
|
16
|
+
"Bash(npm link:*)",
|
|
17
|
+
"Bash(cc delete:*)"
|
|
8
18
|
]
|
|
9
19
|
},
|
|
10
20
|
"askForConfirmation": false,
|
|
@@ -9,7 +9,8 @@ description: CloudCC CRM 二次开发 CLI 文档检索技能。用于在设计
|
|
|
9
9
|
|
|
10
10
|
### 1. 设计实现方案时
|
|
11
11
|
|
|
12
|
-
- 当用户要做方案设计、实现设计、模块选型时,优先调用每个模块的
|
|
12
|
+
- 当用户要做方案设计、实现设计、模块选型时,优先调用每个模块的
|
|
13
|
+
`introduction`文档。
|
|
13
14
|
- 命令格式:`cc doc <module> introduction`
|
|
14
15
|
- 目标:先理解模块定位、适用场景、能力边界。
|
|
15
16
|
- 然后编写详细的设计文档,包括对象,字段等。
|
package/README.md
CHANGED
|
@@ -22,6 +22,17 @@ sudo npm i -g cloudcc-cli
|
|
|
22
22
|
}
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
# ReleaseV2.3.3
|
|
26
|
+
|
|
27
|
+
#### Release Date: 2026-3-26
|
|
28
|
+
|
|
29
|
+
#### Release Scope: Full
|
|
30
|
+
|
|
31
|
+
#### Release Content
|
|
32
|
+
|
|
33
|
+
- Optimization
|
|
34
|
+
- Refined developer documentation and added CLI command usage
|
|
35
|
+
|
|
25
36
|
# ReleaseV2.3.2
|
|
26
37
|
|
|
27
38
|
#### Release Date: 2026-3-25
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcc-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "cloudcc-cli",
|
|
5
5
|
"author": "cloudcc",
|
|
6
6
|
"license": "ISC",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"test-cli-one": "node --test test/globalSelectList.cli.test.js",
|
|
20
20
|
"test-cli-all": "node --test ",
|
|
21
21
|
"cc-pull": "git fetch --tags -f && git pull",
|
|
22
|
+
"npm-login": "npm login --registry https://registry.npmmirror.com",
|
|
22
23
|
"publish-lib": "npm publish --registry https://registry.npmjs.org && git add . && git commit -m 'update' && git push && curl https://npmmirror.com/sync/cloudcc-cli",
|
|
23
24
|
"package-jar": "mvn clean && mvn package",
|
|
24
25
|
"fetch-dev-env": "node src/mcp/tools/dev-env/fetcher.js",
|
|
@@ -8,6 +8,93 @@
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## 0. 必须使用 CLI 管理本地类文件
|
|
12
|
+
|
|
13
|
+
自定义类在本项目中的目录结构、`config.json`、主类中的 `// @SOURCE_CONTENT_START`
|
|
14
|
+
… `// @SOURCE_CONTENT_END` 区域,均与 **cloudcc-cli**
|
|
15
|
+
的创建、发布、拉取逻辑绑定。**必须通过下列命令**
|
|
16
|
+
完成新建目录、与服务器同步、发布与删除;不要手工新建
|
|
17
|
+
`classes/<类名>/`、不要复制粘贴整套类文件夹、不要私自篡改 `config.json` 里的
|
|
18
|
+
`id` 或破坏版本字段,否则容易导致发布失败、拉取覆盖异常或与线上一致性不一致。
|
|
19
|
+
|
|
20
|
+
**允许的做法**:在 CLI 已生成的主类 `*.java` 中,仅在上述 SOURCE
|
|
21
|
+
标记之间编写与修改业务代码;其余与平台同步相关的操作一律走命令。
|
|
22
|
+
|
|
23
|
+
执行命令前请确认:已完成 `cc doc project devguide`
|
|
24
|
+
中的环境初始化,项目根目录配置可用且包含 `accessToken`。
|
|
25
|
+
|
|
26
|
+
### 0.1 命令总览(以代码实现为准)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cc create classes <name>
|
|
30
|
+
cc publish classes <name>
|
|
31
|
+
cc pull classes <name>
|
|
32
|
+
cc get classes [listQueryJson] [projectPath]
|
|
33
|
+
cc detail classes <name>
|
|
34
|
+
cc detail classes "" <id>
|
|
35
|
+
cc pullList classes <id> <projectPath>
|
|
36
|
+
cc delete classes <nameOrId> [projectPath]
|
|
37
|
+
cc doc classes <introduction|devguide>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
参数约定:
|
|
41
|
+
|
|
42
|
+
- `name`:Java 类名,与 `classes/<name>/` 目录名一致。
|
|
43
|
+
- `listQueryJson`:可选;列表查询条件的 JSON 经 `encodeURI(JSON.stringify(...))`
|
|
44
|
+
编码后传入。不传时使用默认分页参数。
|
|
45
|
+
- `projectPath`:项目根路径,可选;不传则使用当前工作目录。
|
|
46
|
+
- `id`:线上类 ID。`detail`
|
|
47
|
+
在仅查服务器时可将类名置空:`cc detail classes "" <id>`。`pullList` 用 ID
|
|
48
|
+
将线上类落到指定项目的 `classes/` 下。
|
|
49
|
+
- `nameOrId`:本地目录名,或类 ID。若本地存在 `config.json` 且含
|
|
50
|
+
`id`,删除时会优先用其中的服务器 ID。
|
|
51
|
+
|
|
52
|
+
### 0.2 命令说明摘要
|
|
53
|
+
|
|
54
|
+
| 命令 | 作用 |
|
|
55
|
+
| ---------- | ----------------------------------------------------------------------------------- |
|
|
56
|
+
| `create` | 在 `classes/<name>/` 生成主类、测试类、`config.json` 模板 |
|
|
57
|
+
| `publish` | 将本地 SOURCE 区域源码提交到服务器;首次成功后会写回 `config.json` 的 `id` |
|
|
58
|
+
| `pull` | 按本地 `config.json` 的 `id` 从服务器拉取源码,覆盖主类中 SOURCE 区域(需已发布过) |
|
|
59
|
+
| `get` | 查询线上类列表(JSON 输出) |
|
|
60
|
+
| `detail` | 按类名优先读本地;或仅按 `id` 读服务器详情 |
|
|
61
|
+
| `pullList` | 按类 `id` 将线上类拉取到指定 `projectPath` 下的 `classes/<类名>/` |
|
|
62
|
+
| `delete` | 调用接口删除服务器上的类;参数可为本地类名或类 ID |
|
|
63
|
+
| `doc` | 输出 `introduction` 或 `devguide`(`devguide` 含附录 SDK 速查) |
|
|
64
|
+
|
|
65
|
+
### 0.3 推荐操作顺序
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# 1) 查看线上已有类(可选,避免重名或确认 ID)
|
|
69
|
+
cc get classes
|
|
70
|
+
|
|
71
|
+
# 2) 新建类(仅通过 create 生成目录与文件)
|
|
72
|
+
cc create classes MyClass
|
|
73
|
+
|
|
74
|
+
# 3) 编辑 classes/MyClass/MyClass.java 中 SOURCE 区域后发布
|
|
75
|
+
cc publish classes MyClass
|
|
76
|
+
|
|
77
|
+
# 4) 需要与服务器对齐时,拉取覆盖本地 SOURCE 区域
|
|
78
|
+
cc pull classes MyClass
|
|
79
|
+
|
|
80
|
+
# 5) 按已知线上类 ID 拉到指定项目(迁移、批量)
|
|
81
|
+
cc pullList classes <线上类ID> <projectPath>
|
|
82
|
+
|
|
83
|
+
# 6) 不再使用时删除线上类
|
|
84
|
+
cc delete classes MyClass
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 0.4 文档子命令
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cc doc classes introduction
|
|
91
|
+
cc doc classes devguide
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
仅支持 `introduction` 与 `devguide`,其他子命令会报错。
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
11
98
|
## 1. 概念与使用场景
|
|
12
99
|
|
|
13
100
|
### 1.1 什么是自定义类
|
|
@@ -438,6 +525,9 @@ new PageClsInvoker(userInfo).invoker("Hello", "test3", null, arglist);
|
|
|
438
525
|
|
|
439
526
|
## 6. 自定义类开发 Checklist
|
|
440
527
|
|
|
528
|
+
- [ ] 类目录与平台同步仅通过 `cc create` / `cc pull` / `cc pullList` /
|
|
529
|
+
`cc publish` / `cc delete` 等命令操作,不手工造目录或改 `config.json` 的
|
|
530
|
+
`id`
|
|
441
531
|
- [ ] 类名、方法名与调用方(按钮/触发器/组件/定时作业)约定一致
|
|
442
532
|
- [ ] 构造函数正确接收 `UserInfo` 并实例化 `CCService` 等依赖
|
|
443
533
|
- [ ] 所有 `CCService` 操作(`insert`/`update`/`delete`/`cquery`)使用正确的对象
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# CloudCC 全局选项列表操作指南
|
|
2
2
|
|
|
3
|
-
> 参考文档:[全局选项列表值集](https://help.cloudcc.cn/product02/quan-ju-xuan-xiang-lie-biao-zhi-ji/)
|
|
4
|
-
|
|
5
3
|
---
|
|
6
4
|
|
|
7
5
|
## 1. 入口与列表页
|
|
@@ -152,61 +150,4 @@ cc doc globalSelectList introduction
|
|
|
152
150
|
cc doc globalSelectList devguide
|
|
153
151
|
```
|
|
154
152
|
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## 7. API 参考
|
|
158
|
-
|
|
159
|
-
### 7.1 查询列表
|
|
160
|
-
|
|
161
|
-
- **接口**:`POST /api/globalSelectSetup/queryList`
|
|
162
|
-
- **请求体**:
|
|
163
|
-
|
|
164
|
-
```json
|
|
165
|
-
{
|
|
166
|
-
"pageNum": "1",
|
|
167
|
-
"pageSize": "10000"
|
|
168
|
-
}
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
- **响应**:`data.globalSelectList`(数组)
|
|
172
|
-
|
|
173
|
-
### 7.2 新建
|
|
174
|
-
|
|
175
|
-
- **接口**:`POST /api/globalSelectSetup/save`
|
|
176
|
-
- **请求体**:
|
|
177
|
-
|
|
178
|
-
```json
|
|
179
|
-
{
|
|
180
|
-
"label": "test2",
|
|
181
|
-
"name": "test2",
|
|
182
|
-
"description": "描述",
|
|
183
|
-
"ptext": "值1\r\n值2\r\n值3",
|
|
184
|
-
"isPicklistSorted": "1",
|
|
185
|
-
"isFirstDefault": "1"
|
|
186
|
-
}
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
- **响应**:`data` 为新建记录的 ID 字符串
|
|
190
|
-
|
|
191
|
-
### 7.3 删除
|
|
192
|
-
|
|
193
|
-
- **接口**:`POST /api/globalSelectSetup/delete`
|
|
194
|
-
- **请求体**:
|
|
195
|
-
|
|
196
|
-
```json
|
|
197
|
-
{
|
|
198
|
-
"id": "<id>",
|
|
199
|
-
"deleteFromDisk": "false"
|
|
200
|
-
}
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
| 参数 | 说明 |
|
|
204
|
-
|------------------|--------------------------------------------------------|
|
|
205
|
-
| `id` | 全局选项列表 ID |
|
|
206
|
-
| `deleteFromDisk` | `"false"` 软删除(可恢复);`"true"` 彻底删除(不可恢复)|
|
|
207
|
-
|
|
208
|
-
### 7.4 详情
|
|
209
153
|
|
|
210
|
-
- **接口**:`POST /api/globalSelectSetup/detail`
|
|
211
|
-
- **请求体**:`{ "id": "<id>" }`
|
|
212
|
-
- **响应**:`data` 包含 `globalSelect`、`enabledList`、`disabledList`、`useList` 四个字段(详见第 4 节)
|
|
@@ -1,203 +1,129 @@
|
|
|
1
|
-
# CloudCC
|
|
1
|
+
# CloudCC 菜单 CLI 命令说明
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 支持的命令
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
| 操作 | 说明 |
|
|
6
|
+
|------|------|
|
|
7
|
+
| `create menu object` | 创建自定义对象菜单 |
|
|
8
|
+
| `create menu page` | 创建自定义页面菜单 |
|
|
9
|
+
| `create menu script` | 创建自定义脚本菜单 |
|
|
10
|
+
| `create menu site` | 创建站点菜单 |
|
|
11
|
+
| `get menu` | 查询菜单列表 |
|
|
12
|
+
| `delete menu` | 删除菜单 |
|
|
7
13
|
|
|
8
|
-
|
|
14
|
+
## CLI 命令详解
|
|
9
15
|
|
|
10
|
-
|
|
11
|
-
cc doc menu introduction
|
|
12
|
-
cc doc menu devguide
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## 2. 开发前准备
|
|
18
|
-
|
|
19
|
-
执行菜单相关命令前,请确认:
|
|
20
|
-
|
|
21
|
-
- 已完成 `cc doc project devguide` 的环境初始化
|
|
22
|
-
- 项目根目录存在可用的 `cloudcc-cli.config.js`
|
|
23
|
-
- 当前环境连接可用(org / token / endpoint 正确)
|
|
24
|
-
- 已明确菜单所属资源(对象 ID、页面 API、脚本内容或站点 ID)
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 3. 支持的命令总览
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
cc create menu object <path> <objectId> <tabName> [tabStyle] [mobileimg] [cloudccservicetab]
|
|
32
|
-
cc create menu page <path> <pageApi> <tabName> <pname> [tabStyle] [mobileimg] [cloudccservicetab] [mobileurl]
|
|
33
|
-
cc create menu script <path> <tabName> <pname> [functioncode] [tabStyle] [mobileimg] [cloudccservicetab]
|
|
34
|
-
cc create menu site <path> <siteId> <tabName> [tabStyle] [mobileimg] [cloudccservicetab]
|
|
35
|
-
|
|
36
|
-
cc get menu <projectPath> [encodedCondJson]
|
|
37
|
-
cc delete menu <projectPath> <tabId>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## 4. 创建菜单
|
|
43
|
-
|
|
44
|
-
### 4.1 创建自定义对象菜单
|
|
16
|
+
### 创建自定义对象菜单
|
|
45
17
|
|
|
46
18
|
```bash
|
|
47
19
|
cc create menu object <path> <objectId> <tabName> [tabStyle] [mobileimg] [cloudccservicetab]
|
|
48
20
|
```
|
|
49
21
|
|
|
50
|
-
|
|
22
|
+
**参数说明:**
|
|
51
23
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
| 参数 | 必填 | 说明 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| `path` | 是 | 项目路径,`.` 表示当前目录 |
|
|
27
|
+
| `objectId` | 是 | 自定义对象 ID |
|
|
28
|
+
| `tabName` | 是 | 菜单显示名称 |
|
|
29
|
+
| `tabStyle` | 否 | PC 端图标(默认 `cloudtab145`)|
|
|
30
|
+
| `mobileimg` | 否 | 移动端图标(默认 `cloudcc01`)|
|
|
31
|
+
| `cloudccservicetab` | 否 | 服务图标(默认 `cloudccservicetab_1`)|
|
|
58
32
|
|
|
59
|
-
|
|
33
|
+
**示例:**
|
|
60
34
|
|
|
61
35
|
```bash
|
|
62
36
|
cc create menu object . a0F9D000000XXXXUAI "客户管理"
|
|
63
37
|
```
|
|
64
38
|
|
|
65
|
-
###
|
|
39
|
+
### 创建自定义页面菜单
|
|
66
40
|
|
|
67
41
|
```bash
|
|
68
42
|
cc create menu page <path> <pageApi> <tabName> <pname> [tabStyle] [mobileimg] [cloudccservicetab] [mobileurl]
|
|
69
43
|
```
|
|
70
44
|
|
|
71
|
-
|
|
45
|
+
**参数说明:**
|
|
72
46
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
47
|
+
| 参数 | 必填 | 说明 |
|
|
48
|
+
|------|------|------|
|
|
49
|
+
| `path` | 是 | 项目路径 |
|
|
50
|
+
| `pageApi` | 是 | 自定义页面 API 名称(CLI 会追加 `#lightning`)|
|
|
51
|
+
| `tabName` | 是 | 菜单显示名称 |
|
|
52
|
+
| `pname` | 是 | 菜单内部名称(建议字母开头)|
|
|
53
|
+
| `tabStyle` / `mobileimg` / `cloudccservicetab` | 否 | 图标参数 |
|
|
54
|
+
| `mobileurl` | 否 | 移动端地址 |
|
|
79
55
|
|
|
80
|
-
|
|
56
|
+
**示例:**
|
|
81
57
|
|
|
82
58
|
```bash
|
|
83
59
|
cc create menu page . contract-assistant "合同助手" contract_menu
|
|
84
60
|
```
|
|
85
61
|
|
|
86
|
-
###
|
|
62
|
+
### 创建自定义脚本菜单
|
|
87
63
|
|
|
88
64
|
```bash
|
|
89
65
|
cc create menu script <path> <tabName> <pname> [functioncode] [tabStyle] [mobileimg] [cloudccservicetab]
|
|
90
66
|
```
|
|
91
67
|
|
|
92
|
-
|
|
68
|
+
**参数说明:**
|
|
93
69
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
70
|
+
| 参数 | 必填 | 说明 |
|
|
71
|
+
|------|------|------|
|
|
72
|
+
| `path` | 是 | 项目路径 |
|
|
73
|
+
| `tabName` | 是 | 菜单显示名称 |
|
|
74
|
+
| `pname` | 是 | 菜单内部名称 |
|
|
75
|
+
| `functioncode` | 否 | 脚本内容(默认示例脚本)|
|
|
99
76
|
|
|
100
|
-
|
|
77
|
+
**示例:**
|
|
101
78
|
|
|
102
79
|
```bash
|
|
103
80
|
cc create menu script . "数据导入工具" data_import_menu "ccc.alert('Hello World');"
|
|
104
81
|
```
|
|
105
82
|
|
|
106
|
-
###
|
|
83
|
+
### 创建站点菜单
|
|
107
84
|
|
|
108
85
|
```bash
|
|
109
86
|
cc create menu site <path> <siteId> <tabName> [tabStyle] [mobileimg] [cloudccservicetab]
|
|
110
87
|
```
|
|
111
88
|
|
|
112
|
-
|
|
89
|
+
**参数说明:**
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
91
|
+
| 参数 | 必填 | 说明 |
|
|
92
|
+
|------|------|------|
|
|
93
|
+
| `path` | 是 | 项目路径 |
|
|
94
|
+
| `siteId` | 是 | 站点 ID |
|
|
95
|
+
| `tabName` | 是 | 菜单显示名称 |
|
|
118
96
|
|
|
119
|
-
|
|
97
|
+
**示例:**
|
|
120
98
|
|
|
121
99
|
```bash
|
|
122
100
|
cc create menu site . a0H9D000000XXXXUAI "合作伙伴门户"
|
|
123
101
|
```
|
|
124
102
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
## 5. 查询与删除
|
|
128
|
-
|
|
129
|
-
### 5.1 查询菜单
|
|
103
|
+
### 查询菜单列表
|
|
130
104
|
|
|
131
105
|
```bash
|
|
132
106
|
cc get menu <projectPath> [encodedCondJson]
|
|
133
107
|
```
|
|
134
108
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- `projectPath` 默认当前目录
|
|
138
|
-
- `encodedCondJson` 为 URI 编码后的 JSON 查询条件
|
|
139
|
-
|
|
140
|
-
示例:
|
|
109
|
+
**示例:**
|
|
141
110
|
|
|
142
111
|
```bash
|
|
112
|
+
# 查询所有菜单
|
|
143
113
|
cc get menu .
|
|
114
|
+
|
|
115
|
+
# 带查询条件
|
|
144
116
|
cc get menu . '%7B%22type%22%3A%22page%22%7D'
|
|
145
117
|
```
|
|
146
118
|
|
|
147
|
-
###
|
|
119
|
+
### 删除菜单
|
|
148
120
|
|
|
149
121
|
```bash
|
|
150
122
|
cc delete menu <projectPath> <tabId>
|
|
151
123
|
```
|
|
152
124
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- `tabId` 为菜单 ID,建议先执行 `cc get menu .` 再删除
|
|
156
|
-
|
|
157
|
-
示例:
|
|
125
|
+
**示例:**
|
|
158
126
|
|
|
159
127
|
```bash
|
|
160
128
|
cc delete menu . a0I9D000000XXXXUAI
|
|
161
129
|
```
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## 6. 与后台菜单配置流程的映射
|
|
166
|
-
|
|
167
|
-
根据 CloudCC 官方菜单流程,完整上线通常包含三层动作:
|
|
168
|
-
|
|
169
|
-
1. 新建菜单(对象 / 页面 / 脚本)
|
|
170
|
-
2. 添加到简档(控制可见角色)
|
|
171
|
-
3. 添加到应用程序(控制出现在什么应用)
|
|
172
|
-
|
|
173
|
-
`cloudcc-cli` 当前主要覆盖第 1 步(菜单实体创建)。
|
|
174
|
-
因此在 CLI 创建后,建议在后台继续核验第 2-3 步,确保用户可见且出现在目标应用导航中。
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## 7. 常见注意事项
|
|
179
|
-
|
|
180
|
-
- 菜单创建成功不等于用户可见,需检查简档权限
|
|
181
|
-
- 菜单创建成功不等于出现在预期应用,需检查应用挂载
|
|
182
|
-
- `page` 类型请确认页面 API 存在且可访问
|
|
183
|
-
- 删除菜单前确认未被培训文档、操作手册或用户流程依赖
|
|
184
|
-
- 建议先在测试环境验证,再在生产环境执行
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## 8. 推荐操作顺序
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
# 1) 查询现有菜单,避免重名
|
|
192
|
-
cc get menu .
|
|
193
|
-
|
|
194
|
-
# 2) 创建目标菜单(示例:页面菜单)
|
|
195
|
-
cc create menu page . contract-manage "合同管理" contract_menu
|
|
196
|
-
|
|
197
|
-
# 3) 再次查询确认已创建
|
|
198
|
-
cc get menu .
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
创建后请在 CloudCC 后台完成简档与应用核验。
|
|
202
|
-
|
|
203
|
-
---
|
package/src/pagelayout/create.js
CHANGED
|
@@ -16,8 +16,8 @@ async function getExistingLayouts(config, objId) {
|
|
|
16
16
|
config.accessToken
|
|
17
17
|
);
|
|
18
18
|
|
|
19
|
-
if (res && res.result && res.
|
|
20
|
-
return res.
|
|
19
|
+
if (res && res.result && res.data && Array.isArray(res.data) && res.data.length > 0) {
|
|
20
|
+
return res.data;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
throw new Error("未找到可用的页面布局");
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const { postClass } = require("../../utils/http");
|
|
2
|
+
const { getPackageJson } = require("../../utils/config");
|
|
3
|
+
const chalk = require("chalk");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 删除页面布局
|
|
7
|
+
* 用法:cc delete pagelayout <projectPath> <layoutId>
|
|
8
|
+
* @param {Array} argvs - 命令行参数数组
|
|
9
|
+
* @returns {Promise<Object>} 删除结果
|
|
10
|
+
*/
|
|
11
|
+
async function deleteLayout(argvs) {
|
|
12
|
+
try {
|
|
13
|
+
// 命令行参数格式:cc delete pagelayout <projectPath> <layoutId>
|
|
14
|
+
const projectPath = argvs[2] || process.cwd();
|
|
15
|
+
const layoutId = argvs[3];
|
|
16
|
+
|
|
17
|
+
if (!layoutId) {
|
|
18
|
+
console.error();
|
|
19
|
+
console.error(chalk.red("Error: 缺少页面布局 ID"));
|
|
20
|
+
console.error("用法: cc delete pagelayout <projectPath> <layoutId>");
|
|
21
|
+
console.error("示例:");
|
|
22
|
+
console.error(" cc delete pagelayout . add202610BD89F09XyGT");
|
|
23
|
+
console.error();
|
|
24
|
+
throw new Error("缺少必需参数: layoutId");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const config = await getPackageJson(projectPath);
|
|
28
|
+
|
|
29
|
+
console.error();
|
|
30
|
+
console.error(chalk.green(`Deleting page layout "${layoutId}"...`));
|
|
31
|
+
console.error();
|
|
32
|
+
|
|
33
|
+
const res = await postClass(
|
|
34
|
+
config.setupSvc + "/api/layout/deleteButton",
|
|
35
|
+
{
|
|
36
|
+
id: layoutId
|
|
37
|
+
},
|
|
38
|
+
config.accessToken
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
if (res && res.result) {
|
|
42
|
+
console.error(chalk.green("页面布局删除成功!"));
|
|
43
|
+
console.log(JSON.stringify(res.data || res));
|
|
44
|
+
return res.data || res;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const msg = res && (res.returnInfo || res.message) ? (res.returnInfo || res.message) : "Unknown error";
|
|
48
|
+
throw new Error("Delete PageLayout Failed: " + msg);
|
|
49
|
+
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error();
|
|
52
|
+
console.error(chalk.red("页面布局删除失败:"), error.message || error);
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = deleteLayout;
|