@qingflow-tech/qingflow-cli 1.1.2 → 1.1.34
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/README.md +2 -2
- package/docs/local-agent-install.md +10 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/skills/qingflow-cli/SKILL.md +61 -47
- package/skills/qingflow-cli/manifest.yaml +1 -1
- package/skills/qingflow-cli/reference/00-INDEX.md +35 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_APP_DELIVERY_WORKFLOW.md +21 -477
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md +44 -290
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_SCHEMA_APPLY_FIELD_TYPES_AND_SCENARIOS.md +11 -102
- package/skills/qingflow-cli/reference/builder/10-build-single-app.md +57 -0
- package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +84 -0
- package/skills/qingflow-cli/reference/builder/30-schema-fields.md +317 -0
- package/skills/qingflow-cli/reference/builder/40-layout.md +70 -0
- package/skills/qingflow-cli/reference/builder/50-views.md +540 -0
- package/skills/qingflow-cli/reference/builder/60-charts.md +328 -0
- package/skills/qingflow-cli/reference/builder/70-portal.md +372 -0
- package/skills/qingflow-cli/reference/builder/80-buttons-associated-resources.md +148 -0
- package/skills/qingflow-cli/reference/builder/90-workflow.md +35 -0
- package/skills/qingflow-cli/reference/builder/99-publish-verify.md +64 -0
- package/skills/qingflow-cli/reference/builder/README.md +62 -0
- package/skills/qingflow-cli/reference/builder/code-integrations/README.md +130 -0
- package/skills/qingflow-cli/reference/builder/code-integrations/code-block.md +66 -0
- package/skills/qingflow-cli/reference/builder/code-integrations/q-linker.md +77 -0
- package/skills/qingflow-cli/reference/builder/reference/app-delivery-sop.md +508 -0
- package/skills/qingflow-cli/reference/builder/reference/match-rules.md +229 -0
- package/skills/qingflow-cli/reference/builder/reference/workspace-icons.md +89 -0
- package/skills/qingflow-cli/reference/builder/workflow/01-overview.md +48 -0
- package/skills/qingflow-cli/reference/builder/workflow/02-update-mode.md +63 -0
- package/skills/qingflow-cli/reference/builder/workflow/03-flow-patterns.md +59 -0
- package/skills/qingflow-cli/reference/builder/workflow/04-stage1-business-modeling.md +131 -0
- package/skills/qingflow-cli/reference/builder/workflow/05-stage2-members-roles.md +29 -0
- package/skills/qingflow-cli/reference/builder/workflow/06-stage3-build-spec.md +211 -0
- package/skills/qingflow-cli/reference/builder/workflow/07-stage4-validate-spec.md +36 -0
- package/skills/qingflow-cli/reference/builder/workflow/08-stage5-apply-verify.md +66 -0
- package/skills/qingflow-cli/reference/builder/workflow/09-stage6-summary.md +88 -0
- package/skills/qingflow-cli/reference/builder/workflow/10-node-config-reference.md +93 -0
- package/skills/qingflow-cli/reference/builder/workflow/11-troubleshooting.md +18 -0
- package/skills/qingflow-cli/reference/builder/workflow/README.md +88 -0
- package/skills/qingflow-cli/reference/builder/workflow/workflow-schema.json +1754 -0
- package/skills/qingflow-cli/reference/charts_upsert_dashboard_starter.example.json +81 -0
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_ADMIN_CHEATSHEET.md +94 -0
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_DATA_RETRIEVAL_WORKFLOW.md +139 -0
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_EXPLORATION_REPORT.md +84 -0
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_FIELD_DATA_TYPES.md +129 -0
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_MEMBER_CHEATSHEET.md +195 -0
- package/skills/qingflow-cli/reference/core/QINGFLOW_CLI_ONE_SHOT_CHEATSHEET.md +159 -0
- package/skills/qingflow-cli/reference/examples/README.md +17 -0
- package/skills/qingflow-cli/reference/examples/associated/associated_resources_semantic_full.example.json +50 -0
- package/skills/qingflow-cli/reference/examples/buttons/custom_buttons_advanced.example.json +56 -0
- package/skills/qingflow-cli/reference/examples/charts/charts_remove.example.json +1 -0
- package/skills/qingflow-cli/reference/examples/charts/charts_reorder.example.json +1 -0
- package/skills/qingflow-cli/reference/examples/charts/charts_upsert_bar.example.json +8 -0
- package/skills/qingflow-cli/reference/examples/charts/charts_upsert_dashboard_starter.example.json +118 -0
- package/skills/qingflow-cli/reference/examples/charts/charts_upsert_minimal.example.json +13 -0
- package/skills/qingflow-cli/reference/examples/layout/layout_sections_full.example.json +22 -0
- package/skills/qingflow-cli/reference/examples/portal/portal_sections_all_types.example.json +145 -0
- package/skills/qingflow-cli/reference/examples/portal/portal_sections_five_types.example.json +126 -0
- package/skills/qingflow-cli/reference/examples/portal/portal_sections_standard_workbench.example.json +178 -0
- package/skills/qingflow-cli/reference/examples/record/record_insert_all_field_types.example.json +35 -0
- package/skills/qingflow-cli/reference/examples/schema/_batch_schema_complex.json +18 -0
- package/skills/qingflow-cli/reference/examples/schema/_batch_schema_scalar.json +17 -0
- package/skills/qingflow-cli/reference/examples/schema/schema_add_fields_minimal.example.json +7 -0
- package/skills/qingflow-cli/reference/examples/schema/schema_apply_add_fields_all_types.json +78 -0
- package/skills/qingflow-cli/reference/examples/schema/schema_multi_app_form_relation_layout.example.json +166 -0
- package/skills/qingflow-cli/reference/examples/schema/schema_single_app_form_standard.example.json +95 -0
- package/skills/qingflow-cli/reference/examples/views/views_batch_full.example.json +159 -0
- package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json +42 -0
- package/skills/qingflow-cli/reference/portal_sections_all_types.example.json +18 -4
- package/skills/qingflow-cli/reference/portal_sections_five_types.example.json +3 -3
- package/skills/qingflow-cli/reference/portal_sections_standard_workbench.example.json +57 -7
- package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_CREATE_WORKFLOW.md +22 -0
- package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_DELETE_WORKFLOW.md +31 -0
- package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_IMPORT_WORKFLOW.md +176 -0
- package/skills/qingflow-cli/reference/record/QINGFLOW_CLI_RECORD_UPDATE_WORKFLOW.md +167 -0
- package/skills/qingflow-cli/reference/record/analysis/README.md +130 -0
- package/skills/qingflow-cli/reference/record/analysis/analysis-gotchas.md +91 -0
- package/skills/qingflow-cli/reference/record/analysis/analysis-patterns.md +112 -0
- package/skills/qingflow-cli/reference/record/analysis/business-context.md +74 -0
- package/skills/qingflow-cli/reference/record/analysis/confidence-reporting.md +69 -0
- package/skills/qingflow-cli/reference/record/analysis/data-access-playbook.md +106 -0
- package/skills/qingflow-cli/reference/record/analysis/pandas-recipes.md +172 -0
- package/skills/qingflow-cli/reference/record/analysis/report-format.md +76 -0
- package/skills/qingflow-cli/reference/record/insert/README.md +125 -0
- package/skills/qingflow-cli/reference/schema_apply_add_fields_all_types.json +1 -1
- package/skills/qingflow-cli/reference/task/QINGFLOW_CLI_TASK_CONTEXT_WORKFLOW.md +153 -0
- package/skills/qingflow-cli/reference/task/ops/README.md +134 -0
- package/skills/qingflow-cli/reference/task/ops/environments.md +43 -0
- package/skills/qingflow-cli/reference/task/ops/workflow-usage.md +29 -0
- package/skills/qingflow-cli/reference/views_upsert_table_minimal.example.json +42 -7
- package/skills/qingflow-cli/scripts/validate_system_build_summary.py +124 -0
- package/skills/qingflow-cli/scripts/workflow/diff_flow_spec.py +275 -0
- package/skills/qingflow-cli/scripts/workflow/validate_flow_spec.py +627 -0
- package/src/qingflow_mcp/builder_facade/models.py +413 -119
- package/src/qingflow_mcp/builder_facade/service.py +4238 -666
- package/src/qingflow_mcp/cli/commands/builder.py +232 -75
- package/src/qingflow_mcp/cli/main.py +34 -0
- package/src/qingflow_mcp/public_surface.py +10 -0
- package/src/qingflow_mcp/server_app_builder.py +62 -34
- package/src/qingflow_mcp/solution/compiler/workflow_compiler.py +173 -0
- package/src/qingflow_mcp/solution/executor.py +2 -0
- package/src/qingflow_mcp/tools/ai_builder_tools.py +2649 -457
- package/src/qingflow_mcp/tools/record_tools.py +23 -11
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"package_id": 123456,
|
|
3
|
+
"apps": [
|
|
4
|
+
{
|
|
5
|
+
"client_key": "customer",
|
|
6
|
+
"app_name": "客户",
|
|
7
|
+
"icon": "view-grid",
|
|
8
|
+
"color": "blue",
|
|
9
|
+
"form": [
|
|
10
|
+
{
|
|
11
|
+
"section": "客户基础信息",
|
|
12
|
+
"rows": [
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
"name": "客户编号",
|
|
16
|
+
"type": "text",
|
|
17
|
+
"data_title": true,
|
|
18
|
+
"required": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "客户名称",
|
|
22
|
+
"type": "text",
|
|
23
|
+
"required": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "客户状态",
|
|
27
|
+
"type": "select",
|
|
28
|
+
"options": ["潜在", "合作中", "暂停", "终止"]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
{
|
|
33
|
+
"name": "客户负责人",
|
|
34
|
+
"type": "member"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "所属部门",
|
|
38
|
+
"type": "department"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"client_key": "order",
|
|
47
|
+
"app_name": "销售订单",
|
|
48
|
+
"icon": "inbox",
|
|
49
|
+
"color": "emerald",
|
|
50
|
+
"form": [
|
|
51
|
+
{
|
|
52
|
+
"section": "订单基础信息",
|
|
53
|
+
"rows": [
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
"name": "订单编号",
|
|
57
|
+
"type": "text",
|
|
58
|
+
"data_title": true,
|
|
59
|
+
"required": true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "关联客户",
|
|
63
|
+
"type": "relation",
|
|
64
|
+
"target_app_ref": "customer",
|
|
65
|
+
"relation_mode": "single",
|
|
66
|
+
"display_field": {
|
|
67
|
+
"name": "客户编号"
|
|
68
|
+
},
|
|
69
|
+
"visible_fields": [
|
|
70
|
+
{
|
|
71
|
+
"name": "客户名称"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "客户状态"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "订单状态",
|
|
80
|
+
"type": "select",
|
|
81
|
+
"options": ["草稿", "执行中", "已完成", "已取消"]
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
{
|
|
86
|
+
"name": "订单金额",
|
|
87
|
+
"type": "amount"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "签约日期",
|
|
91
|
+
"type": "date"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"client_key": "payment",
|
|
100
|
+
"app_name": "回款记录",
|
|
101
|
+
"icon": "share",
|
|
102
|
+
"color": "azure",
|
|
103
|
+
"form": [
|
|
104
|
+
{
|
|
105
|
+
"section": "回款基础信息",
|
|
106
|
+
"rows": [
|
|
107
|
+
[
|
|
108
|
+
{
|
|
109
|
+
"name": "回款编号",
|
|
110
|
+
"type": "text",
|
|
111
|
+
"data_title": true,
|
|
112
|
+
"required": true
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "关联订单",
|
|
116
|
+
"type": "relation",
|
|
117
|
+
"target_app_ref": "order",
|
|
118
|
+
"relation_mode": "single",
|
|
119
|
+
"display_field": {
|
|
120
|
+
"name": "订单编号"
|
|
121
|
+
},
|
|
122
|
+
"visible_fields": [
|
|
123
|
+
{
|
|
124
|
+
"name": "订单金额"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "订单状态"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "关联客户",
|
|
133
|
+
"type": "relation",
|
|
134
|
+
"target_app_ref": "customer",
|
|
135
|
+
"relation_mode": "single",
|
|
136
|
+
"display_field": {
|
|
137
|
+
"name": "客户编号"
|
|
138
|
+
},
|
|
139
|
+
"visible_fields": [
|
|
140
|
+
{
|
|
141
|
+
"name": "客户名称"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
[
|
|
147
|
+
{
|
|
148
|
+
"name": "回款金额",
|
|
149
|
+
"type": "amount"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "回款日期",
|
|
153
|
+
"type": "date"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "回款状态",
|
|
157
|
+
"type": "select",
|
|
158
|
+
"options": ["待确认", "已确认", "异常"]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
package/skills/qingflow-cli/reference/examples/schema/schema_single_app_form_standard.example.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"section": "基础信息",
|
|
4
|
+
"rows": [
|
|
5
|
+
[
|
|
6
|
+
{
|
|
7
|
+
"name": "工单编号",
|
|
8
|
+
"type": "text",
|
|
9
|
+
"data_title": true,
|
|
10
|
+
"required": true,
|
|
11
|
+
"description": "唯一业务编号"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "工单名称",
|
|
15
|
+
"type": "text",
|
|
16
|
+
"required": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "工单状态",
|
|
20
|
+
"type": "select",
|
|
21
|
+
"required": true,
|
|
22
|
+
"options": ["待处理", "处理中", "已完成", "已关闭"]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
"name": "负责人",
|
|
28
|
+
"type": "member"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "负责部门",
|
|
32
|
+
"type": "department",
|
|
33
|
+
"department_scope": {"mode": "all"}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "计划完成日期",
|
|
37
|
+
"type": "date"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"section": "业务信息",
|
|
44
|
+
"rows": [
|
|
45
|
+
[
|
|
46
|
+
{
|
|
47
|
+
"name": "计划数量",
|
|
48
|
+
"type": "number"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "预算金额",
|
|
52
|
+
"type": "amount"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "是否加急",
|
|
56
|
+
"type": "boolean"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
{
|
|
61
|
+
"name": "业务标签",
|
|
62
|
+
"type": "multi_select",
|
|
63
|
+
"options": ["重点", "风险", "跨部门", "需复核"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "附件资料",
|
|
67
|
+
"type": "attachment",
|
|
68
|
+
"data_cover": true
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
"name": "处理说明",
|
|
74
|
+
"type": "multiline"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"section": "明细信息",
|
|
81
|
+
"rows": [
|
|
82
|
+
[
|
|
83
|
+
{
|
|
84
|
+
"name": "处理明细",
|
|
85
|
+
"type": "subtable",
|
|
86
|
+
"subfields": [
|
|
87
|
+
{"name": "明细事项", "type": "text"},
|
|
88
|
+
{"name": "明细数量", "type": "number"},
|
|
89
|
+
{"name": "明细备注", "type": "multiline"}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
]
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"views": [
|
|
3
|
+
{
|
|
4
|
+
"operation": "upsert",
|
|
5
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
6
|
+
"name": "生产工单执行视图",
|
|
7
|
+
"type": "table",
|
|
8
|
+
"columns": ["工单编号", "产品", "工单状态", "负责人", "计划完成日期"],
|
|
9
|
+
"filters": [
|
|
10
|
+
{"field_name": "工单状态", "operator": "in", "values": ["待排产", "生产中"]},
|
|
11
|
+
{"field_name": "产品", "operator": "contains", "value": "标准"},
|
|
12
|
+
{"field_name": "计划完成日期", "operator": "lte", "value": "2026-07-31"}
|
|
13
|
+
],
|
|
14
|
+
"query_conditions": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"exact": false,
|
|
17
|
+
"hide_before_query": false,
|
|
18
|
+
"rows": [["工单编号", "工单状态"], ["负责人", "计划完成日期"]]
|
|
19
|
+
},
|
|
20
|
+
"visibility": {
|
|
21
|
+
"mode": "workspace",
|
|
22
|
+
"selectors": {},
|
|
23
|
+
"external_mode": "not",
|
|
24
|
+
"external_selectors": {}
|
|
25
|
+
},
|
|
26
|
+
"action_buttons": [
|
|
27
|
+
{
|
|
28
|
+
"client_key": "create_quality_from_list",
|
|
29
|
+
"text": "行内创建质检",
|
|
30
|
+
"action": "add_data",
|
|
31
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
32
|
+
"field_mappings": [
|
|
33
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
34
|
+
],
|
|
35
|
+
"default_values": {"处理状态": "待处理"},
|
|
36
|
+
"placement": "list",
|
|
37
|
+
"primary": true,
|
|
38
|
+
"style_preset": "primary_blue",
|
|
39
|
+
"visible_when": [
|
|
40
|
+
{"field_name": "工单状态", "operator": "eq", "value": "生产中"}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"client_key": "create_quality_from_detail",
|
|
45
|
+
"text": "详情创建质检",
|
|
46
|
+
"action": "add_data",
|
|
47
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
48
|
+
"field_mappings": [
|
|
49
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
50
|
+
],
|
|
51
|
+
"default_values": {"处理状态": "待处理"},
|
|
52
|
+
"placement": "detail",
|
|
53
|
+
"style_preset": "neutral_outline"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"client_key": "open_work_order_sop",
|
|
57
|
+
"text": "打开SOP",
|
|
58
|
+
"action": "link",
|
|
59
|
+
"url": "https://example.com/sop/work-order",
|
|
60
|
+
"placement": "header",
|
|
61
|
+
"style_preset": "text_blue"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"operation": "upsert",
|
|
67
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
68
|
+
"name": "工单状态看板",
|
|
69
|
+
"type": "board",
|
|
70
|
+
"columns": ["工单编号", "产品", "负责人", "计划完成日期"],
|
|
71
|
+
"group_by": "工单状态",
|
|
72
|
+
"filters": [
|
|
73
|
+
{"field_name": "工单状态", "operator": "not_empty"},
|
|
74
|
+
{"field_name": "关闭日期", "operator": "is_empty"}
|
|
75
|
+
],
|
|
76
|
+
"query_conditions": {
|
|
77
|
+
"enabled": true,
|
|
78
|
+
"rows": [["工单编号", "负责人"], ["计划完成日期"]]
|
|
79
|
+
},
|
|
80
|
+
"action_buttons": [
|
|
81
|
+
{
|
|
82
|
+
"text": "看板行内创建质检",
|
|
83
|
+
"action": "add_data",
|
|
84
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
85
|
+
"field_mappings": [
|
|
86
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
87
|
+
],
|
|
88
|
+
"placement": "list",
|
|
89
|
+
"visible_when": [
|
|
90
|
+
{"field_name": "工单状态", "operator": "eq", "value": "已完工"}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"text": "看板详情创建质检",
|
|
95
|
+
"action": "add_data",
|
|
96
|
+
"target_app_key": "QUALITY_APP_KEY",
|
|
97
|
+
"field_mappings": [
|
|
98
|
+
{"source_field": "数据ID", "target_field": "关联工单"}
|
|
99
|
+
],
|
|
100
|
+
"placement": "detail"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"operation": "upsert",
|
|
106
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
107
|
+
"name": "工单计划甘特图",
|
|
108
|
+
"type": "gantt",
|
|
109
|
+
"columns": ["工单编号", "产品", "工单状态", "计划开始日期", "计划完成日期"],
|
|
110
|
+
"start_field": "计划开始日期",
|
|
111
|
+
"end_field": "计划完成日期",
|
|
112
|
+
"title_field": "工单编号",
|
|
113
|
+
"filters": [
|
|
114
|
+
{"field_name": "计划开始日期", "operator": "gte", "value": "2026-07-01"}
|
|
115
|
+
],
|
|
116
|
+
"query_conditions": {
|
|
117
|
+
"enabled": true,
|
|
118
|
+
"rows": [["工单编号", "工单状态"], ["计划开始日期", "计划完成日期"]]
|
|
119
|
+
},
|
|
120
|
+
"action_buttons": [
|
|
121
|
+
{
|
|
122
|
+
"text": "详情查看排产说明",
|
|
123
|
+
"action": "link",
|
|
124
|
+
"url": "https://example.com/sop/schedule",
|
|
125
|
+
"placement": "detail"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"operation": "patch",
|
|
131
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
132
|
+
"view_key": "RAW_VIEW_KEY_TO_PATCH",
|
|
133
|
+
"set": {
|
|
134
|
+
"columns": ["工单编号", "工单状态", "负责人"],
|
|
135
|
+
"filters": [
|
|
136
|
+
{"field_name": "工单状态", "operator": "neq", "value": "已关闭"}
|
|
137
|
+
],
|
|
138
|
+
"query_conditions": {
|
|
139
|
+
"enabled": true,
|
|
140
|
+
"rows": [["工单编号", "工单状态"], ["负责人"]]
|
|
141
|
+
},
|
|
142
|
+
"action_buttons": [
|
|
143
|
+
{
|
|
144
|
+
"text": "补充详情按钮",
|
|
145
|
+
"action": "link",
|
|
146
|
+
"url": "https://example.com/detail-help",
|
|
147
|
+
"placement": "detail"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"action_buttons_mode": "merge"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"operation": "remove",
|
|
155
|
+
"app_key": "WORK_ORDER_APP_KEY",
|
|
156
|
+
"view_key": "RAW_VIEW_KEY_TO_REMOVE"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"views": [
|
|
3
|
+
{
|
|
4
|
+
"operation": "upsert",
|
|
5
|
+
"app_key": "APP_KEY",
|
|
6
|
+
"name": "示例业务操作视图_CLI模板",
|
|
7
|
+
"type": "table",
|
|
8
|
+
"columns": ["主记录编号", "主记录名称", "状态", "负责人"],
|
|
9
|
+
"filters": [
|
|
10
|
+
{"field_name": "状态", "operator": "neq", "value": "已关闭"}
|
|
11
|
+
],
|
|
12
|
+
"query_conditions": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"exact": false,
|
|
15
|
+
"hide_before_query": false,
|
|
16
|
+
"rows": [["主记录编号", "主记录名称"], ["状态", "负责人"]]
|
|
17
|
+
},
|
|
18
|
+
"action_buttons": [
|
|
19
|
+
{
|
|
20
|
+
"text": "行内创建子记录",
|
|
21
|
+
"action": "add_data",
|
|
22
|
+
"target_app_key": "TARGET_APP_KEY",
|
|
23
|
+
"field_mappings": [
|
|
24
|
+
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
25
|
+
],
|
|
26
|
+
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
27
|
+
"placement": "list"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"text": "详情创建子记录",
|
|
31
|
+
"action": "add_data",
|
|
32
|
+
"target_app_key": "TARGET_APP_KEY",
|
|
33
|
+
"field_mappings": [
|
|
34
|
+
{"source_field": "数据ID", "target_field": "关联主记录"}
|
|
35
|
+
],
|
|
36
|
+
"default_values": {"目标状态字段": "REPLACE_WITH_TARGET_OPTION_LABEL"},
|
|
37
|
+
"placement": "detail"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -44,7 +44,21 @@
|
|
|
44
44
|
"rows": 4
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
"config": {
|
|
47
|
+
"config": {
|
|
48
|
+
"gridTitle": "九宫格",
|
|
49
|
+
"beingShowTitle": true,
|
|
50
|
+
"items": [
|
|
51
|
+
{
|
|
52
|
+
"type": 1,
|
|
53
|
+
"jumpMode": 1,
|
|
54
|
+
"linkAppKey": "YOUR_APP_KEY",
|
|
55
|
+
"linkFormType": 1,
|
|
56
|
+
"title": "应用入口",
|
|
57
|
+
"customTitle": "应用入口",
|
|
58
|
+
"beingCustomTitle": false
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
48
62
|
},
|
|
49
63
|
{
|
|
50
64
|
"title": "说明文字块",
|
|
@@ -72,7 +86,7 @@
|
|
|
72
86
|
"pc": {
|
|
73
87
|
"x": 0,
|
|
74
88
|
"y": 8,
|
|
75
|
-
"cols":
|
|
89
|
+
"cols": 24,
|
|
76
90
|
"rows": 2
|
|
77
91
|
},
|
|
78
92
|
"mobile": {
|
|
@@ -113,7 +127,7 @@
|
|
|
113
127
|
"pc": {
|
|
114
128
|
"x": 0,
|
|
115
129
|
"y": 18,
|
|
116
|
-
"cols":
|
|
130
|
+
"cols": 24,
|
|
117
131
|
"rows": 6
|
|
118
132
|
},
|
|
119
133
|
"mobile": {
|
|
@@ -123,7 +137,7 @@
|
|
|
123
137
|
"rows": 6
|
|
124
138
|
}
|
|
125
139
|
},
|
|
126
|
-
"
|
|
140
|
+
"chart": {
|
|
127
141
|
"app_key": "YOUR_APP_KEY",
|
|
128
142
|
"chart_id": "YOUR_CHART_ID"
|
|
129
143
|
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"pc": {
|
|
68
68
|
"x": 0,
|
|
69
69
|
"y": 6,
|
|
70
|
-
"cols":
|
|
70
|
+
"cols": 24,
|
|
71
71
|
"rows": 6
|
|
72
72
|
},
|
|
73
73
|
"mobile": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"rows": 6
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
"
|
|
80
|
+
"chart": {
|
|
81
81
|
"app_key": "ead8ims5i401",
|
|
82
82
|
"chart_id": "mcp_fb104267c5c249ca"
|
|
83
83
|
}
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"x": 12,
|
|
113
113
|
"y": 12,
|
|
114
114
|
"cols": 12,
|
|
115
|
-
"rows":
|
|
115
|
+
"rows": 8
|
|
116
116
|
},
|
|
117
117
|
"mobile": {
|
|
118
118
|
"x": 0,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"pc": {"x": 0, "y": 4, "cols": 6, "rows": 5},
|
|
49
49
|
"mobile": {"x": 0, "y": 4, "cols": 6, "rows": 5}
|
|
50
50
|
},
|
|
51
|
-
"
|
|
51
|
+
"chart": {"app_key": "APP_KEY_DEVICE", "name": "设备总数", "chart_type": "target", "metric": "count(*)"}
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"title": "正常设备",
|
|
@@ -58,7 +58,13 @@
|
|
|
58
58
|
"pc": {"x": 6, "y": 4, "cols": 6, "rows": 5},
|
|
59
59
|
"mobile": {"x": 0, "y": 9, "cols": 6, "rows": 5}
|
|
60
60
|
},
|
|
61
|
-
"
|
|
61
|
+
"chart": {
|
|
62
|
+
"app_key": "APP_KEY_DEVICE",
|
|
63
|
+
"name": "正常设备",
|
|
64
|
+
"chart_type": "target",
|
|
65
|
+
"metric": "count(*)",
|
|
66
|
+
"filters": [{"field_name": "使用状态", "operator": "eq", "value": "正常"}]
|
|
67
|
+
}
|
|
62
68
|
},
|
|
63
69
|
{
|
|
64
70
|
"title": "维修中设备",
|
|
@@ -68,7 +74,13 @@
|
|
|
68
74
|
"pc": {"x": 12, "y": 4, "cols": 6, "rows": 5},
|
|
69
75
|
"mobile": {"x": 0, "y": 14, "cols": 6, "rows": 5}
|
|
70
76
|
},
|
|
71
|
-
"
|
|
77
|
+
"chart": {
|
|
78
|
+
"app_key": "APP_KEY_DEVICE",
|
|
79
|
+
"name": "维修中设备",
|
|
80
|
+
"chart_type": "target",
|
|
81
|
+
"metric": "count(*)",
|
|
82
|
+
"filters": [{"field_name": "使用状态", "operator": "eq", "value": "维修中"}]
|
|
83
|
+
}
|
|
72
84
|
},
|
|
73
85
|
{
|
|
74
86
|
"title": "本月报修",
|
|
@@ -78,7 +90,16 @@
|
|
|
78
90
|
"pc": {"x": 18, "y": 4, "cols": 6, "rows": 5},
|
|
79
91
|
"mobile": {"x": 0, "y": 19, "cols": 6, "rows": 5}
|
|
80
92
|
},
|
|
81
|
-
"
|
|
93
|
+
"chart": {
|
|
94
|
+
"app_key": "APP_KEY_REPAIR",
|
|
95
|
+
"name": "本月报修",
|
|
96
|
+
"chart_type": "target",
|
|
97
|
+
"metric": "count(*)",
|
|
98
|
+
"filters": [
|
|
99
|
+
{"field_name": "报修日期", "operator": "gte", "value": "2026-07-01"},
|
|
100
|
+
{"field_name": "报修日期", "operator": "lte", "value": "2026-07-31"}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
82
103
|
},
|
|
83
104
|
{
|
|
84
105
|
"title": "设备状态分布",
|
|
@@ -87,7 +108,16 @@
|
|
|
87
108
|
"pc": {"x": 0, "y": 9, "cols": 8, "rows": 7},
|
|
88
109
|
"mobile": {"x": 0, "y": 24, "cols": 6, "rows": 7}
|
|
89
110
|
},
|
|
90
|
-
"
|
|
111
|
+
"chart": {
|
|
112
|
+
"app_key": "APP_KEY_DEVICE",
|
|
113
|
+
"name": "设备状态分布",
|
|
114
|
+
"chart_type": "ring",
|
|
115
|
+
"metric": "count(*)",
|
|
116
|
+
"group_by": ["使用状态"],
|
|
117
|
+
"filters": [
|
|
118
|
+
{"field_name": "使用状态", "operator": "not_empty"}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
91
121
|
},
|
|
92
122
|
{
|
|
93
123
|
"title": "故障类型分布",
|
|
@@ -96,7 +126,17 @@
|
|
|
96
126
|
"pc": {"x": 8, "y": 9, "cols": 8, "rows": 7},
|
|
97
127
|
"mobile": {"x": 0, "y": 31, "cols": 6, "rows": 7}
|
|
98
128
|
},
|
|
99
|
-
"
|
|
129
|
+
"chart": {
|
|
130
|
+
"app_key": "APP_KEY_REPAIR",
|
|
131
|
+
"name": "故障类型分布",
|
|
132
|
+
"chart_type": "columnar",
|
|
133
|
+
"metric": "count(*)",
|
|
134
|
+
"group_by": ["故障类型"],
|
|
135
|
+
"filters": [
|
|
136
|
+
{"field_name": "故障类型", "operator": "in", "values": ["机械故障", "电气故障", "软件故障"]},
|
|
137
|
+
{"field_name": "处理状态", "operator": "neq", "value": "已作废"}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
100
140
|
},
|
|
101
141
|
{
|
|
102
142
|
"title": "维修完成趋势",
|
|
@@ -105,7 +145,17 @@
|
|
|
105
145
|
"pc": {"x": 16, "y": 9, "cols": 8, "rows": 7},
|
|
106
146
|
"mobile": {"x": 0, "y": 38, "cols": 6, "rows": 7}
|
|
107
147
|
},
|
|
108
|
-
"
|
|
148
|
+
"chart": {
|
|
149
|
+
"app_key": "APP_KEY_REPAIR",
|
|
150
|
+
"name": "维修完成趋势",
|
|
151
|
+
"chart_type": "columnar",
|
|
152
|
+
"metric": "count(*)",
|
|
153
|
+
"group_by": ["完成日期"],
|
|
154
|
+
"filters": [
|
|
155
|
+
{"field_name": "维修说明", "operator": "contains", "value": "完成"},
|
|
156
|
+
{"field_name": "完成日期", "operator": "not_empty"}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
109
159
|
},
|
|
110
160
|
{
|
|
111
161
|
"title": "异常设备",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Qingflow CLI:创建记录 SOP(申请节点)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
**创建记录详细规则见**:[record/insert/README.md](./insert/README.md)。
|
|
6
|
+
|
|
7
|
+
CLI 对应主路径:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
qingflow --json record schema insert --app-key <APP_KEY> > tmp/qingflow_insert_schema.json
|
|
11
|
+
qingflow --json record insert --app-key <APP_KEY> --items-file tmp/records.json > tmp/qingflow_insert_result.json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
不要用 `record schema applicant` 代替 `record schema insert` 的主路径;新建记录需要 insert-ready schema 里的 `required_fields`、`optional_fields`、`payload_template`、`format_hint`、`expected_format`、`example_value` 和字段级 `options`。
|
|
15
|
+
|
|
16
|
+
成员、部门、关联记录、选项、附件等特殊字段按 [record/insert/README.md](./insert/README.md) 写:先读 insert schema;部门/成员不能自造候选;选项值必须来自 schema `options` 的文本或 id;关联记录批量写入优先 `record_id`,自然名称只在唯一匹配时使用;附件先上传再写返回值。
|
|
17
|
+
|
|
18
|
+
字段类型写法和一份可复制的全类型 `items` 形状见 [record/insert/README.md](./insert/README.md) 与 [record_insert_all_field_types.example.json](../examples/record/record_insert_all_field_types.example.json)。示例只表达 JSON 形状;真实写入必须替换成目标应用 schema 里的字段标题、选项文本、候选值和真实 `record_id`。
|
|
19
|
+
|
|
20
|
+
追加样例数据时也必须 schema-first:按 `required_fields` 补齐必填;按 `expected_format/example_value` 选择数值、金额、日期等格式;按 `options` 生成选项值。不要按业务常识自造“正常/已完成/高优先级”等 schema 里不存在的选项。比例、完成率、评分、百分比等字段也按 schema 示例写;即使 builder 字段类型看起来是 `number`,写入时仍以 insert schema 的 `expected_format` 为准。若返回 `INVALID_AMOUNT_VALUE`、`requires an integer amount`、或 schema 显示 `allow_decimal=false`,只修失败行,把小数改成整数,或回到 builder 阶段重建为允许小数的字段;不要强塞 decimal,也不要重试整批已成功行。
|
|
21
|
+
|
|
22
|
+
录入数据时不要填写轻流系统字段:`数据ID`、`编号`、`申请人`、`申请时间`、`创建人`、`创建时间`、`提交人`、`提交时间`、`更新时间`、`更新人`、`当前流程状态`、`当前处理人`、`当前处理节点`、`流程标题`。这些字段由平台生成;需要确认时在创建成功后读取记录详情,不要把它们写进 `fields` / `items[].fields`。
|