weaver-e10-builder 1.6.15 → 1.7.0
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/dist/cli-register.d.ts +8 -1
- package/dist/cli-register.d.ts.map +1 -1
- package/dist/cli-register.js +238 -86
- package/dist/cli-register.js.map +1 -1
- package/dist/commands/actionflow.d.ts +1 -0
- package/dist/commands/actionflow.d.ts.map +1 -1
- package/dist/commands/actionflow.js +17 -1
- package/dist/commands/actionflow.js.map +1 -1
- package/dist/commands/designer-custom-page.d.ts +3 -0
- package/dist/commands/designer-custom-page.d.ts.map +1 -0
- package/dist/commands/designer-custom-page.js +56 -0
- package/dist/commands/designer-custom-page.js.map +1 -0
- package/dist/commands/designer-event.d.ts.map +1 -1
- package/dist/commands/designer-event.js +70 -5
- package/dist/commands/designer-event.js.map +1 -1
- package/dist/commands/designer-list-advanced.d.ts +3 -0
- package/dist/commands/designer-list-advanced.d.ts.map +1 -0
- package/dist/commands/designer-list-advanced.js +53 -0
- package/dist/commands/designer-list-advanced.js.map +1 -0
- package/dist/commands/designer-list-controls.d.ts +3 -0
- package/dist/commands/designer-list-controls.d.ts.map +1 -0
- package/dist/commands/designer-list-controls.js +39 -0
- package/dist/commands/designer-list-controls.js.map +1 -0
- package/dist/commands/designer-permission.d.ts +3 -0
- package/dist/commands/designer-permission.d.ts.map +1 -0
- package/dist/commands/designer-permission.js +32 -0
- package/dist/commands/designer-permission.js.map +1 -0
- package/dist/commands/designer-tabbar.d.ts +3 -0
- package/dist/commands/designer-tabbar.d.ts.map +1 -0
- package/dist/commands/designer-tabbar.js +24 -0
- package/dist/commands/designer-tabbar.js.map +1 -0
- package/dist/commands/ecode.d.ts +9 -0
- package/dist/commands/ecode.d.ts.map +1 -0
- package/dist/commands/ecode.js +81 -0
- package/dist/commands/ecode.js.map +1 -0
- package/dist/commands/form-base-setting.d.ts +3 -0
- package/dist/commands/form-base-setting.d.ts.map +1 -0
- package/dist/commands/form-base-setting.js +192 -0
- package/dist/commands/form-base-setting.js.map +1 -0
- package/dist/commands/form-field-linkage.d.ts +5 -0
- package/dist/commands/form-field-linkage.d.ts.map +1 -1
- package/dist/commands/form-field-linkage.js +82 -16
- package/dist/commands/form-field-linkage.js.map +1 -1
- package/dist/commands/form-list-columns.d.ts.map +1 -1
- package/dist/commands/form-list-columns.js +4 -0
- package/dist/commands/form-list-columns.js.map +1 -1
- package/dist/commands/form-list-config.d.ts.map +1 -1
- package/dist/commands/form-list-config.js +19 -3
- package/dist/commands/form-list-config.js.map +1 -1
- package/dist/commands/form-list-permission.d.ts.map +1 -1
- package/dist/commands/form-list-permission.js +34 -1
- package/dist/commands/form-list-permission.js.map +1 -1
- package/dist/commands/form-obj-meta.d.ts.map +1 -1
- package/dist/commands/form-obj-meta.js +194 -1
- package/dist/commands/form-obj-meta.js.map +1 -1
- package/dist/commands/form-table-view.d.ts.map +1 -1
- package/dist/commands/form-table-view.js +14 -4
- package/dist/commands/form-table-view.js.map +1 -1
- package/dist/commands/matrix-person.d.ts +3 -0
- package/dist/commands/matrix-person.d.ts.map +1 -0
- package/dist/commands/matrix-person.js +95 -0
- package/dist/commands/matrix-person.js.map +1 -0
- package/dist/commands/matrix.d.ts.map +1 -1
- package/dist/commands/matrix.js +3 -1
- package/dist/commands/matrix.js.map +1 -1
- package/dist/commands/page-combination.d.ts.map +1 -1
- package/dist/commands/page-combination.js +15 -0
- package/dist/commands/page-combination.js.map +1 -1
- package/dist/commands/page-management.d.ts +3 -0
- package/dist/commands/page-management.d.ts.map +1 -0
- package/dist/commands/page-management.js +16 -0
- package/dist/commands/page-management.js.map +1 -0
- package/dist/commands/page.d.ts.map +1 -1
- package/dist/commands/page.js +8 -9
- package/dist/commands/page.js.map +1 -1
- package/dist/commands/report-cell.d.ts.map +1 -1
- package/dist/commands/report-cell.js +215 -0
- package/dist/commands/report-cell.js.map +1 -1
- package/dist/commands/report-code.d.ts +9 -0
- package/dist/commands/report-code.d.ts.map +1 -0
- package/dist/commands/report-code.js +105 -0
- package/dist/commands/report-code.js.map +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +70 -17
- package/dist/commands/report.js.map +1 -1
- package/dist/core/client.d.ts +12 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +23 -2
- package/dist/core/client.js.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/services/action-detail.d.ts +2 -0
- package/dist/services/action-detail.d.ts.map +1 -1
- package/dist/services/action-detail.js +11 -5
- package/dist/services/action-detail.js.map +1 -1
- package/dist/services/actionflow/build_workflow_draft.d.ts +1 -1
- package/dist/services/actionflow/build_workflow_draft.d.ts.map +1 -1
- package/dist/services/actionflow/build_workflow_draft.js +28 -24
- package/dist/services/actionflow/build_workflow_draft.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_update_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/components/action_eb_update_compiler.js +2 -15
- package/dist/services/actionflow/components/action_eb_update_compiler.js.map +1 -1
- package/dist/services/actionflow/components/custom_set_form.d.ts.map +1 -1
- package/dist/services/actionflow/components/custom_set_form.js +1 -9
- package/dist/services/actionflow/components/custom_set_form.js.map +1 -1
- package/dist/services/actionflow/components/dml_execute.d.ts.map +1 -1
- package/dist/services/actionflow/components/dml_execute.js +3 -4
- package/dist/services/actionflow/components/dml_execute.js.map +1 -1
- package/dist/services/actionflow/components/document_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/document_actions.js +0 -3
- package/dist/services/actionflow/components/document_actions.js.map +1 -1
- package/dist/services/actionflow/components/form_data_builder.d.ts.map +1 -1
- package/dist/services/actionflow/components/form_data_builder.js +27 -5
- package/dist/services/actionflow/components/form_data_builder.js.map +1 -1
- package/dist/services/actionflow/components/hrm_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/hrm_actions.js +1 -3
- package/dist/services/actionflow/components/hrm_actions.js.map +1 -1
- package/dist/services/actionflow/components/index.d.ts +1 -1
- package/dist/services/actionflow/components/index.d.ts.map +1 -1
- package/dist/services/actionflow/components/index.js +1 -1
- package/dist/services/actionflow/components/index.js.map +1 -1
- package/dist/services/actionflow/components/inner_mq_listener.js +1 -1
- package/dist/services/actionflow/components/inner_mq_listener.js.map +1 -1
- package/dist/services/actionflow/components/inner_mq_send.d.ts.map +1 -1
- package/dist/services/actionflow/components/inner_mq_send.js +6 -2
- package/dist/services/actionflow/components/inner_mq_send.js.map +1 -1
- package/dist/services/actionflow/components/multiple_execution.d.ts +1 -2
- package/dist/services/actionflow/components/multiple_execution.d.ts.map +1 -1
- package/dist/services/actionflow/components/multiple_execution.js +55 -276
- package/dist/services/actionflow/components/multiple_execution.js.map +1 -1
- package/dist/services/actionflow/components/output.d.ts.map +1 -1
- package/dist/services/actionflow/components/output.js +3 -7
- package/dist/services/actionflow/components/output.js.map +1 -1
- package/dist/services/actionflow/components/send_message.d.ts.map +1 -1
- package/dist/services/actionflow/components/send_message.js +6 -10
- package/dist/services/actionflow/components/send_message.js.map +1 -1
- package/dist/services/actionflow/components/serverless_action.d.ts.map +1 -1
- package/dist/services/actionflow/components/serverless_action.js +3 -2
- package/dist/services/actionflow/components/serverless_action.js.map +1 -1
- package/dist/services/actionflow/components/workflow_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/workflow_actions.js +0 -3
- package/dist/services/actionflow/components/workflow_actions.js.map +1 -1
- package/dist/services/actionflow/context_preflight.d.ts.map +1 -1
- package/dist/services/actionflow/context_preflight.js +12 -9
- package/dist/services/actionflow/context_preflight.js.map +1 -1
- package/dist/services/actionflow/filter_rules.js +4 -4
- package/dist/services/actionflow/filter_rules.js.map +1 -1
- package/dist/services/actionflow/formula_service.d.ts +0 -13
- package/dist/services/actionflow/formula_service.d.ts.map +1 -1
- package/dist/services/actionflow/formula_service.js +45 -267
- package/dist/services/actionflow/formula_service.js.map +1 -1
- package/dist/services/actionflow/generation_service.d.ts.map +1 -1
- package/dist/services/actionflow/generation_service.js +10 -12
- package/dist/services/actionflow/generation_service.js.map +1 -1
- package/dist/services/actionflow/id_generator.d.ts +2 -2
- package/dist/services/actionflow/id_generator.d.ts.map +1 -1
- package/dist/services/actionflow/id_generator.js +5 -11
- package/dist/services/actionflow/id_generator.js.map +1 -1
- package/dist/services/actionflow/loop_context.d.ts +12 -0
- package/dist/services/actionflow/loop_context.d.ts.map +1 -0
- package/dist/services/actionflow/loop_context.js +134 -0
- package/dist/services/actionflow/loop_context.js.map +1 -0
- package/dist/services/actionflow/param_group_dto.d.ts +7 -0
- package/dist/services/actionflow/param_group_dto.d.ts.map +1 -1
- package/dist/services/actionflow/param_group_dto.js +128 -16
- package/dist/services/actionflow/param_group_dto.js.map +1 -1
- package/dist/services/actionflow/param_mapping_basis.js +2 -2
- package/dist/services/actionflow/param_mapping_basis.js.map +1 -1
- package/dist/services/actionflow/preflight_service.d.ts +1 -0
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -1
- package/dist/services/actionflow/preflight_service.js +88 -291
- package/dist/services/actionflow/preflight_service.js.map +1 -1
- package/dist/services/actionflow/readback_verifier.d.ts.map +1 -1
- package/dist/services/actionflow/readback_verifier.js +21 -2
- package/dist/services/actionflow/readback_verifier.js.map +1 -1
- package/dist/services/actionflow/save_workflow_draft.d.ts +2 -3
- package/dist/services/actionflow/save_workflow_draft.d.ts.map +1 -1
- package/dist/services/actionflow/save_workflow_draft.js +14 -16
- package/dist/services/actionflow/save_workflow_draft.js.map +1 -1
- package/dist/services/actionflow/update_service.d.ts +5 -0
- package/dist/services/actionflow/update_service.d.ts.map +1 -1
- package/dist/services/actionflow/update_service.js +126 -3
- package/dist/services/actionflow/update_service.js.map +1 -1
- package/dist/services/actionflow/workflow_compiler.d.ts +1 -2
- package/dist/services/actionflow/workflow_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/workflow_compiler.js +79 -105
- package/dist/services/actionflow/workflow_compiler.js.map +1 -1
- package/dist/services/designer-custom-page.d.ts +11 -0
- package/dist/services/designer-custom-page.d.ts.map +1 -0
- package/dist/services/designer-custom-page.js +227 -0
- package/dist/services/designer-custom-page.js.map +1 -0
- package/dist/services/designer-event.d.ts +7 -2
- package/dist/services/designer-event.d.ts.map +1 -1
- package/dist/services/designer-event.js +357 -33
- package/dist/services/designer-event.js.map +1 -1
- package/dist/services/designer-list-advanced.d.ts +9 -0
- package/dist/services/designer-list-advanced.d.ts.map +1 -0
- package/dist/services/designer-list-advanced.js +64 -0
- package/dist/services/designer-list-advanced.js.map +1 -0
- package/dist/services/designer-list-controls.d.ts +2 -0
- package/dist/services/designer-list-controls.d.ts.map +1 -0
- package/dist/services/designer-list-controls.js +85 -0
- package/dist/services/designer-list-controls.js.map +1 -0
- package/dist/services/designer-list-presentation.d.ts +2 -0
- package/dist/services/designer-list-presentation.d.ts.map +1 -0
- package/dist/services/designer-list-presentation.js +45 -0
- package/dist/services/designer-list-presentation.js.map +1 -0
- package/dist/services/designer-list-runtime.d.ts +2 -0
- package/dist/services/designer-list-runtime.d.ts.map +1 -0
- package/dist/services/designer-list-runtime.js +80 -0
- package/dist/services/designer-list-runtime.js.map +1 -0
- package/dist/services/designer-list-search.d.ts +2 -0
- package/dist/services/designer-list-search.d.ts.map +1 -0
- package/dist/services/designer-list-search.js +72 -0
- package/dist/services/designer-list-search.js.map +1 -0
- package/dist/services/designer-permission.d.ts +52 -0
- package/dist/services/designer-permission.d.ts.map +1 -0
- package/dist/services/designer-permission.js +316 -0
- package/dist/services/designer-permission.js.map +1 -0
- package/dist/services/designer-tabbar.d.ts +11 -0
- package/dist/services/designer-tabbar.d.ts.map +1 -0
- package/dist/services/designer-tabbar.js +114 -0
- package/dist/services/designer-tabbar.js.map +1 -0
- package/dist/services/ecode-check.d.ts +50 -0
- package/dist/services/ecode-check.d.ts.map +1 -0
- package/dist/services/ecode-check.js +408 -0
- package/dist/services/ecode-check.js.map +1 -0
- package/dist/services/esb-interface/importer.d.ts +35 -1
- package/dist/services/esb-interface/importer.d.ts.map +1 -1
- package/dist/services/esb-interface/importer.js +77 -1
- package/dist/services/esb-interface/importer.js.map +1 -1
- package/dist/services/form-base-setting.d.ts +88 -0
- package/dist/services/form-base-setting.d.ts.map +1 -0
- package/dist/services/form-base-setting.js +272 -0
- package/dist/services/form-base-setting.js.map +1 -0
- package/dist/services/form-list-columns.d.ts.map +1 -1
- package/dist/services/form-list-columns.js +12 -3
- package/dist/services/form-list-columns.js.map +1 -1
- package/dist/services/form-list-config.d.ts +40 -3
- package/dist/services/form-list-config.d.ts.map +1 -1
- package/dist/services/form-list-config.js +207 -25
- package/dist/services/form-list-config.js.map +1 -1
- package/dist/services/form-list-fields.d.ts.map +1 -1
- package/dist/services/form-list-fields.js +3 -1
- package/dist/services/form-list-fields.js.map +1 -1
- package/dist/services/form-log-setting.d.ts +55 -0
- package/dist/services/form-log-setting.d.ts.map +1 -0
- package/dist/services/form-log-setting.js +108 -0
- package/dist/services/form-log-setting.js.map +1 -0
- package/dist/services/form-obj-lang.d.ts +45 -0
- package/dist/services/form-obj-lang.d.ts.map +1 -0
- package/dist/services/form-obj-lang.js +127 -0
- package/dist/services/form-obj-lang.js.map +1 -0
- package/dist/services/form-obj-meta.d.ts +34 -0
- package/dist/services/form-obj-meta.d.ts.map +1 -1
- package/dist/services/form-obj-meta.js +81 -12
- package/dist/services/form-obj-meta.js.map +1 -1
- package/dist/services/form-table-view.d.ts +8 -2
- package/dist/services/form-table-view.d.ts.map +1 -1
- package/dist/services/form-table-view.js +22 -5
- package/dist/services/form-table-view.js.map +1 -1
- package/dist/services/form-view.d.ts +1 -1
- package/dist/services/form-view.d.ts.map +1 -1
- package/dist/services/form-view.js +38 -13
- package/dist/services/form-view.js.map +1 -1
- package/dist/services/matrix-person.d.ts +37 -0
- package/dist/services/matrix-person.d.ts.map +1 -0
- package/dist/services/matrix-person.js +57 -0
- package/dist/services/matrix-person.js.map +1 -0
- package/dist/services/org-browser.d.ts +32 -0
- package/dist/services/org-browser.d.ts.map +1 -1
- package/dist/services/org-browser.js +90 -12
- package/dist/services/org-browser.js.map +1 -1
- package/dist/services/page-combination.d.ts +1 -1
- package/dist/services/page-combination.d.ts.map +1 -1
- package/dist/services/page-combination.js +43 -10
- package/dist/services/page-combination.js.map +1 -1
- package/dist/services/page-management.d.ts +67 -0
- package/dist/services/page-management.d.ts.map +1 -0
- package/dist/services/page-management.js +166 -0
- package/dist/services/page-management.js.map +1 -0
- package/dist/services/page-permission.d.ts +2 -2
- package/dist/services/page-permission.d.ts.map +1 -1
- package/dist/services/page-permission.js +22 -9
- package/dist/services/page-permission.js.map +1 -1
- package/dist/services/report/cell-transform.d.ts +62 -0
- package/dist/services/report/cell-transform.d.ts.map +1 -0
- package/dist/services/report/cell-transform.js +192 -0
- package/dist/services/report/cell-transform.js.map +1 -0
- package/dist/services/report/code-block.d.ts +45 -0
- package/dist/services/report/code-block.d.ts.map +1 -0
- package/dist/services/report/code-block.js +92 -0
- package/dist/services/report/code-block.js.map +1 -0
- package/dist/services/report/dataset.d.ts +40 -0
- package/dist/services/report/dataset.d.ts.map +1 -1
- package/dist/services/report/dataset.js +171 -1
- package/dist/services/report/dataset.js.map +1 -1
- package/dist/services/report/lifecycle.d.ts.map +1 -1
- package/dist/services/report/lifecycle.js +24 -3
- package/dist/services/report/lifecycle.js.map +1 -1
- package/dist/services/workflow-base-settings.d.ts.map +1 -1
- package/dist/services/workflow-base-settings.js +19 -5
- package/dist/services/workflow-base-settings.js.map +1 -1
- package/ecode-ui/README.md +9 -0
- package/ecode-ui/ui-types.zip +0 -0
- package/ecode-ui/version.json +7 -0
- package/package.json +4 -1
- package/skill-docs/SKILL.md +19 -5
- package/skill-docs/_catalog.md +22 -1
- package/skill-docs/actionflows/SKILL.md +15 -11
- package/skill-docs/actionflows/references/components/database/DMLExecute.md +4 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbAdd.md +1 -1
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbUpdate.md +2 -0
- package/skill-docs/actionflows/references/components/logic/MultipleExecution.md +9 -30
- package/skill-docs/actionflows/references/components/message/InnerMQSend.md +7 -3
- package/skill-docs/actionflows/references/components/serverless/ServerlessAction.md +4 -0
- package/skill-docs/actionflows/references/components/trigger/CustomTrigger.md +6 -6
- package/skill-docs/actionflows/references/components/trigger/InnerMQListener.md +46 -41
- package/skill-docs/actionflows/references/components/trigger/WebHookTrigger.md +4 -0
- package/skill-docs/actionflows/references/dynamic_capability_matrix.md +3 -4
- package/skill-docs/actionflows/references/function_rules.md +5 -1
- package/skill-docs/actionflows/references/trigger_runtime_notes.md +1 -1
- package/skill-docs/assets/factory/factory-custom-page.json +339 -0
- package/skill-docs/references/common/ref-cli-commands.md +34 -5
- package/skill-docs/references/ebuilder-designer/component-permission.md +131 -0
- package/skill-docs/references/ebuilder-designer/events/actions-interaction.md +132 -108
- package/skill-docs/references/ebuilder-designer/events/guide-events.md +112 -57
- package/skill-docs/references/ebuilder-designer/guide-custom-page.md +176 -0
- package/skill-docs/references/ebuilder-designer/guide-designer-components.md +2 -0
- package/skill-docs/references/ebuilder-designer/guide-designer-factory.md +2 -0
- package/skill-docs/references/ebuilder-designer/guide-designer.md +304 -296
- package/skill-docs/references/ebuilder-designer/guide-list.md +339 -0
- package/skill-docs/references/ebuilder-designer/guide-page-combination.md +162 -142
- package/skill-docs/references/ebuilder-designer/guide-page-management.md +90 -0
- package/skill-docs/references/ebuilder-designer/guide-page-permission.md +151 -145
- package/skill-docs/references/ebuilder-designer/guide-tabbar.md +57 -0
- package/skill-docs/references/esb-interface/guide-import.md +38 -34
- package/skill-docs/references/form/guide-create-form.md +13 -0
- package/skill-docs/references/form/guide-form-base-setting.md +78 -0
- package/skill-docs/references/form/guide-form-view.md +77 -13
- package/skill-docs/references/form/guide-list-columns.md +8 -0
- package/skill-docs/references/hrm/guide-matrix.md +16 -0
- package/skill-docs/references/report/cell-transform-guide.md +17 -3
- package/skill-docs/references/report/code-block-guide.md +54 -0
- package/skill-docs/references/report/dataset-sidebar-ops-guide.md +8 -0
- package/skill-docs/references/report/ref-report-commands.md +7 -1
- package/skill-docs/references/report/report-designer-feature-map.md +1 -1
- package/skill-docs/references/report/report-list-page-ops-guide.md +2 -0
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* 动态赋值的字段引用、公式树与资源对象构造。
|
|
3
3
|
* 对齐 Python 版 core/formula_service.py(黄金参照)。
|
|
4
4
|
*/
|
|
5
|
-
import { genSfId,
|
|
6
|
-
import { resolveCustomTriggerDtoId } from './custom_trigger_context.js';
|
|
5
|
+
import { genSfId, requireContextFieldId } from './id_generator.js';
|
|
7
6
|
import { resolveSystemParameter } from './system_params.js';
|
|
8
7
|
import { findFunction } from './functions_catalog.js';
|
|
9
8
|
import { getWorkflowContextFields, getWorkflowContextFieldsByKey, getWorkflowDetailNames, getTargetFormFields, findInMetadata, workflowFieldId, } from './runtime_metadata.js';
|
|
@@ -283,6 +282,7 @@ export function contextMetaForReference(meta, reference, componentType = '') {
|
|
|
283
282
|
copy('tableName', '_context_table_name');
|
|
284
283
|
copy('tableKey', '_context_table_key');
|
|
285
284
|
copy('paramKey', '_context_original_param_key');
|
|
285
|
+
copy('fieldId', '_context_original_field_id');
|
|
286
286
|
copy('parentName', '_context_original_parent_name');
|
|
287
287
|
copy('multKey', '_context_mult_key');
|
|
288
288
|
copy('multName', '_context_mult_name');
|
|
@@ -332,7 +332,7 @@ export function protocolParamKey(paramKey, root, componentType) {
|
|
|
332
332
|
|| isComponentContextRoot(root)) {
|
|
333
333
|
return raw.startsWith(`${root}.`) ? raw.slice(root.length + 1) : raw;
|
|
334
334
|
}
|
|
335
|
-
return raw.replace(/^(?:FormData|ApprovalData|SelectParams)\./, '');
|
|
335
|
+
return raw.replace(/^(?:FormData|ApprovalData|SelectParams|CycleParams)\./, '');
|
|
336
336
|
}
|
|
337
337
|
function customTriggerTables(meta) {
|
|
338
338
|
return meta && Array.isArray(meta._custom_trigger_data?.tableList)
|
|
@@ -502,14 +502,6 @@ function alignContextParentName(paramKey, parentName, fieldLabel, meta = null, o
|
|
|
502
502
|
}
|
|
503
503
|
return labels.join('.');
|
|
504
504
|
}
|
|
505
|
-
/**
|
|
506
|
-
* 对齐 context/index.tsx onClick 的循环路径组装结果。
|
|
507
|
-
*
|
|
508
|
-
* 前端会根据当前循环是“当次”还是“历次”决定是否把 multKey/multName
|
|
509
|
-
* 拼到字段前面。后端没有浏览器 sessionStorage,因此只消费编译/预检阶段
|
|
510
|
-
* 已明确写入的 effectiveMultKey;没有该信息时保留接口返回的当前字段路径,
|
|
511
|
-
* 不凭空把一个当次循环改成历次循环。
|
|
512
|
-
*/
|
|
513
505
|
function resolveFrontendMultPath(paramKey, parentName, meta = null) {
|
|
514
506
|
const baseParamKey = String(meta?._context_original_param_key || paramKey || '');
|
|
515
507
|
const selectedParamKeyRaw = String(meta?._context_selected_param_key || '');
|
|
@@ -543,21 +535,12 @@ function resolveFrontendMultPath(paramKey, parentName, meta = null) {
|
|
|
543
535
|
function addContextTableKey(paramKey, meta = null) {
|
|
544
536
|
const tableKey = String(meta?._context_table_key || '').replace(/\.$/, '');
|
|
545
537
|
const rawKey = String(paramKey || '');
|
|
546
|
-
if (!tableKey || ['FormData', 'ApprovalData', 'SelectParams'].includes(tableKey))
|
|
538
|
+
if (!tableKey || ['FormData', 'ApprovalData', 'SelectParams', 'CycleParams'].includes(tableKey))
|
|
547
539
|
return rawKey;
|
|
548
540
|
if (rawKey === tableKey || rawKey.startsWith(`${tableKey}.`))
|
|
549
541
|
return rawKey;
|
|
550
542
|
return `${tableKey}.${rawKey}`;
|
|
551
543
|
}
|
|
552
|
-
function resolveCustomTriggerFormulaFrontId(paramKey, resolved = {}, meta = null) {
|
|
553
|
-
const rawKey = String(paramKey || '');
|
|
554
|
-
const tableKey = String(resolved.tableKey || meta?._context_table_key || '');
|
|
555
|
-
const lookupKey = tableKey
|
|
556
|
-
&& !rawKey.startsWith(`${tableKey}.`)
|
|
557
|
-
? `${tableKey}.${rawKey}`
|
|
558
|
-
: rawKey;
|
|
559
|
-
return resolveCustomTriggerDtoId(lookupKey, meta?._custom_trigger_data, String(resolved.dimension || meta?._context_dimension || ''));
|
|
560
|
-
}
|
|
561
544
|
// ── Formula 对象生成器 ───────────────────────────────────────
|
|
562
545
|
function makeConfigStr(config) {
|
|
563
546
|
return JSON.stringify(config);
|
|
@@ -612,7 +595,7 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
612
595
|
source: sourceId,
|
|
613
596
|
type: '3',
|
|
614
597
|
value: `${contextRoot}.${fieldKey}`,
|
|
615
|
-
frontId:
|
|
598
|
+
frontId: requireContextFieldId(opts.frontId, 'FormulaBean.frontId'),
|
|
616
599
|
paramKey: String(fieldKey),
|
|
617
600
|
paramType: fieldType,
|
|
618
601
|
childs: [],
|
|
@@ -639,55 +622,6 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
639
622
|
sortWeight: 0.0,
|
|
640
623
|
};
|
|
641
624
|
}
|
|
642
|
-
/**
|
|
643
|
-
* 多次执行组件的“当次循环”上下文。它不是 FormData:平台返回的是 CycleParams,
|
|
644
|
-
* 前端也依赖 comType/isMultCom 来显示“循环(当次循环)”。
|
|
645
|
-
*/
|
|
646
|
-
export function formulaCurrentLoopContext(sourceComponentId, fieldKey, opts = {}) {
|
|
647
|
-
const fid = genSfId();
|
|
648
|
-
const sourceId = String(sourceComponentId || '0');
|
|
649
|
-
const fieldName = String(opts.name || fieldKey);
|
|
650
|
-
const fieldType = opts.fieldType || 'int';
|
|
651
|
-
const primaryKey = 'CycleParams';
|
|
652
|
-
const valuePath = `${primaryKey}.${fieldKey}`;
|
|
653
|
-
const parentName = String(opts.parentName || `循环.${fieldName}`);
|
|
654
|
-
const rawField = opts.rawField && typeof opts.rawField === 'object' ? opts.rawField : {};
|
|
655
|
-
const renderedFieldType = ['int', 'integer', 'long', 'double', 'number'].includes(String(fieldType).toLowerCase()) ? 'number' : ftNorm(fieldType);
|
|
656
|
-
// 前端 MultipleExecution.getRequest 使用平台固定的循环根字段 ID:
|
|
657
|
-
// 逐条循环为 744564088747180033,分批循环为 744564088747180034。
|
|
658
|
-
// 这两个值不是业务字段 ID;把上游列表字段 ID 放到 root FormulaBean 的
|
|
659
|
-
// frontId 会导致设计器仍能显示,但 saveDesign 在服务端校验时返回 500。
|
|
660
|
-
const loopRootFrontId = fieldKey === 'cycle.dataDetail[]'
|
|
661
|
-
? '744564088747180034'
|
|
662
|
-
: fieldKey === 'cycle.dataDetail'
|
|
663
|
-
? '744564088747180033'
|
|
664
|
-
: '';
|
|
665
|
-
return {
|
|
666
|
-
// 保留 getComponentContext 的原始字段信息;编辑器用这些字段回显参数路径。
|
|
667
|
-
...rawField,
|
|
668
|
-
formulaType: ftNorm(fieldType), name: fieldName, businessId: String(opts.businessId || '0'),
|
|
669
|
-
// 前端在点击“循环(当次循环)”时额外生成 assignId,用它区分每个
|
|
670
|
-
// 当次循环引用;缺少时编辑器只显示类型,不能回显所属组件和参数路径。
|
|
671
|
-
assignId: genSfId(), id: fid, source: sourceId, type: '3', value: valuePath,
|
|
672
|
-
frontId: normalizeNumericFrontId(opts.frontId || loopRootFrontId || rawField.id || rawField.paramId || fieldKey, '循环 FormulaBean.frontId'),
|
|
673
|
-
paramId: String(rawField.paramId || opts.frontId || rawField.id || fieldKey),
|
|
674
|
-
paramName: String(rawField.paramName || fieldName),
|
|
675
|
-
showName: String(rawField.showName || fieldName),
|
|
676
|
-
parentName, paramKey: String(fieldKey), paramType: fieldType, fieldType: renderedFieldType,
|
|
677
|
-
childs: [],
|
|
678
|
-
config: {
|
|
679
|
-
// 这是赋值目标的类型(消息标题/内容为 string),与来源字段 paramType 分开。
|
|
680
|
-
paramKey: String(fieldKey), paramType: String(opts.targetFieldType || 'string'),
|
|
681
|
-
parentName, newParentName: parentName,
|
|
682
|
-
multKey: '', multName: '',
|
|
683
|
-
multTypeObj: { allName: parentName, currentName: parentName, currentParamKey: valuePath, allParamKey: valuePath },
|
|
684
|
-
comId: sourceId, isMultCom: true, tableName: '循环参数',
|
|
685
|
-
fieldInfo: { paramKey: String(fieldKey), tablePrimaryKey: primaryKey },
|
|
686
|
-
comType: 'MultipleExecution', parentComId: '0',
|
|
687
|
-
},
|
|
688
|
-
sortWeight: 0.0,
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
625
|
export function formulaSystemVar(varName = '{userid}') {
|
|
692
626
|
const resolved = resolveSystemParameter(varName);
|
|
693
627
|
const fid = genSfId();
|
|
@@ -713,7 +647,6 @@ export function formulaContainerString(childFormulas, valuePlaceholder = '', app
|
|
|
713
647
|
c.position ??= genSfId();
|
|
714
648
|
positions.push(String(c.position));
|
|
715
649
|
}
|
|
716
|
-
const requiresEditorConfig = childFormulas.some((child) => child?.config && typeof child.config === 'object' && child.config.isMultCom === true);
|
|
717
650
|
const config = { paramType: 'string', switchType: 'assign', formulaVersion: 'V1' };
|
|
718
651
|
return {
|
|
719
652
|
configObject: { paramType: 'string', switchType: 'assign' },
|
|
@@ -723,9 +656,7 @@ export function formulaContainerString(childFormulas, valuePlaceholder = '', app
|
|
|
723
656
|
type: '8',
|
|
724
657
|
applicationId: appId,
|
|
725
658
|
value: valuePlaceholder || `textarea#${positions.join('#')}#`,
|
|
726
|
-
childs: childFormulas,
|
|
727
|
-
// 循环当次引用由设计器以对象 config 回显;普通 FormulaBean 仍保留历史字符串格式。
|
|
728
|
-
config: requiresEditorConfig ? { paramType: 'string', switchType: 'assign' } : makeConfigStr(config),
|
|
659
|
+
childs: childFormulas, config: makeConfigStr(config),
|
|
729
660
|
parentId: 0,
|
|
730
661
|
sortWeight: 0.0,
|
|
731
662
|
};
|
|
@@ -1125,7 +1056,7 @@ export function buildPersonFormula(personRef, meta, appId = '', forSendMessage =
|
|
|
1125
1056
|
}
|
|
1126
1057
|
return formulaContext(resolveContextSource(personRef, eventId), pid, {
|
|
1127
1058
|
name: String(personRef.name || personRef.label || pid),
|
|
1128
|
-
frontId: personRef.
|
|
1059
|
+
frontId: personRef._resolvedContext?.fieldId || personRef._resolvedContext?.rawField?.id,
|
|
1129
1060
|
componentType,
|
|
1130
1061
|
meta: contextRoot ? { ...meta, _context_table_primary_key: contextRoot } : meta,
|
|
1131
1062
|
requireResolvedRoot: true,
|
|
@@ -1336,35 +1267,7 @@ function buildNamedFunctionBean(ref, fieldId, fieldType, meta, appId, defaultSou
|
|
|
1336
1267
|
const childs = args.map((arg, index) => {
|
|
1337
1268
|
const resolved = resolveFunctionArgument(arg, entry.detail[index], entry.name, index);
|
|
1338
1269
|
const child = unwrapDynamicTextarea(resolved.value, `函数 '${entry.name}' 第 ${index + 1} 个参数`);
|
|
1339
|
-
|
|
1340
|
-
// 预检阶段会把字段上下文挂到原始引用上;函数参数经过
|
|
1341
|
-
// resolveFunctionArgument/unwrapDynamicTextarea 后仍需显式保留这份
|
|
1342
|
-
// CustomTrigger 元数据,否则 buildAssignBean 只能看到字段名 d/e/f,
|
|
1343
|
-
// 最终把字段名错误地写入 FormulaBean.frontId。
|
|
1344
|
-
if (child && typeof child === 'object' && String(child.kind || child.assignmentKind || '') === 'context') {
|
|
1345
|
-
const customData = meta?._custom_trigger_data;
|
|
1346
|
-
const childKey = String(child.paramKey || child.key || '');
|
|
1347
|
-
if (customData && childKey) {
|
|
1348
|
-
const resolvedContext = child._resolvedContext && typeof child._resolvedContext === 'object'
|
|
1349
|
-
? child._resolvedContext : {};
|
|
1350
|
-
const fieldId = String(resolvedContext.fieldId
|
|
1351
|
-
|| resolveCustomTriggerDtoId(childKey, customData, 'field')
|
|
1352
|
-
|| child.frontId
|
|
1353
|
-
|| '');
|
|
1354
|
-
normalizedChild = {
|
|
1355
|
-
...child,
|
|
1356
|
-
componentType: String(child.componentType || 'CustomTrigger'),
|
|
1357
|
-
frontId: fieldId,
|
|
1358
|
-
_resolvedContext: {
|
|
1359
|
-
...resolvedContext,
|
|
1360
|
-
fieldId,
|
|
1361
|
-
componentType: 'CustomTrigger',
|
|
1362
|
-
paramKey: childKey,
|
|
1363
|
-
parentName: String(resolvedContext.parentName || child.parentName || ''),
|
|
1364
|
-
},
|
|
1365
|
-
};
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1270
|
+
const normalizedChild = child;
|
|
1368
1271
|
const argumentFieldType = [
|
|
1369
1272
|
resolved.fieldType,
|
|
1370
1273
|
child?.fieldType,
|
|
@@ -1376,56 +1279,6 @@ function buildNamedFunctionBean(ref, fieldId, fieldType, meta, appId, defaultSou
|
|
|
1376
1279
|
});
|
|
1377
1280
|
return formulaFunction(entry.id, entry.name, childs, formulaType, entry.excelFunc, entry.category || entry.resultType, entry.detail, appId, entry.paramSize);
|
|
1378
1281
|
}
|
|
1379
|
-
/**
|
|
1380
|
-
* 把循环当前项的业务字段还原为上游列表的带索引上下文。
|
|
1381
|
-
* CustomTrigger 的列表数据来自 SelectParams,不能复用 EnquiryForm 的
|
|
1382
|
-
* query_result(FormData);其他来源也沿用各自的上下文根节点。
|
|
1383
|
-
*/
|
|
1384
|
-
function buildIndexedSourceContextFormula(sourceParamKey, fieldLabel, sourceId, appId, fieldType, resolved, meta) {
|
|
1385
|
-
const marker = sourceParamKey.indexOf('[]');
|
|
1386
|
-
if (marker < 0)
|
|
1387
|
-
throw new Error(`[context] 循环列表来源 paramKey 缺少 []: ${sourceParamKey}`);
|
|
1388
|
-
const componentType = String(resolved.sourceComponentType || resolved.componentType || 'EventFormData');
|
|
1389
|
-
const contextRoot = String(resolved.sourceTablePrimaryKey || contextRootForComponent(componentType));
|
|
1390
|
-
const tableName = String(resolved.sourceTableName || contextTableNameForRoot(contextRoot));
|
|
1391
|
-
const position = genSfId();
|
|
1392
|
-
const indexedParamKey = `${sourceParamKey.slice(0, marker)}[${position}]${sourceParamKey.slice(marker + 2)}`;
|
|
1393
|
-
const rawField = resolved.rawField && typeof resolved.rawField === 'object' ? resolved.rawField : {};
|
|
1394
|
-
const label = String(resolved.label || fieldLabel || rawField.showName || rawField.paramName || sourceParamKey);
|
|
1395
|
-
const parentName = alignContextParentName(sourceParamKey, resolved.parentName || `${tableName}.${label}`, label, meta, { componentType });
|
|
1396
|
-
const frontIdCandidate = componentType === 'CustomTrigger'
|
|
1397
|
-
? resolveCustomTriggerFormulaFrontId(sourceParamKey, resolved, meta)
|
|
1398
|
-
: (resolved.fieldId ?? rawField.id ?? rawField.paramId ?? '');
|
|
1399
|
-
const frontId = normalizeNumericFrontId(frontIdCandidate, '循环当前项上下文 FormulaBean.frontId');
|
|
1400
|
-
const child = formulaFixed('0', 'string');
|
|
1401
|
-
child.name = '0';
|
|
1402
|
-
child.position = position;
|
|
1403
|
-
const flat = {
|
|
1404
|
-
...rawField,
|
|
1405
|
-
formulaType: ftNorm(fieldType), name: label, parentName,
|
|
1406
|
-
businessId: appId || '', id: genSfId(), source: String(sourceId || '0'), type: '3',
|
|
1407
|
-
value: `${contextRoot}.${indexedParamKey}`, frontId,
|
|
1408
|
-
paramKey: sourceParamKey, paramType: fieldType, fieldType: ftNorm(fieldType),
|
|
1409
|
-
childs: [child], parentId: '0',
|
|
1410
|
-
config: {
|
|
1411
|
-
paramKey: sourceParamKey, isMultCom: false, comType: componentType,
|
|
1412
|
-
switchType: 'assign', parentComId: 0, formulaVersion: 'V1',
|
|
1413
|
-
fieldInfo: { paramKey: sourceParamKey, tablePrimaryKey: contextRoot },
|
|
1414
|
-
tableName, paramType: ftNorm(fieldType), parentName,
|
|
1415
|
-
multName: '', multKey: '',
|
|
1416
|
-
multTypeObj: {
|
|
1417
|
-
allName: parentName, currentName: parentName,
|
|
1418
|
-
currentParamKey: `${contextRoot}.${indexedParamKey}`,
|
|
1419
|
-
allParamKey: `${contextRoot}.${sourceParamKey}`,
|
|
1420
|
-
},
|
|
1421
|
-
comId: String(sourceId || '0'), newParentName: parentName,
|
|
1422
|
-
},
|
|
1423
|
-
};
|
|
1424
|
-
child.parentId = flat.id;
|
|
1425
|
-
child.position = position;
|
|
1426
|
-
attachEsbAssign(flat, meta, String(sourceId || '0'));
|
|
1427
|
-
return flat;
|
|
1428
|
-
}
|
|
1429
1282
|
export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSourceId = '') {
|
|
1430
1283
|
if (!meta || typeof meta !== 'object')
|
|
1431
1284
|
meta = {};
|
|
@@ -1449,56 +1302,12 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
1449
1302
|
const label = src && typeof src === 'object' ? (src.label ?? src.name ?? key) : key;
|
|
1450
1303
|
const sourceComponent = String(src?._resolvedContext?.componentType || src?.componentType || meta?._context_component_type || meta?._upstream_component_type || 'ApproveTrigger');
|
|
1451
1304
|
key = normalizeContextParamKey(key, sourceComponent);
|
|
1452
|
-
const isCurrentLoop = src && typeof src === 'object' && (String(src.scope ?? src.contextScope ?? '') === 'current_loop' ||
|
|
1453
|
-
String(src.componentType ?? '') === 'MultipleExecution');
|
|
1454
|
-
if (isCurrentLoop) {
|
|
1455
|
-
if (!sourceId)
|
|
1456
|
-
throw new Error('[context] 当次循环引用缺少所属循环 source');
|
|
1457
|
-
const resolved = src._resolvedContext && typeof src._resolvedContext === 'object' ? src._resolvedContext : {};
|
|
1458
|
-
// 循环中的业务字段要保留上游列表来源和索引位置。只有循环控制字段
|
|
1459
|
-
// (例如 hasCycled)使用 CycleParams;把业务字段直接写成
|
|
1460
|
-
// CycleParams.cycle.dataDetail 会让设计器丢失“数据源查询/字段”层级。
|
|
1461
|
-
const sourceParamKey = String(resolved.sourceParamKey || '');
|
|
1462
|
-
const sourceComponentId = String(resolved.sourceComponentId || '');
|
|
1463
|
-
const listMarker = sourceParamKey.indexOf('[]');
|
|
1464
|
-
if (sourceParamKey && sourceComponentId && listMarker >= 0) {
|
|
1465
|
-
const sourceComponentType = String(resolved.sourceComponentType || resolved.sourceComponent || '');
|
|
1466
|
-
if (sourceComponentType === 'CustomTrigger') {
|
|
1467
|
-
const sourceBean = buildIndexedSourceContextFormula(sourceParamKey, String(resolved.label ?? label), sourceComponentId, appId, String(resolved.fieldType ?? src.fieldType ?? src.valueType ?? fieldType), resolved, meta);
|
|
1468
|
-
return sourceBean;
|
|
1469
|
-
}
|
|
1470
|
-
const formId = sourceParamKey.slice(0, listMarker);
|
|
1471
|
-
const sourceFieldKey = sourceParamKey.slice(listMarker + 2).replace(/^\./, '');
|
|
1472
|
-
if (formId && sourceFieldKey) {
|
|
1473
|
-
const queryBean = buildAssignBean({
|
|
1474
|
-
kind: 'query_result', formId, fieldId: sourceFieldKey,
|
|
1475
|
-
source: sourceComponentId, label: String(resolved.label ?? label),
|
|
1476
|
-
valueType: String(resolved.fieldType ?? src.fieldType ?? src.valueType ?? fieldType),
|
|
1477
|
-
componentKey: resolved.rawField?.componentKey,
|
|
1478
|
-
componentName: resolved.rawField?.componentName,
|
|
1479
|
-
componentType: resolved.rawField?.componentType,
|
|
1480
|
-
description: resolved.rawField?.description,
|
|
1481
|
-
_resolvedContext: {
|
|
1482
|
-
fieldId: String(resolved.rawField?.id || resolved.fieldId || sourceFieldKey),
|
|
1483
|
-
label: String(resolved.label ?? label),
|
|
1484
|
-
rawField: resolved.rawField,
|
|
1485
|
-
},
|
|
1486
|
-
}, fieldId, fieldType, meta, appId, defaultSourceId);
|
|
1487
|
-
return queryBean;
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
return formulaCurrentLoopContext(String(sourceId), String(key), {
|
|
1491
|
-
name: String(resolved.label ?? label), businessId: appId,
|
|
1492
|
-
fieldType: String(resolved.fieldType ?? src.fieldType ?? src.valueType ?? 'int'),
|
|
1493
|
-
frontId: String(resolved.fieldId ?? src.frontId ?? key),
|
|
1494
|
-
parentName: String(resolved.parentName ?? `循环.${resolved.label ?? label}`),
|
|
1495
|
-
rawField: resolved.rawField,
|
|
1496
|
-
targetFieldType: fieldType,
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
1305
|
const wfId = String(meta._workflow_id || '');
|
|
1500
1306
|
const resolvedKey = resolveParamKey(wfId, String(key));
|
|
1501
1307
|
const resolved = src && typeof src._resolvedContext === 'object' ? src._resolvedContext : {};
|
|
1308
|
+
if (sourceComponent === 'MultipleExecution' && (!resolved.fieldId || resolved.tablePrimaryKey !== 'CycleParams')) {
|
|
1309
|
+
throw new Error(`[context] 循环字段 '${String(key)}' 缺少循环组件上下文返回的真实字段 ID 或分组`);
|
|
1310
|
+
}
|
|
1502
1311
|
const resolvedFieldTypeCandidate = [
|
|
1503
1312
|
resolved.fieldType,
|
|
1504
1313
|
resolved.rawField?.paramType,
|
|
@@ -1512,7 +1321,7 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
1512
1321
|
const sourceFieldType = resolvedFieldType || resolveSourceFieldType(resolvedKey, meta) || 'string';
|
|
1513
1322
|
// 批量新增的普通字段映射与函数参数使用不同的前端协议:前者是 type=10/sub,
|
|
1514
1323
|
// 而函数里的明细字段必须是带索引子节点的 type=3 上下文引用。
|
|
1515
|
-
if (resolvedKey.includes('[].')) {
|
|
1324
|
+
if (resolvedKey.includes('[].') && sourceComponent !== 'MultipleExecution') {
|
|
1516
1325
|
const detailLabel = String(src?.detailLabel || src?.parentName || '');
|
|
1517
1326
|
const workflowName = String(meta._upstream_workflow_name || '');
|
|
1518
1327
|
if (src?._formulaArgument) {
|
|
@@ -1524,11 +1333,9 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
1524
1333
|
// 查询结果是一层数组(formId[].fieldId),不能套用流程明细的
|
|
1525
1334
|
// workflowId.detailId[].fieldId 解析器。
|
|
1526
1335
|
if (/^[^\.\[]+\[\]\.[^\.\[]+$/.test(resolvedKey)) {
|
|
1527
|
-
return formulaIndexedQueryResultArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel || '表单数据');
|
|
1336
|
+
return formulaIndexedQueryResultArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel || '表单数据', resolved.fieldId || resolved.rawField?.id);
|
|
1528
1337
|
}
|
|
1529
|
-
return formulaIndexedWorkflowDetailArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel, contextMetaForReference(meta, src, sourceComponent),
|
|
1530
|
-
? String(resolved.fieldId || resolveCustomTriggerFormulaFrontId(resolvedKey, resolved, meta))
|
|
1531
|
-
: src?._resolvedContext?.fieldId, resolved);
|
|
1338
|
+
return formulaIndexedWorkflowDetailArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel, contextMetaForReference(meta, src, sourceComponent), resolved.fieldId || resolved.rawField?.id, resolved);
|
|
1532
1339
|
}
|
|
1533
1340
|
const child = assignFlatEsbChild(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), undefined, detailLabel, workflowName, sourceComponent, contextMetaForReference(meta, src, sourceComponent), resolved, String(src?.basisParamKey || src?.basisValue?.paramKey || ''), String(src?.basisType || src?.config?.basisType || 'formSetting'));
|
|
1534
1341
|
attachEsbAssign(child, meta, String(sourceId));
|
|
@@ -1558,7 +1365,9 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
1558
1365
|
};
|
|
1559
1366
|
const sourceName = String(resolved.parentName || meta._upstream_workflow_name || meta._upstream_form_name || '');
|
|
1560
1367
|
const parentName = sourceName
|
|
1561
|
-
? (sourceName
|
|
1368
|
+
? (sourceName === String(label) || sourceName === `${String(label)}[]`
|
|
1369
|
+
|| sourceName.endsWith(`.${String(label)}`) || sourceName.endsWith(`.${String(label)}[]`)
|
|
1370
|
+
? sourceName : `${sourceName}.${String(label)}`)
|
|
1562
1371
|
: `表单数据.${String(label)}`;
|
|
1563
1372
|
const multPath = resolveFrontendMultPath(String(key || resolvedKey), parentName, sourceMeta);
|
|
1564
1373
|
sourceMeta._context_original_param_key = String(resolved.paramKey || resolvedKey);
|
|
@@ -1612,10 +1421,10 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
1612
1421
|
const label = String(resolved.label ?? rawField.showName ?? rawField.paramName ?? ref?.label ?? queryFieldId);
|
|
1613
1422
|
const parentName = String(resolved.parentName ?? ref?.parentName ?? `${ref?.tableName ?? '表单数据'}[].${label}`);
|
|
1614
1423
|
const position = genSfId();
|
|
1615
|
-
const realFieldId = resolved.fieldId ??
|
|
1424
|
+
const realFieldId = resolved.fieldId ?? rawField.id;
|
|
1616
1425
|
if (realFieldId == null || String(realFieldId).trim() === '')
|
|
1617
1426
|
throw new Error('[query_result] 缺少 getComponentContext 返回的字段 ID,无法生成 frontId');
|
|
1618
|
-
const contextFieldInstanceId =
|
|
1427
|
+
const contextFieldInstanceId = requireContextFieldId(realFieldId, '查询结果 FormulaBean.frontId');
|
|
1619
1428
|
const child = formulaFixed(String(index), 'string');
|
|
1620
1429
|
child.name = String(index);
|
|
1621
1430
|
child.position = position;
|
|
@@ -1808,19 +1617,12 @@ export function assignFlatContext(paramKey, fieldLabel, sourceId, appId, fieldTy
|
|
|
1808
1617
|
parentName: alignedParentName, tempFormulaId: tempFormulaId || '',
|
|
1809
1618
|
};
|
|
1810
1619
|
}
|
|
1811
|
-
function assignFlatHttpContext(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', tablePrimaryKey = 'responseBody', meta = null) {
|
|
1620
|
+
function assignFlatHttpContext(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', tablePrimaryKey = 'responseBody', meta = null, resolvedFrontId = '') {
|
|
1812
1621
|
const fid = genSfId();
|
|
1813
1622
|
const key = String(paramKey);
|
|
1814
1623
|
const table = String(tablePrimaryKey);
|
|
1815
1624
|
const value = `${table}.${key}`;
|
|
1816
1625
|
const pname = String(parentName || `响应数据.${fieldLabel}`);
|
|
1817
|
-
const tail = key.includes('.') ? key.slice(key.lastIndexOf('.') + 1) : key;
|
|
1818
|
-
const responseFields = meta && typeof meta === 'object' && meta._http_response_fields && typeof meta._http_response_fields === 'object'
|
|
1819
|
-
? meta._http_response_fields : {};
|
|
1820
|
-
const sourceKey = String(sourceId || '');
|
|
1821
|
-
const fieldMeta = responseFields[`${sourceKey}|${table}.${key}`]
|
|
1822
|
-
|| responseFields[`${sourceKey}|${key}`]
|
|
1823
|
-
|| responseFields[`${sourceKey}|${tail}`];
|
|
1824
1626
|
return {
|
|
1825
1627
|
formulaType: fieldType,
|
|
1826
1628
|
name: String(fieldLabel),
|
|
@@ -1829,10 +1631,8 @@ function assignFlatHttpContext(paramKey, fieldLabel, sourceId, appId, fieldType
|
|
|
1829
1631
|
source: String(sourceId) || '0',
|
|
1830
1632
|
type: '3',
|
|
1831
1633
|
value,
|
|
1832
|
-
// 前端上下文项的 frontId 是响应参数行真实 id
|
|
1833
|
-
|
|
1834
|
-
// 保存成“看似有值但平台无法定位”的公式。
|
|
1835
|
-
frontId: normalizeNumericFrontId(fieldMeta?.id || fieldMeta?.frontId || tail, 'HTTP 响应 FormulaBean.frontId'),
|
|
1634
|
+
// 前端上下文项的 frontId 是响应参数行真实 id。
|
|
1635
|
+
frontId: requireContextFieldId(resolvedFrontId || meta?._context_original_field_id, 'HTTP 响应 FormulaBean.frontId'),
|
|
1836
1636
|
paramKey: key,
|
|
1837
1637
|
parentName: pname,
|
|
1838
1638
|
childs: [],
|
|
@@ -1861,7 +1661,7 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1861
1661
|
const requestedPkey = String(paramKey);
|
|
1862
1662
|
const httpMatch = requestedPkey.match(/^(responseBody|responseHeader|responseCookie|URL)\.(.+)$/);
|
|
1863
1663
|
if (httpMatch) {
|
|
1864
|
-
return assignFlatHttpContext(httpMatch[2], fieldLabel, src, appId, fieldType, parentName, httpMatch[1], meta);
|
|
1664
|
+
return assignFlatHttpContext(httpMatch[2], fieldLabel, src, appId, fieldType, parentName, httpMatch[1], meta, resolvedFrontId);
|
|
1865
1665
|
}
|
|
1866
1666
|
const componentType = String(meta?._context_component_type || meta?._upstream_component_type || '');
|
|
1867
1667
|
const explicitContextRoot = String(meta?._context_table_primary_key || '').trim();
|
|
@@ -1888,20 +1688,15 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1888
1688
|
const pname = alignContextParentName(currentPkey, multPath.parentName, fieldLabel, meta, { componentType });
|
|
1889
1689
|
const tail = pkey.includes('.') ? pkey.slice(pkey.lastIndexOf('.') + 1).replace(/\[\]$/, '') : pkey.replace(/\[\]$/, '');
|
|
1890
1690
|
const plainApprovalShape = !/^\d+$/.test(tail) && !pkey.includes('[].') && !pkey.includes('[]. ');
|
|
1891
|
-
let frontId = '';
|
|
1892
1691
|
let ctxComponentKey = '';
|
|
1893
1692
|
const wfId = String(meta?._workflow_id || meta?._event_form_id || '');
|
|
1894
1693
|
const ctxFields = wfId ? (getWorkflowContextFields()[wfId] || {}) : {};
|
|
1895
|
-
const pkeyTail = currentPkey.includes('.') ? currentPkey.slice(currentPkey.lastIndexOf('.') + 1).replace(/\[\]$/, '') : currentPkey.replace(/\[\]$/, '');
|
|
1896
1694
|
for (const field of Object.values(ctxFields)) {
|
|
1897
1695
|
if (!field || typeof field !== 'object')
|
|
1898
1696
|
continue;
|
|
1899
1697
|
const candidate = String(field.paramKey || '');
|
|
1900
|
-
|
|
1901
|
-
if (candidate !== currentPkey && candTail !== pkeyTail)
|
|
1698
|
+
if (candidate !== currentPkey)
|
|
1902
1699
|
continue;
|
|
1903
|
-
if (String(field.id || ''))
|
|
1904
|
-
frontId = String(field.id);
|
|
1905
1700
|
ctxComponentKey = String(field.componentKey || '');
|
|
1906
1701
|
break;
|
|
1907
1702
|
}
|
|
@@ -1924,17 +1719,9 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1924
1719
|
if (formId && pkeyHead === formId)
|
|
1925
1720
|
isApproval = false;
|
|
1926
1721
|
}
|
|
1927
|
-
// frontId
|
|
1928
|
-
|
|
1929
|
-
const
|
|
1930
|
-
? resolveCustomTriggerDtoId(addContextTableKey(currentPkey, meta), meta?._custom_trigger_data, String(meta?._context_dimension || ''))
|
|
1931
|
-
: '';
|
|
1932
|
-
const frontIdCandidate = resolvedSourceComponent === 'CustomTrigger'
|
|
1933
|
-
// CustomTrigger 的 frontId 只能来自触发器 customData.tableList。
|
|
1934
|
-
// 接口字段 id、paramKey 尾段和外部传入的临时 frontId 都不能兜底。
|
|
1935
|
-
? customFrontId
|
|
1936
|
-
: (resolvedFrontId || frontId || pkeyTail);
|
|
1937
|
-
frontId = normalizeNumericFrontId(frontIdCandidate, '上下文 FormulaBean.frontId');
|
|
1722
|
+
// frontId 来自选中的真实上下文字段,不能由 paramKey 尾段推导。
|
|
1723
|
+
const frontIdCandidate = resolvedFrontId || meta?._context_original_field_id;
|
|
1724
|
+
const frontId = requireContextFieldId(frontIdCandidate, '上下文 FormulaBean.frontId');
|
|
1938
1725
|
const prefix = isApproval ? 'ApprovalData' : (resolvedSourceComponent === 'CustomTrigger' ? 'SelectParams' : contextRoot);
|
|
1939
1726
|
const valuePrefix = parameterContext ? '' : `${prefix}.`;
|
|
1940
1727
|
const tableName = String(meta?._context_table_name || (parameterContext ? parameterTable : contextTableNameForRoot(prefix)));
|
|
@@ -2019,6 +1806,9 @@ function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = '
|
|
|
2019
1806
|
const apiParamKey = String(resolved.paramKey
|
|
2020
1807
|
|| sourceMeta._context_original_param_key
|
|
2021
1808
|
|| protocolParamKey(paramKey, contextRoot, sourceComponent));
|
|
1809
|
+
// Basis.onRowClick 使用选中下级的 originalId(上下文 ParamBean.id)。
|
|
1810
|
+
const basisFrontId = requireContextFieldId(resolved.fieldId
|
|
1811
|
+
|| resolved.rawField?.id, '依据值下级 config.frontId');
|
|
2022
1812
|
return {
|
|
2023
1813
|
id: fid, name: String(fieldLabel), value: subId, type: '10', fieldType, formulaType: fieldType,
|
|
2024
1814
|
paramType: fieldType,
|
|
@@ -2026,6 +1816,7 @@ function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = '
|
|
|
2026
1816
|
config: {
|
|
2027
1817
|
paramKey: apiParamKey, basisType: String(basisType || 'formSetting'), switchType: 'sub', level: 1,
|
|
2028
1818
|
id: subId, source: src, formulaVersion: 'V1', value: detailVal,
|
|
1819
|
+
...(basisType === 'formSetting' ? { frontId: basisFrontId } : {}),
|
|
2029
1820
|
config: {
|
|
2030
1821
|
paramKey: path.paramKey, isMultCom: Boolean(resolved.isMultCom), comType: sourceComponent, switchType: 'assign', parentComId: 0,
|
|
2031
1822
|
fieldInfo: { paramKey: detailPk, tablePrimaryKey: contextRoot },
|
|
@@ -2069,10 +1860,8 @@ function assignBasisFormulaArgument(paramKey, fieldLabel, sourceId, appId, field
|
|
|
2069
1860
|
const parentName = String(resolvedContext.parentName
|
|
2070
1861
|
|| meta?._context_original_parent_name
|
|
2071
1862
|
|| fieldLabel);
|
|
2072
|
-
const fieldId =
|
|
2073
|
-
|| resolvedContext.rawField?.id
|
|
2074
|
-
|| resolvedContext.rawField?.paramId
|
|
2075
|
-
|| '');
|
|
1863
|
+
const fieldId = requireContextFieldId(resolvedContext.fieldId
|
|
1864
|
+
|| resolvedContext.rawField?.id, '依据值下级 FormulaBean.frontId');
|
|
2076
1865
|
const multKey = String(resolvedContext.multKey || meta?._context_mult_key || '');
|
|
2077
1866
|
const comId = String(resolvedContext.comId || meta?._context_com_id || sourceId || '0');
|
|
2078
1867
|
return {
|
|
@@ -2084,7 +1873,9 @@ function assignBasisFormulaArgument(paramKey, fieldLabel, sourceId, appId, field
|
|
|
2084
1873
|
formulaType: fieldType,
|
|
2085
1874
|
paramType: fieldType,
|
|
2086
1875
|
applicationId: appId || '',
|
|
2087
|
-
|
|
1876
|
+
...(basisType !== 'formSetting' && fieldId
|
|
1877
|
+
? { frontId: requireContextFieldId(fieldId, '依据值下级 FormulaBean.frontId') }
|
|
1878
|
+
: {}),
|
|
2088
1879
|
config: {
|
|
2089
1880
|
basisType: String(basisType || 'formSetting'),
|
|
2090
1881
|
paramKey: selectedParamKey,
|
|
@@ -2154,7 +1945,7 @@ function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, ap
|
|
|
2154
1945
|
type: '3',
|
|
2155
1946
|
applicationId: appId || '',
|
|
2156
1947
|
value: contextValue,
|
|
2157
|
-
frontId:
|
|
1948
|
+
frontId: requireContextFieldId(resolvedFrontId, '流程明细 FormulaBean.frontId'),
|
|
2158
1949
|
paramKey: normalizedParamKey,
|
|
2159
1950
|
parentName,
|
|
2160
1951
|
childs: [index],
|
|
@@ -2184,7 +1975,7 @@ function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, ap
|
|
|
2184
1975
|
};
|
|
2185
1976
|
}
|
|
2186
1977
|
/** 查询结果数组字段作为函数参数时的设计器 FormulaBean。 */
|
|
2187
|
-
function formulaIndexedQueryResultArgument(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', tableLabel = '表单数据') {
|
|
1978
|
+
function formulaIndexedQueryResultArgument(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', tableLabel = '表单数据', resolvedFieldId = '') {
|
|
2188
1979
|
const fid = genSfId();
|
|
2189
1980
|
const match = String(paramKey).match(/^([^\.\[]+)\[\]\.([^\.\[]+)$/);
|
|
2190
1981
|
if (!match)
|
|
@@ -2205,7 +1996,7 @@ function formulaIndexedQueryResultArgument(paramKey, fieldLabel, sourceId, appId
|
|
|
2205
1996
|
type: '3',
|
|
2206
1997
|
applicationId: appId || '',
|
|
2207
1998
|
value,
|
|
2208
|
-
frontId:
|
|
1999
|
+
frontId: requireContextFieldId(resolvedFieldId, '查询结果明细 FormulaBean.frontId'),
|
|
2209
2000
|
paramKey: String(paramKey),
|
|
2210
2001
|
parentName,
|
|
2211
2002
|
childs: [index],
|
|
@@ -2291,24 +2082,11 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
2291
2082
|
const src = resolveContextSource(ref, defaultSourceId);
|
|
2292
2083
|
const sourceComponent = String(ref?._resolvedContext?.componentType || ref?.componentType || meta?._context_component_type || meta?._upstream_component_type || 'ApproveTrigger');
|
|
2293
2084
|
key = normalizeContextParamKey(key, sourceComponent);
|
|
2294
|
-
// 循环体内的上下文不是普通表单数据。设计器会把它保存为
|
|
2295
|
-
// CycleParams.<paramKey>,并要求 comType/isMultCom 指向 MultipleExecution;
|
|
2296
|
-
// 如果继续走下面的 direct/nested 分支,回读时会错误变成 FormData.<paramKey>。
|
|
2297
|
-
const isCurrentLoop = ref && typeof ref === 'object' && (String(ref.scope ?? ref.contextScope ?? '') === 'current_loop' ||
|
|
2298
|
-
String(ref.componentType ?? '') === 'MultipleExecution');
|
|
2299
|
-
if (isCurrentLoop) {
|
|
2300
|
-
flat = buildAssignBean({ ...ref, kind: 'context', source: src }, fieldId, fieldType, meta, appId, defaultSourceId);
|
|
2301
|
-
switchT = 'assign';
|
|
2302
|
-
return {
|
|
2303
|
-
formFieldKey: '',
|
|
2304
|
-
value: {
|
|
2305
|
-
original: false, operate, switchType: switchT, fieldKey: String(fieldId), assignType: '',
|
|
2306
|
-
fieldType, assignId: String(flat.id || assignId), multiSelect: false, assign: flat,
|
|
2307
|
-
},
|
|
2308
|
-
};
|
|
2309
|
-
}
|
|
2310
2085
|
const resolvedContext = ref?._resolvedContext && typeof ref._resolvedContext === 'object'
|
|
2311
2086
|
? ref._resolvedContext : {};
|
|
2087
|
+
if (sourceComponent === 'MultipleExecution' && (!resolvedContext.fieldId || resolvedContext.tablePrimaryKey !== 'CycleParams')) {
|
|
2088
|
+
throw new Error(`[context] 循环字段 '${String(key)}' 缺少循环组件上下文返回的真实字段 ID 或分组`);
|
|
2089
|
+
}
|
|
2312
2090
|
const resolvedComponentType = String(resolvedContext.componentType || sourceComponent || '').trim();
|
|
2313
2091
|
const resolvedTableRoot = String(resolvedContext.tablePrimaryKey || '').trim();
|
|
2314
2092
|
const basisParamKey = String(ref?.basisParamKey || ref?.basisValue?.paramKey || '').trim();
|
|
@@ -2370,7 +2148,7 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
2370
2148
|
const workflowId = String(meta._workflow_id || '');
|
|
2371
2149
|
const paramKeyFull = resolveParamKey(workflowId, String(key));
|
|
2372
2150
|
const directMeta = directContextMeta(meta, sourceComponent, ref);
|
|
2373
|
-
flat = assignFlatContextDirect(paramKeyFull, String(label || key), String(src), appId, ft, String(meta._upstream_workflow_name || ''), directMeta, ref?._resolvedContext?.fieldId || ref?.
|
|
2151
|
+
flat = assignFlatContextDirect(paramKeyFull, String(label || key), String(src), appId, ft, String(meta._upstream_workflow_name || ''), directMeta, ref?._resolvedContext?.fieldId || ref?._resolvedContext?.rawField?.id);
|
|
2374
2152
|
switchT = 'assign';
|
|
2375
2153
|
}
|
|
2376
2154
|
else if (assignmentMode === 'nested' && operate === 'OPERATE_EQUAL') {
|
|
@@ -2417,7 +2195,7 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
2417
2195
|
else
|
|
2418
2196
|
directParent = `表单数据.${label || key}`;
|
|
2419
2197
|
const directMeta = directContextMeta(meta, sourceComponent, ref);
|
|
2420
|
-
flat = assignFlatContextDirect(pkey, String(label || key), String(src), appId, ft, directParent, directMeta, ref?._resolvedContext?.fieldId || ref?.
|
|
2198
|
+
flat = assignFlatContextDirect(pkey, String(label || key), String(src), appId, ft, directParent, directMeta, ref?._resolvedContext?.fieldId || ref?._resolvedContext?.rawField?.id);
|
|
2421
2199
|
switchT = 'assign';
|
|
2422
2200
|
}
|
|
2423
2201
|
else {
|
|
@@ -2437,7 +2215,7 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
2437
2215
|
srcName = String(meta._upstream_form_name || '');
|
|
2438
2216
|
const directParent = srcName ? `${srcName}.${label || key}` : `表单数据.${label || key}`;
|
|
2439
2217
|
const directMeta = directContextMeta(meta, sourceComponent, ref);
|
|
2440
|
-
flat = assignFlatContextDirect(pkey, String(label || key), String(src), appId, ft, directParent, directMeta, ref?._resolvedContext?.fieldId || ref?.
|
|
2218
|
+
flat = assignFlatContextDirect(pkey, String(label || key), String(src), appId, ft, directParent, directMeta, ref?._resolvedContext?.fieldId || ref?._resolvedContext?.rawField?.id);
|
|
2441
2219
|
switchT = 'assign';
|
|
2442
2220
|
}
|
|
2443
2221
|
}
|