feat: simplify account create/edit and add row copy
All checks were successful
技能自动化发布 / release (push) Successful in 8s
All checks were successful
技能自动化发布 / release (push) Successful in 8s
Data-management add/edit now use short forms with enums; copy clones a platform account into a new empty profile. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,7 +20,64 @@
|
||||
"platform_key": {
|
||||
"type": "string",
|
||||
"title": "平台",
|
||||
"description": "关联平台信息表;宿主按列 lookup 渲染下拉"
|
||||
"display_type": "lookup",
|
||||
"lookup": {
|
||||
"ref_table": "platforms",
|
||||
"value_column": "platform_key",
|
||||
"label_column": "display_name",
|
||||
"filter_column": "enabled",
|
||||
"filter_value": 1
|
||||
}
|
||||
},
|
||||
"account_label": {
|
||||
"type": "string",
|
||||
"title": "账号名称"
|
||||
},
|
||||
"login_id": {
|
||||
"type": "string",
|
||||
"title": "登录账号"
|
||||
}
|
||||
}
|
||||
},
|
||||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||||
"entrypoint": {
|
||||
"type": "cli",
|
||||
"command": "account",
|
||||
"args": [
|
||||
"add-web",
|
||||
"--platform", "{{platform_key}}",
|
||||
"--label", "{{account_label}}",
|
||||
"--login-id", "{{login_id}}"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "account-update",
|
||||
"label": "编辑账号",
|
||||
"description": "只改名称、登录账号、标识类型、入口链接和启用状态。",
|
||||
"replaces": "update",
|
||||
"placements": [],
|
||||
"executionProfile": "sync",
|
||||
"interaction": "form",
|
||||
"bind": {
|
||||
"tables": ["accounts"],
|
||||
"inputMapping": {
|
||||
"accountId": "$row.$pk",
|
||||
"account_label": "$row.account_label",
|
||||
"login_id": "$row.login_id",
|
||||
"login_id_type": "$row.login_id_type",
|
||||
"url": "$row.url",
|
||||
"status": "$row.status"
|
||||
}
|
||||
},
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"required": ["accountId", "account_label", "status"],
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "number",
|
||||
"title": "编号",
|
||||
"readOnly": true
|
||||
},
|
||||
"account_label": {
|
||||
"type": "string",
|
||||
@@ -33,49 +90,64 @@
|
||||
"login_id_type": {
|
||||
"type": "string",
|
||||
"title": "登录标识类型",
|
||||
"default": "unknown"
|
||||
},
|
||||
"tenant_id": {
|
||||
"type": "string",
|
||||
"title": "租户编号"
|
||||
},
|
||||
"environment": {
|
||||
"type": "string",
|
||||
"title": "环境",
|
||||
"default": "production"
|
||||
},
|
||||
"role": {
|
||||
"type": "string",
|
||||
"title": "角色",
|
||||
"default": "default"
|
||||
},
|
||||
"provider_code": {
|
||||
"type": "string",
|
||||
"title": "供应商代码"
|
||||
"enum": ["unknown", "phone", "email", "username", "customer_code", "api_account"]
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"title": "入口链接"
|
||||
"title": "入口链接",
|
||||
"display_type": "url"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"title": "状态",
|
||||
"enum": ["active", "disabled", "needs_review"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||||
"entrypoint": {
|
||||
"type": "cli",
|
||||
"command": "account",
|
||||
"args": [
|
||||
"add-web",
|
||||
"--platform", "{{platform_key}}",
|
||||
"update",
|
||||
"--id", "{{accountId}}",
|
||||
"--label", "{{account_label}}",
|
||||
"--login-id", "{{login_id}}",
|
||||
"--login-id-type", "{{login_id_type}}",
|
||||
"--tenant-id", "{{tenant_id}}",
|
||||
"--environment", "{{environment}}",
|
||||
"--role", "{{role}}",
|
||||
"--provider-code", "{{provider_code}}",
|
||||
"--url", "{{url}}"
|
||||
"--url", "{{url}}",
|
||||
"--status", "{{status}}"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "account-copy",
|
||||
"label": "复制",
|
||||
"description": "复制为同平台新账号:新空 Profile,登录账号留空,名称自动加「副本」。",
|
||||
"placements": ["row"],
|
||||
"executionProfile": "sync",
|
||||
"interaction": "direct",
|
||||
"bind": {
|
||||
"tables": ["accounts"],
|
||||
"inputMapping": { "accountId": "$row.$pk" }
|
||||
},
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"required": ["accountId"],
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "number",
|
||||
"title": "账号 ID",
|
||||
"readOnly": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }],
|
||||
"entrypoint": {
|
||||
"type": "cli",
|
||||
"command": "account",
|
||||
"args": ["copy", "{{accountId}}"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "reveal-profile",
|
||||
"label": "打开目录",
|
||||
|
||||
Reference in New Issue
Block a user