weaver-e10-builder 1.6.4 → 1.6.5
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/commands/actionflow.d.ts.map +1 -1
- package/dist/commands/actionflow.js +2 -0
- package/dist/commands/actionflow.js.map +1 -1
- package/dist/commands/form-add-detail-table.js +3 -3
- package/dist/commands/form-add-detail-table.js.map +1 -1
- package/dist/commands/form-browser-definition.js +8 -8
- package/dist/commands/form-browser-definition.js.map +1 -1
- package/dist/commands/form-code.js +7 -7
- package/dist/commands/form-code.js.map +1 -1
- package/dist/commands/form-data.js +1 -1
- package/dist/commands/form-data.js.map +1 -1
- package/dist/commands/form-ebuilder-scope.js +8 -8
- package/dist/commands/form-ebuilder-scope.js.map +1 -1
- package/dist/commands/form-engine-linkage.js +12 -12
- package/dist/commands/form-engine-linkage.js.map +1 -1
- package/dist/commands/form-layout-diff.js +1 -1
- package/dist/commands/form-layout-diff.js.map +1 -1
- package/dist/commands/form-layout-edit.js +1 -1
- package/dist/commands/form-layout-edit.js.map +1 -1
- package/dist/commands/form-layout-init-reviewed.js +1 -1
- package/dist/commands/form-layout-init-reviewed.js.map +1 -1
- package/dist/commands/form-layout-init.js +2 -2
- package/dist/commands/form-layout-init.js.map +1 -1
- package/dist/commands/form-layout-template-easy.js +1 -1
- package/dist/commands/form-layout-template-easy.js.map +1 -1
- package/dist/commands/form-layout.js +4 -4
- package/dist/commands/form-layout.js.map +1 -1
- package/dist/commands/form-view.d.ts.map +1 -1
- package/dist/commands/form-view.js +1 -2
- package/dist/commands/form-view.js.map +1 -1
- package/dist/commands/form.js +3 -3
- package/dist/commands/form.js.map +1 -1
- package/dist/commands/report-admin.js +1 -1
- package/dist/commands/report-admin.js.map +1 -1
- package/dist/commands/report-query.js +1 -1
- package/dist/commands/report-query.js.map +1 -1
- package/dist/commands/report.js +1 -1
- package/dist/commands/report.js.map +1 -1
- package/dist/commands/wf-form-layout-init-reviewed.d.ts +3 -0
- package/dist/commands/wf-form-layout-init-reviewed.d.ts.map +1 -0
- package/dist/commands/wf-form-layout-init-reviewed.js +71 -0
- package/dist/commands/wf-form-layout-init-reviewed.js.map +1 -0
- 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 +16 -16
- package/dist/commands/wf-form.js.map +1 -1
- package/dist/commands/workflow-advanced.js +1 -1
- package/dist/commands/workflow-advanced.js.map +1 -1
- package/dist/commands/workflow-basic-info.js +4 -4
- package/dist/commands/workflow-basic-info.js.map +1 -1
- package/dist/commands/workflow.js +6 -6
- package/dist/commands/workflow.js.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/services/actionflow/classified_protection_source.d.ts +10 -0
- package/dist/services/actionflow/classified_protection_source.d.ts.map +1 -0
- package/dist/services/actionflow/classified_protection_source.js +27 -0
- package/dist/services/actionflow/classified_protection_source.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_add.d.ts.map +1 -1
- package/dist/services/actionflow/components/action_eb_add.js +4 -5
- package/dist/services/actionflow/components/action_eb_add.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 +13 -1
- package/dist/services/actionflow/components/action_eb_update.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_update_compiler.d.ts +12 -0
- package/dist/services/actionflow/components/action_eb_update_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/components/action_eb_update_compiler.js +88 -3
- 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 -10
- package/dist/services/actionflow/components/approve_create.js.map +1 -1
- package/dist/services/actionflow/components/condition.d.ts.map +1 -1
- package/dist/services/actionflow/components/condition.js +3 -2
- package/dist/services/actionflow/components/condition.js.map +1 -1
- package/dist/services/actionflow/components/eb_get_data_by_id.d.ts.map +1 -1
- package/dist/services/actionflow/components/eb_get_data_by_id.js +9 -1
- package/dist/services/actionflow/components/eb_get_data_by_id.js.map +1 -1
- package/dist/services/actionflow/components/send_message.js +1 -1
- 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 +20 -11
- 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 +9 -1
- package/dist/services/actionflow/context_preflight.js.map +1 -1
- package/dist/services/actionflow/design_client.d.ts +4 -0
- package/dist/services/actionflow/design_client.d.ts.map +1 -1
- package/dist/services/actionflow/design_client.js +65 -0
- package/dist/services/actionflow/design_client.js.map +1 -1
- package/dist/services/actionflow/form_source.d.ts +9 -2
- package/dist/services/actionflow/form_source.d.ts.map +1 -1
- package/dist/services/actionflow/form_source.js +21 -6
- package/dist/services/actionflow/form_source.js.map +1 -1
- package/dist/services/actionflow/formula_service.d.ts.map +1 -1
- package/dist/services/actionflow/formula_service.js +153 -37
- package/dist/services/actionflow/formula_service.js.map +1 -1
- package/dist/services/actionflow/preflight_service.d.ts +14 -3
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -1
- package/dist/services/actionflow/preflight_service.js +276 -42
- 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 +154 -23
- package/dist/services/actionflow/workflow_compiler.js.map +1 -1
- package/dist/services/workflow-layout-init-reviewed.d.ts +35 -0
- package/dist/services/workflow-layout-init-reviewed.d.ts.map +1 -0
- package/dist/services/workflow-layout-init-reviewed.js +120 -0
- package/dist/services/workflow-layout-init-reviewed.js.map +1 -0
- package/package.json +1 -1
- package/skill-docs/SKILL.md +4 -4
- package/skill-docs/actionflows/SKILL.md +2 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbUpdate.md +2 -0
- package/skill-docs/actionflows/references/components/ebuilder/EventButton.md +1 -1
- package/skill-docs/actionflows/references/components/logic/Condition.md +2 -0
- package/skill-docs/actionflows/references/components/message/SendMessage.md +2 -2
- package/skill-docs/actionflows/references/components/workflow/ApproveCommit.md +17 -17
- package/skill-docs/actionflows/references/components/workflow/ApproveCreate.md +1 -1
- package/skill-docs/actionflows/references/components/workflow/ApproveSave.md +1 -1
- package/skill-docs/actionflows/references/components/workflow/ApproveSendBack.md +17 -17
- package/skill-docs/references/common/ref-cli-commands.md +1 -0
- package/skill-docs/references/form/guide-browser-definition.md +73 -40
- package/skill-docs/references/form/layout/code-block/layout-css.md +41 -0
- package/skill-docs/references/form/layout/initialization.md +2 -0
- package/skill-docs/references/form/layout/layout-overview.md +8 -0
- package/skill-docs/references/form/layout/template/advanced.md +21 -0
- package/skill-docs/references/form/layout/template/easy.md +2 -0
- package/skill-docs/references/form/layout/template/flow.md +2 -0
- package/skill-docs/references/form/layout/template/template-guide.md +3 -1
- package/skill-docs/references/form/layout/workflow-layout.md +13 -1
- package/skill-docs/references/form/ref-form-fields.md +18 -4
- package/skill-docs/references/workflow/guide-workflow-odoc.md +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight_service.d.ts","sourceRoot":"","sources":["../../../src/services/actionflow/preflight_service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"preflight_service.d.ts","sourceRoot":"","sources":["../../../src/services/actionflow/preflight_service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA6DtD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAiCpF;AAED,uCAAuC;AACvC,wBAAsB,2BAA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,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAshB5H"}
|
|
@@ -4,6 +4,7 @@ import * as personSource from './person_source.js';
|
|
|
4
4
|
import * as contextSource from './context_source.js';
|
|
5
5
|
import * as hrmSource from './hrm_source.js';
|
|
6
6
|
import * as documentSource from './document_source.js';
|
|
7
|
+
import * as classifiedProtectionSource from './classified_protection_source.js';
|
|
7
8
|
import * as browserSource from './browser_source.js';
|
|
8
9
|
import * as logicFlowSource from './logicflow_source.js';
|
|
9
10
|
import { completeEbuilder, pickEbuilderBrowserRow } from './ebuilder_source.js';
|
|
@@ -37,6 +38,11 @@ function buttonName(row) {
|
|
|
37
38
|
return String(row?.name ?? row?.content ?? row?.text ?? '').trim();
|
|
38
39
|
}
|
|
39
40
|
function supportsTriggerBefore(row) {
|
|
41
|
+
// 前端 eventButton/index.tsx 的简单模式只筛选 buttonKey=save/editSave,
|
|
42
|
+
// 并把它们固定映射为 buttonLocation=before;这类响应没有 needTriggerBefore。
|
|
43
|
+
const buttonKey = String(row?.buttonKey || '').trim();
|
|
44
|
+
if (buttonKey === 'save' || buttonKey === 'editSave')
|
|
45
|
+
return true;
|
|
40
46
|
const value = row?.needTriggerBefore;
|
|
41
47
|
return value === true || value === 1 || value === '1' || String(value).toLowerCase() === 'true';
|
|
42
48
|
}
|
|
@@ -555,6 +561,111 @@ function walkPlanSteps(value) {
|
|
|
555
561
|
walk(value);
|
|
556
562
|
return steps[Symbol.iterator]();
|
|
557
563
|
}
|
|
564
|
+
function fixedAssignmentValue(value) {
|
|
565
|
+
if (typeof value === 'string' || typeof value === 'number')
|
|
566
|
+
return { fixed: true, value };
|
|
567
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
568
|
+
return { fixed: false };
|
|
569
|
+
const kind = String(value.kind ?? value.assignmentKind ?? '').toLowerCase();
|
|
570
|
+
if (kind && !['fixed', 'literal'].includes(kind))
|
|
571
|
+
return { fixed: false };
|
|
572
|
+
let config = value.config;
|
|
573
|
+
if (typeof config === 'string') {
|
|
574
|
+
try {
|
|
575
|
+
config = JSON.parse(config);
|
|
576
|
+
}
|
|
577
|
+
catch {
|
|
578
|
+
config = {};
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if (String(config?.switchType || '').toLowerCase() === 'assign')
|
|
582
|
+
return { fixed: false };
|
|
583
|
+
if (kind === 'fixed' || kind === 'literal')
|
|
584
|
+
return { fixed: true, value: value.value ?? config?.originValue };
|
|
585
|
+
if (String(value.type || '') === '1' || String(config?.switchType || '').toLowerCase() === 'fixvalue') {
|
|
586
|
+
return { fixed: true, value: config?.originValue ?? value.value ?? value.name };
|
|
587
|
+
}
|
|
588
|
+
if (value.value !== undefined && !value.type && !value.formulaType)
|
|
589
|
+
return { fixed: true, value: value.value };
|
|
590
|
+
return { fixed: false };
|
|
591
|
+
}
|
|
592
|
+
/** 对齐新建流程前端:读取密级选项,补默认密级/有效期,并校验固定密级。 */
|
|
593
|
+
export async function resolveApproveCreateClassifiedProtection(plan, client, errors, warnings) {
|
|
594
|
+
const steps = [...walkPlanSteps({ actions: plan.actions || [] })].filter((step) => step.type === 'ApproveCreate');
|
|
595
|
+
if (!steps.length)
|
|
596
|
+
return;
|
|
597
|
+
const hasExplicitValue = steps.some((step) => step.params?.secretLevel != null || step.params?.secretLevelValidity != null);
|
|
598
|
+
let config;
|
|
599
|
+
try {
|
|
600
|
+
config = await classifiedProtectionSource.getClassifiedProtectionConfig(client);
|
|
601
|
+
}
|
|
602
|
+
catch (error) {
|
|
603
|
+
const message = `新建流程密级选项查询失败:${String(error?.message || error)}`;
|
|
604
|
+
if (hasExplicitValue)
|
|
605
|
+
errors.push(`${message};无法校验已配置的密级。`);
|
|
606
|
+
else
|
|
607
|
+
warnings.push(`${message};本次不补前端默认密级。`);
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (!config.isOpenClassification) {
|
|
611
|
+
if (hasExplicitValue)
|
|
612
|
+
errors.push('当前租户未启用密级保护,但新建流程配置了 secretLevel/secretLevelValidity。');
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
if (!config.resourceOptionInfo.length) {
|
|
616
|
+
if (hasExplicitValue)
|
|
617
|
+
errors.push('密级保护已启用,但接口没有返回可用密级选项。');
|
|
618
|
+
else
|
|
619
|
+
warnings.push('密级保护已启用,但接口没有返回密级选项,无法按前端逻辑填入默认密级。');
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
for (const step of steps) {
|
|
623
|
+
const params = step.params ??= {};
|
|
624
|
+
const path = `ApproveCreate${step.name ? ` '${step.name}'` : ''}`;
|
|
625
|
+
let selected;
|
|
626
|
+
const rawSecret = params.secretLevel;
|
|
627
|
+
if (rawSecret == null || rawSecret === '') {
|
|
628
|
+
selected = config.resourceOptionInfo[0];
|
|
629
|
+
params.secretLevel = { kind: 'fixed', value: String(selected.id), valueType: 'string' };
|
|
630
|
+
(plan._autoResources ??= []).push({
|
|
631
|
+
path: `${path}.secretLevel`, resourceType: 'classified_protection_option',
|
|
632
|
+
value: { id: String(selected.id), name: String(selected.content || selected.name || '') },
|
|
633
|
+
reason: '按前端新建流程组件逻辑,未指定密级时默认选择 resourceOptionInfo 第一项',
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
const literal = fixedAssignmentValue(rawSecret);
|
|
638
|
+
if (!literal.fixed) {
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
const wanted = String(literal.value ?? '').trim();
|
|
642
|
+
const matches = config.resourceOptionInfo.filter((option) => String(option.id) === wanted || String(option.content ?? option.name ?? '').trim() === wanted);
|
|
643
|
+
if (matches.length !== 1) {
|
|
644
|
+
errors.push(`${path}.secretLevel 固定值 '${wanted}' 未能在当前租户密级选项中唯一匹配(匹配数: ${matches.length});请提供真实选项 ID 或名称。`);
|
|
645
|
+
continue;
|
|
646
|
+
}
|
|
647
|
+
selected = matches[0];
|
|
648
|
+
params.secretLevel = { kind: 'fixed', value: String(selected.id), valueType: 'string' };
|
|
649
|
+
if (String(literal.value) !== String(selected.id)) {
|
|
650
|
+
(plan._autoResources ??= []).push({
|
|
651
|
+
path: `${path}.secretLevel`, resourceType: 'classified_protection_option',
|
|
652
|
+
value: { id: String(selected.id), name: String(selected.content || selected.name || '') },
|
|
653
|
+
reason: '将密级名称解析为当前租户真实选项 ID',
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
const validityMode = String(selected?.secretLevelValidityShowType || 'hidden');
|
|
658
|
+
if (validityMode !== 'hidden' && (params.secretLevelValidity == null || params.secretLevelValidity === '')
|
|
659
|
+
&& selected?.defaultSecretLevelValidity != null && selected.defaultSecretLevelValidity !== '') {
|
|
660
|
+
params.secretLevelValidity = { kind: 'fixed', value: String(selected.defaultSecretLevelValidity), valueType: 'string' };
|
|
661
|
+
(plan._autoResources ??= []).push({
|
|
662
|
+
path: `${path}.secretLevelValidity`, resourceType: 'classified_protection_validity',
|
|
663
|
+
value: String(selected.defaultSecretLevelValidity),
|
|
664
|
+
reason: '按前端所选密级的 defaultSecretLevelValidity 填充保密期限',
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
558
669
|
/** 把显式固定人员展开为当前租户 Browser 对象。 */
|
|
559
670
|
export async function resolveFixedPeople(plan, client) {
|
|
560
671
|
const records = [];
|
|
@@ -586,6 +697,13 @@ export async function resolveFixedPeople(plan, client) {
|
|
|
586
697
|
const raw = container[key];
|
|
587
698
|
if (raw == null)
|
|
588
699
|
continue;
|
|
700
|
+
// SendMessage.receiver 是“提醒对象”联合类型。只有人员对象需要人员 Browser;
|
|
701
|
+
// 全员、部门、分部、角色等由各自对象类型处理,不能误走 resourceData。
|
|
702
|
+
if (componentType === 'SendMessage' && key === 'receiver' && raw && typeof raw === 'object') {
|
|
703
|
+
const receiverType = String(raw.objectType || raw.targetType || raw.type || '').toLowerCase();
|
|
704
|
+
if (receiverType && !['user', 'person', 'personnel', 'resource'].includes(receiverType))
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
589
707
|
const fixedArray = raw && typeof raw === 'object' && raw.kind === 'fixed' && Array.isArray(raw.value);
|
|
590
708
|
const values = fixedArray ? raw.value : (Array.isArray(raw) ? raw : [raw]);
|
|
591
709
|
if (values.some((item) => item && typeof item === 'object' && item.type && item.config && !item.kind))
|
|
@@ -1305,13 +1423,18 @@ export async function resolveEntrustFields(plan, client, errors) {
|
|
|
1305
1423
|
}
|
|
1306
1424
|
}
|
|
1307
1425
|
}
|
|
1308
|
-
/**
|
|
1426
|
+
/** 新建、保存、提交、退回流程都按实时流程定义读取主表与明细字段,映射只接受真实字段 ID。 */
|
|
1309
1427
|
export async function resolveBizCreateFields(step, plan, client, errors, path) {
|
|
1310
1428
|
const params = (step.params || {});
|
|
1429
|
+
const componentType = String(step.type || 'ApproveCreate');
|
|
1430
|
+
const operationName = {
|
|
1431
|
+
ApproveCreate: '新建流程', ApproveSave: '保存流程',
|
|
1432
|
+
ApproveCommit: '提交流程', ApproveSendBack: '退回流程',
|
|
1433
|
+
}[componentType] || componentType;
|
|
1311
1434
|
const wfPath = Array.isArray(params.workflowPath) ? (params.workflowPath[0] || {}) : (params.workflowPath || {});
|
|
1312
1435
|
const wfId = String(wfPath.id || wfPath.createFlowId || '');
|
|
1313
1436
|
if (!wfId) {
|
|
1314
|
-
errors.push(`${path}.params.workflowPath.id 缺失 (
|
|
1437
|
+
errors.push(`${path}.params.workflowPath.id 缺失 (${operationName}必须指定目标流程)`);
|
|
1315
1438
|
return;
|
|
1316
1439
|
}
|
|
1317
1440
|
try {
|
|
@@ -1352,7 +1475,7 @@ export async function resolveBizCreateFields(step, plan, client, errors, path) {
|
|
|
1352
1475
|
wfPath.formIds = formIds;
|
|
1353
1476
|
}
|
|
1354
1477
|
if (!formIds.length) {
|
|
1355
|
-
errors.push(`${path}.params.workflowPath.formIds 缺失: getWfField 未返回目标流程主表 formId
|
|
1478
|
+
errors.push(`${path}.params.workflowPath.formIds 缺失: getWfField 未返回目标流程主表 formId,无法安全${operationName};请确认目标流程已绑定表单。`);
|
|
1356
1479
|
}
|
|
1357
1480
|
const allFieldIds = new Set(bizFields.main.map((f) => f.id));
|
|
1358
1481
|
for (const dt of bizFields.detail) {
|
|
@@ -1378,6 +1501,13 @@ export async function resolveBizCreateFields(step, plan, client, errors, path) {
|
|
|
1378
1501
|
errors.push(`${path}.params.constants['${targetFid}'] 目标字段不存在于目标流程 '${wfId}' 的表单字段中`);
|
|
1379
1502
|
}
|
|
1380
1503
|
}
|
|
1504
|
+
const formulas = params.formula || {};
|
|
1505
|
+
if (formulas && typeof formulas === 'object') {
|
|
1506
|
+
for (const targetFid of Object.keys(formulas)) {
|
|
1507
|
+
if (!allFieldIds.has(String(targetFid)))
|
|
1508
|
+
errors.push(`${path}.params.formula['${targetFid}'] 目标字段不存在于目标流程 '${wfId}' 的表单字段中`);
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1381
1511
|
for (const [di, ditem] of (params.detail || []).entries()) {
|
|
1382
1512
|
if (!ditem || typeof ditem !== 'object')
|
|
1383
1513
|
continue;
|
|
@@ -1389,6 +1519,10 @@ export async function resolveBizCreateFields(step, plan, client, errors, path) {
|
|
|
1389
1519
|
if (tid2 && !allFieldIds.has(tid2))
|
|
1390
1520
|
errors.push(`${path}.params.detail[${di}].mapping['${sk}'] 目标字段 '${tid2}' 不存在于目标流程 '${wfId}' 的表单字段中 (明细表子字段 id 必须实时查全量, 禁止推算)`);
|
|
1391
1521
|
}
|
|
1522
|
+
for (const targetFid of Object.keys(ditem.formula || {})) {
|
|
1523
|
+
if (!allFieldIds.has(String(targetFid)))
|
|
1524
|
+
errors.push(`${path}.params.detail[${di}].formula['${targetFid}'] 目标字段不存在于目标流程 '${wfId}' 的表单字段中`);
|
|
1525
|
+
}
|
|
1392
1526
|
}
|
|
1393
1527
|
}
|
|
1394
1528
|
}
|
|
@@ -1518,12 +1652,15 @@ export function checkSourceReferences(plan, eventContextFields, errors, availabl
|
|
|
1518
1652
|
}
|
|
1519
1653
|
}
|
|
1520
1654
|
}
|
|
1521
|
-
if (
|
|
1655
|
+
if (['ApproveCreate', 'ApproveSave', 'ApproveCommit', 'ApproveSendBack'].includes(String(step.type))) {
|
|
1522
1656
|
if (params && typeof params === 'object') {
|
|
1523
1657
|
checkMapping(params.mapping, `${path}.mapping`);
|
|
1658
|
+
checkReference(params.formula, `${path}.formula`);
|
|
1524
1659
|
for (const [di, det] of (params.detail || []).entries()) {
|
|
1525
|
-
if (det && typeof det === 'object')
|
|
1660
|
+
if (det && typeof det === 'object') {
|
|
1526
1661
|
checkMapping(det.mapping, `${path}.detail[${di}].mapping`);
|
|
1662
|
+
checkReference(det.formula, `${path}.detail[${di}].formula`);
|
|
1663
|
+
}
|
|
1527
1664
|
}
|
|
1528
1665
|
}
|
|
1529
1666
|
}
|
|
@@ -1789,14 +1926,112 @@ function expandLoopDataContext(step, store) {
|
|
|
1789
1926
|
if (Object.keys(expanded).length)
|
|
1790
1927
|
store.merge(expanded, 'MultipleExecution');
|
|
1791
1928
|
}
|
|
1792
|
-
/**
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1929
|
+
/**
|
|
1930
|
+
* 显式 mapping 必须带实时显示名和完整上下文。
|
|
1931
|
+
*
|
|
1932
|
+
* mapping 的旧写法把来源 paramKey 放在对象 key 上,例如:
|
|
1933
|
+
* { "paymentTerms[].paymentNote": "<目标字段ID>" }。
|
|
1934
|
+
* hydrateContextReferences 只能遍历值,无法从这个 key 上给后续编译器
|
|
1935
|
+
* 回填 _resolvedContext,导致明细分支进入 assignFlatEsbChild 时丢失
|
|
1936
|
+
* WebHook 的 Body 根。这里在预检阶段把 key 规范化为对象,并复用
|
|
1937
|
+
* getComponentContext 返回的真实字段元数据;不根据 paramKey 猜 fieldId/root。
|
|
1938
|
+
*/
|
|
1939
|
+
export function hydrateMappingLabels(plan, eventContextFields, eventContext = {}) {
|
|
1940
|
+
const runtimeFields = Object.values(eventContext || {}).filter((field) => (field && typeof field === 'object' && field.type !== 'context_group' && field.paramKey));
|
|
1941
|
+
// eventContextFields 已经经过 resolveContextGroupRoot 归一化,优先使用它,
|
|
1942
|
+
// 避免 parsePlatformContext 的原始 numeric primaryKey 覆盖 WebHook 的逻辑根 Body。
|
|
1943
|
+
const contextFields = [...(eventContextFields || []), ...runtimeFields];
|
|
1944
|
+
const fieldsByParamKey = new Map();
|
|
1945
|
+
const addField = (key, field) => {
|
|
1946
|
+
const normalized = String(key || '').trim();
|
|
1947
|
+
if (!normalized)
|
|
1948
|
+
return;
|
|
1949
|
+
const bucket = fieldsByParamKey.get(normalized) || [];
|
|
1950
|
+
if (!bucket.some((item) => String(item?.id ?? '') === String(field?.id ?? '') && String(item?.paramKey ?? '') === String(field?.paramKey ?? ''))) {
|
|
1951
|
+
bucket.push(field);
|
|
1798
1952
|
}
|
|
1799
|
-
|
|
1953
|
+
fieldsByParamKey.set(normalized, bucket);
|
|
1954
|
+
};
|
|
1955
|
+
for (const field of contextFields) {
|
|
1956
|
+
if (!field || typeof field !== 'object' || !field.paramKey)
|
|
1957
|
+
continue;
|
|
1958
|
+
const paramKey = String(field.paramKey);
|
|
1959
|
+
const root = String(field.tablePrimaryKey || field.contextGroup || '').trim();
|
|
1960
|
+
addField(paramKey, field);
|
|
1961
|
+
if (root && !paramKey.startsWith(`${root}.`))
|
|
1962
|
+
addField(`${root}.${paramKey}`, field);
|
|
1963
|
+
if (root && paramKey.startsWith(`${root}.`))
|
|
1964
|
+
addField(paramKey.slice(root.length + 1), field);
|
|
1965
|
+
}
|
|
1966
|
+
const findField = (key) => {
|
|
1967
|
+
const requested = String(key || '').trim();
|
|
1968
|
+
if (!requested)
|
|
1969
|
+
return null;
|
|
1970
|
+
const direct = fieldsByParamKey.get(requested) || [];
|
|
1971
|
+
if (direct.length === 1)
|
|
1972
|
+
return direct[0];
|
|
1973
|
+
if (direct.length > 1)
|
|
1974
|
+
return null;
|
|
1975
|
+
const stripped = requested.replace(/^(?:Params|Header|Body)\./, '');
|
|
1976
|
+
const matches = fieldsByParamKey.get(stripped) || [];
|
|
1977
|
+
return matches.length === 1 ? matches[0] : null;
|
|
1978
|
+
};
|
|
1979
|
+
const resolvedContext = (field) => {
|
|
1980
|
+
if (!field || typeof field !== 'object')
|
|
1981
|
+
return undefined;
|
|
1982
|
+
const rawField = field.raw && typeof field.raw === 'object' ? field.raw : field;
|
|
1983
|
+
const tablePrimaryKey = String(field.tablePrimaryKey || field.contextGroup || rawField.tablePrimaryKey || '').trim();
|
|
1984
|
+
const fieldId = field.id ?? rawField.id ?? rawField.paramId;
|
|
1985
|
+
if (!tablePrimaryKey || fieldId === undefined || fieldId === null || String(fieldId).trim() === '')
|
|
1986
|
+
return undefined;
|
|
1987
|
+
const paramKey = String(field.paramKey || rawField.paramKey || '').trim();
|
|
1988
|
+
return {
|
|
1989
|
+
fieldId: String(fieldId),
|
|
1990
|
+
fieldType: String(field.fieldType || field.paramType || rawField.fieldType || rawField.paramType || 'string'),
|
|
1991
|
+
label: String(field.label || field.showName || field.paramName || rawField.showName || rawField.paramName || paramKey),
|
|
1992
|
+
componentType: String(field.componentType || 'WebHookTrigger'),
|
|
1993
|
+
dimension: String(field.dimension || rawField.dimension || 'field'),
|
|
1994
|
+
tablePrimaryKey,
|
|
1995
|
+
tableName: String(field.tableName || rawField.tableName || tablePrimaryKey),
|
|
1996
|
+
tableKey: String(field.tableKey || field.contextGroup || tablePrimaryKey),
|
|
1997
|
+
parentName: String(field.parentName || rawField.parentName || ''),
|
|
1998
|
+
paramKey,
|
|
1999
|
+
multKey: String(field.multKey || rawField.multKey || ''),
|
|
2000
|
+
multName: String(field.multName || rawField.multName || ''),
|
|
2001
|
+
isMultCom: Boolean(field.isMultCom ?? rawField.isMultCom),
|
|
2002
|
+
parentComId: String(field.parentComId || rawField.parentComId || ''),
|
|
2003
|
+
comId: String(field.comId || rawField.comId || ''),
|
|
2004
|
+
rawField: { ...rawField },
|
|
2005
|
+
};
|
|
2006
|
+
};
|
|
2007
|
+
const labelOf = (field, fallback) => String(field?.label || field?.showName || field?.paramName || field?.raw?.showName || field?.raw?.paramName || fallback);
|
|
2008
|
+
const enrichTarget = (sourceKey, target) => {
|
|
2009
|
+
const requestedKey = target && typeof target === 'object' && !Array.isArray(target)
|
|
2010
|
+
? String(target.paramKey || target.key || sourceKey)
|
|
2011
|
+
: String(sourceKey);
|
|
2012
|
+
const field = findField(requestedKey);
|
|
2013
|
+
const label = labelOf(field, requestedKey);
|
|
2014
|
+
if (target && typeof target === 'object' && !Array.isArray(target)) {
|
|
2015
|
+
const declaredKind = String(target.kind || target.assignmentKind || 'context');
|
|
2016
|
+
if (declaredKind !== 'query_result') {
|
|
2017
|
+
target.paramKey ??= requestedKey;
|
|
2018
|
+
target.label ??= label;
|
|
2019
|
+
if (!target._resolvedContext && field) {
|
|
2020
|
+
const resolved = resolvedContext(field);
|
|
2021
|
+
if (resolved)
|
|
2022
|
+
target._resolvedContext = resolved;
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
return target;
|
|
2026
|
+
}
|
|
2027
|
+
if (!field)
|
|
2028
|
+
return target;
|
|
2029
|
+
const normalized = { target: String(target), paramKey: requestedKey, label };
|
|
2030
|
+
const resolved = resolvedContext(field);
|
|
2031
|
+
if (resolved)
|
|
2032
|
+
normalized._resolvedContext = resolved;
|
|
2033
|
+
return normalized;
|
|
2034
|
+
};
|
|
1800
2035
|
const hydrate = (steps) => {
|
|
1801
2036
|
for (const step of steps || []) {
|
|
1802
2037
|
if (!step || typeof step !== 'object')
|
|
@@ -1805,16 +2040,7 @@ export function hydrateMappingLabels(plan, eventContextFields) {
|
|
|
1805
2040
|
const mapping = params && typeof params === 'object' ? params.mapping : null;
|
|
1806
2041
|
if (mapping && typeof mapping === 'object') {
|
|
1807
2042
|
for (const [sourceKey, target] of Object.entries(mapping)) {
|
|
1808
|
-
|
|
1809
|
-
if (!label)
|
|
1810
|
-
continue;
|
|
1811
|
-
if (target && typeof target === 'object') {
|
|
1812
|
-
target.paramKey ??= String(sourceKey);
|
|
1813
|
-
target.label ??= label;
|
|
1814
|
-
}
|
|
1815
|
-
else {
|
|
1816
|
-
mapping[sourceKey] = { target: String(target), paramKey: String(sourceKey), label };
|
|
1817
|
-
}
|
|
2043
|
+
mapping[sourceKey] = enrichTarget(String(sourceKey), target);
|
|
1818
2044
|
}
|
|
1819
2045
|
}
|
|
1820
2046
|
if (params && typeof params === 'object') {
|
|
@@ -1822,17 +2048,7 @@ export function hydrateMappingLabels(plan, eventContextFields) {
|
|
|
1822
2048
|
if (!detail || typeof detail !== 'object' || typeof detail.mapping !== 'object')
|
|
1823
2049
|
continue;
|
|
1824
2050
|
for (const [sourceKey, target] of Object.entries(detail.mapping)) {
|
|
1825
|
-
|
|
1826
|
-
const label = labelByParamKey[sourceParamKey] || '';
|
|
1827
|
-
if (!label)
|
|
1828
|
-
continue;
|
|
1829
|
-
if (target && typeof target === 'object') {
|
|
1830
|
-
target.paramKey ??= sourceParamKey;
|
|
1831
|
-
target.label ??= label;
|
|
1832
|
-
}
|
|
1833
|
-
else {
|
|
1834
|
-
detail.mapping[sourceKey] = { target: String(target), paramKey: sourceParamKey, label };
|
|
1835
|
-
}
|
|
2051
|
+
detail.mapping[sourceKey] = enrichTarget(String(sourceKey), target);
|
|
1836
2052
|
}
|
|
1837
2053
|
}
|
|
1838
2054
|
}
|
|
@@ -2144,7 +2360,7 @@ export function syncBizFieldsToDraft(draft, plan) {
|
|
|
2144
2360
|
const pa = planActions[i], da = draftActions[i];
|
|
2145
2361
|
if (!pa || !da || typeof pa !== 'object' || typeof da !== 'object')
|
|
2146
2362
|
continue;
|
|
2147
|
-
if (
|
|
2363
|
+
if (!['ApproveCreate', 'ApproveSave', 'ApproveCommit', 'ApproveSendBack'].includes(String(pa.type)))
|
|
2148
2364
|
continue;
|
|
2149
2365
|
const pp = pa.params;
|
|
2150
2366
|
if (!pp || typeof pp !== 'object' || !pp._bizFields)
|
|
@@ -2332,6 +2548,7 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2332
2548
|
return { valid: false, errors: ['event must be an object'], contextStore: {} };
|
|
2333
2549
|
}
|
|
2334
2550
|
await fillRequiredTriggerOperator(plan, client);
|
|
2551
|
+
await resolveApproveCreateClassifiedProtection(plan, client, errors, warnings);
|
|
2335
2552
|
await resolveFixedPeople(plan, client);
|
|
2336
2553
|
try {
|
|
2337
2554
|
await resolveFixedWorkflowInstances(plan, client);
|
|
@@ -2387,7 +2604,7 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2387
2604
|
// 忽略
|
|
2388
2605
|
}
|
|
2389
2606
|
// EventButton 的 targetForm 可能只提供表单 id;先完成 targetForm 的实时归属回填,
|
|
2390
|
-
// 再按前端
|
|
2607
|
+
// 再按前端 ebuilderButton 浏览器校验真实按钮以及 before 能力。
|
|
2391
2608
|
try {
|
|
2392
2609
|
const buttonResources = await resolveEventButtonSelection(plan, client);
|
|
2393
2610
|
if (buttonResources.length)
|
|
@@ -2405,11 +2622,16 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2405
2622
|
const tf = stepFormRef(step);
|
|
2406
2623
|
if (tf && tf.id) {
|
|
2407
2624
|
const formId = String(tf.id);
|
|
2408
|
-
//
|
|
2409
|
-
//
|
|
2410
|
-
|
|
2625
|
+
// 删除表单数据、更新表单数据的条件编辑器,以及数据源查询/定时触发
|
|
2626
|
+
// 组件都绑定 dataSource 字段选择器;条件左值必须和前端一样来自
|
|
2627
|
+
// /api/ebuilder/common/ds/fields,不能回退到 getEbField。
|
|
2628
|
+
const isActionEbUpdateCondition = step.type === 'ActionEbUpdate'
|
|
2629
|
+
&& String((step.params || {}).opType || 'updateData') === 'updateData';
|
|
2630
|
+
const strictConditionSource = [
|
|
2631
|
+
'ActionEbDelete', 'EnquiryForm', 'TimeBatchTrigger', 'DateTrigger',
|
|
2632
|
+
].includes(step.type) || isActionEbUpdateCondition;
|
|
2411
2633
|
const sourceProtocol = formSource.actionflowDataSourceProtocol(tf);
|
|
2412
|
-
//
|
|
2634
|
+
// 严格条件来源的字段不是普通 EB 表单字段:
|
|
2413
2635
|
// 它们必须来自 /api/ebuilder/common/ds/fields,不能先调用 getEbField。
|
|
2414
2636
|
let fields = strictConditionSource ? [] : await getFormFieldsFull(formId, client, tf);
|
|
2415
2637
|
if (!strictConditionSource)
|
|
@@ -2418,7 +2640,7 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2418
2640
|
// 查询组件偶尔会只保留系统字段,筛选编辑器因此把业务字段标成“已删除”。
|
|
2419
2641
|
const params = step.params && typeof step.params === 'object' ? step.params : (step.params = {});
|
|
2420
2642
|
if (['ActionEbDelete', 'EnquiryForm', 'TimeBatchTrigger', 'DateTrigger'].includes(step.type)
|
|
2421
|
-
|| (step.type === 'ActionEbUpdate' &&
|
|
2643
|
+
|| (step.type === 'ActionEbUpdate' && String(params.opType || 'updateData') === 'updateData')) {
|
|
2422
2644
|
// EnquiryForm/条件更新的筛选条件左值必须来自数据源字段选择器,
|
|
2423
2645
|
// 而不是只用 getEbField 的表单字段对象。后者经常缺少数据源侧的
|
|
2424
2646
|
// name/formInfo/sformId,会导致设计器把条件字段显示为“已删除”
|
|
@@ -2769,7 +2991,7 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2769
2991
|
}
|
|
2770
2992
|
}
|
|
2771
2993
|
// 显式 mapping 补实时显示名
|
|
2772
|
-
hydrateMappingLabels(plan, eventContextFields);
|
|
2994
|
+
hydrateMappingLabels(plan, eventContextFields, eventContext);
|
|
2773
2995
|
hydrateWorkflowProvenanceMappings(plan, eventContextFields);
|
|
2774
2996
|
hydrateLoopCycleTimes(plan, eventContextFields);
|
|
2775
2997
|
// finalOutput 不属于 actions,但其 CustFormDetailDto.formulaValue 也可能
|
|
@@ -2783,6 +3005,18 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2783
3005
|
// 逐节点查上下文 + ApproveCreate 目标字段
|
|
2784
3006
|
const walk = async (steps, branchStore, prefix) => {
|
|
2785
3007
|
for (const [index, step] of (steps || []).entries()) {
|
|
3008
|
+
// Output 是终止节点,不是可查询上下文的动作组件;分支里的 Output
|
|
3009
|
+
// 仍需把提醒内容中的上下文公式回填,但不能把它送到
|
|
3010
|
+
// getComponentContext,否则它没有 EventButton 上游元数据,会误报
|
|
3011
|
+
// triggerFlag 只能用于 EventButton。
|
|
3012
|
+
if (step?.type === 'Output') {
|
|
3013
|
+
const eventContextGroup = Object.values(branchStore.asDict()).find((value) => (value && typeof value === 'object' && value.type === 'context_group' && value.component));
|
|
3014
|
+
hydrateContextReferences([step], branchStore.asDict(), {
|
|
3015
|
+
id: 'event_1',
|
|
3016
|
+
type: String(eventContextGroup?.component || event.type || ''),
|
|
3017
|
+
});
|
|
3018
|
+
continue;
|
|
3019
|
+
}
|
|
2786
3020
|
const path = `${prefix}[${index}]`;
|
|
2787
3021
|
let result;
|
|
2788
3022
|
try {
|
|
@@ -2821,7 +3055,7 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2821
3055
|
hydrateLoopSourceReferences(step, branchStore.asDict());
|
|
2822
3056
|
await walk(step.actions || [], new ContextStore(branchStore.asDict()), `${path}.actions`);
|
|
2823
3057
|
}
|
|
2824
|
-
else if (
|
|
3058
|
+
else if (['ApproveCreate', 'ApproveSave', 'ApproveCommit', 'ApproveSendBack'].includes(String(step.type))) {
|
|
2825
3059
|
await resolveBizCreateFields(step, plan, client, errors, path);
|
|
2826
3060
|
}
|
|
2827
3061
|
}
|