weaver-e10-builder 1.6.12 → 1.6.13
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 +22 -0
- package/dist/cli-register.d.ts.map +1 -0
- package/dist/cli-register.js +340 -0
- package/dist/cli-register.js.map +1 -0
- package/dist/commands/form-list-columns.d.ts.map +1 -1
- package/dist/commands/form-list-columns.js +85 -3
- package/dist/commands/form-list-columns.js.map +1 -1
- package/dist/commands/form-list-config.d.ts +9 -0
- package/dist/commands/form-list-config.d.ts.map +1 -0
- package/dist/commands/form-list-config.js +113 -0
- package/dist/commands/form-list-config.js.map +1 -0
- package/dist/commands/form-list-filter.d.ts.map +1 -1
- package/dist/commands/form-list-filter.js +231 -3
- package/dist/commands/form-list-filter.js.map +1 -1
- package/dist/commands/form-nlist.d.ts.map +1 -1
- package/dist/commands/form-nlist.js +48 -1
- package/dist/commands/form-nlist.js.map +1 -1
- package/dist/index.js +19 -213
- package/dist/index.js.map +1 -1
- package/dist/services/actionflow/build_workflow_draft.d.ts.map +1 -1
- package/dist/services/actionflow/build_workflow_draft.js +8 -0
- package/dist/services/actionflow/build_workflow_draft.js.map +1 -1
- package/dist/services/actionflow/calendar_mapper.d.ts.map +1 -1
- package/dist/services/actionflow/calendar_mapper.js +7 -4
- package/dist/services/actionflow/calendar_mapper.js.map +1 -1
- package/dist/services/actionflow/component_registry.d.ts.map +1 -1
- package/dist/services/actionflow/component_registry.js +18 -2
- package/dist/services/actionflow/component_registry.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_delete.js +1 -1
- package/dist/services/actionflow/components/action_eb_delete.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 +2 -1
- package/dist/services/actionflow/components/action_eb_update.js.map +1 -1
- package/dist/services/actionflow/components/approve_create.d.ts.map +1 -1
- package/dist/services/actionflow/components/approve_create.js +4 -3
- package/dist/services/actionflow/components/approve_create.js.map +1 -1
- package/dist/services/actionflow/components/document_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/document_actions.js +15 -48
- package/dist/services/actionflow/components/document_actions.js.map +1 -1
- package/dist/services/actionflow/components/enquiry_form.d.ts +0 -7
- package/dist/services/actionflow/components/enquiry_form.d.ts.map +1 -1
- package/dist/services/actionflow/components/enquiry_form.js +10 -54
- package/dist/services/actionflow/components/enquiry_form.js.map +1 -1
- package/dist/services/actionflow/components/form_data_builder.d.ts +2 -0
- package/dist/services/actionflow/components/form_data_builder.d.ts.map +1 -1
- package/dist/services/actionflow/components/form_data_builder.js +35 -0
- package/dist/services/actionflow/components/form_data_builder.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 +8 -2
- package/dist/services/actionflow/components/inner_mq_send.js.map +1 -1
- package/dist/services/actionflow/components/send_message.d.ts.map +1 -1
- package/dist/services/actionflow/components/send_message.js +52 -1
- 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 +39 -0
- package/dist/services/actionflow/components/serverless_action.js.map +1 -1
- package/dist/services/actionflow/components/simple_scheduler.d.ts.map +1 -1
- package/dist/services/actionflow/components/simple_scheduler.js +46 -12
- package/dist/services/actionflow/components/simple_scheduler.js.map +1 -1
- package/dist/services/actionflow/components/time_batch_trigger.js +4 -3
- package/dist/services/actionflow/components/time_batch_trigger.js.map +1 -1
- package/dist/services/actionflow/context_preflight.js +4 -4
- package/dist/services/actionflow/context_preflight.js.map +1 -1
- package/dist/services/actionflow/form_source.d.ts +2 -0
- package/dist/services/actionflow/form_source.d.ts.map +1 -1
- package/dist/services/actionflow/form_source.js +45 -10
- 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 +23 -5
- package/dist/services/actionflow/formula_service.js.map +1 -1
- package/dist/services/actionflow/param_mapping_basis.d.ts +3 -0
- package/dist/services/actionflow/param_mapping_basis.d.ts.map +1 -0
- package/dist/services/actionflow/param_mapping_basis.js +61 -0
- package/dist/services/actionflow/param_mapping_basis.js.map +1 -0
- package/dist/services/actionflow/preflight_service.d.ts +2 -0
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -1
- package/dist/services/actionflow/preflight_service.js +69 -34
- package/dist/services/actionflow/preflight_service.js.map +1 -1
- package/dist/services/actionflow/runtime_metadata.d.ts +1 -0
- package/dist/services/actionflow/runtime_metadata.d.ts.map +1 -1
- package/dist/services/actionflow/runtime_metadata.js +3 -0
- package/dist/services/actionflow/runtime_metadata.js.map +1 -1
- package/dist/services/actionflow/trigger_common.d.ts.map +1 -1
- package/dist/services/actionflow/trigger_common.js +4 -7
- package/dist/services/actionflow/trigger_common.js.map +1 -1
- package/dist/services/actionflow/update_service.d.ts +6 -0
- package/dist/services/actionflow/update_service.d.ts.map +1 -1
- package/dist/services/actionflow/update_service.js +6 -38
- package/dist/services/actionflow/update_service.js.map +1 -1
- package/dist/services/actionflow/workflow_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/workflow_compiler.js +7 -7
- package/dist/services/actionflow/workflow_compiler.js.map +1 -1
- package/dist/services/actionflow/workflow_request_level.d.ts +3 -0
- package/dist/services/actionflow/workflow_request_level.d.ts.map +1 -0
- package/dist/services/actionflow/workflow_request_level.js +11 -0
- package/dist/services/actionflow/workflow_request_level.js.map +1 -0
- package/dist/services/form-list-columns.d.ts +11 -0
- package/dist/services/form-list-columns.d.ts.map +1 -1
- package/dist/services/form-list-columns.js +10 -0
- package/dist/services/form-list-columns.js.map +1 -1
- package/dist/services/form-list-config.d.ts +58 -0
- package/dist/services/form-list-config.d.ts.map +1 -0
- package/dist/services/form-list-config.js +140 -0
- package/dist/services/form-list-config.js.map +1 -0
- package/dist/services/form-list-fields.d.ts +36 -0
- package/dist/services/form-list-fields.d.ts.map +1 -0
- package/dist/services/form-list-fields.js +182 -0
- package/dist/services/form-list-fields.js.map +1 -0
- package/dist/services/form-list-filter-http.d.ts +60 -0
- package/dist/services/form-list-filter-http.d.ts.map +1 -0
- package/dist/services/form-list-filter-http.js +137 -0
- package/dist/services/form-list-filter-http.js.map +1 -0
- package/dist/services/form-list-filter-sql.d.ts +74 -0
- package/dist/services/form-list-filter-sql.d.ts.map +1 -0
- package/dist/services/form-list-filter-sql.js +206 -0
- package/dist/services/form-list-filter-sql.js.map +1 -0
- package/dist/services/form-nlist.d.ts +25 -0
- package/dist/services/form-nlist.d.ts.map +1 -1
- package/dist/services/form-nlist.js +223 -0
- package/dist/services/form-nlist.js.map +1 -1
- package/dist/services/form-view.d.ts +3 -3
- package/dist/services/form-view.d.ts.map +1 -1
- package/dist/services/form-view.js +26 -12
- package/dist/services/form-view.js.map +1 -1
- package/dist/services/workflow-function-management.d.ts +1 -1
- package/package.json +1 -1
- package/skill-docs/SKILL.md +4 -4
- package/skill-docs/actionflows/references/components/ebuilder/DateTrigger.md +32 -32
- package/skill-docs/actionflows/references/components/ebuilder/EnquiryForm.md +3 -1
- package/skill-docs/actionflows/references/components/ebuilder/TimeBatchTrigger.md +19 -19
- package/skill-docs/references/common/ref-cli-commands.md +9 -4
- package/skill-docs/references/form/guide-form-view.md +201 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param_mapping_basis.d.ts","sourceRoot":"","sources":["../../../src/services/actionflow/param_mapping_basis.ts"],"names":[],"mappings":"AAEA,8BAA8B;AAC9B,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAkDrH"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { genSfId, normalizeNumericFrontId } from './id_generator.js';
|
|
2
|
+
/** 编译参数映射中选择的「依据值(参数行)」下级。 */
|
|
3
|
+
export function buildParamMappingBasisFormula(rows, target, item, appId) {
|
|
4
|
+
const reference = item.value;
|
|
5
|
+
if (!reference || typeof reference !== 'object' || String(reference.kind || reference.assignmentKind) !== 'context') {
|
|
6
|
+
throw new Error('参数映射依据值下级必须选择上下文字段');
|
|
7
|
+
}
|
|
8
|
+
const selector = String(item.basisParamId || item.basisParamKey || '').trim();
|
|
9
|
+
const candidates = rows.filter((row) => String(row.id || '') === selector || String(row.paramKey || '') === selector);
|
|
10
|
+
if (!selector || candidates.length !== 1)
|
|
11
|
+
throw new Error(`参数映射依据行 '${selector}' 未在 tableData 中唯一匹配`);
|
|
12
|
+
const basis = candidates[0];
|
|
13
|
+
let parentId = String(target.parentId || '');
|
|
14
|
+
const seen = new Set();
|
|
15
|
+
while (parentId && parentId !== String(basis.id)) {
|
|
16
|
+
if (seen.has(parentId))
|
|
17
|
+
throw new Error('参数映射存在循环父子关系');
|
|
18
|
+
seen.add(parentId);
|
|
19
|
+
parentId = String(rows.find((row) => String(row.id) === parentId)?.parentId || '');
|
|
20
|
+
}
|
|
21
|
+
if (parentId !== String(basis.id))
|
|
22
|
+
throw new Error('参数映射依据行必须是目标参数的上级');
|
|
23
|
+
const formula = basis.formulaData;
|
|
24
|
+
const context = String(formula?.type) === '8' ? formula.childs?.[0] : formula;
|
|
25
|
+
if (!context || !['3', '10'].includes(String(context.type)))
|
|
26
|
+
throw new Error('参数映射依据行需要先设置上下文或依据值赋值');
|
|
27
|
+
const basisConfig = String(context.type) === '10' ? context.config : context;
|
|
28
|
+
const basisSource = String(basisConfig?.source || '').trim();
|
|
29
|
+
const selectedSource = String(reference.source || reference.comId || '').trim();
|
|
30
|
+
if (basisSource && selectedSource && !['event', 'event_1', 'trigger'].includes(selectedSource) && basisSource !== selectedSource) {
|
|
31
|
+
throw new Error('参数映射依据行与来源字段属于不同的上下文节点');
|
|
32
|
+
}
|
|
33
|
+
const basisPath = String(String(context.type) === '10' ? basisConfig?.paramKey : basisConfig?.config?.paramKey || basisConfig?.paramKey || '').trim();
|
|
34
|
+
const resolved = reference._resolvedContext || {};
|
|
35
|
+
const sourcePath = String(resolved.paramKey || '').trim();
|
|
36
|
+
if (!sourcePath)
|
|
37
|
+
throw new Error('参数映射依据值字段缺少上下文接口返回的 paramKey');
|
|
38
|
+
const root = String(resolved.tablePrimaryKey || '').trim();
|
|
39
|
+
const stripRoot = (path) => root && path.startsWith(`${root}.`) ? path.slice(root.length + 1) : path;
|
|
40
|
+
const parentPath = stripRoot(basisPath);
|
|
41
|
+
const fieldPath = stripRoot(sourcePath);
|
|
42
|
+
const relative = fieldPath === parentPath ? 'esbAssignSelf' : fieldPath.startsWith(`${parentPath}.`) ? fieldPath.slice(parentPath.length + 1) : '';
|
|
43
|
+
if (!parentPath || !relative)
|
|
44
|
+
throw new Error(`来源字段 '${sourcePath}' 不属于依据值 '${basisPath}'`);
|
|
45
|
+
const fieldId = normalizeNumericFrontId(resolved.fieldId || resolved.rawField?.id, '参数映射依据值字段 frontId');
|
|
46
|
+
if (!fieldId)
|
|
47
|
+
throw new Error(`来源字段 '${sourcePath}' 缺少真实 ParamBean.id`);
|
|
48
|
+
const selected = `${basis.id}#${relative}`;
|
|
49
|
+
const name = String(reference.label || resolved.label || reference.name || resolved.rawField?.showName || sourcePath);
|
|
50
|
+
const fieldType = String(resolved.fieldType || resolved.rawField?.paramType || reference.valueType || target.paramType || 'string');
|
|
51
|
+
return {
|
|
52
|
+
id: genSfId(), name, value: selected, type: '10', fieldType, formulaType: fieldType,
|
|
53
|
+
applicationId: String(appId || ''), childs: [], parentId: '0',
|
|
54
|
+
config: {
|
|
55
|
+
frontId: fieldId, paramKey: fieldPath, basisType: 'paramSetting', switchType: `sub#${basis.id}`,
|
|
56
|
+
level: 1, id: selected, source: basisSource, formulaVersion: 'V1',
|
|
57
|
+
value: basisConfig.value, config: basisConfig.config, originValue: selected, content: name,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=param_mapping_basis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param_mapping_basis.js","sourceRoot":"","sources":["../../../src/services/actionflow/param_mapping_basis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAErE,8BAA8B;AAC9B,MAAM,UAAU,6BAA6B,CAAC,IAAW,EAAE,MAAW,EAAE,IAAS,EAAE,KAAa;IAC9F,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;IAC7B,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,cAAc,CAAC,KAAK,SAAS,EAAE,CAAC;QACpH,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC;IAC3H,IAAI,CAAC,QAAQ,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,sBAAsB,CAAC,CAAC;IACtG,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,OAAO,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AAE,cAAc,EAAE,UAAU,EAAE,OAAO,KAAK,CAAC,EAAE,EAAE;YAC/F,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI;YACjE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI;SAC3F;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -15,6 +15,8 @@ export declare function resolveEventButtonSelection(plan: Record<string, any>, c
|
|
|
15
15
|
export declare function stepFormRef(step: Record<string, any>): Record<string, any> | null;
|
|
16
16
|
/** 查 form-fields 返回完整字段列表(id/showName/componentKey/paramType),进程缓存。 */
|
|
17
17
|
export declare function getFormFieldsFull(formId: string, client: ApiClient, tf?: Record<string, any> | null): Promise<any[]>;
|
|
18
|
+
/** 删除和条件更新只解析 EB 表单,不使用数据源各分类的 Browser。 */
|
|
19
|
+
export declare function resolveFormConditionTargets(plan: Record<string, any>, client: ApiClient): Promise<void>;
|
|
18
20
|
/** 回填 plan 里 targetForm 缺失的 groupId/name/text/groupName。返回无法解析的表单 id 列表。 */
|
|
19
21
|
export declare function resolveTargetForms(plan: Record<string, any>, client: ApiClient): Promise<string[]>;
|
|
20
22
|
/** 为必填的表单定时触发器补一个当前租户真实操作人。 */
|
|
@@ -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;AA4DtD;;;;GAIG;A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eAAe;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;CACvB;AAiCD,kCAAkC;AAClC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAklB5H"}
|
|
@@ -15,7 +15,6 @@ const FORM_ID_CACHE = {};
|
|
|
15
15
|
import { ContextStore, PlatformContextProvider } from './context_provider.js';
|
|
16
16
|
import { hydrateContextReferences, hydrateQueryResultReferences, queryNodeContext, resolveContextGroupRoot, } from './context_preflight.js';
|
|
17
17
|
import { get as getComponent } from './components/index.js';
|
|
18
|
-
import { defaultQueryFieldsAll } from './query_field_defaults.js';
|
|
19
18
|
import { getStepBranches } from './step_branches.js';
|
|
20
19
|
import { normalizeParamGroupSetting } from './param_group_dto.js';
|
|
21
20
|
import { genSfId } from './id_generator.js';
|
|
@@ -241,9 +240,7 @@ export async function getFormFieldsFull(formId, client, tf) {
|
|
|
241
240
|
catch {
|
|
242
241
|
// 查询失败返回空,由调用方判定
|
|
243
242
|
}
|
|
244
|
-
//
|
|
245
|
-
// 设计器的 ds/fields 仍能返回完整的主表和明细字段。这里仅作为动作流
|
|
246
|
-
// 预检的字段元数据兜底,不修改表单数据或表单设计接口。
|
|
243
|
+
// 保持原有字段查询兼容;条件字段始终由各自的实时选择器单独登记。
|
|
247
244
|
if (!fields.length) {
|
|
248
245
|
try {
|
|
249
246
|
const fallback = await formSource.dataSourceFields(client, formId);
|
|
@@ -263,7 +260,7 @@ export async function getFormFieldsFull(formId, client, tf) {
|
|
|
263
260
|
}
|
|
264
261
|
}
|
|
265
262
|
catch {
|
|
266
|
-
//
|
|
263
|
+
// 查询失败时保持空字段列表,由预检报告。
|
|
267
264
|
}
|
|
268
265
|
}
|
|
269
266
|
FORM_FIELDS_CACHE[formId] = fields;
|
|
@@ -303,6 +300,41 @@ function findTfGroup(plan, formId) {
|
|
|
303
300
|
};
|
|
304
301
|
return search(plan.actions || []);
|
|
305
302
|
}
|
|
303
|
+
function usesFormConditionFields(step) {
|
|
304
|
+
return step?.type === 'ActionEbDelete' || (step?.type === 'ActionEbUpdate'
|
|
305
|
+
&& String(step?.params?.opType || 'updateData') === 'updateData');
|
|
306
|
+
}
|
|
307
|
+
/** 删除和条件更新只解析 EB 表单,不使用数据源各分类的 Browser。 */
|
|
308
|
+
export async function resolveFormConditionTargets(plan, client) {
|
|
309
|
+
for (const step of walkPlanSteps(plan.actions || [])) {
|
|
310
|
+
if (!usesFormConditionFields(step))
|
|
311
|
+
continue;
|
|
312
|
+
const ref = step.params?.targetForm;
|
|
313
|
+
if (!ref || typeof ref !== 'object' || Array.isArray(ref))
|
|
314
|
+
throw new Error(`${step.type}.targetForm 缺少目标表单`);
|
|
315
|
+
const id = String(ref.id || ref.tableId || '').trim();
|
|
316
|
+
const groupId = String(ref.groupId || ref.appId || '').trim();
|
|
317
|
+
if (id && groupId && (ref.name || ref.text) && ref.groupName) {
|
|
318
|
+
ref.id = id;
|
|
319
|
+
ref.groupId = groupId;
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
const keyword = id || String(ref.name || ref.text || '').trim();
|
|
323
|
+
if (!keyword)
|
|
324
|
+
throw new Error(`${step.type}.targetForm 缺少表单 ID 或名称,无法查询所属应用`);
|
|
325
|
+
const result = await formSource.searchForms(client, keyword, groupId ? { appId: groupId } : {});
|
|
326
|
+
const hits = result.hits.filter((hit) => (!id || hit.objId === id) && (!groupId || hit.appId === groupId));
|
|
327
|
+
if (result.truncated || hits.length !== 1 || !hits[0].appId) {
|
|
328
|
+
throw new Error(`${step.type}.targetForm 未能唯一确定表单及所属应用:${keyword}(匹配 ${hits.length} 项)`);
|
|
329
|
+
}
|
|
330
|
+
const hit = hits[0];
|
|
331
|
+
ref.id = hit.objId;
|
|
332
|
+
ref.groupId = hit.appId;
|
|
333
|
+
ref.name ||= hit.name;
|
|
334
|
+
ref.text ||= hit.name;
|
|
335
|
+
ref.groupName ||= hit.appName;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
306
338
|
/** 回填 plan 里 targetForm 缺失的 groupId/name/text/groupName。返回无法解析的表单 id 列表。 */
|
|
307
339
|
export async function resolveTargetForms(plan, client) {
|
|
308
340
|
const normalizeRef = (ref) => {
|
|
@@ -344,7 +376,7 @@ export async function resolveTargetForms(plan, client) {
|
|
|
344
376
|
for (const step of steps || []) {
|
|
345
377
|
if (!step || typeof step !== 'object')
|
|
346
378
|
continue;
|
|
347
|
-
if (['ActionEbAdd', 'ActionEbUpdate', 'ActionEbDelete', 'ActionEbRecover', 'ActionEbSaveVersion', 'EbGetDataById'].includes(step.type)) {
|
|
379
|
+
if (!usesFormConditionFields(step) && ['ActionEbAdd', 'ActionEbUpdate', 'ActionEbDelete', 'ActionEbRecover', 'ActionEbSaveVersion', 'EbGetDataById'].includes(step.type)) {
|
|
348
380
|
const tf = (step.params || {}).targetForm;
|
|
349
381
|
if (tf && typeof tf === 'object' && tf.id) {
|
|
350
382
|
if (!tf.groupId || !tf.name || !tf.text || !tf.groupName)
|
|
@@ -420,7 +452,7 @@ export async function resolveTargetForms(plan, client) {
|
|
|
420
452
|
continue;
|
|
421
453
|
const params = step.params || {};
|
|
422
454
|
if (params && typeof params === 'object') {
|
|
423
|
-
if (['ActionEbAdd', 'ActionEbUpdate', 'ActionEbDelete', 'ActionEbRecover', 'ActionEbSaveVersion', 'EbGetDataById'].includes(step.type)) {
|
|
455
|
+
if (!usesFormConditionFields(step) && ['ActionEbAdd', 'ActionEbUpdate', 'ActionEbDelete', 'ActionEbRecover', 'ActionEbSaveVersion', 'EbGetDataById'].includes(step.type)) {
|
|
424
456
|
const tf = params.targetForm;
|
|
425
457
|
if (tf && typeof tf === 'object' && tf.groupId)
|
|
426
458
|
groupIds.add(String(tf.groupId));
|
|
@@ -2712,13 +2744,14 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2712
2744
|
return { valid: false, errors, warnings, contextStore: store.asDict() };
|
|
2713
2745
|
// 回填 targetForm 缺失的 groupId/name
|
|
2714
2746
|
try {
|
|
2747
|
+
await resolveFormConditionTargets(plan, client);
|
|
2715
2748
|
const unresolvedForms = await resolveTargetForms(plan, client);
|
|
2716
2749
|
for (const fid of unresolvedForms) {
|
|
2717
2750
|
errors.push(`targetForm.id='${fid}' 未在平台表单中找到, 无法确定所属应用(groupId). 请用 form-applications + form-list 确认表单真实存在.`);
|
|
2718
2751
|
}
|
|
2719
2752
|
}
|
|
2720
|
-
catch {
|
|
2721
|
-
|
|
2753
|
+
catch (error) {
|
|
2754
|
+
errors.push(`目标表单查询失败: ${String(error?.message || error)}`);
|
|
2722
2755
|
}
|
|
2723
2756
|
// EventButton 的 targetForm 可能只提供表单 id;先完成 targetForm 的实时归属回填,
|
|
2724
2757
|
// 再按前端 ebuilderButton 浏览器校验真实按钮以及 before 能力。
|
|
@@ -2731,11 +2764,11 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2731
2764
|
errors.push(`EventButton 按钮查询/执行前能力校验失败: ${String(error?.message || error)}`);
|
|
2732
2765
|
}
|
|
2733
2766
|
// 查并登记所有目标表单字段元数据(转换前必须有 fieldType/componentKey)
|
|
2734
|
-
const hydrateFilterFields = async (steps) => {
|
|
2767
|
+
const hydrateFilterFields = async (steps, formConditionOnly = false) => {
|
|
2735
2768
|
for (const step of steps || []) {
|
|
2736
2769
|
if (!step || typeof step !== 'object')
|
|
2737
2770
|
continue;
|
|
2738
|
-
if (['ActionEbAdd', 'ActionEbUpdate', 'ActionEbDelete', '
|
|
2771
|
+
if ((!formConditionOnly || usesFormConditionFields(step)) && ['ActionEbAdd', 'ActionEbUpdate', 'ActionEbDelete', 'EnquiryForm', 'TimeBatchTrigger', 'EventFormData', 'EventButton', 'DateTrigger'].includes(step.type)) {
|
|
2739
2772
|
const tf = stepFormRef(step);
|
|
2740
2773
|
if (tf && tf.id) {
|
|
2741
2774
|
const formId = String(tf.id);
|
|
@@ -2744,28 +2777,23 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2744
2777
|
// /api/ebuilder/common/ds/fields,不能回退到 getEbField。
|
|
2745
2778
|
const isActionEbUpdateCondition = step.type === 'ActionEbUpdate'
|
|
2746
2779
|
&& String((step.params || {}).opType || 'updateData') === 'updateData';
|
|
2780
|
+
const isFormCondition = usesFormConditionFields(step);
|
|
2781
|
+
const isButtonCondition = step.type === 'EventButton' && Boolean(step.params?.filter);
|
|
2782
|
+
// 表单数据触发沿用前端按字段变化的既有查询;其余仅表单设置使用 getEbField。
|
|
2783
|
+
const needsEbFields = ['ActionEbAdd', 'ActionEbUpdate', 'EventFormData'].includes(step.type);
|
|
2747
2784
|
const strictConditionSource = [
|
|
2748
2785
|
'ActionEbDelete', 'EnquiryForm', 'TimeBatchTrigger', 'DateTrigger',
|
|
2749
|
-
].includes(step.type) || isActionEbUpdateCondition;
|
|
2750
|
-
const sourceProtocol = formSource.actionflowDataSourceProtocol(tf);
|
|
2751
|
-
// 删除/条件更新的 ConditionSet 绑定的是目标 e-builder 表单 Browser,
|
|
2752
|
-
// 与数据源查询/定时触发器不同:ds/fields 必须传应用 groupId、表单 sourceId
|
|
2753
|
-
// 和 sourceType=FORM(前端 ConditionSet 的实际请求协议)。
|
|
2754
|
-
const conditionFieldProtocol = step.type === 'ActionEbDelete' || isActionEbUpdateCondition
|
|
2755
|
-
? {
|
|
2756
|
-
groupId: String(tf.groupId || tf.appId || ''),
|
|
2757
|
-
sourceType: 'FORM',
|
|
2758
|
-
}
|
|
2759
|
-
: sourceProtocol;
|
|
2786
|
+
].includes(step.type) || isActionEbUpdateCondition || isButtonCondition;
|
|
2787
|
+
const sourceProtocol = isFormCondition || isButtonCondition ? null : formSource.actionflowDataSourceProtocol(tf);
|
|
2760
2788
|
// 严格条件来源的字段不是普通 EB 表单字段:
|
|
2761
2789
|
// 它们必须来自 /api/ebuilder/common/ds/fields,不能先调用 getEbField。
|
|
2762
|
-
let fields =
|
|
2763
|
-
if (!strictConditionSource)
|
|
2790
|
+
let fields = needsEbFields ? await getFormFieldsFull(formId, client, tf) : [];
|
|
2791
|
+
if (!strictConditionSource && needsEbFields)
|
|
2764
2792
|
await hydrateReferenceFilterFields(plan, client, formId, tf, fields);
|
|
2765
2793
|
// “默认全选”必须在计划层固化为实时字段列表。仅在编译期依赖全局缓存时,
|
|
2766
2794
|
// 查询组件偶尔会只保留系统字段,筛选编辑器因此把业务字段标成“已删除”。
|
|
2767
2795
|
const params = step.params && typeof step.params === 'object' ? step.params : (step.params = {});
|
|
2768
|
-
if (['ActionEbDelete', 'EnquiryForm', 'TimeBatchTrigger', 'DateTrigger'].includes(step.type)
|
|
2796
|
+
if (['ActionEbDelete', 'EnquiryForm', 'TimeBatchTrigger', 'DateTrigger'].includes(step.type) || isButtonCondition
|
|
2769
2797
|
|| (step.type === 'ActionEbUpdate' && String(params.opType || 'updateData') === 'updateData')) {
|
|
2770
2798
|
// EnquiryForm/条件更新的筛选条件左值必须来自数据源字段选择器,
|
|
2771
2799
|
// 而不是只用 getEbField 的表单字段对象。后者经常缺少数据源侧的
|
|
@@ -2773,7 +2801,9 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2773
2801
|
// 或保存时静默丢弃。
|
|
2774
2802
|
let dataSourceFields = [];
|
|
2775
2803
|
try {
|
|
2776
|
-
const dataSourceResponse =
|
|
2804
|
+
const dataSourceResponse = isFormCondition || isButtonCondition
|
|
2805
|
+
? await formSource.formConditionFields(client, String(tf.groupId || tf.appId || ''), formId)
|
|
2806
|
+
: await formSource.dataSourceFields(client, formId, true, sourceProtocol);
|
|
2777
2807
|
dataSourceFields = normalizeShowDataSourceFields(dataSourceResponse, formId)
|
|
2778
2808
|
.map((field) => normalizeDataSourceField(field, formId))
|
|
2779
2809
|
.filter((field) => Boolean(field?.id));
|
|
@@ -2781,20 +2811,24 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2781
2811
|
replaceTargetDataSourceFields(formId, dataSourceFields);
|
|
2782
2812
|
if (strictConditionSource) {
|
|
2783
2813
|
fields = dataSourceFields;
|
|
2784
|
-
|
|
2814
|
+
if (!isFormCondition && !isButtonCondition)
|
|
2815
|
+
await hydrateReferenceFilterFields(plan, client, formId, tf, fields);
|
|
2785
2816
|
}
|
|
2786
|
-
if (dataSourceFields.length)
|
|
2817
|
+
if (dataSourceFields.length && step.type !== 'ActionEbUpdate')
|
|
2787
2818
|
registerTargetFormFields(formId, dataSourceFields);
|
|
2788
|
-
if (strictConditionSource &&
|
|
2819
|
+
if (strictConditionSource && !dataSourceFields.length) {
|
|
2789
2820
|
errors.push(`${step.type}.filterCondition: /api/ebuilder/common/ds/fields 未返回数据源字段,拒绝使用 getEbField 生成条件左值。`);
|
|
2790
2821
|
}
|
|
2791
2822
|
}
|
|
2792
2823
|
catch (error) {
|
|
2793
|
-
if (strictConditionSource
|
|
2824
|
+
if (strictConditionSource) {
|
|
2794
2825
|
replaceTargetDataSourceFields(formId, []);
|
|
2795
2826
|
errors.push(`${step.type}.filterCondition: /api/ebuilder/common/ds/fields 查询失败,拒绝使用 getEbField 生成条件左值:${String(error?.message || error)}`);
|
|
2796
2827
|
}
|
|
2797
2828
|
}
|
|
2829
|
+
// 删除和条件更新不配置数据源查询的 queryFields,也不请求 showDataSourceFields。
|
|
2830
|
+
if (isFormCondition || isButtonCondition)
|
|
2831
|
+
continue;
|
|
2798
2832
|
if (step.type === 'EnquiryForm') {
|
|
2799
2833
|
const groupFields = Array.isArray(params.groupFields) ? params.groupFields : [];
|
|
2800
2834
|
const groupMessage = Array.isArray(params.groupMessage) ? params.groupMessage : [];
|
|
@@ -2850,7 +2884,7 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2850
2884
|
let physicalTable = String(selectable.find((f) => f?.physicalTable)?.physicalTable || fields.find((f) => f?.physicalTable)?.physicalTable || '');
|
|
2851
2885
|
if (!physicalTable) {
|
|
2852
2886
|
try {
|
|
2853
|
-
const full = await formSource.dataSourceFields(client, formId, true, sourceProtocol);
|
|
2887
|
+
const full = await formSource.dataSourceFields(client, formId, true, sourceProtocol ?? undefined);
|
|
2854
2888
|
const walkPhysical = (items) => {
|
|
2855
2889
|
for (const item of items || []) {
|
|
2856
2890
|
if (item?.physicalTable)
|
|
@@ -2904,9 +2938,8 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2904
2938
|
const mainFields = fields
|
|
2905
2939
|
.filter((field) => String(field.subFormId ?? '-1') === '-1')
|
|
2906
2940
|
.map((field) => ({ formId, parseMark: Boolean(field.parseMark ?? true), id: String(field.id), content: String(field.showName || field.name || field.id) }));
|
|
2907
|
-
const defaults = defaultQueryFieldsAll(formId);
|
|
2908
2941
|
const seen = new Set();
|
|
2909
|
-
params.queryFields =
|
|
2942
|
+
params.queryFields = mainFields.filter((field) => {
|
|
2910
2943
|
const id = String(field?.id || '');
|
|
2911
2944
|
if (!id || seen.has(id))
|
|
2912
2945
|
return false;
|
|
@@ -2937,9 +2970,11 @@ export async function preflightContext(plan, appId, client) {
|
|
|
2937
2970
|
if (step.type === 'Condition') {
|
|
2938
2971
|
for (const branch of getStepBranches(step) || []) {
|
|
2939
2972
|
if (branch && typeof branch === 'object')
|
|
2940
|
-
await hydrateFilterFields(branch.actions || []);
|
|
2973
|
+
await hydrateFilterFields(branch.actions || [], formConditionOnly);
|
|
2941
2974
|
}
|
|
2942
2975
|
}
|
|
2976
|
+
if (step.type === 'MultipleExecution' && Array.isArray(step.actions))
|
|
2977
|
+
await hydrateFilterFields(step.actions, true);
|
|
2943
2978
|
}
|
|
2944
2979
|
};
|
|
2945
2980
|
await hydrateFilterFields([event]);
|