weaver-e10-builder 1.5.11 → 1.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -189
- package/assets/image-style-observation.schema.json +1355 -0
- package/assets/layout-spec.schema.json +52 -0
- package/dist/commands/form-field-linkage.d.ts +55 -0
- package/dist/commands/form-field-linkage.d.ts.map +1 -1
- package/dist/commands/form-field-linkage.js +1026 -12
- package/dist/commands/form-field-linkage.js.map +1 -1
- package/dist/commands/form-formula-linkage.d.ts +36 -0
- package/dist/commands/form-formula-linkage.d.ts.map +1 -1
- package/dist/commands/form-formula-linkage.js +107 -7
- package/dist/commands/form-formula-linkage.js.map +1 -1
- package/dist/commands/form-layout-restore.d.ts +3 -0
- package/dist/commands/form-layout-restore.d.ts.map +1 -0
- package/dist/commands/form-layout-restore.js +217 -0
- package/dist/commands/form-layout-restore.js.map +1 -0
- package/dist/commands/form-layout.d.ts.map +1 -1
- package/dist/commands/form-layout.js +11 -1
- package/dist/commands/form-layout.js.map +1 -1
- package/dist/commands/form-obj-meta.d.ts +12 -0
- package/dist/commands/form-obj-meta.d.ts.map +1 -0
- package/dist/commands/form-obj-meta.js +116 -0
- package/dist/commands/form-obj-meta.js.map +1 -0
- package/dist/commands/form-validate.d.ts.map +1 -1
- package/dist/commands/form-validate.js +167 -35
- package/dist/commands/form-validate.js.map +1 -1
- package/dist/commands/form.d.ts.map +1 -1
- package/dist/commands/form.js +26 -2
- package/dist/commands/form.js.map +1 -1
- package/dist/commands/menu.d.ts.map +1 -1
- package/dist/commands/menu.js +5 -3
- package/dist/commands/menu.js.map +1 -1
- package/dist/commands/wf-form.d.ts.map +1 -1
- package/dist/commands/wf-form.js +215 -13
- package/dist/commands/wf-form.js.map +1 -1
- package/dist/core/client.d.ts +2 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +4 -2
- package/dist/core/client.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/services/actionflow/calendar_mapper.d.ts.map +1 -1
- package/dist/services/actionflow/calendar_mapper.js +34 -14
- package/dist/services/actionflow/calendar_mapper.js.map +1 -1
- package/dist/services/actionflow/components/document_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/document_actions.js +113 -4
- package/dist/services/actionflow/components/document_actions.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 +18 -1
- package/dist/services/actionflow/components/eb_get_data_by_id.js.map +1 -1
- package/dist/services/actionflow/components/index.d.ts.map +1 -1
- package/dist/services/actionflow/components/index.js +2 -1
- package/dist/services/actionflow/components/index.js.map +1 -1
- package/dist/services/actionflow/components/schedule_create.d.ts.map +1 -1
- package/dist/services/actionflow/components/schedule_create.js +22 -6
- package/dist/services/actionflow/components/schedule_create.js.map +1 -1
- package/dist/services/actionflow/components/workflow_actions.d.ts +1 -0
- package/dist/services/actionflow/components/workflow_actions.d.ts.map +1 -1
- package/dist/services/actionflow/components/workflow_actions.js +31 -6
- package/dist/services/actionflow/components/workflow_actions.js.map +1 -1
- package/dist/services/actionflow/document_source.d.ts +5 -0
- package/dist/services/actionflow/document_source.d.ts.map +1 -1
- package/dist/services/actionflow/document_source.js +16 -0
- package/dist/services/actionflow/document_source.js.map +1 -1
- package/dist/services/actionflow/formula_service.d.ts.map +1 -1
- package/dist/services/actionflow/formula_service.js +19 -8
- package/dist/services/actionflow/formula_service.js.map +1 -1
- package/dist/services/actionflow/preflight_service.d.ts +5 -0
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -1
- package/dist/services/actionflow/preflight_service.js +127 -2
- package/dist/services/actionflow/preflight_service.js.map +1 -1
- package/dist/services/actionflow/save_workflow_draft.d.ts +7 -0
- package/dist/services/actionflow/save_workflow_draft.d.ts.map +1 -1
- package/dist/services/actionflow/save_workflow_draft.js +1 -1
- package/dist/services/actionflow/save_workflow_draft.js.map +1 -1
- package/dist/services/actionflow/workflow_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/workflow_compiler.js +26 -0
- package/dist/services/actionflow/workflow_compiler.js.map +1 -1
- package/dist/services/form-formula-linkage.d.ts +4 -0
- package/dist/services/form-formula-linkage.d.ts.map +1 -1
- package/dist/services/form-formula-linkage.js +3 -1
- package/dist/services/form-formula-linkage.js.map +1 -1
- package/dist/services/form-layout-io.d.ts +18 -0
- package/dist/services/form-layout-io.d.ts.map +1 -0
- package/dist/services/form-layout-io.js +89 -0
- package/dist/services/form-layout-io.js.map +1 -0
- package/dist/services/form-layout-source/artifact.d.ts +8 -0
- package/dist/services/form-layout-source/artifact.d.ts.map +1 -0
- package/dist/services/form-layout-source/artifact.js +52 -0
- package/dist/services/form-layout-source/artifact.js.map +1 -0
- package/dist/services/form-layout-source/binding.d.ts +10 -0
- package/dist/services/form-layout-source/binding.d.ts.map +1 -0
- package/dist/services/form-layout-source/binding.js +43 -0
- package/dist/services/form-layout-source/binding.js.map +1 -0
- package/dist/services/form-layout-source/compile.d.ts +7 -0
- package/dist/services/form-layout-source/compile.d.ts.map +1 -0
- package/dist/services/form-layout-source/compile.js +262 -0
- package/dist/services/form-layout-source/compile.js.map +1 -0
- package/dist/services/form-layout-source/creation.d.ts +18 -0
- package/dist/services/form-layout-source/creation.d.ts.map +1 -0
- package/dist/services/form-layout-source/creation.js +42 -0
- package/dist/services/form-layout-source/creation.js.map +1 -0
- package/dist/services/form-layout-source/excel-extractor.d.ts +7 -0
- package/dist/services/form-layout-source/excel-extractor.d.ts.map +1 -0
- package/dist/services/form-layout-source/excel-extractor.js +342 -0
- package/dist/services/form-layout-source/excel-extractor.js.map +1 -0
- package/dist/services/form-layout-source/image-border.d.ts +9 -0
- package/dist/services/form-layout-source/image-border.d.ts.map +1 -0
- package/dist/services/form-layout-source/image-border.js +128 -0
- package/dist/services/form-layout-source/image-border.js.map +1 -0
- package/dist/services/form-layout-source/image-observation.d.ts +14 -0
- package/dist/services/form-layout-source/image-observation.d.ts.map +1 -0
- package/dist/services/form-layout-source/image-observation.js +90 -0
- package/dist/services/form-layout-source/image-observation.js.map +1 -0
- package/dist/services/form-layout-source/image-review.d.ts +32 -0
- package/dist/services/form-layout-source/image-review.d.ts.map +1 -0
- package/dist/services/form-layout-source/image-review.js +266 -0
- package/dist/services/form-layout-source/image-review.js.map +1 -0
- package/dist/services/form-layout-source/image-style.d.ts +16 -0
- package/dist/services/form-layout-source/image-style.d.ts.map +1 -0
- package/dist/services/form-layout-source/image-style.js +539 -0
- package/dist/services/form-layout-source/image-style.js.map +1 -0
- package/dist/services/form-layout-source/json.d.ts +3 -0
- package/dist/services/form-layout-source/json.d.ts.map +1 -0
- package/dist/services/form-layout-source/json.js +33 -0
- package/dist/services/form-layout-source/json.js.map +1 -0
- package/dist/services/form-layout-source/presentation.d.ts +23 -0
- package/dist/services/form-layout-source/presentation.d.ts.map +1 -0
- package/dist/services/form-layout-source/presentation.js +174 -0
- package/dist/services/form-layout-source/presentation.js.map +1 -0
- package/dist/services/form-layout-source/preview.d.ts +4 -0
- package/dist/services/form-layout-source/preview.d.ts.map +1 -0
- package/dist/services/form-layout-source/preview.js +49 -0
- package/dist/services/form-layout-source/preview.js.map +1 -0
- package/dist/services/form-layout-source/schema.d.ts +20 -0
- package/dist/services/form-layout-source/schema.d.ts.map +1 -0
- package/dist/services/form-layout-source/schema.js +149 -0
- package/dist/services/form-layout-source/schema.js.map +1 -0
- package/dist/services/form-layout-source/source-grid.d.ts +8 -0
- package/dist/services/form-layout-source/source-grid.d.ts.map +1 -0
- package/dist/services/form-layout-source/source-grid.js +61 -0
- package/dist/services/form-layout-source/source-grid.js.map +1 -0
- package/dist/services/form-layout-source/types.d.ts +242 -0
- package/dist/services/form-layout-source/types.d.ts.map +1 -0
- package/dist/services/form-layout-source/types.js +2 -0
- package/dist/services/form-layout-source/types.js.map +1 -0
- package/dist/services/form-layout-source/verify.d.ts +14 -0
- package/dist/services/form-layout-source/verify.d.ts.map +1 -0
- package/dist/services/form-layout-source/verify.js +226 -0
- package/dist/services/form-layout-source/verify.js.map +1 -0
- package/dist/services/form-obj-meta.d.ts +72 -0
- package/dist/services/form-obj-meta.d.ts.map +1 -0
- package/dist/services/form-obj-meta.js +103 -0
- package/dist/services/form-obj-meta.js.map +1 -0
- package/dist/services/validate-help.d.ts +25 -0
- package/dist/services/validate-help.d.ts.map +1 -0
- package/dist/services/validate-help.js +29 -0
- package/dist/services/validate-help.js.map +1 -0
- package/package.json +3 -1
- package/skill-docs/SKILL.md +15 -6
- package/skill-docs/_catalog.md +1 -0
- package/skill-docs/actionflows/references/components/document/DocumentSave.md +17 -17
- package/skill-docs/actionflows/references/components/workflow/ApproveCompletelyDelete.md +29 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveDelete.md +1 -1
- package/skill-docs/assets/schemas/image-style-observation.schema.json +1355 -0
- package/skill-docs/references/common/guide-plan-template.md +3 -0
- package/skill-docs/references/common/ref-cli-commands.md +17 -4
- package/skill-docs/references/form/guide-create-form.md +2 -0
- package/skill-docs/references/form/guide-field-linkage.md +140 -55
- package/skill-docs/references/form/guide-form-layout-planning.md +6 -0
- package/skill-docs/references/form/guide-form-layout-source.md +366 -0
- package/skill-docs/references/form/guide-form-view.md +1 -1
- package/skill-docs/references/form/guide-formula-linkage.md +44 -1
|
@@ -13,6 +13,11 @@ export declare function resolveTargetForms(plan: Record<string, any>, client: Ap
|
|
|
13
13
|
export declare function fillRequiredTriggerOperator(plan: Record<string, any>, client: ApiClient): Promise<any[]>;
|
|
14
14
|
/** 把显式固定人员展开为当前租户 Browser 对象。 */
|
|
15
15
|
export declare function resolveFixedPeople(plan: Record<string, any>, client: ApiClient): Promise<any[]>;
|
|
16
|
+
/**
|
|
17
|
+
* DocumentSave.fileFolder 必须来自当前租户的文档目录 Browser。
|
|
18
|
+
* 只补全固定值;动态 FormulaBean 和已经构造好的 FormulaBean 不做目录搜索。
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveFixedDocumentFolders(plan: Record<string, any>, client: ApiClient): Promise<any[]>;
|
|
16
21
|
/**
|
|
17
22
|
* e-builder 关联字段的固定值必须是 Browser 对象,而不是名称字符串。
|
|
18
23
|
* 设计器按名称输入时,先通过当前表单/字段的 complete 接口补齐真实 id 和显示名,
|
|
@@ -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;AA4GtD,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAKjF;AAED,uEAAuE;AACvE,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAgE1H;AAgCD,4EAA4E;AAC5E,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA2LxG;AAED,+BAA+B;AAC/B,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAe9G;AAoBD,iCAAiC;AACjC,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MA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,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAcpG;AAED,uDAAuD;AACvD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAiBtG;AAoGD,MAAM,WAAW,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;AAED,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,CAia5H"}
|
|
@@ -3,6 +3,7 @@ import * as workflowSource from './workflow_source.js';
|
|
|
3
3
|
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
|
+
import * as documentSource from './document_source.js';
|
|
6
7
|
import { completeEbuilder, pickEbuilderBrowserRow } from './ebuilder_source.js';
|
|
7
8
|
import { resolveHttpBindings } from './http_source.js';
|
|
8
9
|
import { registerTargetFormFields, registerTargetDetailFields, registerWorkflowFieldIds, registerWorkflowContextFields, getWorkflowFieldIds, getWorkflowDetailFields, getWorkflowDetailNames, getTargetFormFields, getTargetDetailFields, } from './runtime_metadata.js';
|
|
@@ -524,6 +525,112 @@ export async function resolveFixedPeople(plan, client) {
|
|
|
524
525
|
(plan._autoResources ??= []).push(...records);
|
|
525
526
|
return records;
|
|
526
527
|
}
|
|
528
|
+
function documentFolderRows(response) {
|
|
529
|
+
const data = response && typeof response === 'object' && 'data' in response ? response.data : response;
|
|
530
|
+
if (Array.isArray(data))
|
|
531
|
+
return data;
|
|
532
|
+
if (Array.isArray(data?.data))
|
|
533
|
+
return data.data;
|
|
534
|
+
if (Array.isArray(data?.rows))
|
|
535
|
+
return data.rows;
|
|
536
|
+
if (Array.isArray(data?.list))
|
|
537
|
+
return data.list;
|
|
538
|
+
if (Array.isArray(data?.records))
|
|
539
|
+
return data.records;
|
|
540
|
+
return [];
|
|
541
|
+
}
|
|
542
|
+
function documentFolderId(row) {
|
|
543
|
+
return String(row?.id ?? row?.folderId ?? row?.fileFolderId ?? row?.value ?? '').trim();
|
|
544
|
+
}
|
|
545
|
+
function documentFolderNames(row) {
|
|
546
|
+
return [row?.name, row?.content, row?.title, row?.username, row?.path, row?.folderPath]
|
|
547
|
+
.filter((value) => value !== undefined && value !== null && String(value).trim() !== '')
|
|
548
|
+
.map((value) => String(value).trim());
|
|
549
|
+
}
|
|
550
|
+
function fixedDocumentFolderSelector(value) {
|
|
551
|
+
if (isDynamicAssignment(value))
|
|
552
|
+
return null;
|
|
553
|
+
const raw = value && typeof value === 'object' && value.kind === 'fixed' ? value.value : value;
|
|
554
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
555
|
+
return null;
|
|
556
|
+
if (raw.type && raw.config && !raw.kind) {
|
|
557
|
+
const origin = Array.isArray(raw.config.originValue) ? raw.config.originValue[0] : raw.config.originValue;
|
|
558
|
+
return fixedDocumentFolderSelector(origin);
|
|
559
|
+
}
|
|
560
|
+
return {
|
|
561
|
+
id: String(raw.id ?? raw.folderId ?? raw.fileFolderId ?? raw.value ?? '').trim(),
|
|
562
|
+
name: String(raw.name ?? raw.content ?? raw.title ?? raw.username ?? raw.path ?? '').trim(),
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
function normalizeDocumentFolderBrowser(row) {
|
|
566
|
+
if (!row || typeof row !== 'object' || Array.isArray(row))
|
|
567
|
+
return row;
|
|
568
|
+
const normalized = { ...row };
|
|
569
|
+
if (normalized.name === undefined || normalized.name === null || String(normalized.name).trim() === '') {
|
|
570
|
+
const fallbackName = normalized.title ?? normalized.content ?? normalized.username ?? normalized.path ?? normalized.folderPath;
|
|
571
|
+
if (fallbackName !== undefined && fallbackName !== null && String(fallbackName).trim() !== '') {
|
|
572
|
+
normalized.name = String(fallbackName);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
if (normalized.key && typeof normalized.key === 'object' && !Array.isArray(normalized.key)
|
|
576
|
+
&& Object.keys(normalized.key).length === 0) {
|
|
577
|
+
delete normalized.key;
|
|
578
|
+
}
|
|
579
|
+
return normalized;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* DocumentSave.fileFolder 必须来自当前租户的文档目录 Browser。
|
|
583
|
+
* 只补全固定值;动态 FormulaBean 和已经构造好的 FormulaBean 不做目录搜索。
|
|
584
|
+
*/
|
|
585
|
+
export async function resolveFixedDocumentFolders(plan, client) {
|
|
586
|
+
const records = [];
|
|
587
|
+
const targets = [...walkPlanSteps(plan.actions || [])].filter((step) => {
|
|
588
|
+
if (String(step.type || '') !== 'DocumentSave')
|
|
589
|
+
return false;
|
|
590
|
+
const value = step.params?.fileFolder;
|
|
591
|
+
return value !== undefined && value !== null && value !== '' && !isDynamicAssignment(value)
|
|
592
|
+
&& !(value && typeof value === 'object' && value.type && value.config && !value.kind);
|
|
593
|
+
});
|
|
594
|
+
if (!targets.length)
|
|
595
|
+
return records;
|
|
596
|
+
const rows = await documentSource.esbCreateFolderComponentFolder(client, '');
|
|
597
|
+
const folders = documentFolderRows(rows);
|
|
598
|
+
const cache = new Map();
|
|
599
|
+
for (const step of targets) {
|
|
600
|
+
const params = step.params || {};
|
|
601
|
+
const raw = params.fileFolder;
|
|
602
|
+
if (raw === undefined || raw === null || raw === '' || isDynamicAssignment(raw))
|
|
603
|
+
continue;
|
|
604
|
+
if (raw && typeof raw === 'object' && raw.type && raw.config && !raw.kind)
|
|
605
|
+
continue;
|
|
606
|
+
const selector = fixedDocumentFolderSelector(raw);
|
|
607
|
+
if (!selector || (!selector.id && !selector.name)) {
|
|
608
|
+
throw new Error('DocumentSave.fileFolder 固定值必须包含真实文件夹 id 或 name;不能凭空生成目录对象');
|
|
609
|
+
}
|
|
610
|
+
const cacheKey = `${selector.id}\u0000${selector.name}`;
|
|
611
|
+
let matches = cache.get(cacheKey);
|
|
612
|
+
if (!matches) {
|
|
613
|
+
matches = selector.id
|
|
614
|
+
? folders.filter((folder) => documentFolderId(folder) === selector.id)
|
|
615
|
+
: folders.filter((folder) => documentFolderNames(folder).includes(selector.name));
|
|
616
|
+
cache.set(cacheKey, matches);
|
|
617
|
+
}
|
|
618
|
+
if (matches.length !== 1) {
|
|
619
|
+
const target = selector.id || selector.name;
|
|
620
|
+
throw new Error(`DocumentSave.fileFolder 未能从文档文件夹 Browser 唯一匹配 '${target}'(匹配数: ${matches.length})`);
|
|
621
|
+
}
|
|
622
|
+
params.fileFolder = normalizeDocumentFolderBrowser(matches[0]);
|
|
623
|
+
records.push({
|
|
624
|
+
path: `${step.type}.fileFolder`,
|
|
625
|
+
resourceType: 'document_folder_browser',
|
|
626
|
+
value: { id: documentFolderId(matches[0]), name: documentFolderNames(matches[0])[0] || selector.name },
|
|
627
|
+
reason: '新建文档目标文件夹已通过 esbCreateFolderComponentFolder 补全为当前租户真实 Browser 对象',
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
if (records.length)
|
|
631
|
+
(plan._autoResources ??= []).push(...records);
|
|
632
|
+
return records;
|
|
633
|
+
}
|
|
527
634
|
function isDynamicAssignment(value) {
|
|
528
635
|
const kind = String(value?.kind ?? value?.assignmentKind ?? '').toLowerCase();
|
|
529
636
|
return ['context', 'reference', 'system_variable', 'variable', 'constant', 'function', 'formula', 'query_result', 'transform'].includes(kind);
|
|
@@ -1690,6 +1797,12 @@ export async function preflightContext(plan, appId, client) {
|
|
|
1690
1797
|
}
|
|
1691
1798
|
await fillRequiredTriggerOperator(plan, client);
|
|
1692
1799
|
await resolveFixedPeople(plan, client);
|
|
1800
|
+
try {
|
|
1801
|
+
await resolveFixedDocumentFolders(plan, client);
|
|
1802
|
+
}
|
|
1803
|
+
catch (error) {
|
|
1804
|
+
errors.push(`DocumentSave 目标文件夹查询失败: ${String(error?.message || error)}`);
|
|
1805
|
+
}
|
|
1693
1806
|
await resolveEntrustFields(plan, client, errors);
|
|
1694
1807
|
await resolveHrmFieldAssignments(plan, client, errors);
|
|
1695
1808
|
await resolveHrmAlterTypeFieldAssignments(plan, client, errors);
|
|
@@ -1914,11 +2027,20 @@ export async function preflightContext(plan, appId, client) {
|
|
|
1914
2027
|
for (const f of v.fields || []) {
|
|
1915
2028
|
if (!f || typeof f !== 'object')
|
|
1916
2029
|
continue;
|
|
2030
|
+
const tablePrimaryKey = String(f.tablePrimaryKey || v.primaryKey || v.key || '').trim();
|
|
2031
|
+
const tableName = String(f.tableName || v.name || v.label || tablePrimaryKey).trim();
|
|
2032
|
+
const componentType = f.componentType || v.component;
|
|
1917
2033
|
if (f.showName && f.componentKey)
|
|
1918
2034
|
eventFieldTypes[String(f.showName)] = String(f.componentKey);
|
|
1919
2035
|
if (f.showName) {
|
|
1920
2036
|
const pk = String(f.paramKey || '');
|
|
1921
|
-
eventContextFields.push({
|
|
2037
|
+
eventContextFields.push({
|
|
2038
|
+
...f,
|
|
2039
|
+
componentType,
|
|
2040
|
+
tablePrimaryKey,
|
|
2041
|
+
tableName,
|
|
2042
|
+
contextGroup: tablePrimaryKey,
|
|
2043
|
+
});
|
|
1922
2044
|
const idx = seenPk[String(f.showName)];
|
|
1923
2045
|
if (idx === undefined) {
|
|
1924
2046
|
seenPk[String(f.showName)] = eventSourceFields.length;
|
|
@@ -1928,7 +2050,10 @@ export async function preflightContext(plan, appId, client) {
|
|
|
1928
2050
|
paramType: String(f.paramType || '').toLowerCase(),
|
|
1929
2051
|
paramKey: pk,
|
|
1930
2052
|
id: String(f.id || ''),
|
|
1931
|
-
componentType
|
|
2053
|
+
componentType,
|
|
2054
|
+
tablePrimaryKey,
|
|
2055
|
+
tableName,
|
|
2056
|
+
contextGroup: tablePrimaryKey,
|
|
1932
2057
|
});
|
|
1933
2058
|
}
|
|
1934
2059
|
else if (pk.endsWith('[]') && !String(eventSourceFields[idx].paramKey).endsWith('[]')) {
|