weaver-e10-builder 1.2.3 → 1.5.1
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/assets/org-employee-template.xlsx +0 -0
- package/dist/commands/actionflow.d.ts.map +1 -1
- package/dist/commands/actionflow.js +12 -25
- package/dist/commands/actionflow.js.map +1 -1
- package/dist/commands/designer-css.d.ts +15 -0
- package/dist/commands/designer-css.d.ts.map +1 -0
- package/dist/commands/designer-css.js +205 -0
- package/dist/commands/designer-css.js.map +1 -0
- package/dist/commands/form-button.d.ts.map +1 -1
- package/dist/commands/form-button.js +28 -5
- package/dist/commands/form-button.js.map +1 -1
- package/dist/commands/form-field-lang.d.ts.map +1 -1
- package/dist/commands/form-field-lang.js +4 -39
- package/dist/commands/form-field-lang.js.map +1 -1
- package/dist/commands/form-field-linkage.d.ts.map +1 -1
- package/dist/commands/form-field-linkage.js +27 -6
- package/dist/commands/form-field-linkage.js.map +1 -1
- package/dist/commands/form-formula-linkage.d.ts +3 -0
- package/dist/commands/form-formula-linkage.d.ts.map +1 -0
- package/dist/commands/form-formula-linkage.js +434 -0
- package/dist/commands/form-formula-linkage.js.map +1 -0
- package/dist/commands/form-formula.d.ts.map +1 -1
- package/dist/commands/form-formula.js +22 -3
- package/dist/commands/form-formula.js.map +1 -1
- package/dist/commands/form-layout-init.d.ts.map +1 -1
- package/dist/commands/form-layout-init.js +15 -10
- package/dist/commands/form-layout-init.js.map +1 -1
- package/dist/commands/form-layout.js +24 -21
- package/dist/commands/form-layout.js.map +1 -1
- package/dist/commands/form-list-click.d.ts.map +1 -1
- package/dist/commands/form-list-click.js +2 -1
- package/dist/commands/form-list-click.js.map +1 -1
- package/dist/commands/form-native.d.ts.map +1 -1
- package/dist/commands/form-native.js +192 -3
- package/dist/commands/form-native.js.map +1 -1
- package/dist/commands/form-validate.d.ts.map +1 -1
- package/dist/commands/form-validate.js +11 -3
- package/dist/commands/form-validate.js.map +1 -1
- package/dist/commands/form.d.ts.map +1 -1
- package/dist/commands/form.js +323 -192
- package/dist/commands/form.js.map +1 -1
- package/dist/commands/matrix.d.ts.map +1 -1
- package/dist/commands/matrix.js +175 -36
- package/dist/commands/matrix.js.map +1 -1
- package/dist/commands/menu.d.ts.map +1 -1
- package/dist/commands/menu.js +170 -23
- package/dist/commands/menu.js.map +1 -1
- package/dist/commands/org.d.ts +10 -0
- package/dist/commands/org.d.ts.map +1 -0
- package/dist/commands/org.js +278 -0
- package/dist/commands/org.js.map +1 -0
- package/dist/commands/role.d.ts.map +1 -1
- package/dist/commands/role.js +106 -62
- package/dist/commands/role.js.map +1 -1
- package/dist/commands/wf-form.d.ts +1 -0
- package/dist/commands/wf-form.d.ts.map +1 -1
- package/dist/commands/wf-form.js +545 -39
- package/dist/commands/wf-form.js.map +1 -1
- package/dist/commands/workflow-auth-resp.d.ts.map +1 -1
- package/dist/commands/workflow-auth-resp.js +53 -5
- package/dist/commands/workflow-auth-resp.js.map +1 -1
- package/dist/commands/workflow-create-auth-resp.d.ts.map +1 -1
- package/dist/commands/workflow-create-auth-resp.js +5 -1
- package/dist/commands/workflow-create-auth-resp.js.map +1 -1
- package/dist/commands/workflow-node-assign-flow.d.ts.map +1 -1
- package/dist/commands/workflow-node-assign-flow.js +1 -2
- package/dist/commands/workflow-node-assign-flow.js.map +1 -1
- package/dist/commands/workflow-node.d.ts.map +1 -1
- package/dist/commands/workflow-node.js +147 -2
- package/dist/commands/workflow-node.js.map +1 -1
- package/dist/commands/workflow-odoc.d.ts.map +1 -1
- package/dist/commands/workflow-odoc.js +56 -56
- package/dist/commands/workflow-odoc.js.map +1 -1
- package/dist/commands/workflow-setting.d.ts.map +1 -1
- package/dist/commands/workflow-setting.js +77 -1
- package/dist/commands/workflow-setting.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +114 -89
- package/dist/commands/workflow.js.map +1 -1
- package/dist/core/client.d.ts +14 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +28 -12
- package/dist/core/client.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/services/action-detail.d.ts.map +1 -1
- package/dist/services/action-detail.js +5 -4
- package/dist/services/action-detail.js.map +1 -1
- package/dist/services/actionflow/command_output.d.ts +7 -0
- package/dist/services/actionflow/command_output.d.ts.map +1 -1
- package/dist/services/actionflow/command_output.js +46 -0
- package/dist/services/actionflow/command_output.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_add.d.ts.map +1 -1
- package/dist/services/actionflow/components/action_eb_add.js +14 -4
- package/dist/services/actionflow/components/action_eb_add.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_add_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/components/action_eb_add_compiler.js +29 -0
- package/dist/services/actionflow/components/action_eb_add_compiler.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_update.d.ts.map +1 -1
- package/dist/services/actionflow/components/action_eb_update.js +23 -8
- package/dist/services/actionflow/components/action_eb_update.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 +261 -13
- package/dist/services/actionflow/components/action_eb_update_compiler.js.map +1 -1
- package/dist/services/actionflow/components/approve_create.d.ts.map +1 -1
- package/dist/services/actionflow/components/approve_create.js +6 -3
- package/dist/services/actionflow/components/approve_create.js.map +1 -1
- package/dist/services/actionflow/components/custom_set_form.d.ts +10 -0
- package/dist/services/actionflow/components/custom_set_form.d.ts.map +1 -0
- package/dist/services/actionflow/components/custom_set_form.js +99 -0
- package/dist/services/actionflow/components/custom_set_form.js.map +1 -0
- package/dist/services/actionflow/components/custom_trigger.d.ts +2 -2
- package/dist/services/actionflow/components/custom_trigger.d.ts.map +1 -1
- package/dist/services/actionflow/components/custom_trigger.js +11 -11
- package/dist/services/actionflow/components/custom_trigger.js.map +1 -1
- package/dist/services/actionflow/components/dml_execute.d.ts.map +1 -1
- package/dist/services/actionflow/components/dml_execute.js +7 -3
- 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 +7 -3
- package/dist/services/actionflow/components/document_actions.js.map +1 -1
- package/dist/services/actionflow/components/enquiry_form.js +1 -1
- package/dist/services/actionflow/components/enquiry_form.js.map +1 -1
- package/dist/services/actionflow/components/hrm_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/hrm_actions.js +7 -3
- package/dist/services/actionflow/components/hrm_actions.js.map +1 -1
- package/dist/services/actionflow/components/multiple_execution.d.ts.map +1 -1
- package/dist/services/actionflow/components/multiple_execution.js +14 -5
- 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 +6 -1
- package/dist/services/actionflow/components/output.js.map +1 -1
- package/dist/services/actionflow/components/send_message.js +2 -2
- package/dist/services/actionflow/components/send_message.js.map +1 -1
- package/dist/services/actionflow/components/workflow_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/workflow_actions.js +7 -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 +25 -8
- package/dist/services/actionflow/context_preflight.js.map +1 -1
- package/dist/services/actionflow/context_provider.d.ts.map +1 -1
- package/dist/services/actionflow/context_provider.js +24 -4
- package/dist/services/actionflow/context_provider.js.map +1 -1
- package/dist/services/actionflow/custom_trigger_context.d.ts +10 -0
- package/dist/services/actionflow/custom_trigger_context.d.ts.map +1 -0
- package/dist/services/actionflow/custom_trigger_context.js +46 -0
- package/dist/services/actionflow/custom_trigger_context.js.map +1 -0
- package/dist/services/actionflow/dynamic_resources.d.ts.map +1 -1
- package/dist/services/actionflow/dynamic_resources.js +1 -1
- package/dist/services/actionflow/dynamic_resources.js.map +1 -1
- package/dist/services/actionflow/ebuilder_source.d.ts +19 -0
- package/dist/services/actionflow/ebuilder_source.d.ts.map +1 -0
- package/dist/services/actionflow/ebuilder_source.js +78 -0
- package/dist/services/actionflow/ebuilder_source.js.map +1 -0
- package/dist/services/actionflow/filter_rules.js +2 -2
- package/dist/services/actionflow/filter_rules.js.map +1 -1
- package/dist/services/actionflow/form_source.d.ts +51 -10
- package/dist/services/actionflow/form_source.d.ts.map +1 -1
- package/dist/services/actionflow/form_source.js +173 -29
- package/dist/services/actionflow/form_source.js.map +1 -1
- package/dist/services/actionflow/formula_service.d.ts +13 -2
- package/dist/services/actionflow/formula_service.d.ts.map +1 -1
- package/dist/services/actionflow/formula_service.js +104 -42
- package/dist/services/actionflow/formula_service.js.map +1 -1
- package/dist/services/actionflow/id_generator.d.ts +2 -0
- package/dist/services/actionflow/id_generator.d.ts.map +1 -1
- package/dist/services/actionflow/id_generator.js +13 -0
- package/dist/services/actionflow/id_generator.js.map +1 -1
- package/dist/services/actionflow/preflight_service.d.ts +6 -0
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -1
- package/dist/services/actionflow/preflight_service.js +217 -4
- package/dist/services/actionflow/preflight_service.js.map +1 -1
- package/dist/services/actionflow/workflow_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/workflow_compiler.js +172 -50
- package/dist/services/actionflow/workflow_compiler.js.map +1 -1
- package/dist/services/auth-resp-condition.d.ts +35 -0
- package/dist/services/auth-resp-condition.d.ts.map +1 -0
- package/dist/services/auth-resp-condition.js +111 -0
- package/dist/services/auth-resp-condition.js.map +1 -0
- package/dist/services/condition-rules.d.ts.map +1 -1
- package/dist/services/condition-rules.js +4 -1
- package/dist/services/condition-rules.js.map +1 -1
- package/dist/services/designer-css.d.ts +89 -0
- package/dist/services/designer-css.d.ts.map +1 -0
- package/dist/services/designer-css.js +163 -0
- package/dist/services/designer-css.js.map +1 -0
- package/dist/services/dom-structure.d.ts +42 -0
- package/dist/services/dom-structure.d.ts.map +1 -0
- package/dist/services/dom-structure.js +251 -0
- package/dist/services/dom-structure.js.map +1 -0
- package/dist/services/esb-interface/document-parser.d.ts.map +1 -1
- package/dist/services/esb-interface/document-parser.js +62 -5
- package/dist/services/esb-interface/document-parser.js.map +1 -1
- package/dist/services/form-association.d.ts +19 -0
- package/dist/services/form-association.d.ts.map +1 -1
- package/dist/services/form-association.js +64 -0
- package/dist/services/form-association.js.map +1 -1
- package/dist/services/form-button-action.d.ts +7 -0
- package/dist/services/form-button-action.d.ts.map +1 -1
- package/dist/services/form-button-action.js +11 -1
- package/dist/services/form-button-action.js.map +1 -1
- package/dist/services/form-create.d.ts +4 -0
- package/dist/services/form-create.d.ts.map +1 -1
- package/dist/services/form-create.js +18 -12
- package/dist/services/form-create.js.map +1 -1
- package/dist/services/form-field-patch.d.ts +25 -1
- package/dist/services/form-field-patch.d.ts.map +1 -1
- package/dist/services/form-field-patch.js +52 -9
- package/dist/services/form-field-patch.js.map +1 -1
- package/dist/services/form-formula-linkage.d.ts +349 -0
- package/dist/services/form-formula-linkage.d.ts.map +1 -0
- package/dist/services/form-formula-linkage.js +546 -0
- package/dist/services/form-formula-linkage.js.map +1 -0
- package/dist/services/form-i18n-label.d.ts +48 -0
- package/dist/services/form-i18n-label.d.ts.map +1 -0
- package/dist/services/form-i18n-label.js +91 -0
- package/dist/services/form-i18n-label.js.map +1 -0
- package/dist/services/form-layout-insert.d.ts +84 -0
- package/dist/services/form-layout-insert.d.ts.map +1 -0
- package/dist/services/form-layout-insert.js +244 -0
- package/dist/services/form-layout-insert.js.map +1 -0
- package/dist/services/form-linkage-condition.d.ts +159 -0
- package/dist/services/form-linkage-condition.d.ts.map +1 -0
- package/dist/services/form-linkage-condition.js +307 -0
- package/dist/services/form-linkage-condition.js.map +1 -0
- package/dist/services/form-style-template.d.ts +6 -2
- package/dist/services/form-style-template.d.ts.map +1 -1
- package/dist/services/form-style-template.js +8 -4
- package/dist/services/form-style-template.js.map +1 -1
- package/dist/services/formula-detail.d.ts +98 -6
- package/dist/services/formula-detail.d.ts.map +1 -1
- package/dist/services/formula-detail.js +208 -26
- package/dist/services/formula-detail.js.map +1 -1
- package/dist/services/matrix-rows.d.ts +43 -0
- package/dist/services/matrix-rows.d.ts.map +1 -0
- package/dist/services/matrix-rows.js +104 -0
- package/dist/services/matrix-rows.js.map +1 -0
- package/dist/services/menu-catalog.d.ts +84 -0
- package/dist/services/menu-catalog.d.ts.map +1 -0
- package/dist/services/menu-catalog.js +183 -0
- package/dist/services/menu-catalog.js.map +1 -0
- package/dist/services/org-department.d.ts +114 -0
- package/dist/services/org-department.d.ts.map +1 -0
- package/dist/services/org-department.js +209 -0
- package/dist/services/org-department.js.map +1 -0
- package/dist/services/org-employee.d.ts +87 -0
- package/dist/services/org-employee.d.ts.map +1 -0
- package/dist/services/org-employee.js +219 -0
- package/dist/services/org-employee.js.map +1 -0
- package/dist/services/role-member.d.ts +99 -0
- package/dist/services/role-member.d.ts.map +1 -0
- package/dist/services/role-member.js +206 -0
- package/dist/services/role-member.js.map +1 -0
- package/dist/services/workflow-add-step.d.ts +45 -0
- package/dist/services/workflow-add-step.d.ts.map +1 -0
- package/dist/services/workflow-add-step.js +122 -0
- package/dist/services/workflow-add-step.js.map +1 -0
- package/dist/services/workflow-assign-flow.d.ts +1 -6
- package/dist/services/workflow-assign-flow.d.ts.map +1 -1
- package/dist/services/workflow-assign-flow.js +3 -8
- package/dist/services/workflow-assign-flow.js.map +1 -1
- package/dist/services/workflow-drawback.d.ts +19 -0
- package/dist/services/workflow-drawback.d.ts.map +1 -0
- package/dist/services/workflow-drawback.js +59 -0
- package/dist/services/workflow-drawback.js.map +1 -0
- package/dist/services/workflow-info.d.ts +83 -0
- package/dist/services/workflow-info.d.ts.map +1 -0
- package/dist/services/workflow-info.js +97 -0
- package/dist/services/workflow-info.js.map +1 -0
- package/dist/services/workflow-links.d.ts +51 -0
- package/dist/services/workflow-links.d.ts.map +1 -0
- package/dist/services/workflow-links.js +162 -0
- package/dist/services/workflow-links.js.map +1 -0
- package/dist/services/workflow-node-layout.d.ts +45 -4
- package/dist/services/workflow-node-layout.d.ts.map +1 -1
- package/dist/services/workflow-node-layout.js +142 -41
- package/dist/services/workflow-node-layout.js.map +1 -1
- package/dist/services/workflow-odoc-setting.d.ts +43 -0
- package/dist/services/workflow-odoc-setting.d.ts.map +1 -0
- package/dist/services/workflow-odoc-setting.js +109 -0
- package/dist/services/workflow-odoc-setting.js.map +1 -0
- package/dist/services/workflow-tab-config.d.ts +54 -0
- package/dist/services/workflow-tab-config.d.ts.map +1 -0
- package/dist/services/workflow-tab-config.js +137 -0
- package/dist/services/workflow-tab-config.js.map +1 -0
- package/dist/types.d.ts +5 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/column-name.d.ts +24 -0
- package/dist/utils/column-name.d.ts.map +1 -1
- package/dist/utils/column-name.js +16 -0
- package/dist/utils/column-name.js.map +1 -1
- package/ecodecmd/package.json +1 -2
- package/ecodecmd/src/loaddep.js +19 -9
- package/package.json +48 -48
- package/skill-docs/SKILL.md +15 -11
- package/skill-docs/_catalog.md +85 -79
- package/skill-docs/actionflows/SKILL.md +173 -168
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbAdd.md +38 -1
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbUpdate.md +42 -0
- package/skill-docs/actionflows/references/components/ebuilder/EventButton.md +1 -1
- package/skill-docs/actionflows/references/components/logic/Output.md +2 -0
- package/skill-docs/actionflows/references/components/trigger/CustomTrigger.md +48 -11
- package/skill-docs/actionflows/references/components/workflow/ApproveCreate.md +1 -1
- package/skill-docs/assets/dom-structure/Bar.json +341 -0
- package/skill-docs/assets/dom-structure/BarStack.json +341 -0
- package/skill-docs/assets/dom-structure/Bubble.json +323 -0
- package/skill-docs/assets/dom-structure/Calendar.json +515 -0
- package/skill-docs/assets/dom-structure/Circular.json +337 -0
- package/skill-docs/assets/dom-structure/CollapsePanel.json +289 -0
- package/skill-docs/assets/dom-structure/Comment.json +617 -0
- package/skill-docs/assets/dom-structure/CountDown.json +755 -0
- package/skill-docs/assets/dom-structure/DigitalPanel.json +191 -0
- package/skill-docs/assets/dom-structure/EbButton.json +387 -0
- package/skill-docs/assets/dom-structure/FastCreate.json +242 -0
- package/skill-docs/assets/dom-structure/Gauge.json +282 -0
- package/skill-docs/assets/dom-structure/HBar.json +336 -0
- package/skill-docs/assets/dom-structure/HBarStack.json +337 -0
- package/skill-docs/assets/dom-structure/Line.json +341 -0
- package/skill-docs/assets/dom-structure/NList.json +712 -0
- package/skill-docs/assets/dom-structure/NavBar.json +274 -0
- package/skill-docs/assets/dom-structure/NavPanel.json +390 -0
- package/skill-docs/assets/dom-structure/NewTab.json +606 -0
- package/skill-docs/assets/dom-structure/Nightingale.json +336 -0
- package/skill-docs/assets/dom-structure/PageHeader.json +205 -0
- package/skill-docs/assets/dom-structure/Picture.json +209 -0
- package/skill-docs/assets/dom-structure/Pie.json +338 -0
- package/skill-docs/assets/dom-structure/ProgressChart.json +299 -0
- package/skill-docs/assets/dom-structure/SearchGlobal.json +628 -0
- package/skill-docs/assets/dom-structure/Slide.json +489 -0
- package/skill-docs/assets/dom-structure/Treemap.json +324 -0
- package/skill-docs/references/common/guide-plan-template.md +10 -4
- package/skill-docs/references/common/ref-cli-commands.md +67 -34
- package/skill-docs/references/ebuilder-designer/guide-designer-components.md +12 -1
- package/skill-docs/references/ebuilder-designer/guide-designer-css.md +127 -0
- package/skill-docs/references/ebuilder-designer/guide-designer.md +6 -5
- package/skill-docs/references/esb-interface/guide-import.md +4 -1
- package/skill-docs/references/form/guide-create-form.md +14 -1
- package/skill-docs/references/form/guide-field-linkage.md +2 -0
- package/skill-docs/references/form/guide-form-formula-functions.md +36 -0
- package/skill-docs/references/form/guide-form-layout-incremental.md +75 -0
- package/skill-docs/references/form/guide-form-layout-planning.md +1 -1
- package/skill-docs/references/form/guide-form-linkage.md +89 -5
- package/skill-docs/references/form/guide-formula-linkage.md +250 -0
- package/skill-docs/references/form/ref-form-fields.md +6 -0
- package/skill-docs/references/hrm/guide-matrix.md +79 -16
- package/skill-docs/references/hrm/guide-org-employee.md +56 -0
- package/skill-docs/references/menu/system-menus.md +12 -0
- package/skill-docs/references/workflow/guide-workflow-auth-resp.md +48 -22
- package/skill-docs/references/workflow/guide-workflow-odoc-setting.md +248 -0
- package/skill-docs/references/workflow/guide-workflow-odoc.md +25 -33
- package/skill-docs/references/workflow/guide-workflow.md +18 -3
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* 动态赋值的字段引用、公式树与资源对象构造。
|
|
3
3
|
* 对齐 Python 版 core/formula_service.py(黄金参照)。
|
|
4
4
|
*/
|
|
5
|
-
import { genSfId } from './id_generator.js';
|
|
5
|
+
import { genSfId, normalizeNumericFrontId } from './id_generator.js';
|
|
6
|
+
import { resolveCustomTriggerDtoId } from './custom_trigger_context.js';
|
|
6
7
|
import { resolveSystemParameter } from './system_params.js';
|
|
7
8
|
import { findFunction } from './functions_catalog.js';
|
|
8
9
|
import { getWorkflowContextFields, getWorkflowContextFieldsByKey, getWorkflowDetailNames, getTargetFormFields, findInMetadata, workflowFieldId, } from './runtime_metadata.js';
|
|
@@ -26,6 +27,29 @@ const VALUE_TYPE_ALIASES = {
|
|
|
26
27
|
date: 'Date', Date: 'Date', time: 'Time', Time: 'Time',
|
|
27
28
|
datetime: 'DateTime', DateTime: 'DateTime',
|
|
28
29
|
};
|
|
30
|
+
/** 触发器上下文根节点。自定义触发的参数由 SelectParams 提供,不是普通表单数据。 */
|
|
31
|
+
export function contextRootForComponent(componentType) {
|
|
32
|
+
return String(componentType || '') === 'CustomTrigger'
|
|
33
|
+
? 'SelectParams'
|
|
34
|
+
: String(componentType || '') === 'ApproveTrigger'
|
|
35
|
+
? 'ApprovalData'
|
|
36
|
+
: 'FormData';
|
|
37
|
+
}
|
|
38
|
+
export function contextTableNameForRoot(root) {
|
|
39
|
+
return root === 'ApprovalData' ? '流程数据' : root === 'SelectParams' ? '选择参数' : '表单数据';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 自定义触发的来源 key 只保存业务路径,不能把公式根节点混进 paramKey。
|
|
43
|
+
* 主表与明细表必须共用同一个主表路径,例如:
|
|
44
|
+
* `mainTable.name`、`mainTable.detail[].field`;公式 value 再由编译器补上
|
|
45
|
+
* `SelectParams.` 前缀。
|
|
46
|
+
*/
|
|
47
|
+
export function normalizeContextParamKey(paramKey, componentType) {
|
|
48
|
+
const key = String(paramKey ?? '');
|
|
49
|
+
if (String(componentType || '') !== 'CustomTrigger')
|
|
50
|
+
return key;
|
|
51
|
+
return key.replace(/^(?:FormData|ApprovalData|SelectParams)\./, '');
|
|
52
|
+
}
|
|
29
53
|
// ── 字段解析 ────────────────────────────────────────────────
|
|
30
54
|
export function resolveSourceFieldType(paramKey, meta) {
|
|
31
55
|
if (!paramKey)
|
|
@@ -182,6 +206,8 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
182
206
|
const fieldName = String(opts.name || fieldKey);
|
|
183
207
|
const componentType = opts.componentType || 'ApproveTrigger';
|
|
184
208
|
const fieldType = opts.fieldType || 'string';
|
|
209
|
+
const contextRoot = contextRootForComponent(componentType);
|
|
210
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
185
211
|
return {
|
|
186
212
|
formulaType: ftNorm(fieldType),
|
|
187
213
|
name: fieldName,
|
|
@@ -189,8 +215,8 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
189
215
|
id: fid,
|
|
190
216
|
source: sourceId,
|
|
191
217
|
type: '3',
|
|
192
|
-
value:
|
|
193
|
-
frontId:
|
|
218
|
+
value: `${contextRoot}.${fieldKey}`,
|
|
219
|
+
frontId: normalizeNumericFrontId(opts.frontId ?? fieldKey, 'FormulaBean.frontId'),
|
|
194
220
|
paramKey: String(fieldKey),
|
|
195
221
|
paramType: fieldType,
|
|
196
222
|
childs: [],
|
|
@@ -203,12 +229,12 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
203
229
|
multName: '',
|
|
204
230
|
multTypeObj: {
|
|
205
231
|
allName: fieldName, currentName: fieldName,
|
|
206
|
-
currentParamKey:
|
|
232
|
+
currentParamKey: `${contextRoot}.${fieldKey}`, allParamKey: `${contextRoot}.${fieldKey}`,
|
|
207
233
|
},
|
|
208
234
|
comId: sourceId,
|
|
209
235
|
isMultCom: Boolean(opts.isMult),
|
|
210
|
-
tableName
|
|
211
|
-
fieldInfo: { paramKey: String(fieldKey), tablePrimaryKey:
|
|
236
|
+
tableName,
|
|
237
|
+
fieldInfo: { paramKey: String(fieldKey), tablePrimaryKey: contextRoot },
|
|
212
238
|
comType: componentType,
|
|
213
239
|
parentComId: String(opts.parentComId || '0'),
|
|
214
240
|
switchType: 'assign',
|
|
@@ -247,7 +273,7 @@ export function formulaCurrentLoopContext(sourceComponentId, fieldKey, opts = {}
|
|
|
247
273
|
// 前端在点击“循环(当次循环)”时额外生成 assignId,用它区分每个
|
|
248
274
|
// 当次循环引用;缺少时编辑器只显示类型,不能回显所属组件和参数路径。
|
|
249
275
|
assignId: genSfId(), id: fid, source: sourceId, type: '3', value: valuePath,
|
|
250
|
-
frontId:
|
|
276
|
+
frontId: normalizeNumericFrontId(opts.frontId || loopRootFrontId || rawField.id || rawField.paramId || fieldKey, '循环 FormulaBean.frontId'),
|
|
251
277
|
paramId: String(rawField.paramId || opts.frontId || rawField.id || fieldKey),
|
|
252
278
|
paramName: String(rawField.paramName || fieldName),
|
|
253
279
|
showName: String(rawField.showName || fieldName),
|
|
@@ -430,7 +456,10 @@ export function buildPersonFormula(personRef, meta, appId = '', forSendMessage =
|
|
|
430
456
|
}
|
|
431
457
|
if (directPerson) {
|
|
432
458
|
if (ptype === 'context')
|
|
433
|
-
return formulaContext('', pid
|
|
459
|
+
return formulaContext('', pid, {
|
|
460
|
+
name: String(personRef.name || personRef.label || pid),
|
|
461
|
+
frontId: personRef.frontId || personRef.fieldId || personRef._resolvedContext?.fieldId,
|
|
462
|
+
});
|
|
434
463
|
const pname = String(personRef.name || personRef.label || '');
|
|
435
464
|
if (pid && pname && pid !== '{userid}' && pid !== 'currentUser') {
|
|
436
465
|
const personObj = buildPersonObject(pid, pname);
|
|
@@ -458,7 +487,10 @@ export function buildPersonFormula(personRef, meta, appId = '', forSendMessage =
|
|
|
458
487
|
if (!pname)
|
|
459
488
|
pname = String(meta._upstream_form_name || '');
|
|
460
489
|
const full = pname ? `${pname}.${disp}` : `表单数据.${disp}`;
|
|
461
|
-
|
|
490
|
+
const personSourceMeta = personRef._resolvedContext?.componentType === 'CustomTrigger'
|
|
491
|
+
? { ...(meta || {}), _context_component_type: 'CustomTrigger' }
|
|
492
|
+
: meta;
|
|
493
|
+
child = assignFlatContextDirect(pk, disp, src, appId, ft, full, personSourceMeta, personRef._resolvedContext?.fieldId);
|
|
462
494
|
}
|
|
463
495
|
else {
|
|
464
496
|
child = formulaSystemVar('{userid}');
|
|
@@ -650,6 +682,8 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
650
682
|
if (['', 'event', 'event_1', 'trigger'].includes(String(sourceId)))
|
|
651
683
|
sourceId = defaultSourceId;
|
|
652
684
|
const label = src && typeof src === 'object' ? (src.label ?? src.name ?? key) : key;
|
|
685
|
+
const sourceComponent = String(src?._resolvedContext?.componentType || src?.componentType || meta?._context_component_type || meta?._upstream_component_type || 'ApproveTrigger');
|
|
686
|
+
key = normalizeContextParamKey(key, sourceComponent);
|
|
653
687
|
const isCurrentLoop = src && typeof src === 'object' && (String(src.scope ?? src.contextScope ?? '') === 'current_loop' ||
|
|
654
688
|
String(src.componentType ?? '') === 'MultipleExecution');
|
|
655
689
|
if (isCurrentLoop) {
|
|
@@ -709,9 +743,11 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
709
743
|
if (/^[^\.\[]+\[\]\.[^\.\[]+$/.test(resolvedKey)) {
|
|
710
744
|
return formulaIndexedQueryResultArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel || '表单数据');
|
|
711
745
|
}
|
|
712
|
-
return formulaIndexedWorkflowDetailArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel,
|
|
746
|
+
return formulaIndexedWorkflowDetailArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel, sourceComponent === 'CustomTrigger'
|
|
747
|
+
? { ...(meta || {}), _context_component_type: sourceComponent, _upstream_component_type: sourceComponent }
|
|
748
|
+
: meta, src?._resolvedContext?.fieldId);
|
|
713
749
|
}
|
|
714
|
-
const child = assignFlatEsbChild(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), undefined, detailLabel, workflowName);
|
|
750
|
+
const child = assignFlatEsbChild(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), undefined, detailLabel, workflowName, sourceComponent);
|
|
715
751
|
attachEsbAssign(child, meta, String(sourceId));
|
|
716
752
|
return child;
|
|
717
753
|
}
|
|
@@ -726,7 +762,7 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
726
762
|
const parentName = sourceName
|
|
727
763
|
? (sourceName.endsWith(`.${String(label)}`) ? sourceName : `${sourceName}.${String(label)}`)
|
|
728
764
|
: `表单数据.${String(label)}`;
|
|
729
|
-
const contextBean = assignFlatContextDirect(resolvedKey, String(label), String(sourceId), appId, sourceFieldType, parentName, sourceMeta);
|
|
765
|
+
const contextBean = assignFlatContextDirect(resolvedKey, String(label), String(sourceId), appId, sourceFieldType, parentName, sourceMeta, resolved.fieldId);
|
|
730
766
|
attachEsbAssign(contextBean, meta, String(sourceId));
|
|
731
767
|
return contextBean;
|
|
732
768
|
}
|
|
@@ -761,7 +797,7 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
761
797
|
const label = String(resolved.label ?? rawField.showName ?? rawField.paramName ?? ref?.label ?? queryFieldId);
|
|
762
798
|
const parentName = String(resolved.parentName ?? ref?.parentName ?? `${ref?.tableName ?? '表单数据'}[].${label}`);
|
|
763
799
|
const position = genSfId();
|
|
764
|
-
const contextFieldInstanceId =
|
|
800
|
+
const contextFieldInstanceId = normalizeNumericFrontId(resolved.fieldId ?? ref?.frontId ?? genSfId(), '查询结果 FormulaBean.frontId');
|
|
765
801
|
const child = formulaFixed(String(index), 'string');
|
|
766
802
|
child.name = String(index);
|
|
767
803
|
child.position = position;
|
|
@@ -928,11 +964,16 @@ function assignFlatFixed(valueStr, appId, fieldType = 'string') {
|
|
|
928
964
|
applicationId: appId || '', config: { originValue: valueStr, switchType: 'fixvalue' },
|
|
929
965
|
};
|
|
930
966
|
}
|
|
931
|
-
export function assignFlatContext(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', tempFormulaId = '', tableId = '', componentKey = 'Text', paramKeyFull = '', valueFull = '') {
|
|
967
|
+
export function assignFlatContext(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', tempFormulaId = '', tableId = '', componentKey = 'Text', paramKeyFull = '', valueFull = '', meta = null) {
|
|
932
968
|
const fid = genSfId();
|
|
933
969
|
const src = String(sourceId) || '0';
|
|
970
|
+
const componentType = String(meta?._context_component_type || meta?._upstream_component_type || '');
|
|
971
|
+
const contextRoot = contextRootForComponent(componentType);
|
|
972
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
934
973
|
const pname = String(parentName || fieldLabel);
|
|
935
|
-
const val = valueFull
|
|
974
|
+
const val = valueFull
|
|
975
|
+
? String(valueFull).replace(/^(?:FormData|ApprovalData|SelectParams)\./, `${contextRoot}.`)
|
|
976
|
+
: (tableId ? `${contextRoot}.${tableId}.${paramKey}` : `${contextRoot}.${paramKey}`);
|
|
936
977
|
const pkey = paramKeyFull || (tableId ? `${tableId}.${paramKey}` : String(paramKey));
|
|
937
978
|
return {
|
|
938
979
|
id: fid, name: String(fieldLabel), value: val, type: '3', fieldType, formulaType: fieldType,
|
|
@@ -942,8 +983,8 @@ export function assignFlatContext(paramKey, fieldLabel, sourceId, appId, fieldTy
|
|
|
942
983
|
switchType: 'assign', comId: src, paramKey: pkey, paramType: fieldType,
|
|
943
984
|
parentName: pname, newParentName: pname, multName: '', multKey: '',
|
|
944
985
|
multTypeObj: { currentName: pname, allName: pname, currentParamKey: val, allParamKey: val },
|
|
945
|
-
isMultCom: false, comType: 'ApproveTrigger', tableName
|
|
946
|
-
fieldInfo: { tablePrimaryKey:
|
|
986
|
+
isMultCom: false, comType: componentType || 'ApproveTrigger', tableName,
|
|
987
|
+
fieldInfo: { tablePrimaryKey: contextRoot, paramKey: pkey },
|
|
947
988
|
tempFormulaId: tempFormulaId || '', formulaVersion: 'V1',
|
|
948
989
|
}),
|
|
949
990
|
parentName: pname, tempFormulaId: tempFormulaId || '',
|
|
@@ -973,7 +1014,7 @@ function assignFlatHttpContext(paramKey, fieldLabel, sourceId, appId, fieldType
|
|
|
973
1014
|
// 前端上下文项的 frontId 是响应参数行真实 id,不是 paramKey 尾段。
|
|
974
1015
|
// 只有实时接口详情没有该行 id 时才退回尾段,避免把跨 HTTP 动态赋值
|
|
975
1016
|
// 保存成“看似有值但平台无法定位”的公式。
|
|
976
|
-
frontId:
|
|
1017
|
+
frontId: normalizeNumericFrontId(fieldMeta?.id || fieldMeta?.frontId || tail, 'HTTP 响应 FormulaBean.frontId'),
|
|
977
1018
|
paramKey: key,
|
|
978
1019
|
parentName: pname,
|
|
979
1020
|
childs: [],
|
|
@@ -996,7 +1037,7 @@ function assignFlatHttpContext(paramKey, fieldLabel, sourceId, appId, fieldType
|
|
|
996
1037
|
parentId: '0',
|
|
997
1038
|
};
|
|
998
1039
|
}
|
|
999
|
-
export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', meta = null) {
|
|
1040
|
+
export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', meta = null, resolvedFrontId = '') {
|
|
1000
1041
|
const fid = genSfId();
|
|
1001
1042
|
const src = String(sourceId) || '0';
|
|
1002
1043
|
const pkey = String(paramKey);
|
|
@@ -1039,9 +1080,15 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1039
1080
|
}
|
|
1040
1081
|
// frontId 必须 = 字段 id(paramKey 尾段),设计器用它在字段浏览器里定位字段;
|
|
1041
1082
|
// 清空会导致设计器「动态赋值」找不到字段标红(真机验证 2026-08-19,场景12)。
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1083
|
+
const customFrontId = resolvedSourceComponent === 'CustomTrigger'
|
|
1084
|
+
? resolveCustomTriggerDtoId(paramKey, meta?._custom_trigger_data, '')
|
|
1085
|
+
: '';
|
|
1086
|
+
const frontIdCandidate = resolvedSourceComponent === 'CustomTrigger'
|
|
1087
|
+
? (customFrontId || resolvedFrontId)
|
|
1088
|
+
: (resolvedFrontId || frontId || pkeyTail);
|
|
1089
|
+
frontId = normalizeNumericFrontId(frontIdCandidate, '上下文 FormulaBean.frontId');
|
|
1090
|
+
const prefix = isApproval ? 'ApprovalData' : contextRootForComponent(resolvedSourceComponent);
|
|
1091
|
+
const tableName = contextTableNameForRoot(prefix);
|
|
1045
1092
|
const sourceComponent = resolvedSourceComponent;
|
|
1046
1093
|
const result = {
|
|
1047
1094
|
formulaType: fieldType, name: String(fieldLabel), businessId: appId || '', id: fid,
|
|
@@ -1050,7 +1097,7 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1050
1097
|
config: {
|
|
1051
1098
|
paramKey: pkey, isMultCom: false, comType: sourceComponent, switchType: 'assign', formulaVersion: 'V1',
|
|
1052
1099
|
fieldInfo: { paramKey: pkey, tablePrimaryKey: prefix },
|
|
1053
|
-
tableName
|
|
1100
|
+
tableName,
|
|
1054
1101
|
paramType: fieldType, parentName: pname, multName: '', multKey: '',
|
|
1055
1102
|
multTypeObj: {
|
|
1056
1103
|
allName: pname, currentName: pname,
|
|
@@ -1064,13 +1111,15 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1064
1111
|
result.frontId = frontId;
|
|
1065
1112
|
return result;
|
|
1066
1113
|
}
|
|
1067
|
-
function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', detailParamKey = '', detailLabel = '', workflowName = '') {
|
|
1114
|
+
function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', detailParamKey = '', detailLabel = '', workflowName = '', componentType = 'ApproveTrigger') {
|
|
1068
1115
|
const fid = genSfId();
|
|
1069
1116
|
const src = String(sourceId) || '0';
|
|
1117
|
+
const contextRoot = contextRootForComponent(componentType);
|
|
1118
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
1070
1119
|
const tailPart = paramKey.includes('.') ? paramKey.slice(paramKey.lastIndexOf('.') + 1) : paramKey;
|
|
1071
1120
|
const subId = tailPart.replace(/\[\]$/, '');
|
|
1072
1121
|
const detailPk = detailParamKey || (paramKey.includes('[]') ? paramKey.slice(0, paramKey.indexOf('[]')) + '[]' : '');
|
|
1073
|
-
const detailVal =
|
|
1122
|
+
const detailVal = `${contextRoot}.${detailPk}`;
|
|
1074
1123
|
const parentName = workflowName ? `${workflowName}.${fieldLabel}[]` : `${fieldLabel}[]`;
|
|
1075
1124
|
const subName = workflowName ? `${workflowName}.${fieldLabel}` : String(fieldLabel);
|
|
1076
1125
|
const allName = workflowName && detailLabel ? `${workflowName}.${detailLabel}[]` : parentName;
|
|
@@ -1081,12 +1130,12 @@ function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = '
|
|
|
1081
1130
|
paramKey: String(paramKey), basisType: 'formSetting', switchType: 'sub', level: 1,
|
|
1082
1131
|
id: subId, source: src, formulaVersion: 'V1', value: detailVal,
|
|
1083
1132
|
config: {
|
|
1084
|
-
paramKey: detailPk, isMultCom: false, comType:
|
|
1085
|
-
fieldInfo: { paramKey: detailPk, tablePrimaryKey:
|
|
1086
|
-
tableName
|
|
1133
|
+
paramKey: detailPk, isMultCom: false, comType: componentType, switchType: 'assign', parentComId: 0,
|
|
1134
|
+
fieldInfo: { paramKey: detailPk, tablePrimaryKey: contextRoot },
|
|
1135
|
+
tableName, paramType: fieldType, parentName, multName: '', multKey: '',
|
|
1087
1136
|
multTypeObj: {
|
|
1088
1137
|
allName, currentName: subName,
|
|
1089
|
-
currentParamKey: paramKey.startsWith(
|
|
1138
|
+
currentParamKey: paramKey.startsWith(`${contextRoot}.`) ? String(paramKey) : `${contextRoot}.${paramKey}`,
|
|
1090
1139
|
allParamKey: detailVal,
|
|
1091
1140
|
},
|
|
1092
1141
|
comId: src, newParentName: parentName,
|
|
@@ -1103,7 +1152,7 @@ function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = '
|
|
|
1103
1152
|
* 选中“明细[0].字段”后保存的真实结构是 type=3:value 的 [] 被一个 type=1
|
|
1104
1153
|
* 索引子节点 position 替换。缺少这个索引节点时,设计器只会把字段名渲染成红字。
|
|
1105
1154
|
*/
|
|
1106
|
-
function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', detailLabel = '', meta = {}) {
|
|
1155
|
+
function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', detailLabel = '', meta = {}, resolvedFrontId = '') {
|
|
1107
1156
|
const fid = genSfId();
|
|
1108
1157
|
const match = String(paramKey).match(/^([^\.]+)\.([^\.\[]+)\[\]\.([^\.\[]+)$/);
|
|
1109
1158
|
if (!match)
|
|
@@ -1116,9 +1165,11 @@ function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, ap
|
|
|
1116
1165
|
index.name = '0';
|
|
1117
1166
|
index.position = genSfId();
|
|
1118
1167
|
index.parentId = fid;
|
|
1119
|
-
const sourceComponent = String(meta?._upstream_component_type || 'ApproveTrigger');
|
|
1120
|
-
const
|
|
1121
|
-
const
|
|
1168
|
+
const sourceComponent = String(meta?._context_component_type || meta?._upstream_component_type || 'ApproveTrigger');
|
|
1169
|
+
const contextRoot = contextRootForComponent(sourceComponent);
|
|
1170
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
1171
|
+
const contextValue = `${contextRoot}.${workflowId}.${detailId}[${index.position}].${detailFieldId}`;
|
|
1172
|
+
const allParamKey = `${contextRoot}.${paramKey}`;
|
|
1122
1173
|
return {
|
|
1123
1174
|
formulaType: fieldType,
|
|
1124
1175
|
name: String(fieldLabel),
|
|
@@ -1128,7 +1179,7 @@ function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, ap
|
|
|
1128
1179
|
type: '3',
|
|
1129
1180
|
applicationId: appId || '',
|
|
1130
1181
|
value: contextValue,
|
|
1131
|
-
frontId: detailFieldId,
|
|
1182
|
+
frontId: normalizeNumericFrontId(sourceComponent === 'CustomTrigger' ? resolvedFrontId : (resolvedFrontId || detailFieldId), '流程明细 FormulaBean.frontId'),
|
|
1132
1183
|
paramKey: String(paramKey),
|
|
1133
1184
|
parentName,
|
|
1134
1185
|
childs: [index],
|
|
@@ -1140,8 +1191,8 @@ function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, ap
|
|
|
1140
1191
|
parentComId: 0,
|
|
1141
1192
|
parentName,
|
|
1142
1193
|
formulaVersion: 'V1',
|
|
1143
|
-
fieldInfo: { paramKey: String(paramKey), tablePrimaryKey:
|
|
1144
|
-
tableName
|
|
1194
|
+
fieldInfo: { paramKey: String(paramKey), tablePrimaryKey: contextRoot },
|
|
1195
|
+
tableName,
|
|
1145
1196
|
paramType: fieldType,
|
|
1146
1197
|
multName: '',
|
|
1147
1198
|
multKey: '',
|
|
@@ -1179,7 +1230,7 @@ function formulaIndexedQueryResultArgument(paramKey, fieldLabel, sourceId, appId
|
|
|
1179
1230
|
type: '3',
|
|
1180
1231
|
applicationId: appId || '',
|
|
1181
1232
|
value,
|
|
1182
|
-
frontId: fieldId,
|
|
1233
|
+
frontId: normalizeNumericFrontId(fieldId, '查询结果明细 FormulaBean.frontId'),
|
|
1183
1234
|
paramKey: String(paramKey),
|
|
1184
1235
|
parentName,
|
|
1185
1236
|
childs: [index],
|
|
@@ -1265,6 +1316,8 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
1265
1316
|
let src = ref && typeof ref === 'object' ? (ref.source ?? ref.comId ?? '') : '';
|
|
1266
1317
|
if (['', 'event', 'event_1', 'trigger'].includes(String(src)))
|
|
1267
1318
|
src = defaultSourceId;
|
|
1319
|
+
const sourceComponent = String(ref?._resolvedContext?.componentType || ref?.componentType || meta?._context_component_type || meta?._upstream_component_type || 'ApproveTrigger');
|
|
1320
|
+
key = normalizeContextParamKey(key, sourceComponent);
|
|
1268
1321
|
// 循环体内的上下文不是普通表单数据。设计器会把它保存为
|
|
1269
1322
|
// CycleParams.<paramKey>,并要求 comType/isMultCom 指向 MultipleExecution;
|
|
1270
1323
|
// 如果继续走下面的 direct/nested 分支,回读时会错误变成 FormData.<paramKey>。
|
|
@@ -1294,7 +1347,7 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
1294
1347
|
if (realDtl)
|
|
1295
1348
|
detailLabel = realDtl;
|
|
1296
1349
|
const workflowName = String(meta._upstream_workflow_name || '');
|
|
1297
|
-
flat = assignFlatEsbChild(pkeyFull, subLabel, String(src), appId, ft, undefined, detailLabel, workflowName);
|
|
1350
|
+
flat = assignFlatEsbChild(pkeyFull, subLabel, String(src), appId, ft, undefined, detailLabel, workflowName, sourceComponent);
|
|
1298
1351
|
switchT = 'sub';
|
|
1299
1352
|
attachEsbAssign(flat, meta, String(src));
|
|
1300
1353
|
return {
|
|
@@ -1308,7 +1361,10 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
1308
1361
|
else if (assignmentMode === 'direct' && operate === 'OPERATE_EQUAL') {
|
|
1309
1362
|
const workflowId = String(meta._workflow_id || '');
|
|
1310
1363
|
const paramKeyFull = resolveParamKey(workflowId, String(key));
|
|
1311
|
-
|
|
1364
|
+
const directMeta = sourceComponent === 'CustomTrigger'
|
|
1365
|
+
? { ...(meta || {}), _context_component_type: sourceComponent }
|
|
1366
|
+
: meta;
|
|
1367
|
+
flat = assignFlatContextDirect(paramKeyFull, String(label || key), String(src), appId, 'string', String(meta._upstream_workflow_name || ''), directMeta, ref?._resolvedContext?.fieldId);
|
|
1312
1368
|
switchT = 'assign';
|
|
1313
1369
|
}
|
|
1314
1370
|
else if (assignmentMode === 'nested' && operate === 'OPERATE_EQUAL') {
|
|
@@ -1354,11 +1410,14 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
1354
1410
|
directParent = `${formName}.${label || pkey}`;
|
|
1355
1411
|
else
|
|
1356
1412
|
directParent = `表单数据.${label || key}`;
|
|
1357
|
-
|
|
1413
|
+
const directMeta = sourceComponent === 'CustomTrigger'
|
|
1414
|
+
? { ...(meta || {}), _context_component_type: sourceComponent }
|
|
1415
|
+
: meta;
|
|
1416
|
+
flat = assignFlatContextDirect(pkey, String(label || key), String(src), appId, ft, directParent, directMeta, ref?._resolvedContext?.fieldId);
|
|
1358
1417
|
switchT = 'assign';
|
|
1359
1418
|
}
|
|
1360
1419
|
else {
|
|
1361
|
-
const child = assignFlatContext(String(key), String(label || key), String(src), appId, ft, parentName, '', tableId, 'Text', pkey, pval);
|
|
1420
|
+
const child = assignFlatContext(String(key), String(label || key), String(src), appId, ft, parentName, '', tableId, 'Text', pkey, pval, meta);
|
|
1362
1421
|
const container = formulaContainerString([child], '', appId);
|
|
1363
1422
|
const childId = String(child.id || '');
|
|
1364
1423
|
if (childId && typeof child.config === 'string') {
|
|
@@ -1384,7 +1443,10 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
1384
1443
|
if (!srcName)
|
|
1385
1444
|
srcName = String(meta._upstream_form_name || '');
|
|
1386
1445
|
const directParent = srcName ? `${srcName}.${label || key}` : `表单数据.${label || key}`;
|
|
1387
|
-
|
|
1446
|
+
const directMeta = sourceComponent === 'CustomTrigger'
|
|
1447
|
+
? { ...(meta || {}), _context_component_type: sourceComponent }
|
|
1448
|
+
: meta;
|
|
1449
|
+
flat = assignFlatContextDirect(pkey, String(label || key), String(src), appId, ft, directParent, directMeta, ref?._resolvedContext?.fieldId);
|
|
1388
1450
|
switchT = 'assign';
|
|
1389
1451
|
}
|
|
1390
1452
|
}
|