@qingflow-tech/qingflow-cli 1.1.50-beta.1 → 1.1.50-beta.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/README.md +3 -3
- package/package.json +1 -1
- package/pyproject.toml +8 -2
- package/skills/qingflow-cli/SKILL.md +74 -0
- package/skills/qingflow-cli/reference/QINGFLOW_CLI_BUILDER_VIEWS_WORKFLOW.md +3 -9
- package/skills/qingflow-cli/reference/builder/20-build-complete-system.md +3 -2
- package/skills/qingflow-cli/reference/builder/30-schema-fields.md +9 -5
- package/skills/qingflow-cli/reference/builder/50-views.md +176 -190
- package/skills/qingflow-cli/reference/builder/README.md +1 -1
- package/skills/qingflow-cli/reference/builder/reference/app-delivery-sop.md +6 -6
- package/skills/qingflow-cli/reference/examples/README.md +1 -1
- package/skills/qingflow-cli/reference/examples/views/views_apply_v1alpha1.example.json +14 -0
- package/skills/qingflow-cli/reference/examples/views/views_upsert_table_minimal.example.json +30 -36
- package/src/qingflow_mcp/app_form_compat.py +3 -0
- package/src/qingflow_mcp/app_form_validator.py +16 -3
- package/src/qingflow_mcp/builder_facade/app_form.py +360 -68
- package/src/qingflow_mcp/builder_facade/models.py +208 -17
- package/src/qingflow_mcp/builder_facade/schemas/app_form/manifest.json +1 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/complete.json +61 -27
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/address.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/amount.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/attachment.json +5 -9
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/code_block.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/data_relation.json +8 -15
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/date.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/datetime.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/department.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/email.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/link.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/long_text.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/member.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/multi_select.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/number.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/phone.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/q_linker.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/relation.json +43 -12
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/rich_text.json +146 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_choice.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/single_select.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/subtable.json +58 -24
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/fields/text.json +3 -7
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/formula.json +8 -0
- package/src/qingflow_mcp/builder_facade/schemas/app_form/v1alpha1/summary.json +5 -10
- package/src/qingflow_mcp/builder_facade/schemas/views/manifest.json +43 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/complete.json +1193 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/button-config.json +53 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/data-permission.json +60 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/display.json +71 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/operation-permission.json +48 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/details/query-condition.json +47 -0
- package/src/qingflow_mcp/builder_facade/schemas/views/v1alpha1/summary.json +274 -0
- package/src/qingflow_mcp/builder_facade/service.py +1427 -410
- package/src/qingflow_mcp/builder_facade/views_extract.py +572 -0
- package/src/qingflow_mcp/builder_facade/views_schema.py +400 -0
- package/src/qingflow_mcp/cli/commands/builder.py +72 -53
- package/src/qingflow_mcp/public_surface.py +3 -0
- package/src/qingflow_mcp/response_trim.py +11 -2
- package/src/qingflow_mcp/server_app_builder.py +32 -8
- package/src/qingflow_mcp/solution/executor.py +93 -7
- package/src/qingflow_mcp/tools/ai_builder_tools.py +211 -393
- package/src/qingflow_mcp/tools/solution_tools.py +2 -0
- package/src/qingflow_mcp/tools/view_tools.py +0 -6
- package/src/qingflow_mcp/tools/view_writer.py +44 -0
- package/skills/qingflow-cli/reference/examples/views/views_batch_full.example.json +0 -159
- package/skills/qingflow-cli/reference/views_upsert_table_minimal.example.json +0 -42
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import re
|
|
4
4
|
from enum import Enum
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import Any, Union
|
|
6
6
|
|
|
7
7
|
from pydantic import AliasChoices, Field, model_validator
|
|
8
8
|
|
|
@@ -134,6 +134,7 @@ class PublicViewType(str, Enum):
|
|
|
134
134
|
card = "card"
|
|
135
135
|
board = "board"
|
|
136
136
|
gantt = "gantt"
|
|
137
|
+
hierarchy = "hierarchy"
|
|
137
138
|
|
|
138
139
|
|
|
139
140
|
class PublicButtonTriggerAction(str, Enum):
|
|
@@ -390,9 +391,38 @@ class FlowConditionRulePatch(StrictModel):
|
|
|
390
391
|
return self
|
|
391
392
|
|
|
392
393
|
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
def _coerce_que_id(value: Any) -> Any:
|
|
397
|
+
"""字段引用归一:queId(后端字段唯一键)。接受 int / "123" / "field_123"(field_id 形态) → int;
|
|
398
|
+
其余形态原样返回交给 pydantic 报错(契约诚实:不支持显示名引用)。"""
|
|
399
|
+
if isinstance(value, bool) or isinstance(value, int):
|
|
400
|
+
return value
|
|
401
|
+
if isinstance(value, str):
|
|
402
|
+
stripped = value.strip()
|
|
403
|
+
if stripped.isdigit():
|
|
404
|
+
return int(stripped)
|
|
405
|
+
if stripped.startswith("field_") and stripped[6:].isdigit():
|
|
406
|
+
return int(stripped[6:])
|
|
407
|
+
return value
|
|
408
|
+
|
|
393
409
|
class ViewFilterRulePatch(StrictModel):
|
|
394
|
-
|
|
410
|
+
que_id: int = Field(validation_alias=AliasChoices("que_id", "queId", "field_id", "fieldId"))
|
|
395
411
|
operator: ViewFilterOperator = Field(default=ViewFilterOperator.eq, validation_alias=AliasChoices("operator", "op"))
|
|
412
|
+
|
|
413
|
+
@model_validator(mode="before")
|
|
414
|
+
@classmethod
|
|
415
|
+
def normalize_que_id(cls, value: Any) -> Any:
|
|
416
|
+
if isinstance(value, dict):
|
|
417
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
418
|
+
if alias in value and "que_id" not in value:
|
|
419
|
+
value = {**{k: v for k, v in value.items() if k != alias}, "que_id": value[alias]}
|
|
420
|
+
break
|
|
421
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
422
|
+
value.pop(alias, None) if alias != "que_id" else None
|
|
423
|
+
if isinstance(value, dict) and "que_id" in value:
|
|
424
|
+
return {**value, "que_id": _coerce_que_id(value["que_id"])}
|
|
425
|
+
return value
|
|
396
426
|
values: list[Any] = Field(default_factory=list)
|
|
397
427
|
|
|
398
428
|
@model_validator(mode="before")
|
|
@@ -405,11 +435,18 @@ class ViewFilterRulePatch(StrictModel):
|
|
|
405
435
|
if self.operator in {ViewFilterOperator.is_empty, ViewFilterOperator.not_empty}:
|
|
406
436
|
self.values = []
|
|
407
437
|
return self
|
|
408
|
-
if not self.values:
|
|
438
|
+
if not self.values and self.operator != ViewFilterOperator.in_:
|
|
439
|
+
# in+空值合法:选项/成员类字段"ANY 判型未选任何值"的存量形态
|
|
440
|
+
# (后端 judgeType=EQUAL_ANY+空值,实测回写稳定保留)
|
|
409
441
|
raise ValueError("view filter rule requires values")
|
|
410
442
|
return self
|
|
411
443
|
|
|
412
444
|
|
|
445
|
+
# 视图筛选双形态(与 visible_when/root_filter 的嵌组形态对齐):
|
|
446
|
+
# 扁平 [rule, ...] = 单组 AND(向后兼容);嵌套 [[rule,...],[rule,...]] = 组间 OR、组内 AND
|
|
447
|
+
ViewFilterGroupPatch = Union[ViewFilterRulePatch, list[ViewFilterRulePatch]]
|
|
448
|
+
|
|
449
|
+
|
|
413
450
|
class FieldSelector(StrictModel):
|
|
414
451
|
field_id: str | None = None
|
|
415
452
|
que_id: int | None = None
|
|
@@ -544,16 +581,14 @@ class VisibilityPatch(StrictModel):
|
|
|
544
581
|
|
|
545
582
|
@model_validator(mode="after")
|
|
546
583
|
def validate_shape(self) -> "VisibilityPatch":
|
|
547
|
-
|
|
548
|
-
|
|
584
|
+
# mode=specific + 空 selectors 是合法形态(auth=2 但未配置成员),回写保真;
|
|
585
|
+
# 不强制要求 specific 必须有 selectors
|
|
549
586
|
if self.mode != PublicVisibilityMode.specific and self.selectors.has_any_selector():
|
|
550
587
|
raise ValueError("selectors are only allowed when mode=specific")
|
|
551
588
|
if self.mode == PublicVisibilityMode.everyone and self.external_mode != PublicExternalVisibilityMode.workspace:
|
|
552
589
|
raise ValueError("mode=everyone requires external_mode=workspace")
|
|
553
590
|
if self.mode == PublicVisibilityMode.everyone and self.external_selectors.has_any_selector():
|
|
554
591
|
raise ValueError("external_selectors are not allowed when mode=everyone")
|
|
555
|
-
if self.external_mode == PublicExternalVisibilityMode.specific and not self.external_selectors.has_any_selector():
|
|
556
|
-
raise ValueError("external_mode=specific requires external_selectors")
|
|
557
592
|
if self.external_mode != PublicExternalVisibilityMode.specific and self.external_selectors.has_any_selector():
|
|
558
593
|
raise ValueError("external_selectors are only allowed when external_mode=specific")
|
|
559
594
|
return self
|
|
@@ -1137,6 +1172,141 @@ class ViewQueryConditionsPatch(StrictModel):
|
|
|
1137
1172
|
rows: list[list[str | int]] = Field(default_factory=list, validation_alias=AliasChoices("rows", "fields", "queryCondition"))
|
|
1138
1173
|
|
|
1139
1174
|
|
|
1175
|
+
class ViewDataPermissionPatch(StrictModel):
|
|
1176
|
+
"""数据权限形状(公开语义)→ dataPermissionType + dataScope。"""
|
|
1177
|
+
|
|
1178
|
+
type: str = Field(default="custom", validation_alias=AliasChoices("type", "permission_type", "permissionType"))
|
|
1179
|
+
scope: str = Field(default="all", validation_alias=AliasChoices("scope", "data_scope", "dataScope"))
|
|
1180
|
+
|
|
1181
|
+
@model_validator(mode="after")
|
|
1182
|
+
def validate_shape(self) -> "ViewDataPermissionPatch":
|
|
1183
|
+
if self.type not in {"config", "custom"}:
|
|
1184
|
+
raise ValueError("data_permission.type must be config or custom")
|
|
1185
|
+
if self.scope not in {"all", "oneself", "dept", "subordinate", "custom"}:
|
|
1186
|
+
raise ValueError("data_permission.scope must be one of all/oneself/dept/subordinate/custom")
|
|
1187
|
+
return self
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
class ViewSortRulePatch(StrictModel):
|
|
1191
|
+
"""排序规则(公开语义)→ viewgraphSorts + sortType=customSort。"""
|
|
1192
|
+
|
|
1193
|
+
que_id: int = Field(validation_alias=AliasChoices("que_id", "queId", "field_id", "fieldId"))
|
|
1194
|
+
ascending: bool = Field(default=True, validation_alias=AliasChoices("ascending", "asc", "beingSortAscend"))
|
|
1195
|
+
|
|
1196
|
+
@model_validator(mode="before")
|
|
1197
|
+
@classmethod
|
|
1198
|
+
def normalize_que_id(cls, value: Any) -> Any:
|
|
1199
|
+
if isinstance(value, dict):
|
|
1200
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
1201
|
+
if alias in value and "que_id" not in value:
|
|
1202
|
+
value = {**{k: v for k, v in value.items() if k != alias}, "que_id": value[alias]}
|
|
1203
|
+
break
|
|
1204
|
+
for alias in ("queId", "field_id", "fieldId"):
|
|
1205
|
+
value.pop(alias, None) if alias != "que_id" else None
|
|
1206
|
+
if isinstance(value, dict) and "que_id" in value:
|
|
1207
|
+
return {**value, "que_id": _coerce_que_id(value["que_id"])}
|
|
1208
|
+
return value
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
class ViewCardConfigPatch(StrictModel):
|
|
1212
|
+
"""卡片视图特有配置 → titleQue/frontCoverQueId/clippingMode/... 。"""
|
|
1213
|
+
|
|
1214
|
+
title_que_id: int | None = Field(default=None, validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1215
|
+
cover_que_id: int | None = Field(default=None, validation_alias=AliasChoices("cover_que_id", "coverQueId", "front_cover_que_id", "frontCoverQueId"))
|
|
1216
|
+
clipping_mode: str | None = Field(default=None, validation_alias=AliasChoices("clipping_mode", "clippingMode"))
|
|
1217
|
+
image_adaption: bool | None = Field(default=None, validation_alias=AliasChoices("image_adaption", "imageAdaption", "beingImageAdaption"))
|
|
1218
|
+
show_field_title: bool | None = Field(default=None, validation_alias=AliasChoices("show_field_title", "showFieldTitle", "beingShowQueTitle"))
|
|
1219
|
+
show_title: bool | None = Field(default=None, validation_alias=AliasChoices("show_title", "showTitle", "beingShowTitleQue"))
|
|
1220
|
+
show_cover: bool | None = Field(default=None, validation_alias=AliasChoices("show_cover", "showCover", "beingShowCover"))
|
|
1221
|
+
group_que_id: int | None = Field(default=None, validation_alias=AliasChoices("group_que_id", "groupQueId"))
|
|
1222
|
+
group_color: bool | None = Field(default=None, validation_alias=AliasChoices("group_color", "groupColor", "beingGroupColor"))
|
|
1223
|
+
|
|
1224
|
+
@model_validator(mode="after")
|
|
1225
|
+
def validate_shape(self) -> "ViewCardConfigPatch":
|
|
1226
|
+
if self.clipping_mode is not None and self.clipping_mode not in {"default", "fill"}:
|
|
1227
|
+
raise ValueError("card.clipping_mode must be default or fill")
|
|
1228
|
+
return self
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
class ViewGanttGroupPatch(StrictModel):
|
|
1232
|
+
que_id: int = Field(validation_alias=AliasChoices("que_id", "queId"))
|
|
1233
|
+
ordinal: int | None = Field(default=None)
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
class ViewGanttDependencyPatch(StrictModel):
|
|
1237
|
+
predecessor_que_id: int = Field(validation_alias=AliasChoices("predecessor_que_id", "predecessorQueId"))
|
|
1238
|
+
dependency_que_id: int = Field(validation_alias=AliasChoices("dependency_que_id", "dependencyQueId"))
|
|
1239
|
+
start_start_option_id: int | None = Field(default=None, validation_alias=AliasChoices("start_start_option_id", "startStartOptionId"))
|
|
1240
|
+
start_end_option_id: int | None = Field(default=None, validation_alias=AliasChoices("start_end_option_id", "startEndOptionId"))
|
|
1241
|
+
end_start_option_id: int | None = Field(default=None, validation_alias=AliasChoices("end_start_option_id", "endStartOptionId"))
|
|
1242
|
+
end_end_option_id: int | None = Field(default=None, validation_alias=AliasChoices("end_end_option_id", "endEndOptionId"))
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
class ViewGanttConfigPatch(StrictModel):
|
|
1246
|
+
"""甘特视图特有配置 → viewgraphGanttConfigVO。"""
|
|
1247
|
+
|
|
1248
|
+
title_que_id: int | None = Field(default=None, validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1249
|
+
start_que_id: int | None = Field(default=None, validation_alias=AliasChoices("start_que_id", "startQueId"))
|
|
1250
|
+
end_que_id: int | None = Field(default=None, validation_alias=AliasChoices("end_que_id", "endQueId"))
|
|
1251
|
+
default_time_dimension: str | None = Field(default=None, validation_alias=AliasChoices("default_time_dimension", "defaultTimeDimension"))
|
|
1252
|
+
auto_calibration: bool | None = Field(default=None, validation_alias=AliasChoices("auto_calibration", "autoCalibration", "beingAutoCalibration"))
|
|
1253
|
+
groups: list[ViewGanttGroupPatch] = Field(default_factory=list)
|
|
1254
|
+
dependencies: list[ViewGanttDependencyPatch] = Field(default_factory=list, validation_alias=AliasChoices("dependencies", "dependency"))
|
|
1255
|
+
|
|
1256
|
+
@model_validator(mode="after")
|
|
1257
|
+
def validate_shape(self) -> "ViewGanttConfigPatch":
|
|
1258
|
+
if self.default_time_dimension is not None and self.default_time_dimension not in {"day", "week", "month", "year"}:
|
|
1259
|
+
raise ValueError("gantt.default_time_dimension must be day, week, month, or year")
|
|
1260
|
+
if len(self.dependencies) > 1:
|
|
1261
|
+
raise ValueError("gantt.dependencies supports at most one dependency relation in v1alpha1")
|
|
1262
|
+
return self
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
class ViewHierarchyConfigPatch(StrictModel):
|
|
1266
|
+
"""层级视图特有配置 → viewgraphHierarchyConfigVO。"""
|
|
1267
|
+
|
|
1268
|
+
title_que_id: int = Field(validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1269
|
+
children_que_id: int = Field(validation_alias=AliasChoices("children_que_id", "childrenQueId"))
|
|
1270
|
+
root_filter: list[list[ViewFilterRulePatch]] = Field(
|
|
1271
|
+
default_factory=list,
|
|
1272
|
+
validation_alias=AliasChoices("root_filter", "rootFilter", "root_node_filter", "rootNodeFilter"),
|
|
1273
|
+
)
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
class ViewDisplayConfigPatch(StrictModel):
|
|
1277
|
+
"""展示杂项 → defaultRowHigh/beingPinNavigate/remark。"""
|
|
1278
|
+
|
|
1279
|
+
row_height: str | None = Field(default=None, validation_alias=AliasChoices("row_height", "rowHeight", "defaultRowHigh"))
|
|
1280
|
+
pin_navigate: bool | None = Field(default=None, validation_alias=AliasChoices("pin_navigate", "pinNavigate", "beingPinNavigate"))
|
|
1281
|
+
remark: str | None = Field(default=None)
|
|
1282
|
+
|
|
1283
|
+
@model_validator(mode="after")
|
|
1284
|
+
def validate_shape(self) -> "ViewDisplayConfigPatch":
|
|
1285
|
+
# 后端 defaultRowHigh 实际值域:compact/moderate/highest(high 为历史别名)
|
|
1286
|
+
if self.row_height is not None and self.row_height not in {"compact", "moderate", "highest", "high"}:
|
|
1287
|
+
raise ValueError("display.row_height must be compact, moderate, highest, or high")
|
|
1288
|
+
return self
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
class ViewRecordConfigPatch(StrictModel):
|
|
1292
|
+
"""记录可见性开关 → beingAuditRecordVisible 等。"""
|
|
1293
|
+
|
|
1294
|
+
audit_visible: bool | None = Field(default=None, validation_alias=AliasChoices("audit_visible", "auditVisible", "beingAuditRecordVisible"))
|
|
1295
|
+
data_log_visible: bool | None = Field(default=None, validation_alias=AliasChoices("data_log_visible", "dataLogVisible", "beingDataLogVisible"))
|
|
1296
|
+
qrobot_record_visible: bool | None = Field(default=None, validation_alias=AliasChoices("qrobot_record_visible", "qrobotRecordVisible", "beingQrobotRecordVisible"))
|
|
1297
|
+
workflow_future_visible: bool | None = Field(default=None, validation_alias=AliasChoices("workflow_future_visible", "workflowFutureVisible", "beingWorkflowNodeFutureListVisible"))
|
|
1298
|
+
comment: bool | None = Field(default=None, validation_alias=AliasChoices("comment", "beingCommentStatus"))
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
class ViewShareConfigPatch(StrictModel):
|
|
1302
|
+
"""分享与安全 → beingNeedPass/viewgraphPass/beingForceLogin/beingPrintStatus。"""
|
|
1303
|
+
|
|
1304
|
+
need_pass: bool | None = Field(default=None, validation_alias=AliasChoices("need_pass", "needPass", "beingNeedPass"))
|
|
1305
|
+
password: str | None = Field(default=None, validation_alias=AliasChoices("password", "pass", "viewgraphPass"))
|
|
1306
|
+
force_login: bool | None = Field(default=None, validation_alias=AliasChoices("force_login", "forceLogin", "beingForceLogin"))
|
|
1307
|
+
print_enabled: bool | None = Field(default=None, validation_alias=AliasChoices("print_enabled", "printEnabled", "beingPrintStatus"))
|
|
1308
|
+
|
|
1309
|
+
|
|
1140
1310
|
class ViewAssociatedResourcesPatch(StrictModel):
|
|
1141
1311
|
visible: bool = Field(default=True, validation_alias=AliasChoices("visible", "enabled", "asosChartVisible"))
|
|
1142
1312
|
limit_type: str | None = Field(default=None, validation_alias=AliasChoices("limit_type", "limitType"))
|
|
@@ -1239,17 +1409,29 @@ class ViewActionButtonPatch(StrictModel):
|
|
|
1239
1409
|
class ViewUpsertPatch(StrictModel):
|
|
1240
1410
|
name: str
|
|
1241
1411
|
view_key: str | None = Field(default=None, validation_alias=AliasChoices("view_key", "viewKey"))
|
|
1412
|
+
pinned: bool | None = Field(default=None, validation_alias=AliasChoices("pinned", "fixed", "is_pinned", "isPinned"))
|
|
1242
1413
|
type: PublicViewType
|
|
1243
|
-
columns: list[
|
|
1244
|
-
|
|
1245
|
-
filters: list[
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1414
|
+
columns: list[int] = Field(default_factory=list)
|
|
1415
|
+
group_que_id: int | None = Field(default=None, validation_alias=AliasChoices("group_que_id", "groupQueId"))
|
|
1416
|
+
filters: list["ViewFilterGroupPatch"] = Field(default_factory=list)
|
|
1417
|
+
start_que_id: int | None = Field(default=None, validation_alias=AliasChoices("start_que_id", "startQueId"))
|
|
1418
|
+
end_que_id: int | None = Field(default=None, validation_alias=AliasChoices("end_que_id", "endQueId"))
|
|
1419
|
+
title_que_id: int | None = Field(default=None, validation_alias=AliasChoices("title_que_id", "titleQueId"))
|
|
1249
1420
|
buttons: list["ViewButtonBindingPatch"] | None = None
|
|
1250
1421
|
action_buttons: list[ViewActionButtonPatch] | None = Field(default=None, validation_alias=AliasChoices("action_buttons", "actionButtons"))
|
|
1251
1422
|
action_buttons_mode: str = Field(default="merge", validation_alias=AliasChoices("action_buttons_mode", "actionButtonsMode", "button_mode", "buttonMode"))
|
|
1252
1423
|
visibility: VisibilityPatch | None = None
|
|
1424
|
+
data_permission: ViewDataPermissionPatch | None = Field(
|
|
1425
|
+
default=None,
|
|
1426
|
+
validation_alias=AliasChoices("data_permission", "dataPermission"),
|
|
1427
|
+
)
|
|
1428
|
+
sort: list[ViewSortRulePatch] | None = Field(default=None, validation_alias=AliasChoices("sort", "sort_rules", "sortRules"))
|
|
1429
|
+
card: ViewCardConfigPatch | None = Field(default=None)
|
|
1430
|
+
gantt: ViewGanttConfigPatch | None = Field(default=None)
|
|
1431
|
+
hierarchy: ViewHierarchyConfigPatch | None = Field(default=None)
|
|
1432
|
+
display: ViewDisplayConfigPatch | None = Field(default=None)
|
|
1433
|
+
record: ViewRecordConfigPatch | None = Field(default=None)
|
|
1434
|
+
share: ViewShareConfigPatch | None = Field(default=None)
|
|
1253
1435
|
query_conditions: ViewQueryConditionsPatch | None = Field(default=None, validation_alias=AliasChoices("query_conditions", "queryConditions", "query_condition", "queryCondition"))
|
|
1254
1436
|
associated_resources: ViewAssociatedResourcesPatch | None = Field(
|
|
1255
1437
|
default=None,
|
|
@@ -1321,10 +1503,19 @@ class ViewUpsertPatch(StrictModel):
|
|
|
1321
1503
|
def validate_shape(self) -> "ViewUpsertPatch":
|
|
1322
1504
|
if self.type in {PublicViewType.table, PublicViewType.card} and not self.columns:
|
|
1323
1505
|
raise ValueError("table/card views require columns")
|
|
1324
|
-
if self.type == PublicViewType.board and not self.
|
|
1325
|
-
raise ValueError("board view requires
|
|
1326
|
-
if self.type == PublicViewType.gantt and not (self.
|
|
1327
|
-
raise ValueError("gantt view requires
|
|
1506
|
+
if self.type == PublicViewType.board and not self.group_que_id:
|
|
1507
|
+
raise ValueError("board view requires group_que_id")
|
|
1508
|
+
if self.type == PublicViewType.gantt and not (self.start_que_id and self.end_que_id):
|
|
1509
|
+
raise ValueError("gantt view requires start_que_id and end_que_id")
|
|
1510
|
+
if self.type == PublicViewType.hierarchy:
|
|
1511
|
+
if self.hierarchy is None or not (self.hierarchy.title_que_id and self.hierarchy.children_que_id):
|
|
1512
|
+
raise ValueError("hierarchy view requires hierarchy.title_que_id and children_que_id")
|
|
1513
|
+
elif self.hierarchy is not None:
|
|
1514
|
+
raise ValueError("hierarchy config is only allowed on hierarchy views")
|
|
1515
|
+
if self.type != PublicViewType.card and self.card is not None:
|
|
1516
|
+
raise ValueError("card config is only allowed on card views")
|
|
1517
|
+
if self.type != PublicViewType.gantt and self.gantt is not None:
|
|
1518
|
+
raise ValueError("gantt config is only allowed on gantt views")
|
|
1328
1519
|
normalized_mode = str(self.action_buttons_mode or "merge").strip().lower()
|
|
1329
1520
|
if normalized_mode not in {"merge", "replace"}:
|
|
1330
1521
|
raise ValueError("action_buttons_mode must be merge or replace")
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
]
|
|
240
240
|
},
|
|
241
241
|
"fileSize": {
|
|
242
|
-
"minimum":
|
|
242
|
+
"minimum": 0,
|
|
243
243
|
"type": [
|
|
244
244
|
"integer",
|
|
245
245
|
"null"
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
]
|
|
260
260
|
},
|
|
261
261
|
"maxFileLimit": {
|
|
262
|
-
"minimum":
|
|
262
|
+
"minimum": 0,
|
|
263
263
|
"type": [
|
|
264
264
|
"integer",
|
|
265
265
|
"null"
|
|
@@ -518,7 +518,7 @@
|
|
|
518
518
|
},
|
|
519
519
|
"DataRelationCondition": {
|
|
520
520
|
"additionalProperties": false,
|
|
521
|
-
"description": "一条数据关联过滤条件;sourceField 必须属于数据来源,operator 必须适用于该字段类型。固定值请使用 literal operand,不要直接声明后端 matchRules。",
|
|
521
|
+
"description": "一条数据关联过滤条件;sourceField 必须属于数据来源,operator 必须适用于该字段类型。固定值请使用 literal operand,不要直接声明后端 matchRules。sourceField 省略为存量读回形态(历史脏公式的源字段缺失,如 #queId_0$,写回时以 queId=0 透传),新建条件应提供 sourceField。",
|
|
522
522
|
"properties": {
|
|
523
523
|
"operand": {
|
|
524
524
|
"$ref": "#/$defs/DataRelationOperand",
|
|
@@ -554,11 +554,10 @@
|
|
|
554
554
|
},
|
|
555
555
|
"sourceField": {
|
|
556
556
|
"$ref": "#/$defs/FieldSelector",
|
|
557
|
-
"description": "
|
|
557
|
+
"description": "被过滤的数据源字段;存量读回形态可能缺失(后端反解析出的条件源字段 queId=0 且无名称)。"
|
|
558
558
|
}
|
|
559
559
|
},
|
|
560
560
|
"required": [
|
|
561
|
-
"sourceField",
|
|
562
561
|
"operator",
|
|
563
562
|
"operand"
|
|
564
563
|
],
|
|
@@ -566,7 +565,7 @@
|
|
|
566
565
|
},
|
|
567
566
|
"DataRelationConfig": {
|
|
568
567
|
"additionalProperties": false,
|
|
569
|
-
"description": "数据关联字段配置;从应用、Q-Linker 或代码块输出中读取数据。",
|
|
568
|
+
"description": "数据关联字段配置;从应用、Q-Linker 或代码块输出中读取数据。source 省略表示该字段当前无关联来源配置(存量表单读回形态:后端 GET 对 displayed 目标缺失的 relation 行不回传,FormSvcImpl#getQuestionRelationsBeans continue 分支;新建数据关联字段应提供 source)。",
|
|
570
569
|
"properties": {
|
|
571
570
|
"aggregation": {
|
|
572
571
|
"description": "可选聚合方式;null 表示不聚合。",
|
|
@@ -601,12 +600,10 @@
|
|
|
601
600
|
},
|
|
602
601
|
"source": {
|
|
603
602
|
"$ref": "#/$defs/DataRelationSource",
|
|
604
|
-
"description": "数据来源;按 kind
|
|
603
|
+
"description": "数据来源;按 kind 选择一种来源结构。存量读回形态可能无 source(后端读面不回传关联配置),此时写回不重建该字段的关联。"
|
|
605
604
|
}
|
|
606
605
|
},
|
|
607
|
-
"required": [
|
|
608
|
-
"source"
|
|
609
|
-
],
|
|
606
|
+
"required": [],
|
|
610
607
|
"type": "object"
|
|
611
608
|
},
|
|
612
609
|
"DataRelationCustomButton": {
|
|
@@ -1299,13 +1296,9 @@
|
|
|
1299
1296
|
"type": "string"
|
|
1300
1297
|
},
|
|
1301
1298
|
"width": {
|
|
1302
|
-
"description": "
|
|
1303
|
-
"
|
|
1304
|
-
|
|
1305
|
-
50,
|
|
1306
|
-
75,
|
|
1307
|
-
100
|
|
1308
|
-
],
|
|
1299
|
+
"description": "字段在所在行的宽度百分比(1-100 整数);后端不校验总和与取值,存量数据存在 33/34 等三等分布值。",
|
|
1300
|
+
"maximum": 100,
|
|
1301
|
+
"minimum": 1,
|
|
1309
1302
|
"type": "integer"
|
|
1310
1303
|
}
|
|
1311
1304
|
},
|
|
@@ -1975,7 +1968,7 @@
|
|
|
1975
1968
|
},
|
|
1976
1969
|
"RelationConfig": {
|
|
1977
1970
|
"additionalProperties": false,
|
|
1978
|
-
"description": "
|
|
1971
|
+
"description": "引用字段配置;引用其他应用中的数据。展示字段与权限以 displayFields 为准(后端 referQuestions 全量有序回写,queAuth 1=可编辑/2=隐藏/3=仅可见);displayField/visibleFields 为已废弃旧形态,apply 兼容接收一个版本窗口(displayField 同时视为双向绑定目标)。",
|
|
1979
1972
|
"properties": {
|
|
1980
1973
|
"beingDefaultFormulaAutoFillEnabled": {
|
|
1981
1974
|
"description": "是否启用引用字段的默认值公式自动填充。",
|
|
@@ -2013,7 +2006,32 @@
|
|
|
2013
2006
|
},
|
|
2014
2007
|
"displayField": {
|
|
2015
2008
|
"$ref": "#/$defs/FieldSelector",
|
|
2016
|
-
"description": "
|
|
2009
|
+
"description": "已废弃:主展示字段;apply 兼容翻译为 twoWayBoundField + displayFields 首项,后续版本移除。"
|
|
2010
|
+
},
|
|
2011
|
+
"displayFields": {
|
|
2012
|
+
"description": "有序展示字段全量列表(含隐藏字段),按 ordinal 保序回写为后端 referQuestions。可为空列表:空 = 双向绑定未配展示字段的合法存量形态(后端写链路对空 referQuestions 跳过插入、读面容忍空),round-trip 空↔空稳定;与已废弃 displayField/visibleFields 不可混用,条目 queId 不可重复。",
|
|
2013
|
+
"items": {
|
|
2014
|
+
"additionalProperties": false,
|
|
2015
|
+
"properties": {
|
|
2016
|
+
"auth": {
|
|
2017
|
+
"default": "visible",
|
|
2018
|
+
"description": "展示字段权限;editable=可编辑(1), hidden=隐藏(2), visible=仅可见(3);缺失按 visible。",
|
|
2019
|
+
"enum": [
|
|
2020
|
+
"editable",
|
|
2021
|
+
"hidden",
|
|
2022
|
+
"visible"
|
|
2023
|
+
]
|
|
2024
|
+
},
|
|
2025
|
+
"field": {
|
|
2026
|
+
"$ref": "#/$defs/FieldSelector"
|
|
2027
|
+
}
|
|
2028
|
+
},
|
|
2029
|
+
"required": [
|
|
2030
|
+
"field"
|
|
2031
|
+
],
|
|
2032
|
+
"type": "object"
|
|
2033
|
+
},
|
|
2034
|
+
"type": "array"
|
|
2017
2035
|
},
|
|
2018
2036
|
"relationMode": {
|
|
2019
2037
|
"default": "single",
|
|
@@ -2028,8 +2046,19 @@
|
|
|
2028
2046
|
"minLength": 1,
|
|
2029
2047
|
"type": "string"
|
|
2030
2048
|
},
|
|
2049
|
+
"twoWayBoundField": {
|
|
2050
|
+
"description": "双向引用绑定的目标字段(后端 referQueId);null/省略 = 单向引用。get 读面在 referQueId 非空时必产出。",
|
|
2051
|
+
"oneOf": [
|
|
2052
|
+
{
|
|
2053
|
+
"type": "null"
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
"$ref": "#/$defs/FieldSelector"
|
|
2057
|
+
}
|
|
2058
|
+
]
|
|
2059
|
+
},
|
|
2031
2060
|
"visibleFields": {
|
|
2032
|
-
"description": "
|
|
2061
|
+
"description": "已废弃:额外展示字段;apply 兼容翻译为 displayFields 后续项,后续版本移除。",
|
|
2033
2062
|
"items": {
|
|
2034
2063
|
"$ref": "#/$defs/FieldSelector"
|
|
2035
2064
|
},
|
|
@@ -2038,8 +2067,7 @@
|
|
|
2038
2067
|
}
|
|
2039
2068
|
},
|
|
2040
2069
|
"required": [
|
|
2041
|
-
"targetAppKey"
|
|
2042
|
-
"displayField"
|
|
2070
|
+
"targetAppKey"
|
|
2043
2071
|
],
|
|
2044
2072
|
"type": "object"
|
|
2045
2073
|
},
|
|
@@ -2100,11 +2128,10 @@
|
|
|
2100
2128
|
"description": "段落判别值。"
|
|
2101
2129
|
},
|
|
2102
2130
|
"rows": {
|
|
2103
|
-
"description": "
|
|
2131
|
+
"description": "段落内的有序字段行;可为空数组(空 = 存量空段落形态,后端容忍,round-trip 空↔空稳定)。",
|
|
2104
2132
|
"items": {
|
|
2105
2133
|
"$ref": "#/$defs/FieldRow"
|
|
2106
2134
|
},
|
|
2107
|
-
"minItems": 1,
|
|
2108
2135
|
"type": "array"
|
|
2109
2136
|
},
|
|
2110
2137
|
"sectionId": {
|
|
@@ -2385,7 +2412,10 @@
|
|
|
2385
2412
|
"$ref": "#/$defs/NumberConfig"
|
|
2386
2413
|
},
|
|
2387
2414
|
"questionType": {
|
|
2388
|
-
"
|
|
2415
|
+
"enum": [
|
|
2416
|
+
"number",
|
|
2417
|
+
"amount"
|
|
2418
|
+
]
|
|
2389
2419
|
}
|
|
2390
2420
|
},
|
|
2391
2421
|
"required": [
|
|
@@ -2398,7 +2428,10 @@
|
|
|
2398
2428
|
"$ref": "#/$defs/EmptyConfig"
|
|
2399
2429
|
},
|
|
2400
2430
|
"questionType": {
|
|
2401
|
-
"
|
|
2431
|
+
"enum": [
|
|
2432
|
+
"date",
|
|
2433
|
+
"datetime"
|
|
2434
|
+
]
|
|
2402
2435
|
}
|
|
2403
2436
|
},
|
|
2404
2437
|
"required": [
|
|
@@ -2702,7 +2735,8 @@
|
|
|
2702
2735
|
"questionType": {
|
|
2703
2736
|
"enum": [
|
|
2704
2737
|
"date",
|
|
2705
|
-
"datetime"
|
|
2738
|
+
"datetime",
|
|
2739
|
+
"rich_text"
|
|
2706
2740
|
]
|
|
2707
2741
|
}
|
|
2708
2742
|
},
|
|
@@ -322,13 +322,9 @@
|
|
|
322
322
|
"type": "string"
|
|
323
323
|
},
|
|
324
324
|
"width": {
|
|
325
|
-
"description": "
|
|
326
|
-
"
|
|
327
|
-
|
|
328
|
-
50,
|
|
329
|
-
75,
|
|
330
|
-
100
|
|
331
|
-
],
|
|
325
|
+
"description": "字段在所在行的宽度百分比(1-100 整数);后端不校验总和与取值,存量数据存在 33/34 等三等分布值。",
|
|
326
|
+
"maximum": 100,
|
|
327
|
+
"minimum": 1,
|
|
332
328
|
"type": "integer"
|
|
333
329
|
}
|
|
334
330
|
},
|
|
@@ -99,13 +99,9 @@
|
|
|
99
99
|
"type": "string"
|
|
100
100
|
},
|
|
101
101
|
"width": {
|
|
102
|
-
"description": "
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
50,
|
|
106
|
-
75,
|
|
107
|
-
100
|
|
108
|
-
],
|
|
102
|
+
"description": "字段在所在行的宽度百分比(1-100 整数);后端不校验总和与取值,存量数据存在 33/34 等三等分布值。",
|
|
103
|
+
"maximum": 100,
|
|
104
|
+
"minimum": 1,
|
|
109
105
|
"type": "integer"
|
|
110
106
|
}
|
|
111
107
|
},
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
]
|
|
95
95
|
},
|
|
96
96
|
"fileSize": {
|
|
97
|
-
"minimum":
|
|
97
|
+
"minimum": 0,
|
|
98
98
|
"type": [
|
|
99
99
|
"integer",
|
|
100
100
|
"null"
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
]
|
|
115
115
|
},
|
|
116
116
|
"maxFileLimit": {
|
|
117
|
-
"minimum":
|
|
117
|
+
"minimum": 0,
|
|
118
118
|
"type": [
|
|
119
119
|
"integer",
|
|
120
120
|
"null"
|
|
@@ -355,13 +355,9 @@
|
|
|
355
355
|
"type": "string"
|
|
356
356
|
},
|
|
357
357
|
"width": {
|
|
358
|
-
"description": "
|
|
359
|
-
"
|
|
360
|
-
|
|
361
|
-
50,
|
|
362
|
-
75,
|
|
363
|
-
100
|
|
364
|
-
],
|
|
358
|
+
"description": "字段在所在行的宽度百分比(1-100 整数);后端不校验总和与取值,存量数据存在 33/34 等三等分布值。",
|
|
359
|
+
"maximum": 100,
|
|
360
|
+
"minimum": 1,
|
|
365
361
|
"type": "integer"
|
|
366
362
|
}
|
|
367
363
|
},
|
|
@@ -242,13 +242,9 @@
|
|
|
242
242
|
"type": "string"
|
|
243
243
|
},
|
|
244
244
|
"width": {
|
|
245
|
-
"description": "
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
50,
|
|
249
|
-
75,
|
|
250
|
-
100
|
|
251
|
-
],
|
|
245
|
+
"description": "字段在所在行的宽度百分比(1-100 整数);后端不校验总和与取值,存量数据存在 33/34 等三等分布值。",
|
|
246
|
+
"maximum": 100,
|
|
247
|
+
"minimum": 1,
|
|
252
248
|
"type": "integer"
|
|
253
249
|
}
|
|
254
250
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"DataRelationCondition": {
|
|
21
21
|
"additionalProperties": false,
|
|
22
|
-
"description": "一条数据关联过滤条件;sourceField 必须属于数据来源,operator 必须适用于该字段类型。固定值请使用 literal operand,不要直接声明后端 matchRules。",
|
|
22
|
+
"description": "一条数据关联过滤条件;sourceField 必须属于数据来源,operator 必须适用于该字段类型。固定值请使用 literal operand,不要直接声明后端 matchRules。sourceField 省略为存量读回形态(历史脏公式的源字段缺失,如 #queId_0$,写回时以 queId=0 透传),新建条件应提供 sourceField。",
|
|
23
23
|
"properties": {
|
|
24
24
|
"operand": {
|
|
25
25
|
"$ref": "#/$defs/DataRelationOperand",
|
|
@@ -55,11 +55,10 @@
|
|
|
55
55
|
},
|
|
56
56
|
"sourceField": {
|
|
57
57
|
"$ref": "#/$defs/FieldSelector",
|
|
58
|
-
"description": "
|
|
58
|
+
"description": "被过滤的数据源字段;存量读回形态可能缺失(后端反解析出的条件源字段 queId=0 且无名称)。"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
"required": [
|
|
62
|
-
"sourceField",
|
|
63
62
|
"operator",
|
|
64
63
|
"operand"
|
|
65
64
|
],
|
|
@@ -67,7 +66,7 @@
|
|
|
67
66
|
},
|
|
68
67
|
"DataRelationConfig": {
|
|
69
68
|
"additionalProperties": false,
|
|
70
|
-
"description": "数据关联字段配置;从应用、Q-Linker 或代码块输出中读取数据。",
|
|
69
|
+
"description": "数据关联字段配置;从应用、Q-Linker 或代码块输出中读取数据。source 省略表示该字段当前无关联来源配置(存量表单读回形态:后端 GET 对 displayed 目标缺失的 relation 行不回传,FormSvcImpl#getQuestionRelationsBeans continue 分支;新建数据关联字段应提供 source)。",
|
|
71
70
|
"properties": {
|
|
72
71
|
"aggregation": {
|
|
73
72
|
"description": "可选聚合方式;null 表示不聚合。",
|
|
@@ -102,12 +101,10 @@
|
|
|
102
101
|
},
|
|
103
102
|
"source": {
|
|
104
103
|
"$ref": "#/$defs/DataRelationSource",
|
|
105
|
-
"description": "数据来源;按 kind
|
|
104
|
+
"description": "数据来源;按 kind 选择一种来源结构。存量读回形态可能无 source(后端读面不回传关联配置),此时写回不重建该字段的关联。"
|
|
106
105
|
}
|
|
107
106
|
},
|
|
108
|
-
"required": [
|
|
109
|
-
"source"
|
|
110
|
-
],
|
|
107
|
+
"required": [],
|
|
111
108
|
"type": "object"
|
|
112
109
|
},
|
|
113
110
|
"DataRelationCustomButton": {
|
|
@@ -504,13 +501,9 @@
|
|
|
504
501
|
"type": "string"
|
|
505
502
|
},
|
|
506
503
|
"width": {
|
|
507
|
-
"description": "
|
|
508
|
-
"
|
|
509
|
-
|
|
510
|
-
50,
|
|
511
|
-
75,
|
|
512
|
-
100
|
|
513
|
-
],
|
|
504
|
+
"description": "字段在所在行的宽度百分比(1-100 整数);后端不校验总和与取值,存量数据存在 33/34 等三等分布值。",
|
|
505
|
+
"maximum": 100,
|
|
506
|
+
"minimum": 1,
|
|
514
507
|
"type": "integer"
|
|
515
508
|
}
|
|
516
509
|
},
|