cloudcc-cli 2.3.2 → 2.3.4
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 +18 -2
- package/.cloudcc-cache.json +17 -1
- package/.cursor/skills/{cloudcc-cli-usage → cloudcc-dev-usage}/SKILL.md +3 -2
- package/README.md +22 -0
- package/bin/index.js +2 -0
- package/build/{component-CCPlugin1774500425584.common.js → component-cc-cc-dd.common.js} +25 -25
- package/build/component-cc-cc-dd.common.js.map +1 -0
- package/build/component-cc-cc-dd.css +1 -0
- package/build/{component-CCPlugin1774500425584.umd.js → component-cc-cc-dd.umd.js} +27 -27
- package/build/component-cc-cc-dd.umd.js.map +1 -0
- package/build/{component-CCPlugin1774500425584.umd.min.js → component-cc-cc-dd.umd.min.js} +3 -3
- package/build/component-cc-cc-dd.umd.min.js.map +1 -0
- package/build/demo.html +1 -1
- package/package.json +3 -2
- package/plugins/cc-cc-dd/cc-cc-dd.vue +32 -0
- package/plugins/cc-cc-dd/components/HelloWorld.vue +11 -0
- package/plugins/cc-cc-dd/config.json +6 -0
- package/src/classes/docs/devguide.md +90 -0
- package/src/fields/create.js +12 -0
- package/src/globalSelectList/docs/devguide.md +0 -59
- package/src/menu/create-object.js +1 -0
- package/src/menu/create-page.js +1 -0
- package/src/menu/create-script.js +1 -0
- package/src/menu/create-site.js +1 -0
- package/src/menu/docs/devguide.md +57 -131
- package/src/object/create.js +2 -1
- package/src/object/docs/devguide.md +1 -5
- 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/create.js +2 -1
- package/src/role/delete.js +1 -0
- 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/create.js +502 -19
- package/src/user/docs/devguide.md +22 -534
- package/src/validationRule/create.js +153 -0
- package/src/validationRule/delete.js +60 -0
- package/src/validationRule/doc.js +46 -0
- package/src/validationRule/docs/devguide.md +76 -0
- package/src/validationRule/docs/introduction.md +122 -0
- package/src/validationRule/get.js +47 -0
- package/src/validationRule/index.js +10 -0
- package/build/component-CCPlugin1774500425584.common.js.map +0 -1
- package/build/component-CCPlugin1774500425584.css +0 -1
- package/build/component-CCPlugin1774500425584.umd.js.map +0 -1
- package/build/component-CCPlugin1774500425584.umd.min.js.map +0 -1
- package/tmp_customsetting_detail.json +0 -1
package/src/pagelayout/index.js
CHANGED
|
@@ -5,6 +5,68 @@
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## CLI 与本地文件(必读)
|
|
9
|
+
|
|
10
|
+
`plugins/<插件名>/` 目录、`config.json` 以及首次发布写回的 `id` 均与 **cloudcc-cli** 的创建、发布、拉取逻辑绑定。**必须通过下列命令** 完成新建插件目录、与云端同步、发布与删除;不要手工整包复制其他项目的 `plugins/`、不要私自篡改 `config.json` 中的 `id` 或破坏元数据,否则容易导致编译入口错误、发布失败或与云端不一致。
|
|
11
|
+
|
|
12
|
+
**允许的做法**:在 CLI 已生成的目录内用 IDE 编辑 `.vue`、子组件与 `utils/` 等源码;与云端列表、详情、拉取、删除、发布相关的操作一律走命令。
|
|
13
|
+
|
|
14
|
+
执行命令前请确认:已完成 `cc doc project devguide` 中的环境初始化,项目根目录配置可用且具备 `accessToken`(发布流程还会使用 `pluginToken` / 账号密钥等,以你项目配置为准)。
|
|
15
|
+
|
|
16
|
+
### 命令总览(以代码实现为准)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cc create plugin <name>
|
|
20
|
+
cc publish plugin <name>
|
|
21
|
+
cc get plugin [projectPath]
|
|
22
|
+
cc detail plugin <pluginName> [pluginId] [projectPath]
|
|
23
|
+
cc detail plugin "" <pluginId> [projectPath]
|
|
24
|
+
cc pull plugin <pluginNameOrId> [projectPath]
|
|
25
|
+
cc delete plugin <pluginNameOrId> [projectPath]
|
|
26
|
+
cc doc plugin <introduction|devguide>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
参数约定:
|
|
30
|
+
|
|
31
|
+
- `name` / `pluginName`:插件目录名,与 `plugins/<name>/` 一致。
|
|
32
|
+
- `projectPath`:项目根路径;不传则使用当前工作目录。`get` 的第一个可选参数即为 `projectPath`。
|
|
33
|
+
- `pluginNameOrId`:本地目录名,或云端组件 ID;若本地存在 `config.json` 且含 `id`,`pull` / `delete` 会优先使用该 `id`。
|
|
34
|
+
- `pluginId`:`detail` 仅查云端时,将 `pluginName` 置空:`cc detail plugin "" <pluginId>`。
|
|
35
|
+
|
|
36
|
+
### 命令作用摘要
|
|
37
|
+
|
|
38
|
+
| 命令 | 作用 |
|
|
39
|
+
|------|------|
|
|
40
|
+
| `create` | 在 `plugins/<name>/` 生成入口 `.vue`、`components/`、`config.json` 等模板 |
|
|
41
|
+
| `publish` | 使用 `vue-cli-service` 编译并上传;首次成功且接口返回 `id` 时可写回 `config.json` |
|
|
42
|
+
| `get` | 拉取云端组件列表,标准输出为 JSON |
|
|
43
|
+
| `detail` | 按目录名读本地;或按 `pluginId` 读云端(不传 `pluginName` 时) |
|
|
44
|
+
| `pull` | 按本地 `id` 或按传入的 ID 从云端还原文件到本地 `plugins/` 等路径 |
|
|
45
|
+
| `delete` | 调用接口删除云端组件 |
|
|
46
|
+
| `doc` | 输出 `introduction` 或 `devguide`(`devguide` 含附录 CCDK SDK 速查) |
|
|
47
|
+
|
|
48
|
+
### 推荐操作顺序
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# 1) 查看云端已有组件(可选)
|
|
52
|
+
cc get plugin .
|
|
53
|
+
|
|
54
|
+
# 2) 仅通过 create 生成目录与模板
|
|
55
|
+
cc create plugin my_plugin
|
|
56
|
+
|
|
57
|
+
# 3) 本地调试后发布(勿跳过 CLI 发布流程)
|
|
58
|
+
cc publish plugin my_plugin
|
|
59
|
+
|
|
60
|
+
# 4) 与云端对齐或迁移机器时拉取
|
|
61
|
+
cc pull plugin my_plugin
|
|
62
|
+
# 或已知云端 ID:cc pull plugin <id> .
|
|
63
|
+
|
|
64
|
+
# 5) 不再使用时删除云端组件
|
|
65
|
+
cc delete plugin my_plugin
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
8
70
|
## 0. 自定义组件概述(能力与场景)
|
|
9
71
|
|
|
10
72
|
本文节整合了仓库内实践用法,帮助你在开始编码前先判断:什么是自定义组件、能解决什么问题、何时该用。
|
|
@@ -100,7 +162,8 @@ npm run serve
|
|
|
100
162
|
|
|
101
163
|
### 1.2 创建组件
|
|
102
164
|
|
|
103
|
-
-
|
|
165
|
+
- **使用本 CLI 时**:在项目根执行 `cc create plugin <name>`,会在 `plugins/<name>/` 生成标准模板(推荐)。
|
|
166
|
+
- 或在模板工程中手动新建入口文件,**组件名称必须满足 DOM 命名规则**,例如:`cc-com-demo.vue`
|
|
104
167
|
- 推荐遵循:以 `cc-` 开头,后续使用小写单词和 `-` 连接。
|
|
105
168
|
|
|
106
169
|
### 1.3 在 `App` 中引入组件
|
|
@@ -115,12 +178,15 @@ npm run serve
|
|
|
115
178
|
|
|
116
179
|
### 1.5 发布组件
|
|
117
180
|
|
|
118
|
-
|
|
181
|
+
**推荐(与仓库、CI 一致)**:在项目根目录执行:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
cc publish plugin <与目录名一致的 name>
|
|
185
|
+
```
|
|
119
186
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
平台,可在页面编辑器中使用。
|
|
187
|
+
CLI 会编译 `plugins/<name>/<name>.vue` 并上传;首次成功且接口返回 `id` 时可能写回 `plugins/<name>/config.json`。
|
|
188
|
+
|
|
189
|
+
也可在 VS Code 中右键组件入口文件,选择「发布组件」(CloudCC 扩展),控制台提示成功即表示已上传至平台,可在页面编辑器中使用。
|
|
124
190
|
|
|
125
191
|
---
|
|
126
192
|
|
|
@@ -847,6 +913,7 @@ componentInfo: {
|
|
|
847
913
|
|
|
848
914
|
## 13. 自定义组件开发 Checklist
|
|
849
915
|
|
|
916
|
+
- [ ] 插件目录与云端同步仅通过 `cc create` / `cc publish` / `cc pull` / `cc delete` 等命令操作,不整包复制他人 `plugins/` 或手改 `config.json` 的 `id`
|
|
850
917
|
- [ ] 组件文件名与 `componentInfo.component` 命名符合规范(小写 + `-`
|
|
851
918
|
分隔,全局唯一)
|
|
852
919
|
- [ ] 样式默认使用 `lang="scss" scoped`,避免样式污染
|
|
@@ -860,7 +927,9 @@ componentInfo: {
|
|
|
860
927
|
|
|
861
928
|
---
|
|
862
929
|
|
|
863
|
-
## 14.
|
|
930
|
+
## 14. 命令使用说明(与实现一致)
|
|
931
|
+
|
|
932
|
+
文首「CLI 与本地文件(必读)」为总览;本节按子命令列出行为细节。
|
|
864
933
|
|
|
865
934
|
### 14.1 create
|
|
866
935
|
|
|
@@ -868,7 +937,7 @@ componentInfo: {
|
|
|
868
937
|
cc create plugin <name>
|
|
869
938
|
```
|
|
870
939
|
|
|
871
|
-
- 创建 `plugins/<name>/`
|
|
940
|
+
- 创建 `plugins/<name>/` 目录、入口 `<name>.vue`、`components/` 与 `config.json` 模板。
|
|
872
941
|
|
|
873
942
|
### 14.2 publish
|
|
874
943
|
|
|
@@ -876,8 +945,8 @@ cc create plugin <name>
|
|
|
876
945
|
cc publish plugin <name>
|
|
877
946
|
```
|
|
878
947
|
|
|
879
|
-
-
|
|
880
|
-
-
|
|
948
|
+
- 以 `plugins/<name>/<name>.vue` 为入口编译(`vue-cli-service build --target lib`),再上传到云端。
|
|
949
|
+
- 首次发布成功且响应包含 `id` 时,会写回 `plugins/<name>/config.json`(若此前无 `id`)。
|
|
881
950
|
|
|
882
951
|
### 14.3 get
|
|
883
952
|
|
|
@@ -885,17 +954,19 @@ cc publish plugin <name>
|
|
|
885
954
|
cc get plugin [projectPath]
|
|
886
955
|
```
|
|
887
956
|
|
|
888
|
-
-
|
|
957
|
+
- 分页请求云端组件列表,标准输出为 JSON 数组。
|
|
958
|
+
- `projectPath` 可选,用于解析项目根下的 `cloudcc-cli` 配置。
|
|
889
959
|
|
|
890
960
|
### 14.4 detail
|
|
891
961
|
|
|
892
962
|
```bash
|
|
893
|
-
cc detail plugin <pluginName> [projectPath]
|
|
963
|
+
cc detail plugin <pluginName> [pluginId] [projectPath]
|
|
894
964
|
cc detail plugin "" <pluginId> [projectPath]
|
|
895
965
|
```
|
|
896
966
|
|
|
897
|
-
-
|
|
898
|
-
-
|
|
967
|
+
- 提供 `pluginName`(且非空):读取本地 `plugins/<pluginName>/` 的 `config.json` 与入口 `.vue`。
|
|
968
|
+
- 将 `pluginName` 置为空并传 `pluginId`:仅从云端查询详情(`projectPath` 仍用于配置)。
|
|
969
|
+
- 需要指定项目根且保留「仅本地名」时,可用占位:`cc detail plugin <pluginName> "" <projectPath>`(中间空串表示无 `pluginId`)。
|
|
899
970
|
|
|
900
971
|
### 14.5 pull
|
|
901
972
|
|
|
@@ -903,7 +974,8 @@ cc detail plugin "" <pluginId> [projectPath]
|
|
|
903
974
|
cc pull plugin <pluginNameOrId> [projectPath]
|
|
904
975
|
```
|
|
905
976
|
|
|
906
|
-
-
|
|
977
|
+
- 若 `plugins/<输入>/config.json` 存在且含 `id`,按该 `id` 拉取。
|
|
978
|
+
- 否则将输入视为云端组件 ID,拉取后在 `plugins/<归一化名称>/` 等处落盘并更新 `config.json`。
|
|
907
979
|
|
|
908
980
|
### 14.6 delete
|
|
909
981
|
|
|
@@ -911,7 +983,8 @@ cc pull plugin <pluginNameOrId> [projectPath]
|
|
|
911
983
|
cc delete plugin <pluginNameOrId> [projectPath]
|
|
912
984
|
```
|
|
913
985
|
|
|
914
|
-
- 若本地 `config.json`
|
|
986
|
+
- 若本地 `plugins/<name>/config.json` 存在且含 `id`,优先按该 `id` 调删除接口。
|
|
987
|
+
- 否则将参数视为云端 ID 直接删除。
|
|
915
988
|
|
|
916
989
|
### 14.7 doc
|
|
917
990
|
|
|
@@ -920,4 +993,4 @@ cc doc plugin introduction
|
|
|
920
993
|
cc doc plugin devguide
|
|
921
994
|
```
|
|
922
995
|
|
|
923
|
-
-
|
|
996
|
+
- 仅支持 `introduction` 与 `devguide`;`devguide` 会在正文后拼接附录「CCDK SDK 速查」。
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
# CloudCC
|
|
1
|
+
# CloudCC 简档 CLI 命令说明
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 快速开始(CLI 命令)
|
|
8
|
-
|
|
9
|
-
### 支持的简档操作
|
|
3
|
+
## 支持的命令
|
|
10
4
|
|
|
11
5
|
| 操作 | 说明 |
|
|
12
6
|
|------|------|
|
|
@@ -14,14 +8,10 @@
|
|
|
14
8
|
| `get` | 查询简档列表 |
|
|
15
9
|
| `delete` | 删除自定义简档 |
|
|
16
10
|
|
|
17
|
-
---
|
|
18
|
-
|
|
19
11
|
## CLI 命令详解
|
|
20
12
|
|
|
21
13
|
### 创建简档
|
|
22
14
|
|
|
23
|
-
创建一个新的自定义简档,基于现有简档复制权限配置。
|
|
24
|
-
|
|
25
15
|
```bash
|
|
26
16
|
cc create profile <path> <profileName> [description]
|
|
27
17
|
```
|
|
@@ -32,7 +22,7 @@ cc create profile <path> <profileName> [description]
|
|
|
32
22
|
|------|------|------|
|
|
33
23
|
| `path` | 是 | 项目路径,`.` 表示当前目录 |
|
|
34
24
|
| `profileName` | 是 | 简档名称 |
|
|
35
|
-
| `description` | 否 |
|
|
25
|
+
| `description` | 否 | 简档描述 |
|
|
36
26
|
|
|
37
27
|
**示例:**
|
|
38
28
|
|
|
@@ -44,12 +34,8 @@ cc create profile . "销售经理简档"
|
|
|
44
34
|
cc create profile . "销售代表简档" "适用于销售团队的权限配置"
|
|
45
35
|
```
|
|
46
36
|
|
|
47
|
-
---
|
|
48
|
-
|
|
49
37
|
### 查询简档列表
|
|
50
38
|
|
|
51
|
-
获取当前环境中的所有简档列表。
|
|
52
|
-
|
|
53
39
|
```bash
|
|
54
40
|
cc get profile <projectPath> [encodedCondJson]
|
|
55
41
|
```
|
|
@@ -71,12 +57,8 @@ cc get profile .
|
|
|
71
57
|
cc get profile . '%7B%22type%22%3A%22custom%22%7D'
|
|
72
58
|
```
|
|
73
59
|
|
|
74
|
-
---
|
|
75
|
-
|
|
76
60
|
### 删除简档
|
|
77
61
|
|
|
78
|
-
删除指定的自定义简档。
|
|
79
|
-
|
|
80
62
|
```bash
|
|
81
63
|
cc delete profile <projectPath> <profileId>
|
|
82
64
|
```
|
|
@@ -91,242 +73,5 @@ cc delete profile <projectPath> <profileId>
|
|
|
91
73
|
**示例:**
|
|
92
74
|
|
|
93
75
|
```bash
|
|
94
|
-
# 删除指定简档
|
|
95
76
|
cc delete profile . aaa202672F656B7VfEjL
|
|
96
77
|
```
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## 完整工作流示例
|
|
101
|
-
|
|
102
|
-
### 场景:为销售团队创建新的权限简档
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
# 1. 确认项目已初始化(有 cloudcc-cli.config.js)
|
|
106
|
-
cat cloudcc-cli.config.js
|
|
107
|
-
|
|
108
|
-
# 2. 查询现有简档
|
|
109
|
-
cc get profile .
|
|
110
|
-
|
|
111
|
-
# 3. 创建新的销售经理简档(自动复制第一个现有简档的权限)
|
|
112
|
-
cc create profile . "销售经理简档" "销售团队经理级别的权限配置"
|
|
113
|
-
|
|
114
|
-
# 4. 验证简档创建成功
|
|
115
|
-
cc get profile .
|
|
116
|
-
|
|
117
|
-
# 5. 如需删除
|
|
118
|
-
# cc delete profile . <profileId>
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## API 接口详情
|
|
124
|
-
|
|
125
|
-
### 什么是简档?
|
|
126
|
-
|
|
127
|
-
**简档(Profile)** 是 CloudCC 系统的权限配置单元,定义了用户对系统中各种资源的访问权限。
|
|
128
|
-
|
|
129
|
-
### 核心属性
|
|
130
|
-
|
|
131
|
-
| 属性 | 说明 | 示例 |
|
|
132
|
-
|------|------|------|
|
|
133
|
-
| **名称(name)** | 简档显示名称 | "销售经理简档" |
|
|
134
|
-
| **描述(description)** | 简档功能描述 | "适用于销售团队经理" |
|
|
135
|
-
| **类型(type)** | 系统简档或自定义 | `system` / `custom` |
|
|
136
|
-
| **创建时间** | 简档创建时间戳 | 1757993089000 |
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## 简档类型
|
|
141
|
-
|
|
142
|
-
CloudCC 支持两种简档类型:
|
|
143
|
-
|
|
144
|
-
| 类型 | 说明 | 适用场景 |
|
|
145
|
-
|------|------|----------|
|
|
146
|
-
| **系统简档** | 系统预设的简档 | 标准用户、管理员等 |
|
|
147
|
-
| **自定义简档** | 用户自定义创建的简档 | 特定业务角色 |
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## 一、查询简档
|
|
152
|
-
|
|
153
|
-
### 1.1 查询简档列表
|
|
154
|
-
|
|
155
|
-
**接口**: `POST /api/profile/listAll`
|
|
156
|
-
|
|
157
|
-
**请求参数**:
|
|
158
|
-
|
|
159
|
-
| 参数名 | 类型 | 必填 | 说明 |
|
|
160
|
-
|--------|------|------|------|
|
|
161
|
-
| keyword | string | 否 | 搜索关键词 |
|
|
162
|
-
| type | string | 否 | 类型过滤:system/custom |
|
|
163
|
-
|
|
164
|
-
**返回数据**:
|
|
165
|
-
|
|
166
|
-
```javascript
|
|
167
|
-
{
|
|
168
|
-
"result": true,
|
|
169
|
-
"data": {
|
|
170
|
-
"list": [
|
|
171
|
-
{
|
|
172
|
-
"id": "aaa202672F656B7VfEjL",
|
|
173
|
-
"name": "系统管理员",
|
|
174
|
-
"description": "系统管理员简档",
|
|
175
|
-
"type": "system"
|
|
176
|
-
}
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
## 二、创建简档
|
|
185
|
-
|
|
186
|
-
### 2.1 获取可复制的简档列表
|
|
187
|
-
|
|
188
|
-
**接口**: `POST /api/profile/copyProfile`
|
|
189
|
-
|
|
190
|
-
**请求参数**:无
|
|
191
|
-
|
|
192
|
-
**返回数据**:
|
|
193
|
-
|
|
194
|
-
```javascript
|
|
195
|
-
{
|
|
196
|
-
"result": true,
|
|
197
|
-
"data": {
|
|
198
|
-
"profileList": [
|
|
199
|
-
{
|
|
200
|
-
"id": "aaa000001",
|
|
201
|
-
"name": "系统管理员",
|
|
202
|
-
"description": "系统管理员简档"
|
|
203
|
-
}
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### 2.2 创建新简档
|
|
210
|
-
|
|
211
|
-
**接口**: `POST /api/profile/newProfile`
|
|
212
|
-
|
|
213
|
-
**请求参数**:
|
|
214
|
-
|
|
215
|
-
| 参数名 | 类型 | 必填 | 说明 |
|
|
216
|
-
|--------|------|------|------|
|
|
217
|
-
| newProfileName | string | 是 | 新简档名称 |
|
|
218
|
-
| type | string | 否 | 简档类型(传空字符串) |
|
|
219
|
-
| copyFromId | string | 是 | 复制来源简档 ID(来自 copyProfile 接口) |
|
|
220
|
-
|
|
221
|
-
**请求示例**:
|
|
222
|
-
|
|
223
|
-
```json
|
|
224
|
-
{
|
|
225
|
-
"newProfileName": "系统管理员_test",
|
|
226
|
-
"type": "",
|
|
227
|
-
"copyFromId": "aaa000001"
|
|
228
|
-
}
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
## 三、删除简档
|
|
234
|
-
|
|
235
|
-
### 3.1 删除前检查
|
|
236
|
-
|
|
237
|
-
- [ ] 是否有用户正在使用该简档
|
|
238
|
-
- [ ] 是否是系统预设简档(系统简档不可删除)
|
|
239
|
-
- [ ] 级联影响确认
|
|
240
|
-
|
|
241
|
-
### 3.2 删除流程
|
|
242
|
-
|
|
243
|
-
**接口**: `POST /api/profile/delProfile`
|
|
244
|
-
|
|
245
|
-
**请求参数**:
|
|
246
|
-
|
|
247
|
-
| 参数名 | 类型 | 必填 | 说明 |
|
|
248
|
-
|--------|------|------|------|
|
|
249
|
-
| id | string | 是 | 简档 ID |
|
|
250
|
-
|
|
251
|
-
**请求示例**:
|
|
252
|
-
|
|
253
|
-
```json
|
|
254
|
-
{
|
|
255
|
-
"id": "aaa202672F656B7VfEjL"
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## 四、简档数据结构
|
|
262
|
-
|
|
263
|
-
```javascript
|
|
264
|
-
// 查询接口返回的简档数据
|
|
265
|
-
{
|
|
266
|
-
id: "aaa202672F656B7VfEjL",
|
|
267
|
-
name: "销售经理简档",
|
|
268
|
-
description: "销售团队经理级别的权限配置",
|
|
269
|
-
type: "custom"
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// copyProfile 接口返回的简档数据
|
|
273
|
-
{
|
|
274
|
-
id: "aaa000001",
|
|
275
|
-
name: "系统管理员",
|
|
276
|
-
description: "系统管理员简档"
|
|
277
|
-
}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## 五、最佳实践
|
|
283
|
-
|
|
284
|
-
### 命名规范
|
|
285
|
-
|
|
286
|
-
| 项目 | 规范 | 示例 |
|
|
287
|
-
|------|------|------|
|
|
288
|
-
| 简档名称 | 角色 + 简档 | `销售经理简档`、`客服代表简档` |
|
|
289
|
-
| 描述 | 说明适用场景 | `适用于销售团队经理级别` |
|
|
290
|
-
|
|
291
|
-
### 权限设计
|
|
292
|
-
|
|
293
|
-
- **按需分配**:只为需要的角色分配权限
|
|
294
|
-
- **最小权限原则**:用户只拥有完成工作所需的最小权限
|
|
295
|
-
- **定期审查**:定期检查简档权限分配是否合理
|
|
296
|
-
|
|
297
|
-
### 创建简档注意事项
|
|
298
|
-
|
|
299
|
-
- 创建简档时会自动复制第一个可用简档的权限配置
|
|
300
|
-
- 如需特定权限配置,创建后需在 CloudCC 控制台手动调整
|
|
301
|
-
- 建议基于权限最接近的简档进行复制
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## 六、常见问题
|
|
306
|
-
|
|
307
|
-
**Q: 简档创建后为什么不生效?**
|
|
308
|
-
|
|
309
|
-
A: 检查以下几点:
|
|
310
|
-
1. 简档是否已分配给相关用户
|
|
311
|
-
2. 用户是否已重新登录
|
|
312
|
-
3. 缓存是否已刷新
|
|
313
|
-
|
|
314
|
-
**Q: 可以修改系统简档吗?**
|
|
315
|
-
|
|
316
|
-
A: 系统简档不可修改,建议克隆系统简档创建自定义简档进行修改。
|
|
317
|
-
|
|
318
|
-
**Q: 删除简档会影响用户吗?**
|
|
319
|
-
|
|
320
|
-
A: 会。删除简档前需要确保没有用户正在使用该简档,否则这些用户将失去权限配置。
|
|
321
|
-
|
|
322
|
-
**Q: 如何查看简档的完整配置信息?**
|
|
323
|
-
|
|
324
|
-
A: 目前 CLI 只支持列表查询,详细配置需在 CloudCC 控制台查看。
|
|
325
|
-
|
|
326
|
-
**Q: 创建简档时如何选择复制来源?**
|
|
327
|
-
|
|
328
|
-
A: 当前实现自动选择第一个可用简档作为复制来源。如需特定来源,建议先调用 `cc get profile .` 查看列表顺序。
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
*文档版本:1.1 | 最后更新:2026-03-26*
|
package/src/role/create.js
CHANGED
|
@@ -2,6 +2,7 @@ const chalk = require('chalk');
|
|
|
2
2
|
const inquirer = require('inquirer');
|
|
3
3
|
const { postClass } = require("../../utils/http");
|
|
4
4
|
const { getPackageJson } = require("../../utils/config");
|
|
5
|
+
const { id } = require('zod/locales');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 创建角色
|
|
@@ -49,7 +50,7 @@ async function create(argvs) {
|
|
|
49
50
|
console.error(chalk.blue('Step 1: 获取直属上司列表...'));
|
|
50
51
|
const addRoleRes = await postClass(
|
|
51
52
|
config.setupSvc + "/api/role/addRole",
|
|
52
|
-
{ id:
|
|
53
|
+
{ id: config.orgId },
|
|
53
54
|
config.accessToken
|
|
54
55
|
);
|
|
55
56
|
|
package/src/role/delete.js
CHANGED