weaver-e10-builder 1.2.3 → 1.2.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 +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-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-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-native.d.ts.map +1 -1
- package/dist/commands/form-native.js +181 -0
- 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 +76 -19
- package/dist/commands/form.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/wf-form.d.ts +1 -0
- package/dist/commands/wf-form.d.ts.map +1 -1
- package/dist/commands/wf-form.js +44 -13
- package/dist/commands/wf-form.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 +36 -80
- 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 +2 -0
- package/dist/index.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 +239 -6
- package/dist/services/actionflow/components/action_eb_update_compiler.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 +65 -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 +7 -10
- package/dist/services/actionflow/components/custom_trigger.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/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/context_preflight.d.ts.map +1 -1
- package/dist/services/actionflow/context_preflight.js +13 -6
- 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 +3 -2
- package/dist/services/actionflow/context_provider.js.map +1 -1
- 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/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 +4 -1
- package/dist/services/actionflow/formula_service.d.ts.map +1 -1
- package/dist/services/actionflow/formula_service.js +46 -22
- package/dist/services/actionflow/formula_service.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 +211 -3
- 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 +83 -15
- package/dist/services/actionflow/workflow_compiler.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/form-field-patch.d.ts +22 -0
- package/dist/services/form-field-patch.d.ts.map +1 -1
- package/dist/services/form-field-patch.js +29 -0
- package/dist/services/form-field-patch.js.map +1 -1
- 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-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/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/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-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 +100 -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/package.json +48 -48
- package/skill-docs/SKILL.md +7 -7
- package/skill-docs/_catalog.md +2 -0
- package/skill-docs/actionflows/SKILL.md +2 -0
- 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 +16 -11
- 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 +1 -1
- package/skill-docs/references/common/ref-cli-commands.md +21 -13
- 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/form/guide-create-form.md +1 -1
- package/skill-docs/references/form/guide-form-layout-planning.md +1 -1
- package/skill-docs/references/form/guide-form-linkage.md +28 -2
- package/skill-docs/references/menu/system-menus.md +12 -0
- package/skill-docs/references/workflow/guide-workflow-odoc.md +22 -2
- package/skill-docs/references/workflow/guide-workflow.md +18 -3
|
@@ -34,6 +34,93 @@ export async function dsList(client, groupId) {
|
|
|
34
34
|
* `ebbusinessid` 用这个哨兵值;传真实 appId 反而会收窄范围。
|
|
35
35
|
*/
|
|
36
36
|
const GLOBAL_SEARCH_APP_ID = '10000000000000000';
|
|
37
|
+
/** 每次请求的条数。服务端支持远大于 20,别再按一页 20 条去取。 */
|
|
38
|
+
const DEFAULT_PAGE_SIZE = 100;
|
|
39
|
+
const MAX_PAGE_SIZE = 500;
|
|
40
|
+
/** 默认最多返回多少条;超出就如实标记 truncated,而不是悄悄丢掉。 */
|
|
41
|
+
const DEFAULT_MAX_HITS = 100;
|
|
42
|
+
/** `max:0`(不限)时的硬保护,免得极端租户把内存撑爆。 */
|
|
43
|
+
const HARD_MAX_HITS = 2000;
|
|
44
|
+
function clampPageSize(value) {
|
|
45
|
+
const n = Number(value);
|
|
46
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
47
|
+
return DEFAULT_PAGE_SIZE;
|
|
48
|
+
return Math.min(Math.floor(n), MAX_PAGE_SIZE);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 归一 `max`。
|
|
52
|
+
*
|
|
53
|
+
* ⚠️ 不能写成 `Number(v) || DEFAULT` —— 那会把「不限」的 `0` 悄悄变成默认值。
|
|
54
|
+
* 非法值直接报错,不静默兜底。
|
|
55
|
+
*/
|
|
56
|
+
function normalizeMax(value) {
|
|
57
|
+
if (value === undefined || value === null || value === '')
|
|
58
|
+
return DEFAULT_MAX_HITS;
|
|
59
|
+
const n = Number(value);
|
|
60
|
+
if (!Number.isFinite(n))
|
|
61
|
+
throw new Error('max 必须是数字(0 = 不限)');
|
|
62
|
+
if (n < 0)
|
|
63
|
+
throw new Error('max 不能为负(0 = 不限)');
|
|
64
|
+
if (n === 0)
|
|
65
|
+
return HARD_MAX_HITS;
|
|
66
|
+
return Math.min(Math.floor(n), HARD_MAX_HITS);
|
|
67
|
+
}
|
|
68
|
+
function toHit(r, keyword) {
|
|
69
|
+
const objId = String(r?.id ?? '');
|
|
70
|
+
const name = String(r?.name ?? '');
|
|
71
|
+
return {
|
|
72
|
+
objId,
|
|
73
|
+
name,
|
|
74
|
+
appId: String(r?.appid ?? ''),
|
|
75
|
+
appName: String(r?.appName ?? ''),
|
|
76
|
+
url: String(r?.url ?? ''),
|
|
77
|
+
exact: (!!name && name === keyword) || (!!objId && objId === keyword),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** 兼容裸数组 / `apps` / `list` / `records`,并摊平文件夹树。 */
|
|
81
|
+
function flattenAppRows(rows) {
|
|
82
|
+
const out = [];
|
|
83
|
+
for (const row of Array.isArray(rows) ? rows : []) {
|
|
84
|
+
if (!row || typeof row !== 'object')
|
|
85
|
+
continue;
|
|
86
|
+
if (Array.isArray(row.apps)) {
|
|
87
|
+
out.push(...flattenAppRows(row.apps));
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
out.push(row);
|
|
91
|
+
}
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
/** 读当前租户的全部应用(该接口忽略分页参数,一次返回全量)。 */
|
|
95
|
+
export async function listEbuilderApps(client) {
|
|
96
|
+
const res = await client.get(`${base(client)}/api/bs/ebuilder/app/list`);
|
|
97
|
+
if (res?.code !== 200)
|
|
98
|
+
throw new Error(`读取应用列表失败:${res?.msg || '无响应'}`);
|
|
99
|
+
const d = res?.data;
|
|
100
|
+
const rows = Array.isArray(d) ? d : Array.isArray(d?.apps) ? d.apps : d?.list || d?.records || [];
|
|
101
|
+
return flattenAppRows(rows)
|
|
102
|
+
.map((a) => ({ id: String(a?.id ?? a?.appId ?? ''), name: String(a?.name ?? a?.appName ?? '') }))
|
|
103
|
+
.filter((a) => a.id);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 按名字解析应用。
|
|
107
|
+
*
|
|
108
|
+
* 同名多命中、一个都没匹配上,都**报错并给候选**,不替调用方挑一个 ——
|
|
109
|
+
* 解析出来的表单 objId 会被写进 plan 落库,猜错了不是肉眼能回滚的。
|
|
110
|
+
*/
|
|
111
|
+
export function resolveAppByName(apps, name) {
|
|
112
|
+
const want = String(name || '').trim();
|
|
113
|
+
const exact = apps.filter((a) => a.name === want);
|
|
114
|
+
if (exact.length === 1)
|
|
115
|
+
return { id: exact[0].id, name: exact[0].name };
|
|
116
|
+
if (exact.length > 1) {
|
|
117
|
+
throw new Error(`存在 ${exact.length} 个同名应用,请改用 {"appId":"<应用ID>"} 指定:`
|
|
118
|
+
+ exact.map((a) => `${a.name}(${a.id})`).join('、'));
|
|
119
|
+
}
|
|
120
|
+
const near = want ? apps.filter((a) => a.name.includes(want)).slice(0, 10) : [];
|
|
121
|
+
throw new Error(`未找到应用「${want}」`
|
|
122
|
+
+ (near.length ? `;名称相近的应用:${near.map((a) => `${a.name}(${a.id})`).join('、')}` : ''));
|
|
123
|
+
}
|
|
37
124
|
/**
|
|
38
125
|
* 按名字或 objId **跨应用**搜表单。
|
|
39
126
|
*
|
|
@@ -41,41 +128,97 @@ const GLOBAL_SEARCH_APP_ID = '10000000000000000';
|
|
|
41
128
|
* - **传表名** → 服务端**模糊**匹配(子串),同名表可能横跨多个应用,`total` 常 > 1;
|
|
42
129
|
* - **传 objId** → **精确**命中(`total` = 1),可用来由 id 反查它属于哪个应用。
|
|
43
130
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
131
|
+
* 服务端只做模糊匹配,「完全精准才算命中」这类判定要调用方自己按 `name` 复核 ——
|
|
132
|
+
* 本函数只如实返回候选,不替调用方挑。
|
|
133
|
+
*
|
|
134
|
+
* **返回值必须按 `truncated` 解释**:`total` 是服务端在本次筛选下的总数,`hits` 只是
|
|
135
|
+
* 其中一部分。默认最多取 {@link DEFAULT_MAX_HITS} 条,收满就停并置 `truncated: true` ——
|
|
136
|
+
* 「这次没看到」不等于「不存在」,要收全传 `max: 0`。
|
|
46
137
|
*/
|
|
47
138
|
export async function searchForms(client, keyword, opts = {}) {
|
|
48
139
|
const kw = String(keyword || '').trim();
|
|
49
140
|
if (!kw)
|
|
50
141
|
throw new Error('form-search 需要 keyword(表名或 objId)');
|
|
51
|
-
//
|
|
142
|
+
// 应用收窄:能直接拿到 id 就交给服务端过滤;只给了名字就先解析成 id
|
|
143
|
+
let appId = String(opts.appId || '').trim();
|
|
144
|
+
let appName = '';
|
|
52
145
|
const wantApp = String(opts.appName || '').trim();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
146
|
+
if (!appId && wantApp) {
|
|
147
|
+
const hit = resolveAppByName(await listEbuilderApps(client), wantApp);
|
|
148
|
+
appId = hit.id;
|
|
149
|
+
appName = hit.name;
|
|
150
|
+
}
|
|
151
|
+
const pageSize = clampPageSize(opts.pageSize);
|
|
152
|
+
const maxHits = normalizeMax(opts.max);
|
|
153
|
+
let pageNo = Math.max(1, Number(opts.pageNo) || 1);
|
|
154
|
+
const hits = [];
|
|
155
|
+
const seenIds = new Set();
|
|
156
|
+
const seenPages = new Set();
|
|
157
|
+
let total = 0;
|
|
158
|
+
let pagesFetched = 0;
|
|
159
|
+
let stoppedByMax = false;
|
|
160
|
+
for (;;) {
|
|
161
|
+
const q = new URLSearchParams({
|
|
162
|
+
type: 'FORM',
|
|
163
|
+
keyword: kw,
|
|
164
|
+
pageNo: String(pageNo),
|
|
165
|
+
pageSize: String(pageSize),
|
|
166
|
+
});
|
|
167
|
+
// ⚠️ 只有全小写的 `appid` 会被服务端认;`appId` / `groupId` / `appName` 一律被忽略,
|
|
168
|
+
// 传错等于没收窄,会把整个租户的表都拉回来。
|
|
169
|
+
if (appId)
|
|
170
|
+
q.set('appid', appId);
|
|
171
|
+
const res = await client.get(`${base(client)}/api/bs/ebuilder/app/search?${q}`, {
|
|
172
|
+
ebbusinessid: GLOBAL_SEARCH_APP_ID,
|
|
173
|
+
});
|
|
174
|
+
if (res?.code !== 200)
|
|
175
|
+
throw new Error(`搜索失败:${res?.msg || '无响应'}`);
|
|
176
|
+
pagesFetched += 1;
|
|
177
|
+
// 返回体按资源类型分组,只取 FORM 那组(分组各自的 count 才是该类型的总数)
|
|
178
|
+
const group = (Array.isArray(res.data) ? res.data : []).find((g) => g?.type === 'FORM');
|
|
179
|
+
const records = Array.isArray(group?.data?.records) ? group.data.records : [];
|
|
180
|
+
// 首屏的 count 就是当前筛选下的总数
|
|
181
|
+
if (pagesFetched === 1)
|
|
182
|
+
total = Number(group?.data?.count) || 0;
|
|
183
|
+
// 服务端若忽略 pageNo,同一页会被反复返回 —— 用页签名兜住,免得空转到超时
|
|
184
|
+
const sig = records.map((r) => String(r?.id ?? '')).join('|');
|
|
185
|
+
if (sig) {
|
|
186
|
+
if (seenPages.has(sig))
|
|
187
|
+
break;
|
|
188
|
+
seenPages.add(sig);
|
|
189
|
+
}
|
|
190
|
+
for (const r of records) {
|
|
191
|
+
const hit = toHit(r, kw);
|
|
192
|
+
if (!hit.objId || seenIds.has(hit.objId))
|
|
193
|
+
continue; // objId 唯一,跨页重放不产生重复行
|
|
194
|
+
seenIds.add(hit.objId);
|
|
195
|
+
hits.push(hit);
|
|
196
|
+
if (hits.length >= maxHits) {
|
|
197
|
+
stoppedByMax = true;
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (stoppedByMax)
|
|
202
|
+
break;
|
|
203
|
+
if (records.length < pageSize)
|
|
204
|
+
break; // 末页
|
|
205
|
+
if (total > 0 && seenIds.size >= total)
|
|
206
|
+
break; // 服务端说有多少就收多少
|
|
207
|
+
pageNo += 1;
|
|
208
|
+
}
|
|
209
|
+
const truncated = total > 0 ? hits.length < total : stoppedByMax;
|
|
210
|
+
return {
|
|
56
211
|
keyword: kw,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const records = group?.data?.records || [];
|
|
68
|
-
const total = Number(group?.data?.count) || 0;
|
|
69
|
-
let hits = records.map((r) => ({
|
|
70
|
-
objId: String(r?.id ?? ''),
|
|
71
|
-
name: String(r?.name ?? ''),
|
|
72
|
-
appId: String(r?.appid ?? ''),
|
|
73
|
-
appName: String(r?.appName ?? ''),
|
|
74
|
-
url: String(r?.url ?? ''),
|
|
75
|
-
}));
|
|
76
|
-
if (wantApp)
|
|
77
|
-
hits = hits.filter((h) => h.appName === wantApp);
|
|
78
|
-
return { keyword: kw, total, hits, appFiltered: !!wantApp };
|
|
212
|
+
total,
|
|
213
|
+
hits,
|
|
214
|
+
returned: hits.length,
|
|
215
|
+
truncated,
|
|
216
|
+
complete: !truncated,
|
|
217
|
+
pagesFetched,
|
|
218
|
+
appFiltered: !!appId,
|
|
219
|
+
appId: appId || undefined,
|
|
220
|
+
appName: appName || undefined,
|
|
221
|
+
};
|
|
79
222
|
}
|
|
80
223
|
/** 查表单字段。镜像前端 /component/getEbField(tableId 即 formId)。 */
|
|
81
224
|
export async function getEbField(client, tableId, appId) {
|
|
@@ -94,13 +237,14 @@ export async function showDataSourceFields(client, sourceId, groupId = '', sourc
|
|
|
94
237
|
* 该接口与 showDataSourceFields 不同:它返回 physicalField/config/formInfo 等
|
|
95
238
|
* 保存时需要的元数据。查询节点的“全选”必须使用这些原对象,不能只传 id/content。
|
|
96
239
|
*/
|
|
97
|
-
export async function dataSourceFields(client, sourceId, detailFieldsGroup =
|
|
240
|
+
export async function dataSourceFields(client, sourceId, detailFieldsGroup = true) {
|
|
98
241
|
const body = new URLSearchParams({
|
|
99
242
|
groupId: 'weaver-ebuilder-form-service',
|
|
100
243
|
sourceId: String(sourceId),
|
|
101
244
|
sourceType: 'LOGIC',
|
|
102
245
|
detailFieldsGroup: String(detailFieldsGroup),
|
|
103
246
|
enableMerge: 'true',
|
|
247
|
+
customParam: JSON.stringify({ batchIdFields: true, terminal: 'front' }),
|
|
104
248
|
params: '[]',
|
|
105
249
|
});
|
|
106
250
|
return client.postForm(`${base(client)}/api/ebuilder/common/ds/fields`, body.toString());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form_source.js","sourceRoot":"","sources":["../../../src/services/actionflow/form_source.ts"],"names":[],"mappings":"AAOA,SAAS,IAAI,CAAC,MAAiB;IAC7B,OAAQ,MAAc,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;AAC3C,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,gBAAgB,CAAC,GAAQ;IACvC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IAC/C,MAAM,GAAG,GAAwB,EAAE,GAAG,GAAG,EAAE,CAAC;IAC5C,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,OAAO;QAAE,GAA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AAC1F,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** 触发器上下文根节点。自定义触发的参数由 SelectParams 提供,不是普通表单数据。 */
|
|
2
|
+
export declare function contextRootForComponent(componentType: any): string;
|
|
3
|
+
export declare function contextTableNameForRoot(root: string): string;
|
|
1
4
|
export declare function resolveSourceFieldType(paramKey: any, meta: Record<string, any> | null): string;
|
|
2
5
|
export declare function resolveSourceFieldLabel(paramKey: any, meta: Record<string, any> | null, fallback?: string): string;
|
|
3
6
|
export declare function resolveParamKey(workflowId: string, key: any): string;
|
|
@@ -40,7 +43,7 @@ export declare function buildAssignBean(raw: any, fieldId: string, fieldType: st
|
|
|
40
43
|
export declare function normalizeConstantAssignment(value: any, defaultFieldType?: string): [Record<string, any>, string];
|
|
41
44
|
export declare function resolveEnumConstant(value: any, fieldMeta: Record<string, any> | null): any;
|
|
42
45
|
export declare function lookupTargetFieldMeta(targetFieldId: string, result: Record<string, any>): Record<string, any> | null;
|
|
43
|
-
export declare function assignFlatContext(paramKey: string, fieldLabel: string, sourceId: string, appId: string, fieldType?: string, parentName?: string, tempFormulaId?: string, tableId?: string, componentKey?: string, paramKeyFull?: string, valueFull?: string): Record<string, any>;
|
|
46
|
+
export declare function assignFlatContext(paramKey: string, fieldLabel: string, sourceId: string, appId: string, fieldType?: string, parentName?: string, tempFormulaId?: string, tableId?: string, componentKey?: string, paramKeyFull?: string, valueFull?: string, meta?: Record<string, any> | null): Record<string, any>;
|
|
44
47
|
export declare function assignFlatContextDirect(paramKey: string, fieldLabel: string, sourceId: string, appId: string, fieldType?: string, parentName?: string, meta?: Record<string, any> | null): Record<string, any>;
|
|
45
48
|
/**
|
|
46
49
|
* 给上下文类公式(type 3/8/10 等)补 esbAssign.wId —— 与 workflow_compiler.buildFilterInput 的 esbWid 同源。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formula_service.d.ts","sourceRoot":"","sources":["../../../src/services/actionflow/formula_service.ts"],"names":[],"mappings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OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,SAAS,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EACpF,KAAK,SAAK,EAAE,eAAe,SAAK,EAAE,OAAO,SAAkB,EAAE,aAAa,SAAK,EAC/E,UAAU,UAAQ,EAAE,cAAc,SAAK,GACtC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwMrB"}
|
|
@@ -26,6 +26,17 @@ const VALUE_TYPE_ALIASES = {
|
|
|
26
26
|
date: 'Date', Date: 'Date', time: 'Time', Time: 'Time',
|
|
27
27
|
datetime: 'DateTime', DateTime: 'DateTime',
|
|
28
28
|
};
|
|
29
|
+
/** 触发器上下文根节点。自定义触发的参数由 SelectParams 提供,不是普通表单数据。 */
|
|
30
|
+
export function contextRootForComponent(componentType) {
|
|
31
|
+
return String(componentType || '') === 'CustomTrigger'
|
|
32
|
+
? 'SelectParams'
|
|
33
|
+
: String(componentType || '') === 'ApproveTrigger'
|
|
34
|
+
? 'ApprovalData'
|
|
35
|
+
: 'FormData';
|
|
36
|
+
}
|
|
37
|
+
export function contextTableNameForRoot(root) {
|
|
38
|
+
return root === 'ApprovalData' ? '流程数据' : root === 'SelectParams' ? '选择参数' : '表单数据';
|
|
39
|
+
}
|
|
29
40
|
// ── 字段解析 ────────────────────────────────────────────────
|
|
30
41
|
export function resolveSourceFieldType(paramKey, meta) {
|
|
31
42
|
if (!paramKey)
|
|
@@ -182,6 +193,8 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
182
193
|
const fieldName = String(opts.name || fieldKey);
|
|
183
194
|
const componentType = opts.componentType || 'ApproveTrigger';
|
|
184
195
|
const fieldType = opts.fieldType || 'string';
|
|
196
|
+
const contextRoot = contextRootForComponent(componentType);
|
|
197
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
185
198
|
return {
|
|
186
199
|
formulaType: ftNorm(fieldType),
|
|
187
200
|
name: fieldName,
|
|
@@ -189,7 +202,7 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
189
202
|
id: fid,
|
|
190
203
|
source: sourceId,
|
|
191
204
|
type: '3',
|
|
192
|
-
value:
|
|
205
|
+
value: `${contextRoot}.${fieldKey}`,
|
|
193
206
|
frontId: String(fieldKey),
|
|
194
207
|
paramKey: String(fieldKey),
|
|
195
208
|
paramType: fieldType,
|
|
@@ -203,12 +216,12 @@ export function formulaContext(sourceComponentId, fieldKey, opts = {}) {
|
|
|
203
216
|
multName: '',
|
|
204
217
|
multTypeObj: {
|
|
205
218
|
allName: fieldName, currentName: fieldName,
|
|
206
|
-
currentParamKey:
|
|
219
|
+
currentParamKey: `${contextRoot}.${fieldKey}`, allParamKey: `${contextRoot}.${fieldKey}`,
|
|
207
220
|
},
|
|
208
221
|
comId: sourceId,
|
|
209
222
|
isMultCom: Boolean(opts.isMult),
|
|
210
|
-
tableName
|
|
211
|
-
fieldInfo: { paramKey: String(fieldKey), tablePrimaryKey:
|
|
223
|
+
tableName,
|
|
224
|
+
fieldInfo: { paramKey: String(fieldKey), tablePrimaryKey: contextRoot },
|
|
212
225
|
comType: componentType,
|
|
213
226
|
parentComId: String(opts.parentComId || '0'),
|
|
214
227
|
switchType: 'assign',
|
|
@@ -711,7 +724,8 @@ export function buildAssignBean(raw, fieldId, fieldType, meta, appId, defaultSou
|
|
|
711
724
|
}
|
|
712
725
|
return formulaIndexedWorkflowDetailArgument(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), detailLabel, meta);
|
|
713
726
|
}
|
|
714
|
-
const
|
|
727
|
+
const sourceComponent = String(src?._resolvedContext?.componentType || src?.componentType || meta?._upstream_component_type || 'ApproveTrigger');
|
|
728
|
+
const child = assignFlatEsbChild(resolvedKey, String(label), String(sourceId), appId, String(sourceFieldType || fieldType || 'string'), undefined, detailLabel, workflowName, sourceComponent);
|
|
715
729
|
attachEsbAssign(child, meta, String(sourceId));
|
|
716
730
|
return child;
|
|
717
731
|
}
|
|
@@ -928,11 +942,16 @@ function assignFlatFixed(valueStr, appId, fieldType = 'string') {
|
|
|
928
942
|
applicationId: appId || '', config: { originValue: valueStr, switchType: 'fixvalue' },
|
|
929
943
|
};
|
|
930
944
|
}
|
|
931
|
-
export function assignFlatContext(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', tempFormulaId = '', tableId = '', componentKey = 'Text', paramKeyFull = '', valueFull = '') {
|
|
945
|
+
export function assignFlatContext(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', parentName = '', tempFormulaId = '', tableId = '', componentKey = 'Text', paramKeyFull = '', valueFull = '', meta = null) {
|
|
932
946
|
const fid = genSfId();
|
|
933
947
|
const src = String(sourceId) || '0';
|
|
948
|
+
const componentType = String(meta?._context_component_type || meta?._upstream_component_type || '');
|
|
949
|
+
const contextRoot = contextRootForComponent(componentType);
|
|
950
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
934
951
|
const pname = String(parentName || fieldLabel);
|
|
935
|
-
const val = valueFull
|
|
952
|
+
const val = valueFull
|
|
953
|
+
? String(valueFull).replace(/^(?:FormData|ApprovalData|SelectParams)\./, `${contextRoot}.`)
|
|
954
|
+
: (tableId ? `${contextRoot}.${tableId}.${paramKey}` : `${contextRoot}.${paramKey}`);
|
|
936
955
|
const pkey = paramKeyFull || (tableId ? `${tableId}.${paramKey}` : String(paramKey));
|
|
937
956
|
return {
|
|
938
957
|
id: fid, name: String(fieldLabel), value: val, type: '3', fieldType, formulaType: fieldType,
|
|
@@ -942,8 +961,8 @@ export function assignFlatContext(paramKey, fieldLabel, sourceId, appId, fieldTy
|
|
|
942
961
|
switchType: 'assign', comId: src, paramKey: pkey, paramType: fieldType,
|
|
943
962
|
parentName: pname, newParentName: pname, multName: '', multKey: '',
|
|
944
963
|
multTypeObj: { currentName: pname, allName: pname, currentParamKey: val, allParamKey: val },
|
|
945
|
-
isMultCom: false, comType: 'ApproveTrigger', tableName
|
|
946
|
-
fieldInfo: { tablePrimaryKey:
|
|
964
|
+
isMultCom: false, comType: componentType || 'ApproveTrigger', tableName,
|
|
965
|
+
fieldInfo: { tablePrimaryKey: contextRoot, paramKey: pkey },
|
|
947
966
|
tempFormulaId: tempFormulaId || '', formulaVersion: 'V1',
|
|
948
967
|
}),
|
|
949
968
|
parentName: pname, tempFormulaId: tempFormulaId || '',
|
|
@@ -1041,7 +1060,8 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1041
1060
|
// 清空会导致设计器「动态赋值」找不到字段标红(真机验证 2026-08-19,场景12)。
|
|
1042
1061
|
if (!frontId)
|
|
1043
1062
|
frontId = pkeyTail;
|
|
1044
|
-
const prefix = isApproval ? 'ApprovalData' :
|
|
1063
|
+
const prefix = isApproval ? 'ApprovalData' : contextRootForComponent(resolvedSourceComponent);
|
|
1064
|
+
const tableName = contextTableNameForRoot(prefix);
|
|
1045
1065
|
const sourceComponent = resolvedSourceComponent;
|
|
1046
1066
|
const result = {
|
|
1047
1067
|
formulaType: fieldType, name: String(fieldLabel), businessId: appId || '', id: fid,
|
|
@@ -1050,7 +1070,7 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1050
1070
|
config: {
|
|
1051
1071
|
paramKey: pkey, isMultCom: false, comType: sourceComponent, switchType: 'assign', formulaVersion: 'V1',
|
|
1052
1072
|
fieldInfo: { paramKey: pkey, tablePrimaryKey: prefix },
|
|
1053
|
-
tableName
|
|
1073
|
+
tableName,
|
|
1054
1074
|
paramType: fieldType, parentName: pname, multName: '', multKey: '',
|
|
1055
1075
|
multTypeObj: {
|
|
1056
1076
|
allName: pname, currentName: pname,
|
|
@@ -1064,13 +1084,15 @@ export function assignFlatContextDirect(paramKey, fieldLabel, sourceId, appId, f
|
|
|
1064
1084
|
result.frontId = frontId;
|
|
1065
1085
|
return result;
|
|
1066
1086
|
}
|
|
1067
|
-
function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', detailParamKey = '', detailLabel = '', workflowName = '') {
|
|
1087
|
+
function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = 'string', detailParamKey = '', detailLabel = '', workflowName = '', componentType = 'ApproveTrigger') {
|
|
1068
1088
|
const fid = genSfId();
|
|
1069
1089
|
const src = String(sourceId) || '0';
|
|
1090
|
+
const contextRoot = contextRootForComponent(componentType);
|
|
1091
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
1070
1092
|
const tailPart = paramKey.includes('.') ? paramKey.slice(paramKey.lastIndexOf('.') + 1) : paramKey;
|
|
1071
1093
|
const subId = tailPart.replace(/\[\]$/, '');
|
|
1072
1094
|
const detailPk = detailParamKey || (paramKey.includes('[]') ? paramKey.slice(0, paramKey.indexOf('[]')) + '[]' : '');
|
|
1073
|
-
const detailVal =
|
|
1095
|
+
const detailVal = `${contextRoot}.${detailPk}`;
|
|
1074
1096
|
const parentName = workflowName ? `${workflowName}.${fieldLabel}[]` : `${fieldLabel}[]`;
|
|
1075
1097
|
const subName = workflowName ? `${workflowName}.${fieldLabel}` : String(fieldLabel);
|
|
1076
1098
|
const allName = workflowName && detailLabel ? `${workflowName}.${detailLabel}[]` : parentName;
|
|
@@ -1081,12 +1103,12 @@ function assignFlatEsbChild(paramKey, fieldLabel, sourceId, appId, fieldType = '
|
|
|
1081
1103
|
paramKey: String(paramKey), basisType: 'formSetting', switchType: 'sub', level: 1,
|
|
1082
1104
|
id: subId, source: src, formulaVersion: 'V1', value: detailVal,
|
|
1083
1105
|
config: {
|
|
1084
|
-
paramKey: detailPk, isMultCom: false, comType:
|
|
1085
|
-
fieldInfo: { paramKey: detailPk, tablePrimaryKey:
|
|
1086
|
-
tableName
|
|
1106
|
+
paramKey: detailPk, isMultCom: false, comType: componentType, switchType: 'assign', parentComId: 0,
|
|
1107
|
+
fieldInfo: { paramKey: detailPk, tablePrimaryKey: contextRoot },
|
|
1108
|
+
tableName, paramType: fieldType, parentName, multName: '', multKey: '',
|
|
1087
1109
|
multTypeObj: {
|
|
1088
1110
|
allName, currentName: subName,
|
|
1089
|
-
currentParamKey: paramKey.startsWith(
|
|
1111
|
+
currentParamKey: paramKey.startsWith(`${contextRoot}.`) ? String(paramKey) : `${contextRoot}.${paramKey}`,
|
|
1090
1112
|
allParamKey: detailVal,
|
|
1091
1113
|
},
|
|
1092
1114
|
comId: src, newParentName: parentName,
|
|
@@ -1117,8 +1139,10 @@ function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, ap
|
|
|
1117
1139
|
index.position = genSfId();
|
|
1118
1140
|
index.parentId = fid;
|
|
1119
1141
|
const sourceComponent = String(meta?._upstream_component_type || 'ApproveTrigger');
|
|
1120
|
-
const
|
|
1121
|
-
const
|
|
1142
|
+
const contextRoot = contextRootForComponent(sourceComponent);
|
|
1143
|
+
const tableName = contextTableNameForRoot(contextRoot);
|
|
1144
|
+
const contextValue = `${contextRoot}.${workflowId}.${detailId}[${index.position}].${detailFieldId}`;
|
|
1145
|
+
const allParamKey = `${contextRoot}.${paramKey}`;
|
|
1122
1146
|
return {
|
|
1123
1147
|
formulaType: fieldType,
|
|
1124
1148
|
name: String(fieldLabel),
|
|
@@ -1140,8 +1164,8 @@ function formulaIndexedWorkflowDetailArgument(paramKey, fieldLabel, sourceId, ap
|
|
|
1140
1164
|
parentComId: 0,
|
|
1141
1165
|
parentName,
|
|
1142
1166
|
formulaVersion: 'V1',
|
|
1143
|
-
fieldInfo: { paramKey: String(paramKey), tablePrimaryKey:
|
|
1144
|
-
tableName
|
|
1167
|
+
fieldInfo: { paramKey: String(paramKey), tablePrimaryKey: contextRoot },
|
|
1168
|
+
tableName,
|
|
1145
1169
|
paramType: fieldType,
|
|
1146
1170
|
multName: '',
|
|
1147
1171
|
multKey: '',
|
|
@@ -1358,7 +1382,7 @@ export function buildSettingEntry(fieldId, assignment, fieldType = 'Text', meta
|
|
|
1358
1382
|
switchT = 'assign';
|
|
1359
1383
|
}
|
|
1360
1384
|
else {
|
|
1361
|
-
const child = assignFlatContext(String(key), String(label || key), String(src), appId, ft, parentName, '', tableId, 'Text', pkey, pval);
|
|
1385
|
+
const child = assignFlatContext(String(key), String(label || key), String(src), appId, ft, parentName, '', tableId, 'Text', pkey, pval, meta);
|
|
1362
1386
|
const container = formulaContainerString([child], '', appId);
|
|
1363
1387
|
const childId = String(child.id || '');
|
|
1364
1388
|
if (childId && typeof child.config === 'string') {
|