weaver-e10-builder 1.1.3 → 1.1.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/check.d.ts.map +1 -1
- package/dist/commands/check.js +48 -15
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/designer-common.d.ts +56 -0
- package/dist/commands/designer-common.d.ts.map +1 -0
- package/dist/commands/designer-common.js +165 -0
- package/dist/commands/designer-common.js.map +1 -0
- package/dist/commands/designer-setters.d.ts +13 -0
- package/dist/commands/designer-setters.d.ts.map +1 -0
- package/dist/commands/designer-setters.js +593 -0
- package/dist/commands/designer-setters.js.map +1 -0
- package/dist/commands/designer.d.ts +17 -0
- package/dist/commands/designer.d.ts.map +1 -0
- package/dist/commands/designer.js +448 -0
- package/dist/commands/designer.js.map +1 -0
- package/dist/commands/form-add-detail-table.d.ts.map +1 -1
- package/dist/commands/form-add-detail-table.js +59 -0
- package/dist/commands/form-add-detail-table.js.map +1 -1
- package/dist/commands/form-association.d.ts.map +1 -1
- package/dist/commands/form-association.js +3 -2
- package/dist/commands/form-association.js.map +1 -1
- package/dist/commands/form-button.d.ts.map +1 -1
- package/dist/commands/form-button.js +86 -1
- package/dist/commands/form-button.js.map +1 -1
- package/dist/commands/form-data.d.ts.map +1 -1
- package/dist/commands/form-data.js +13 -1
- package/dist/commands/form-data.js.map +1 -1
- package/dist/commands/form-ebuilder-scope.js +3 -3
- package/dist/commands/form-ebuilder-scope.js.map +1 -1
- package/dist/commands/form-formula.js +4 -4
- package/dist/commands/form-formula.js.map +1 -1
- package/dist/commands/form-list-click.d.ts.map +1 -1
- package/dist/commands/form-list-click.js +30 -2
- package/dist/commands/form-list-click.js.map +1 -1
- package/dist/commands/form-list-filter.js +1 -1
- package/dist/commands/form-list-filter.js.map +1 -1
- package/dist/commands/form-list-hierarchy.d.ts +3 -0
- package/dist/commands/form-list-hierarchy.d.ts.map +1 -0
- package/dist/commands/form-list-hierarchy.js +133 -0
- package/dist/commands/form-list-hierarchy.js.map +1 -0
- package/dist/commands/form-list-permission.d.ts.map +1 -1
- package/dist/commands/form-list-permission.js +17 -3
- package/dist/commands/form-list-permission.js.map +1 -1
- package/dist/commands/form-list.d.ts.map +1 -1
- package/dist/commands/form-list.js +2 -0
- package/dist/commands/form-list.js.map +1 -1
- package/dist/commands/form-nlist.d.ts.map +1 -1
- package/dist/commands/form-nlist.js +47 -15
- package/dist/commands/form-nlist.js.map +1 -1
- package/dist/commands/form-option-template.d.ts +3 -0
- package/dist/commands/form-option-template.d.ts.map +1 -0
- package/dist/commands/form-option-template.js +291 -0
- package/dist/commands/form-option-template.js.map +1 -0
- package/dist/commands/form-permission.d.ts.map +1 -1
- package/dist/commands/form-permission.js +214 -2
- package/dist/commands/form-permission.js.map +1 -1
- package/dist/commands/form-view.d.ts.map +1 -1
- package/dist/commands/form-view.js +23 -1
- package/dist/commands/form-view.js.map +1 -1
- package/dist/commands/form.d.ts.map +1 -1
- package/dist/commands/form.js +259 -59
- package/dist/commands/form.js.map +1 -1
- package/dist/commands/icon.d.ts.map +1 -1
- package/dist/commands/icon.js +9 -13
- package/dist/commands/icon.js.map +1 -1
- package/dist/commands/menu-permission.d.ts.map +1 -1
- package/dist/commands/menu-permission.js +19 -12
- package/dist/commands/menu-permission.js.map +1 -1
- package/dist/commands/page.d.ts +14 -0
- package/dist/commands/page.d.ts.map +1 -0
- package/dist/commands/page.js +175 -0
- package/dist/commands/page.js.map +1 -0
- package/dist/commands/wf-form.js +1 -1
- package/dist/commands/wf-form.js.map +1 -1
- package/dist/commands/workflow-condition.js +9 -8
- package/dist/commands/workflow-condition.js.map +1 -1
- package/dist/commands/workflow-node-overtime.d.ts.map +1 -1
- package/dist/commands/workflow-node-overtime.js +16 -8
- package/dist/commands/workflow-node-overtime.js.map +1 -1
- package/dist/commands/workflow-node.d.ts.map +1 -1
- package/dist/commands/workflow-node.js +35 -5
- package/dist/commands/workflow-node.js.map +1 -1
- package/dist/commands/workflow-numbering.d.ts.map +1 -1
- package/dist/commands/workflow-numbering.js +63 -30
- package/dist/commands/workflow-numbering.js.map +1 -1
- package/dist/commands/workflow-operator-sign.d.ts.map +1 -1
- package/dist/commands/workflow-operator-sign.js +2 -1
- package/dist/commands/workflow-operator-sign.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +78 -38
- package/dist/commands/workflow.js.map +1 -1
- package/dist/core/client.d.ts +9 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +16 -1
- package/dist/core/client.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -1
- package/dist/services/actionflow/preflight_service.js +40 -17
- 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 +4 -2
- package/dist/services/actionflow/workflow_compiler.js.map +1 -1
- package/dist/services/form-button-action.d.ts +17 -0
- package/dist/services/form-button-action.d.ts.map +1 -0
- package/dist/services/form-button-action.js +111 -0
- package/dist/services/form-button-action.js.map +1 -0
- package/dist/services/form-create.d.ts +15 -1
- package/dist/services/form-create.d.ts.map +1 -1
- package/dist/services/form-create.js +40 -5
- package/dist/services/form-create.js.map +1 -1
- package/dist/services/form-list-stats.d.ts.map +1 -1
- package/dist/services/form-list-stats.js +29 -6
- package/dist/services/form-list-stats.js.map +1 -1
- package/dist/services/form-nlist.d.ts +8 -2
- package/dist/services/form-nlist.d.ts.map +1 -1
- package/dist/services/form-nlist.js +32 -7
- package/dist/services/form-nlist.js.map +1 -1
- package/dist/services/form-sub-detail.d.ts +36 -0
- package/dist/services/form-sub-detail.d.ts.map +1 -0
- package/dist/services/form-sub-detail.js +132 -0
- package/dist/services/form-sub-detail.js.map +1 -0
- package/dist/services/form-view.d.ts +6 -0
- package/dist/services/form-view.d.ts.map +1 -1
- package/dist/services/form-view.js +24 -0
- package/dist/services/form-view.js.map +1 -1
- package/dist/services/workflow-operator.d.ts +9 -0
- package/dist/services/workflow-operator.d.ts.map +1 -1
- package/dist/services/workflow-operator.js +33 -0
- package/dist/services/workflow-operator.js.map +1 -1
- package/package.json +1 -1
- package/skill-docs/SKILL.md +27 -45
- package/skill-docs/assets/factory/chart-dimensions.json +536 -0
- package/skill-docs/assets/factory/example-btn-progress-collapse-configured.json +2515 -0
- package/skill-docs/assets/factory/example-configured-2.json +13805 -0
- package/skill-docs/assets/factory/example-configured.json +6735 -0
- package/skill-docs/assets/factory/factory-bar-stack.json +326 -0
- package/skill-docs/assets/factory/factory-bar.json +222 -0
- package/skill-docs/assets/factory/factory-bubble.json +322 -0
- package/skill-docs/assets/factory/factory-calendar.json +325 -0
- package/skill-docs/assets/factory/factory-circular.json +320 -0
- package/skill-docs/assets/factory/factory-collapse-panel.json +132 -0
- package/skill-docs/assets/factory/factory-comment.json +388 -0
- package/skill-docs/assets/factory/factory-count-down.json +198 -0
- package/skill-docs/assets/factory/factory-digital-panel.json +108 -0
- package/skill-docs/assets/factory/factory-eb-button.json +150 -0
- package/skill-docs/assets/factory/factory-fast-create.json +62 -0
- package/skill-docs/assets/factory/factory-gauge.json +312 -0
- package/skill-docs/assets/factory/factory-h-bar-stack.json +328 -0
- package/skill-docs/assets/factory/factory-h-bar.json +326 -0
- package/skill-docs/assets/factory/factory-line.json +212 -0
- package/skill-docs/assets/factory/factory-nav-bar.json +167 -0
- package/skill-docs/assets/factory/factory-nav-menu.json +144 -0
- package/skill-docs/assets/factory/factory-nav-panel.json +338 -0
- package/skill-docs/assets/factory/factory-new-tab.json +163 -0
- package/skill-docs/assets/factory/factory-nightingale.json +312 -0
- package/skill-docs/assets/factory/factory-nlist.json +112 -0
- package/skill-docs/assets/factory/factory-page-header.json +171 -0
- package/skill-docs/assets/factory/factory-picture.json +169 -0
- package/skill-docs/assets/factory/factory-pie.json +212 -0
- package/skill-docs/assets/factory/factory-progress-chart.json +162 -0
- package/skill-docs/assets/factory/factory-search-global.json +104 -0
- package/skill-docs/assets/factory/factory-slide.json +164 -0
- package/skill-docs/assets/factory/factory-treemap.json +322 -0
- package/skill-docs/assets/icons.db +0 -0
- package/skill-docs/references/coding/guide-page-code.md +21 -1
- package/skill-docs/references/coding/ref-compile-rules.md +24 -0
- package/skill-docs/references/common/guide-plan-template.md +219 -201
- package/skill-docs/references/common/ref-cli-commands.md +366 -320
- package/skill-docs/references/ebuilder-designer/guide-designer-components.md +110 -0
- package/skill-docs/references/ebuilder-designer/guide-designer-factory.md +460 -0
- package/skill-docs/references/ebuilder-designer/guide-designer-version.md +111 -0
- package/skill-docs/references/ebuilder-designer/guide-designer.md +287 -0
- package/skill-docs/references/form/guide-create-form.md +464 -409
- package/skill-docs/references/form/guide-form-button.md +82 -54
- package/skill-docs/references/form/guide-form-view.md +299 -284
- package/skill-docs/references/workflow/guide-workflow.md +59 -0
package/dist/commands/form.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { writeFileSync, existsSync,
|
|
1
|
+
import { writeFileSync, existsSync, readFileSync } from 'fs';
|
|
2
2
|
import { AuthSession } from '../core/auth.js';
|
|
3
3
|
import { ApiClient } from '../core/client.js';
|
|
4
4
|
import { toColumnName, toTableName } from '../utils/column-name.js';
|
|
5
5
|
import { createCustomPhysicalForm, addInitialFieldsToCustomPhysicalForm, placeholderFromFormat, reapplyGroupLayout } from '../services/form-create.js';
|
|
6
|
+
import { FormSubDetailService } from '../services/form-sub-detail.js';
|
|
6
7
|
import { getRichType, richIdUnits } from '../services/rich-types.js';
|
|
8
|
+
import { registerOptionTemplateCommand } from './form-option-template.js';
|
|
7
9
|
/**
|
|
8
10
|
* componentKey 大小写归一:用户/示例常写 "Textarea"/"Ebuilder" 等小写变体,但代码各处
|
|
9
11
|
* `=== 'TextArea'`、storageFieldType 按 canonical 大小写匹配。不归一会导致 type 存成小写
|
|
@@ -27,6 +29,30 @@ const SYSTEM_FIELD_IDS = new Set([
|
|
|
27
29
|
'batchpubtags', 'batchmytags', 'operate', 'data_read_status',
|
|
28
30
|
'flow_system_number',
|
|
29
31
|
]);
|
|
32
|
+
/** 系统字段的中文名 → 物理字段 id(form read 实测的平台自带字段)。建表时字段与此完全重名 → 跳过新建、直接复用系统字段。 */
|
|
33
|
+
const SYSTEM_FIELD_NAME_TO_ID = {
|
|
34
|
+
'标题': 'name',
|
|
35
|
+
'创建者': 'creator',
|
|
36
|
+
'创建时间': 'create_time',
|
|
37
|
+
'最后更新时间': 'update_time',
|
|
38
|
+
'数据ID': 'id',
|
|
39
|
+
'最后更新人': 'updater',
|
|
40
|
+
'数据状态': 'data_status',
|
|
41
|
+
'流程状态': 'flow_status',
|
|
42
|
+
'当前节点': 'current_step',
|
|
43
|
+
'流程编号': 'flow_system_number',
|
|
44
|
+
};
|
|
45
|
+
/** 布局 config 里可置可见的系统字段:中文名 → 布局 config 逻辑 id(getConfig/initLayout configs 用驼峰 id)。
|
|
46
|
+
* 命中的系统字段把布局置为可见(display/show)+ 独占一行;不在此表的(如流程状态)无布局 config 可置,仅跳过新建。 */
|
|
47
|
+
const SYSTEM_FIELD_CFG_ID = {
|
|
48
|
+
'标题': 'name',
|
|
49
|
+
'创建者': 'creator',
|
|
50
|
+
'创建时间': 'createTime',
|
|
51
|
+
'最后更新时间': 'updateTime',
|
|
52
|
+
'数据ID': 'id',
|
|
53
|
+
'最后更新人': 'updater',
|
|
54
|
+
'数据状态': 'dataStatus',
|
|
55
|
+
};
|
|
30
56
|
// EBuilder dataTitle(关联字段标题栏)默认解析:优先字段名含「名称」的业务字段,无则第一个业务字段。
|
|
31
57
|
// 需求:默认选带"名称"二字的字段(如 客户名称/类型名称),没有就默认选第一个。
|
|
32
58
|
function defaultEBuilderDataTitle(fields) {
|
|
@@ -37,13 +63,13 @@ function defaultEBuilderDataTitle(fields) {
|
|
|
37
63
|
}
|
|
38
64
|
export function registerFormCommands(program) {
|
|
39
65
|
const form = program.command('form').description('表单管理');
|
|
66
|
+
registerOptionTemplateCommand(form, program);
|
|
40
67
|
form.command('read')
|
|
41
68
|
.description('读取表单字段结构')
|
|
42
69
|
.argument('<objId>', '表单 objId')
|
|
43
|
-
.argument('[dir]', '输出目录(可选,用于写入 memo.md)')
|
|
44
70
|
.option('--out <file>', '将 JSON 输出写入文件(UTF-8,避免终端编码问题)')
|
|
45
71
|
.option('--app-id <id>', '应用 ID(提供时自动获取 Select 字段的选项)')
|
|
46
|
-
.action(async (objId,
|
|
72
|
+
.action(async (objId, cmdOpts) => {
|
|
47
73
|
const opts = program.opts();
|
|
48
74
|
const auth = await AuthSession.fromOptions(opts);
|
|
49
75
|
if (!auth)
|
|
@@ -69,7 +95,7 @@ export function registerFormCommands(program) {
|
|
|
69
95
|
for (const dt of detailTables) {
|
|
70
96
|
const dtName = dt.name || dt.subFormName || '(未命名明细表)';
|
|
71
97
|
for (const sf of (dt.fields || [])) {
|
|
72
|
-
// 标注所属明细表名/subFormName
|
|
98
|
+
// 标注所属明细表名/subFormName,渲染展示用
|
|
73
99
|
if (!sf.subFormName)
|
|
74
100
|
sf.subFormName = dtName;
|
|
75
101
|
subFields.push(sf);
|
|
@@ -89,8 +115,13 @@ export function registerFormCommands(program) {
|
|
|
89
115
|
// Fetch options for Select/RadioBox/CheckBox fields (skip system fields with string IDs)
|
|
90
116
|
// 主表 + 明细表(子表)字段都取:之前只遍历主表,子表 Select 的 options 一直拿不到
|
|
91
117
|
const fetchOptions = async (f) => {
|
|
118
|
+
// 多选下拉:摘要/读取里 fieldKey 是 SelectMultiple(fieldType 仍是 Select),
|
|
119
|
+
// 类型判断必须同时认 SelectMultiple,否则选项不拉取、读取摘要不展示(D02)。
|
|
92
120
|
const ftype = f.fieldType || f.fieldKey || '';
|
|
93
|
-
const
|
|
121
|
+
const fkey = f.fieldKey || f.fieldType || '';
|
|
122
|
+
const isOptionField = ftype === 'Select' || ftype === 'SelectMultiple'
|
|
123
|
+
|| fkey === 'Select' || fkey === 'SelectMultiple'
|
|
124
|
+
|| ftype === 'RadioBox' || ftype === 'CheckBox';
|
|
94
125
|
// Use fieldId (actual field ID) not id (sequence number), and skip non-numeric IDs (system fields)
|
|
95
126
|
if (!isOptionField || !f.fieldId || !/^\d+$/.test(String(f.fieldId)))
|
|
96
127
|
return;
|
|
@@ -108,6 +139,10 @@ export function registerFormCommands(program) {
|
|
|
108
139
|
if (options.length > 0) {
|
|
109
140
|
f.options = options.map((o) => ({ valueKey: o.valueKey, name: o.name }));
|
|
110
141
|
}
|
|
142
|
+
// 选项预设模板:模板字段的 options 为空,回显模板引用(选项用 form option-template read 查)
|
|
143
|
+
if (!options.length && fieldData?.data?.templateId) {
|
|
144
|
+
f.optionTemplate = { id: String(fieldData.data.templateId), name: String(fieldData.data.templateName || '') };
|
|
145
|
+
}
|
|
111
146
|
}
|
|
112
147
|
catch { /* ignore individual field failures */ }
|
|
113
148
|
};
|
|
@@ -132,8 +167,12 @@ export function registerFormCommands(program) {
|
|
|
132
167
|
customParam: { terminal: '', objId: formId }, initMode: 5, groupFieldIds: [],
|
|
133
168
|
designerParam: { sourceModule: 'ebuilderform' } }, { ebbusinessid: formId });
|
|
134
169
|
const attrByFieldId = {};
|
|
135
|
-
for (const c of (cfgRes?.data?.configs || []))
|
|
170
|
+
for (const c of (cfgRes?.data?.configs || [])) {
|
|
136
171
|
attrByFieldId[String(c.id)] = c;
|
|
172
|
+
// DetailTable 子字段属性补读:子字段 required/readOnly 在布局 DetailTable children(D03)
|
|
173
|
+
for (const ch of (c.children || []))
|
|
174
|
+
attrByFieldId[String(ch.id)] = ch;
|
|
175
|
+
}
|
|
137
176
|
for (const f of allFields) {
|
|
138
177
|
const c = attrByFieldId[String(f.fieldId)];
|
|
139
178
|
if (!c)
|
|
@@ -165,6 +204,8 @@ export function registerFormCommands(program) {
|
|
|
165
204
|
console.log(` [${f.fieldKey || f.fieldType}] ${f.fieldName} (fieldId: ${f.fieldId || f.id})`);
|
|
166
205
|
if (f.options)
|
|
167
206
|
console.log(` 选项: ${JSON.stringify(f.options)}`);
|
|
207
|
+
if (f.optionTemplate)
|
|
208
|
+
console.log(` 选项模板: ${f.optionTemplate.name} (${f.optionTemplate.id})`);
|
|
168
209
|
}
|
|
169
210
|
if (subFields.length) {
|
|
170
211
|
console.log(` -- 明细表字段 --`);
|
|
@@ -178,32 +219,6 @@ export function registerFormCommands(program) {
|
|
|
178
219
|
}
|
|
179
220
|
}
|
|
180
221
|
}
|
|
181
|
-
// Write memo.md if dir specified
|
|
182
|
-
if (dir && allFields.length > 0) {
|
|
183
|
-
if (!existsSync(dir))
|
|
184
|
-
mkdirSync(dir, { recursive: true });
|
|
185
|
-
let memo = `## 表单\n- 表单ID:${objId}\n`;
|
|
186
|
-
for (const f of fields) {
|
|
187
|
-
if (SYSTEM_FIELD_IDS.has(f.fieldId))
|
|
188
|
-
continue;
|
|
189
|
-
memo += `- 字段名称:${f.fieldName}, 字段类型:${f.fieldKey}, 字段id:${f.fieldId || f.id}\n`;
|
|
190
|
-
if (f.fieldOptions)
|
|
191
|
-
memo += ` 选项:${JSON.stringify(f.fieldOptions)}\n`;
|
|
192
|
-
}
|
|
193
|
-
if (subFields.length) {
|
|
194
|
-
memo += `\n### 明细表字段\n`;
|
|
195
|
-
for (const f of subFields) {
|
|
196
|
-
if (SYSTEM_FIELD_IDS.has(f.fieldId))
|
|
197
|
-
continue;
|
|
198
|
-
memo += `- 字段名称:${f.fieldName}, 字段类型:${f.fieldKey}, 字段id:${f.fieldId}${f.subFormName ? `, 明细表:${f.subFormName}` : ''}\n`;
|
|
199
|
-
if (f.fieldOptions)
|
|
200
|
-
memo += ` 选项:${JSON.stringify(f.fieldOptions)}\n`;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
memo += '- 字段名称:数据ID, 字段类型:Number, 字段id:id\n';
|
|
204
|
-
writeFileSync(`${dir}/memo.md`, memo, 'utf-8');
|
|
205
|
-
console.error('表单信息已记录于 memo.md');
|
|
206
|
-
}
|
|
207
222
|
});
|
|
208
223
|
form.command('list')
|
|
209
224
|
.description('列出应用下的表单')
|
|
@@ -240,11 +255,10 @@ export function registerFormCommands(program) {
|
|
|
240
255
|
.description('创建表单')
|
|
241
256
|
.argument('<appId>', '应用 ID')
|
|
242
257
|
.argument('<name>', '表单名称')
|
|
243
|
-
.argument('[dir]', '输出目录(可选,记录 memo.md)')
|
|
244
258
|
.requiredOption('--fields <json>', '字段定义 JSON 文件路径(如 @fields.json),格式:[{"componentKey":"Text","fieldName":"姓名"}]')
|
|
245
259
|
.option('--menu', '建表后添加台账菜单(默认不加;漏加可用 `e10-cli menu add-table` 补)')
|
|
246
260
|
.option('--layout <type>', '表单布局类型:FLOW(流式)/EXCEL(表格,缺省)。布局类型建表后不可切换', 'EXCEL')
|
|
247
|
-
.action(async (appId, name,
|
|
261
|
+
.action(async (appId, name, cmdOpts) => {
|
|
248
262
|
const opts = program.opts();
|
|
249
263
|
const auth = await AuthSession.fromOptions(opts);
|
|
250
264
|
if (!auth)
|
|
@@ -262,6 +276,8 @@ export function registerFormCommands(program) {
|
|
|
262
276
|
console.error(`文件不存在: ${filePath}`);
|
|
263
277
|
process.exit(1);
|
|
264
278
|
}
|
|
279
|
+
const skippedSys = [];
|
|
280
|
+
const systemOverrides = [];
|
|
265
281
|
let fieldDefs;
|
|
266
282
|
try {
|
|
267
283
|
fieldDefs = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
@@ -309,6 +325,24 @@ export function registerFormCommands(program) {
|
|
|
309
325
|
process.exit(1);
|
|
310
326
|
}
|
|
311
327
|
}
|
|
328
|
+
// 系统字段重名:字段名与平台自带系统字段完全重名 → 不新建物理字段(避免出现两条「标题」/「创建者」),
|
|
329
|
+
// 直接复用系统字段。可布局的系统字段(标题/创建者等)额外收进 systemOverrides → 布局置为可见/独占一行。
|
|
330
|
+
// 仅主表顶层字段参与;DetailTable 子字段(子表无系统字段名冲突)不在此列。
|
|
331
|
+
fieldDefs = fieldDefs.filter((f) => {
|
|
332
|
+
const sysId = SYSTEM_FIELD_NAME_TO_ID[String(f.fieldName ?? '').trim()];
|
|
333
|
+
if (sysId && f.componentKey !== 'DetailTable') {
|
|
334
|
+
skippedSys.push({ name: String(f.fieldName), sysId });
|
|
335
|
+
const cfgId = SYSTEM_FIELD_CFG_ID[String(f.fieldName ?? '').trim()];
|
|
336
|
+
if (cfgId) {
|
|
337
|
+
systemOverrides.push({ configId: cfgId, singleRow: f.singleRow === true, hidden: f.hidden === true });
|
|
338
|
+
}
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
return true;
|
|
342
|
+
});
|
|
343
|
+
if (skippedSys.length) {
|
|
344
|
+
console.error(`⚠ 跳过 ${skippedSys.length} 个与系统字段重名的字段(平台已自带,复用不新建): ${skippedSys.map((s) => `${s.name}`).join('、')}${systemOverrides.length ? '(已置为布局可见)' : ''}`);
|
|
345
|
+
}
|
|
312
346
|
const makeField = (fid, fname, ck, row, col, fieldOptions, isDetail, subFields) => {
|
|
313
347
|
const x = col * 950;
|
|
314
348
|
const y = 35 + row * 52;
|
|
@@ -486,6 +520,8 @@ export function registerFormCommands(program) {
|
|
|
486
520
|
componentKey: f.componentKey, fieldName: f.fieldName,
|
|
487
521
|
required: f.required, readOnly: f.readOnly, unique: f.unique,
|
|
488
522
|
hidden: f.hidden, formFields: f.formFields,
|
|
523
|
+
enableSubDetail: f.enableSubDetail, defaultExpandRow: f.defaultExpandRow,
|
|
524
|
+
subDetailConfig: f.subDetailConfig,
|
|
489
525
|
precision: f.precision, pointSize: f.pointSize,
|
|
490
526
|
percent: f.percent, defaultValue: f.defaultValue,
|
|
491
527
|
group: f.group, multiple: f.multiple,
|
|
@@ -494,13 +530,24 @@ export function registerFormCommands(program) {
|
|
|
494
530
|
// 否则 fields.json 标注的 maxLen/format 被丢(bug:长度默认 100 不生效、日期精度丢失)。
|
|
495
531
|
maxLen: f.maxLen, format: f.format,
|
|
496
532
|
}));
|
|
497
|
-
const fieldResult = await addInitialFieldsToCustomPhysicalForm(client, baseUrl, appId, objId, formId, fieldDefsForStandard, auth.tenantKey, layoutType);
|
|
533
|
+
const fieldResult = await addInitialFieldsToCustomPhysicalForm(client, baseUrl, appId, objId, formId, fieldDefsForStandard, auth.tenantKey, layoutType, systemOverrides);
|
|
498
534
|
fieldGroups = fieldResult.fieldGroups || [];
|
|
499
535
|
console.error(` 字段+布局已写入: ${fieldDefsForStandard.length} 个字段`);
|
|
500
536
|
const detailTables = fieldResult.detailTables || [];
|
|
501
537
|
for (const dt of detailTables) {
|
|
502
538
|
console.error(` 明细表: ${dt.definition.fieldName} subFormId: ${dt.subFormId}`);
|
|
503
539
|
}
|
|
540
|
+
const subDetailService = new FormSubDetailService(client, baseUrl, appId, objId, formId);
|
|
541
|
+
for (const dt of detailTables) {
|
|
542
|
+
const def = dt.definition;
|
|
543
|
+
if (def.enableSubDetail && Array.isArray(def.subDetailConfig) && def.subDetailConfig.length > 0) {
|
|
544
|
+
await subDetailService.set(def.fieldName, def.subDetailConfig, Boolean(def.defaultExpandRow));
|
|
545
|
+
console.error(` 二级明细已配置: ${def.fieldName} → ${def.subDetailConfig.map((x) => x.subForm).join(', ')}`);
|
|
546
|
+
}
|
|
547
|
+
else if (def.enableSubDetail) {
|
|
548
|
+
throw new Error(`明细表 ${def.fieldName} 已声明 enableSubDetail,但 subDetailConfig 为空`);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
504
551
|
}
|
|
505
552
|
catch (e) {
|
|
506
553
|
console.error(`创建失败: ${e.message}`);
|
|
@@ -722,6 +769,85 @@ export function registerFormCommands(program) {
|
|
|
722
769
|
}
|
|
723
770
|
}
|
|
724
771
|
}
|
|
772
|
+
// Step 2a: Select 绑定选项预设模板(fields.json optionTemplate 属性)。
|
|
773
|
+
// 建表时字段已建成裸 Select(无选项),此处补 templateId/templateName/publicTemplate:false/options:[]。
|
|
774
|
+
// 浏览器抓包(2026-09-09):带模板引用后平台渲染时按模板拉选项;回读 hasTemplate:true。
|
|
775
|
+
const tplFields = fieldDefs.filter(f => f.componentKey === 'Select' && f.optionTemplate && !(f.fieldOptions && f.fieldOptions.length));
|
|
776
|
+
if (tplFields.length > 0) {
|
|
777
|
+
console.error(` 绑定 ${tplFields.length} 个选项模板字段...`);
|
|
778
|
+
await resolveFormId();
|
|
779
|
+
// 字段名 → fieldId(建表后回查)
|
|
780
|
+
const fieldsRes = await client.post(`${baseUrl}/api/ebuilder/form/dataset/v1/getFields`, {
|
|
781
|
+
objId, userid: auth.userId, tenantKey: auth.tenantKey,
|
|
782
|
+
});
|
|
783
|
+
const mainFields = fieldsRes?.data?.mainFields || [];
|
|
784
|
+
// 模板解析缓存:ID 直查详情;名称在 custom+system 列表精确匹配
|
|
785
|
+
const tplCache = new Map();
|
|
786
|
+
const resolveTpl = async (idOrName) => {
|
|
787
|
+
if (tplCache.has(idOrName))
|
|
788
|
+
return tplCache.get(idOrName);
|
|
789
|
+
let hit = null;
|
|
790
|
+
try {
|
|
791
|
+
if (/^\d+$/.test(idOrName)) {
|
|
792
|
+
const r = await client.post(`${baseUrl}/api/form/datasources/queryDataSourcesByTemplateValueKey`, { templateId: idOrName });
|
|
793
|
+
if (r?.formDataTemplate?.id)
|
|
794
|
+
hit = { id: String(r.formDataTemplate.id), name: String(r.formDataTemplate.name) };
|
|
795
|
+
}
|
|
796
|
+
else {
|
|
797
|
+
for (const type of ['custom', 'system']) {
|
|
798
|
+
const list = await client.post(`${baseUrl}/api/form/datasources/queryDataList`, { pageNo: 1, pageSize: 100, name: idOrName, type });
|
|
799
|
+
const m = (list?.templatePage?.result || []).find((x) => x.name === idOrName);
|
|
800
|
+
if (m) {
|
|
801
|
+
hit = { id: String(m.id), name: String(m.name) };
|
|
802
|
+
break;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
catch { /* keep null */ }
|
|
808
|
+
tplCache.set(idOrName, hit);
|
|
809
|
+
return hit;
|
|
810
|
+
};
|
|
811
|
+
for (const tf of tplFields) {
|
|
812
|
+
const tpl = await resolveTpl(tf.optionTemplate);
|
|
813
|
+
if (!tpl) {
|
|
814
|
+
console.error(` ⚠ 未找到选项模板「${tf.optionTemplate}」(字段 ${tf.fieldName} 跳过,仍为无选项 Select)`);
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
817
|
+
const target = mainFields.find(f => f.fieldName === tf.fieldName);
|
|
818
|
+
if (!target) {
|
|
819
|
+
console.error(` ⚠ 未找到字段: ${tf.fieldName}`);
|
|
820
|
+
continue;
|
|
821
|
+
}
|
|
822
|
+
try {
|
|
823
|
+
// 取完整字段配置后叠加模板引用(保留平台已落的 columnName/formTableId 等)
|
|
824
|
+
const gf = await client.post(`${baseUrl}/api/ebuilder/form/form/field/manage/getFormField`, { module: 'ebuilderform', formTableField: { formField: { id: target.fieldId, form: { id: resolvedFormId } } } }, { ebbusinessid: resolvedFormId });
|
|
825
|
+
const full = gf?.data || {};
|
|
826
|
+
if (!full.fieldId) {
|
|
827
|
+
console.error(` ⚠ 字段详情读取失败: ${tf.fieldName}`);
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
830
|
+
const jsonObj = {
|
|
831
|
+
...full,
|
|
832
|
+
options: [],
|
|
833
|
+
templateId: tpl.id,
|
|
834
|
+
templateName: tpl.name,
|
|
835
|
+
publicTemplate: false,
|
|
836
|
+
parentId: [],
|
|
837
|
+
};
|
|
838
|
+
const res = await client.post(`${baseUrl}/api/ebuilder/form/form/field/manage/saveFormFieldNew?apid=${appId}`, { formId: resolvedFormId, module: 'ebuilderform', customParam: { appId, objId }, jsonObj: JSON.stringify(jsonObj) }, { ebbusinessid: resolvedFormId });
|
|
839
|
+
if (res?.code === 200 && res?.status) {
|
|
840
|
+
console.error(` 已绑定模板: ${tf.fieldName} → ${tpl.name} (${tpl.id})`);
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
console.error(` 绑定失败: ${tf.fieldName} — ${res?.msg || '未知错误'}`);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
catch (e) {
|
|
847
|
+
console.error(` 绑定异常: ${tf.fieldName} — ${e.message}`);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
725
851
|
// Step 2b: Flow 字段(浏览-流程)绑 sformId —— 对齐 EBuilder Step 2。
|
|
726
852
|
// 之前 form create 只对 EBuilder 事后绑 sformId(Step 2),Flow 无对应步骤 → fields.json 里 Flow 的
|
|
727
853
|
// sformId 被丢弃,字段建成无关联裸 Flow("该字段未配置")。此处补 Flow 的 sformId/relateExt 等,
|
|
@@ -1169,8 +1295,11 @@ export function registerFormCommands(program) {
|
|
|
1169
1295
|
}
|
|
1170
1296
|
}
|
|
1171
1297
|
// Step 7: Configure Select/RadioBox/CheckBox field options and defaults
|
|
1298
|
+
// D02: 多选下拉可直写 componentKey=SelectMultiple(不只是 Select+multiple:true),
|
|
1299
|
+
// 类型判断漏掉它导致选项从不上配、保存后为空 —— 一并纳入。
|
|
1172
1300
|
const optionFields = fieldDefs.filter(f => f.fieldOptions && f.fieldOptions.length > 0
|
|
1173
|
-
&& (f.componentKey === 'Select' || f.componentKey === '
|
|
1301
|
+
&& (f.componentKey === 'Select' || f.componentKey === 'SelectMultiple'
|
|
1302
|
+
|| f.componentKey === 'RadioBox' || f.componentKey === 'CheckBox'));
|
|
1174
1303
|
if (optionFields.length > 0) {
|
|
1175
1304
|
await resolveFormId();
|
|
1176
1305
|
console.error(` 配置 ${optionFields.length} 个选项字段...`);
|
|
@@ -1214,17 +1343,27 @@ export function registerFormCommands(program) {
|
|
|
1214
1343
|
}
|
|
1215
1344
|
const { randomUUID } = await import('crypto');
|
|
1216
1345
|
const defaultVk = ofd.defaultValue;
|
|
1346
|
+
// valueKey 硬约束:必须是纯数字(平台规范+下游引用按数字处理)。非数字直接报错,不静默转换。
|
|
1347
|
+
for (const o of ofd.fieldOptions) {
|
|
1348
|
+
if (o.valueKey !== undefined && o.valueKey !== null && String(o.valueKey) !== '' && !/^\d+$/.test(String(o.valueKey))) {
|
|
1349
|
+
throw new Error(`字段「${ofd.fieldName}」选项「${o.name}」的 valueKey "${o.valueKey}" 必须是数字`);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1217
1352
|
const options = ofd.fieldOptions.map((o, i) => {
|
|
1218
|
-
|
|
1353
|
+
// valueKey=用户自定义选项值,必须为数字(平台规范,抓包样本均为数字);
|
|
1354
|
+
// selectionId 与 valueKey 分离、留空由平台自动生成雪花号。未给 valueKey 时自动生成。
|
|
1355
|
+
const hasVk = o.valueKey !== undefined && o.valueKey !== null && String(o.valueKey) !== '';
|
|
1356
|
+
const fallback = genIds[genIdx++] || String(Date.now() + i);
|
|
1357
|
+
const valueKey = hasVk ? String(o.valueKey) : fallback;
|
|
1219
1358
|
return {
|
|
1220
1359
|
other: false,
|
|
1221
|
-
selectionId:
|
|
1222
|
-
defOption: defaultVk ? (
|
|
1360
|
+
selectionId: '',
|
|
1361
|
+
defOption: defaultVk ? (valueKey === String(defaultVk)) : false,
|
|
1223
1362
|
styleConfig: {}, archive: false, divisionBranch: false,
|
|
1224
1363
|
subCompanyCatalogues: [], dataCount: i === 0 ? ofd.fieldOptions.length : 0,
|
|
1225
1364
|
score: '0', uid: randomUUID(), children: [], extra: {},
|
|
1226
1365
|
name: o.name, isLimit: false,
|
|
1227
|
-
valueKey
|
|
1366
|
+
valueKey,
|
|
1228
1367
|
componentKey: 'Option', order: i, fieldId: targetField.fieldId,
|
|
1229
1368
|
};
|
|
1230
1369
|
});
|
|
@@ -1276,7 +1415,8 @@ export function registerFormCommands(program) {
|
|
|
1276
1415
|
.filter(f => f.componentKey === 'DetailTable' && Array.isArray(f.formFields))
|
|
1277
1416
|
.flatMap(dt => (dt.formFields || [])
|
|
1278
1417
|
.filter(sf => sf.fieldOptions && sf.fieldOptions.length > 0
|
|
1279
|
-
&& (sf.componentKey === 'Select' || sf.componentKey === '
|
|
1418
|
+
&& (sf.componentKey === 'Select' || sf.componentKey === 'SelectMultiple'
|
|
1419
|
+
|| sf.componentKey === 'RadioBox' || sf.componentKey === 'CheckBox'))
|
|
1280
1420
|
.map(sf => ({ ...sf, __detailTable: dt.fieldName })));
|
|
1281
1421
|
if (detailOptionDefs.length > 0) {
|
|
1282
1422
|
await resolveFormId();
|
|
@@ -1340,13 +1480,16 @@ export function registerFormCommands(program) {
|
|
|
1340
1480
|
const dataKey = cur.dataKey || toColumnName(sfDef.fieldName);
|
|
1341
1481
|
const { randomUUID } = await import('crypto');
|
|
1342
1482
|
const options = sfDef.fieldOptions.map((o, i) => {
|
|
1343
|
-
|
|
1483
|
+
// 同主表:valueKey=用户自定义必须数字;selectionId 留空平台生成
|
|
1484
|
+
const hasVk = o.valueKey !== undefined && o.valueKey !== null && String(o.valueKey) !== '';
|
|
1485
|
+
const fallback = subGenIds[subGenIdx++] || String(Date.now() + i);
|
|
1486
|
+
const valueKey = hasVk ? String(o.valueKey) : fallback;
|
|
1344
1487
|
return {
|
|
1345
|
-
other: false, selectionId:
|
|
1488
|
+
other: false, selectionId: '', defOption: false,
|
|
1346
1489
|
styleConfig: {}, archive: false, divisionBranch: false,
|
|
1347
1490
|
subCompanyCatalogues: [], dataCount: i === 0 ? sfDef.fieldOptions.length : 0,
|
|
1348
1491
|
score: '0', uid: randomUUID(), children: [], extra: {},
|
|
1349
|
-
name: o.name, isLimit: false, valueKey
|
|
1492
|
+
name: o.name, isLimit: false, valueKey,
|
|
1350
1493
|
componentKey: 'Option', order: i, fieldId: subFieldId,
|
|
1351
1494
|
};
|
|
1352
1495
|
});
|
|
@@ -1580,10 +1723,10 @@ export function registerFormCommands(program) {
|
|
|
1580
1723
|
console.error(` 显示列兜底失败: ${e.message}(可用 \`e10-cli form table-view ensure ${objId} ${appId}\` 手动补加)`);
|
|
1581
1724
|
}
|
|
1582
1725
|
if (opts.json) {
|
|
1583
|
-
console.log(JSON.stringify({ objId, name, menuId }));
|
|
1726
|
+
console.log(JSON.stringify({ objId, name, menuId, skippedSys }));
|
|
1584
1727
|
}
|
|
1585
1728
|
else {
|
|
1586
|
-
console.log(`完成: ${objId}`);
|
|
1729
|
+
console.log(`完成: ${objId}${skippedSys.length ? `(跳过系统字段重名: ${skippedSys.map((s) => s.name).join('、')})` : ''}`);
|
|
1587
1730
|
}
|
|
1588
1731
|
});
|
|
1589
1732
|
const linkageCmd = form.command('linkage').description('表单字段显隐联动管理');
|
|
@@ -1809,10 +1952,15 @@ export function registerFormCommands(program) {
|
|
|
1809
1952
|
catch { /* best effort */ }
|
|
1810
1953
|
// Build options with defOption
|
|
1811
1954
|
const { randomUUID } = await import('crypto');
|
|
1812
|
-
// valueKey
|
|
1813
|
-
//
|
|
1814
|
-
//
|
|
1815
|
-
const
|
|
1955
|
+
// valueKey=用户自定义选项值,必须是纯数字(平台规范+下游引用按数字处理),非数字直接报错;
|
|
1956
|
+
// selectionId 与 valueKey 分离、留空由平台自动生成雪花号。未给 valueKey 自动生成。
|
|
1957
|
+
// 已有数据的字段平台会拒绝修改,无需保留旧 selectionId。
|
|
1958
|
+
for (const o of optionDefs) {
|
|
1959
|
+
if (o.valueKey !== undefined && o.valueKey !== null && String(o.valueKey) !== '' && !/^\d+$/.test(String(o.valueKey))) {
|
|
1960
|
+
console.error(`❌ 选项「${o.name}」的 valueKey "${o.valueKey}" 必须是数字`);
|
|
1961
|
+
process.exit(1);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1816
1964
|
let genIds = [];
|
|
1817
1965
|
try {
|
|
1818
1966
|
const genRes = await client.post(`${baseUrl}/api/form/local/generatorIds?size=${optionDefs.length + 1}&apid=${appId}`, {});
|
|
@@ -1820,17 +1968,12 @@ export function registerFormCommands(program) {
|
|
|
1820
1968
|
}
|
|
1821
1969
|
catch { /* fallback to timestamp */ }
|
|
1822
1970
|
const options = optionDefs.map((o, i) => {
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
if (!valueKey)
|
|
1826
|
-
valueKey = genIds[i] || String(Date.now() + i);
|
|
1827
|
-
if (o.valueKey && !isNumeric(o.valueKey)) {
|
|
1828
|
-
console.error(` ⚠ ${o.name}: 忽略非数字 valueKey "${o.valueKey}"(平台 selectionId 只接受数字),已重新生成 ${valueKey}`);
|
|
1829
|
-
}
|
|
1971
|
+
const hasVk = o.valueKey !== undefined && o.valueKey !== null && String(o.valueKey) !== '';
|
|
1972
|
+
const valueKey = hasVk ? String(o.valueKey) : (genIds[i] || String(Date.now() + i));
|
|
1830
1973
|
return {
|
|
1831
1974
|
other: false,
|
|
1832
|
-
selectionId:
|
|
1833
|
-
defOption: cmdOpts.default === valueKey,
|
|
1975
|
+
selectionId: '',
|
|
1976
|
+
defOption: cmdOpts.default !== undefined && cmdOpts.default !== null && String(cmdOpts.default) === valueKey,
|
|
1834
1977
|
styleConfig: {}, archive: false, divisionBranch: false, subCompanyCatalogues: [],
|
|
1835
1978
|
dataCount: i === 0 ? optionDefs.length : 0,
|
|
1836
1979
|
score: '0', uid: randomUUID(), children: [], extra: {},
|
|
@@ -1912,6 +2055,7 @@ export function registerFormCommands(program) {
|
|
|
1912
2055
|
.option('--multiple', '多选(人员/部门/EBuilder/Browser/下拉Select,默认单选。下拉多选=SelectMultiple 类型)')
|
|
1913
2056
|
.option('--max-len <n>', '文本最大长度(Text 缺省 100、TextArea 缺省 4000)')
|
|
1914
2057
|
.option('--single-row', '独占一行显示(布局 singleRow:true,其余字段仍两列)')
|
|
2058
|
+
.option('--option-template <idOrName>', 'Select 绑定选项预设模板(ID 或名称;选项不内联,options=[])')
|
|
1915
2059
|
.action(async (objId, appId, fieldName, fieldType, title, cmdOptsRaw) => {
|
|
1916
2060
|
// fieldType 大小写归一(与建表一致):用户常传 "Textarea"/"Ebuilder",不归一则 type 存小写
|
|
1917
2061
|
// "Textarea"(FLOW 渲染异常)、TextArea 分支漏跑。
|
|
@@ -2234,6 +2378,62 @@ export function registerFormCommands(program) {
|
|
|
2234
2378
|
delete jsonObj.scan;
|
|
2235
2379
|
delete jsonObj.readonlyTransLink;
|
|
2236
2380
|
}
|
|
2381
|
+
// Select 绑定选项预设模板:--option-template(ID 或名称)。
|
|
2382
|
+
// 浏览器抓包(2026-09-09):jsonObj 带 templateId+templateName+publicTemplate:false+options:[](选项不内联),
|
|
2383
|
+
// 平台渲染时按模板拉选项。模板管理见 `form option-template`。
|
|
2384
|
+
if (fieldType === 'Select' && cmdOpts.optionTemplate) {
|
|
2385
|
+
// 先清 else 分支给文本类加的 junk + options 占位(模板字段不发选项)
|
|
2386
|
+
delete jsonObj.maxLen;
|
|
2387
|
+
delete jsonObj.unique;
|
|
2388
|
+
delete jsonObj.scan;
|
|
2389
|
+
delete jsonObj.readonlyTransLink;
|
|
2390
|
+
const tplIdOrName = cmdOpts.optionTemplate;
|
|
2391
|
+
// 解析模板:纯数字按 ID 直查详情;否则在 custom+system 列表按名称精确匹配
|
|
2392
|
+
let tplId = '';
|
|
2393
|
+
let tplName = '';
|
|
2394
|
+
const readTpl = async (id) => {
|
|
2395
|
+
const r = await client.post(`${baseUrl}/api/form/datasources/queryDataSourcesByTemplateValueKey`, { templateId: id });
|
|
2396
|
+
return r?.formDataTemplate?.id ? r.formDataTemplate : null;
|
|
2397
|
+
};
|
|
2398
|
+
if (/^\d+$/.test(tplIdOrName)) {
|
|
2399
|
+
const t = await readTpl(tplIdOrName);
|
|
2400
|
+
if (!t) {
|
|
2401
|
+
console.error(`选项模板 ${tplIdOrName} 不存在`);
|
|
2402
|
+
process.exit(1);
|
|
2403
|
+
}
|
|
2404
|
+
tplId = String(t.id);
|
|
2405
|
+
tplName = String(t.name);
|
|
2406
|
+
}
|
|
2407
|
+
else {
|
|
2408
|
+
for (const type of ['custom', 'system']) {
|
|
2409
|
+
const list = await client.post(`${baseUrl}/api/form/datasources/queryDataList`, { pageNo: 1, pageSize: 100, name: tplIdOrName, type });
|
|
2410
|
+
const hit = (list?.templatePage?.result || []).find((r) => r.name === tplIdOrName);
|
|
2411
|
+
if (hit) {
|
|
2412
|
+
tplId = String(hit.id);
|
|
2413
|
+
tplName = String(hit.name);
|
|
2414
|
+
break;
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
if (!tplId) {
|
|
2418
|
+
console.error(`未找到名为「${tplIdOrName}」的选项模板(custom+system 均已查)`);
|
|
2419
|
+
process.exit(1);
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
Object.assign(jsonObj, {
|
|
2423
|
+
hideScore: true,
|
|
2424
|
+
optionBackgroundStyle: 'default',
|
|
2425
|
+
options: [],
|
|
2426
|
+
templateScore: {},
|
|
2427
|
+
currentLevel: '1',
|
|
2428
|
+
templateId: tplId,
|
|
2429
|
+
templateName: tplName,
|
|
2430
|
+
publicTemplate: false,
|
|
2431
|
+
parentId: [],
|
|
2432
|
+
});
|
|
2433
|
+
if (cmdOpts.multiple) {
|
|
2434
|
+
console.error('提示:模板下拉当前按单选(currentLevel=1)绑定;多选+模板组合未验证');
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2237
2437
|
const payload = {
|
|
2238
2438
|
formId, module: 'ebuilderform',
|
|
2239
2439
|
customParam: { appId, objId },
|