weaver-e10-builder 1.0.7-beta → 1.0.9-beta
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 +7 -0
- package/dist/commands/actionflow.d.ts.map +1 -0
- package/dist/commands/actionflow.js +105 -0
- package/dist/commands/actionflow.js.map +1 -0
- package/dist/commands/auth.js +1 -1
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/form-list.d.ts.map +1 -1
- package/dist/commands/form-list.js +18 -9
- package/dist/commands/form-list.js.map +1 -1
- package/dist/commands/form-native.d.ts +0 -14
- package/dist/commands/form-native.d.ts.map +1 -1
- package/dist/commands/form-native.js +398 -72
- package/dist/commands/form-native.js.map +1 -1
- package/dist/commands/form.d.ts.map +1 -1
- package/dist/commands/form.js +5 -2
- package/dist/commands/form.js.map +1 -1
- package/dist/commands/wf-form.d.ts.map +1 -1
- package/dist/commands/wf-form.js +872 -42
- package/dist/commands/wf-form.js.map +1 -1
- package/dist/commands/workflow-action.d.ts +11 -0
- package/dist/commands/workflow-action.d.ts.map +1 -1
- package/dist/commands/workflow-action.js +13 -1586
- package/dist/commands/workflow-action.js.map +1 -1
- package/dist/commands/workflow-create-workflow.d.ts.map +1 -1
- package/dist/commands/workflow-create-workflow.js +111 -30
- package/dist/commands/workflow-create-workflow.js.map +1 -1
- package/dist/commands/workflow-node-robot.js +1 -1
- package/dist/commands/workflow-node-robot.js.map +1 -1
- package/dist/commands/workflow-node-validate.d.ts.map +1 -1
- package/dist/commands/workflow-node-validate.js +56 -45
- package/dist/commands/workflow-node-validate.js.map +1 -1
- package/dist/commands/workflow-numbering.d.ts.map +1 -1
- package/dist/commands/workflow-numbering.js +98 -2
- package/dist/commands/workflow-numbering.js.map +1 -1
- package/dist/commands/workflow-operator-sign.d.ts +3 -0
- package/dist/commands/workflow-operator-sign.d.ts.map +1 -0
- package/dist/commands/workflow-operator-sign.js +118 -0
- package/dist/commands/workflow-operator-sign.js.map +1 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +83 -6
- package/dist/commands/workflow.js.map +1 -1
- package/dist/core/client.d.ts +2 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +2 -0
- package/dist/core/client.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/services/actionflow/build_workflow_draft.d.ts +20 -0
- package/dist/services/actionflow/build_workflow_draft.d.ts.map +1 -0
- package/dist/services/actionflow/build_workflow_draft.js +222 -0
- package/dist/services/actionflow/build_workflow_draft.js.map +1 -0
- package/dist/services/actionflow/calendar_mapper.d.ts +3 -0
- package/dist/services/actionflow/calendar_mapper.d.ts.map +1 -0
- package/dist/services/actionflow/calendar_mapper.js +152 -0
- package/dist/services/actionflow/calendar_mapper.js.map +1 -0
- package/dist/services/actionflow/component_registry.d.ts +13 -0
- package/dist/services/actionflow/component_registry.d.ts.map +1 -0
- package/dist/services/actionflow/component_registry.js +213 -0
- package/dist/services/actionflow/component_registry.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_add.d.ts +3 -0
- package/dist/services/actionflow/components/action_eb_add.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_add.js +127 -0
- package/dist/services/actionflow/components/action_eb_add.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_add_compiler.d.ts +4 -0
- package/dist/services/actionflow/components/action_eb_add_compiler.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_add_compiler.js +13 -0
- package/dist/services/actionflow/components/action_eb_add_compiler.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_delete.d.ts +3 -0
- package/dist/services/actionflow/components/action_eb_delete.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_delete.js +69 -0
- package/dist/services/actionflow/components/action_eb_delete.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_delete_compiler.d.ts +4 -0
- package/dist/services/actionflow/components/action_eb_delete_compiler.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_delete_compiler.js +7 -0
- package/dist/services/actionflow/components/action_eb_delete_compiler.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_recover.d.ts +3 -0
- package/dist/services/actionflow/components/action_eb_recover.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_recover.js +28 -0
- package/dist/services/actionflow/components/action_eb_recover.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_recover_compiler.d.ts +3 -0
- package/dist/services/actionflow/components/action_eb_recover_compiler.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_recover_compiler.js +16 -0
- package/dist/services/actionflow/components/action_eb_recover_compiler.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_save_version.d.ts +3 -0
- package/dist/services/actionflow/components/action_eb_save_version.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_save_version.js +30 -0
- package/dist/services/actionflow/components/action_eb_save_version.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_save_version_compiler.d.ts +3 -0
- package/dist/services/actionflow/components/action_eb_save_version_compiler.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_save_version_compiler.js +15 -0
- package/dist/services/actionflow/components/action_eb_save_version_compiler.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_update.d.ts +3 -0
- package/dist/services/actionflow/components/action_eb_update.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_update.js +154 -0
- package/dist/services/actionflow/components/action_eb_update.js.map +1 -0
- package/dist/services/actionflow/components/action_eb_update_compiler.d.ts +16 -0
- package/dist/services/actionflow/components/action_eb_update_compiler.d.ts.map +1 -0
- package/dist/services/actionflow/components/action_eb_update_compiler.js +94 -0
- package/dist/services/actionflow/components/action_eb_update_compiler.js.map +1 -0
- package/dist/services/actionflow/components/approve_create.d.ts +3 -0
- package/dist/services/actionflow/components/approve_create.d.ts.map +1 -0
- package/dist/services/actionflow/components/approve_create.js +44 -0
- package/dist/services/actionflow/components/approve_create.js.map +1 -0
- package/dist/services/actionflow/components/approve_trigger.d.ts +5 -0
- package/dist/services/actionflow/components/approve_trigger.d.ts.map +1 -0
- package/dist/services/actionflow/components/approve_trigger.js +184 -0
- package/dist/services/actionflow/components/approve_trigger.js.map +1 -0
- package/dist/services/actionflow/components/approve_trigger_compiler.d.ts +4 -0
- package/dist/services/actionflow/components/approve_trigger_compiler.d.ts.map +1 -0
- package/dist/services/actionflow/components/approve_trigger_compiler.js +20 -0
- package/dist/services/actionflow/components/approve_trigger_compiler.js.map +1 -0
- package/dist/services/actionflow/components/condition.d.ts +3 -0
- package/dist/services/actionflow/components/condition.d.ts.map +1 -0
- package/dist/services/actionflow/components/condition.js +23 -0
- package/dist/services/actionflow/components/condition.js.map +1 -0
- package/dist/services/actionflow/components/date_trigger.d.ts +5 -0
- package/dist/services/actionflow/components/date_trigger.d.ts.map +1 -0
- package/dist/services/actionflow/components/date_trigger.js +129 -0
- package/dist/services/actionflow/components/date_trigger.js.map +1 -0
- package/dist/services/actionflow/components/document_actions.d.ts +28 -0
- package/dist/services/actionflow/components/document_actions.d.ts.map +1 -0
- package/dist/services/actionflow/components/document_actions.js +266 -0
- package/dist/services/actionflow/components/document_actions.js.map +1 -0
- package/dist/services/actionflow/components/eb_get_data_by_id.d.ts +5 -0
- package/dist/services/actionflow/components/eb_get_data_by_id.d.ts.map +1 -0
- package/dist/services/actionflow/components/eb_get_data_by_id.js +44 -0
- package/dist/services/actionflow/components/eb_get_data_by_id.js.map +1 -0
- package/dist/services/actionflow/components/enquiry_form.d.ts +5 -0
- package/dist/services/actionflow/components/enquiry_form.d.ts.map +1 -0
- package/dist/services/actionflow/components/enquiry_form.js +100 -0
- package/dist/services/actionflow/components/enquiry_form.js.map +1 -0
- package/dist/services/actionflow/components/event_form_data.d.ts +3 -0
- package/dist/services/actionflow/components/event_form_data.d.ts.map +1 -0
- package/dist/services/actionflow/components/event_form_data.js +29 -0
- package/dist/services/actionflow/components/event_form_data.js.map +1 -0
- package/dist/services/actionflow/components/hrm_actions.d.ts +7 -0
- package/dist/services/actionflow/components/hrm_actions.d.ts.map +1 -0
- package/dist/services/actionflow/components/hrm_actions.js +138 -0
- package/dist/services/actionflow/components/hrm_actions.js.map +1 -0
- package/dist/services/actionflow/components/index.d.ts +32 -0
- package/dist/services/actionflow/components/index.d.ts.map +1 -0
- package/dist/services/actionflow/components/index.js +132 -0
- package/dist/services/actionflow/components/index.js.map +1 -0
- package/dist/services/actionflow/components/logic_flow_set.d.ts +10 -0
- package/dist/services/actionflow/components/logic_flow_set.d.ts.map +1 -0
- package/dist/services/actionflow/components/logic_flow_set.js +79 -0
- package/dist/services/actionflow/components/logic_flow_set.js.map +1 -0
- package/dist/services/actionflow/components/meeting_create.d.ts +5 -0
- package/dist/services/actionflow/components/meeting_create.d.ts.map +1 -0
- package/dist/services/actionflow/components/meeting_create.js +37 -0
- package/dist/services/actionflow/components/meeting_create.js.map +1 -0
- package/dist/services/actionflow/components/multiple_execution.d.ts +5 -0
- package/dist/services/actionflow/components/multiple_execution.d.ts.map +1 -0
- package/dist/services/actionflow/components/multiple_execution.js +136 -0
- package/dist/services/actionflow/components/multiple_execution.js.map +1 -0
- package/dist/services/actionflow/components/output.d.ts +9 -0
- package/dist/services/actionflow/components/output.d.ts.map +1 -0
- package/dist/services/actionflow/components/output.js +81 -0
- package/dist/services/actionflow/components/output.js.map +1 -0
- package/dist/services/actionflow/components/schedule_create.d.ts +5 -0
- package/dist/services/actionflow/components/schedule_create.d.ts.map +1 -0
- package/dist/services/actionflow/components/schedule_create.js +42 -0
- package/dist/services/actionflow/components/schedule_create.js.map +1 -0
- package/dist/services/actionflow/components/send_message.d.ts +7 -0
- package/dist/services/actionflow/components/send_message.d.ts.map +1 -0
- package/dist/services/actionflow/components/send_message.js +200 -0
- package/dist/services/actionflow/components/send_message.js.map +1 -0
- package/dist/services/actionflow/components/simple_scheduler.d.ts +5 -0
- package/dist/services/actionflow/components/simple_scheduler.d.ts.map +1 -0
- package/dist/services/actionflow/components/simple_scheduler.js +22 -0
- package/dist/services/actionflow/components/simple_scheduler.js.map +1 -0
- package/dist/services/actionflow/components/time_batch_trigger.d.ts +5 -0
- package/dist/services/actionflow/components/time_batch_trigger.d.ts.map +1 -0
- package/dist/services/actionflow/components/time_batch_trigger.js +92 -0
- package/dist/services/actionflow/components/time_batch_trigger.js.map +1 -0
- package/dist/services/actionflow/components/workflow_actions.d.ts +26 -0
- package/dist/services/actionflow/components/workflow_actions.d.ts.map +1 -0
- package/dist/services/actionflow/components/workflow_actions.js +403 -0
- package/dist/services/actionflow/components/workflow_actions.js.map +1 -0
- package/dist/services/actionflow/context_data_builder.d.ts +9 -0
- package/dist/services/actionflow/context_data_builder.d.ts.map +1 -0
- package/dist/services/actionflow/context_data_builder.js +31 -0
- package/dist/services/actionflow/context_data_builder.js.map +1 -0
- package/dist/services/actionflow/context_preflight.d.ts +6 -0
- package/dist/services/actionflow/context_preflight.d.ts.map +1 -0
- package/dist/services/actionflow/context_preflight.js +122 -0
- package/dist/services/actionflow/context_preflight.js.map +1 -0
- package/dist/services/actionflow/context_provider.d.ts +18 -0
- package/dist/services/actionflow/context_provider.d.ts.map +1 -0
- package/dist/services/actionflow/context_provider.js +102 -0
- package/dist/services/actionflow/context_provider.js.map +1 -0
- package/dist/services/actionflow/context_source.d.ts +7 -0
- package/dist/services/actionflow/context_source.d.ts.map +1 -0
- package/dist/services/actionflow/context_source.js +10 -0
- package/dist/services/actionflow/context_source.js.map +1 -0
- package/dist/services/actionflow/design_client.d.ts +48 -0
- package/dist/services/actionflow/design_client.d.ts.map +1 -0
- package/dist/services/actionflow/design_client.js +170 -0
- package/dist/services/actionflow/design_client.js.map +1 -0
- package/dist/services/actionflow/document_source.d.ts +5 -0
- package/dist/services/actionflow/document_source.d.ts.map +1 -0
- package/dist/services/actionflow/document_source.js +5 -0
- package/dist/services/actionflow/document_source.js.map +1 -0
- package/dist/services/actionflow/enrich_approve_trigger.d.ts +12 -0
- package/dist/services/actionflow/enrich_approve_trigger.d.ts.map +1 -0
- package/dist/services/actionflow/enrich_approve_trigger.js +107 -0
- package/dist/services/actionflow/enrich_approve_trigger.js.map +1 -0
- package/dist/services/actionflow/filter_rules.d.ts +14 -0
- package/dist/services/actionflow/filter_rules.d.ts.map +1 -0
- package/dist/services/actionflow/filter_rules.js +259 -0
- package/dist/services/actionflow/filter_rules.js.map +1 -0
- package/dist/services/actionflow/form_source.d.ts +17 -0
- package/dist/services/actionflow/form_source.d.ts.map +1 -0
- package/dist/services/actionflow/form_source.js +42 -0
- package/dist/services/actionflow/form_source.js.map +1 -0
- package/dist/services/actionflow/formula_service.d.ts +51 -0
- package/dist/services/actionflow/formula_service.d.ts.map +1 -0
- package/dist/services/actionflow/formula_service.js +999 -0
- package/dist/services/actionflow/formula_service.js.map +1 -0
- package/dist/services/actionflow/generation_service.d.ts +28 -0
- package/dist/services/actionflow/generation_service.d.ts.map +1 -0
- package/dist/services/actionflow/generation_service.js +283 -0
- package/dist/services/actionflow/generation_service.js.map +1 -0
- package/dist/services/actionflow/hrm_source.d.ts +4 -0
- package/dist/services/actionflow/hrm_source.d.ts.map +1 -0
- package/dist/services/actionflow/hrm_source.js +8 -0
- package/dist/services/actionflow/hrm_source.js.map +1 -0
- package/dist/services/actionflow/id_generator.d.ts +13 -0
- package/dist/services/actionflow/id_generator.d.ts.map +1 -0
- package/dist/services/actionflow/id_generator.js +33 -0
- package/dist/services/actionflow/id_generator.js.map +1 -0
- package/dist/services/actionflow/person_source.d.ts +7 -0
- package/dist/services/actionflow/person_source.d.ts.map +1 -0
- package/dist/services/actionflow/person_source.js +34 -0
- package/dist/services/actionflow/person_source.js.map +1 -0
- package/dist/services/actionflow/preflight_service.d.ts +42 -0
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -0
- package/dist/services/actionflow/preflight_service.js +1247 -0
- package/dist/services/actionflow/preflight_service.js.map +1 -0
- package/dist/services/actionflow/query_field_defaults.d.ts +3 -0
- package/dist/services/actionflow/query_field_defaults.d.ts.map +1 -0
- package/dist/services/actionflow/query_field_defaults.js +46 -0
- package/dist/services/actionflow/query_field_defaults.js.map +1 -0
- package/dist/services/actionflow/readback_verifier.d.ts +11 -0
- package/dist/services/actionflow/readback_verifier.d.ts.map +1 -0
- package/dist/services/actionflow/readback_verifier.js +252 -0
- package/dist/services/actionflow/readback_verifier.js.map +1 -0
- package/dist/services/actionflow/request.d.ts +13 -0
- package/dist/services/actionflow/request.d.ts.map +1 -0
- package/dist/services/actionflow/request.js +15 -0
- package/dist/services/actionflow/request.js.map +1 -0
- package/dist/services/actionflow/runtime_metadata.d.ts +27 -0
- package/dist/services/actionflow/runtime_metadata.d.ts.map +1 -0
- package/dist/services/actionflow/runtime_metadata.js +142 -0
- package/dist/services/actionflow/runtime_metadata.js.map +1 -0
- package/dist/services/actionflow/save_workflow_draft.d.ts +34 -0
- package/dist/services/actionflow/save_workflow_draft.d.ts.map +1 -0
- package/dist/services/actionflow/save_workflow_draft.js +449 -0
- package/dist/services/actionflow/save_workflow_draft.js.map +1 -0
- package/dist/services/actionflow/system_params.d.ts +5 -0
- package/dist/services/actionflow/system_params.d.ts.map +1 -0
- package/dist/services/actionflow/system_params.js +55 -0
- package/dist/services/actionflow/system_params.js.map +1 -0
- package/dist/services/actionflow/trigger_common.d.ts +6 -0
- package/dist/services/actionflow/trigger_common.d.ts.map +1 -0
- package/dist/services/actionflow/trigger_common.js +41 -0
- package/dist/services/actionflow/trigger_common.js.map +1 -0
- package/dist/services/actionflow/workflow_compiler.d.ts +27 -0
- package/dist/services/actionflow/workflow_compiler.d.ts.map +1 -0
- package/dist/services/actionflow/workflow_compiler.js +1804 -0
- package/dist/services/actionflow/workflow_compiler.js.map +1 -0
- package/dist/services/actionflow/workflow_source.d.ts +14 -0
- package/dist/services/actionflow/workflow_source.d.ts.map +1 -0
- package/dist/services/actionflow/workflow_source.js +86 -0
- package/dist/services/actionflow/workflow_source.js.map +1 -0
- package/dist/services/workflow-initiator.d.ts +15 -0
- package/dist/services/workflow-initiator.d.ts.map +1 -0
- package/dist/services/workflow-initiator.js +77 -0
- package/dist/services/workflow-initiator.js.map +1 -0
- package/package.json +1 -1
|
@@ -90,7 +90,9 @@ export function registerWorkflowCommands(program) {
|
|
|
90
90
|
.argument('<formObjId>', '表单 objId')
|
|
91
91
|
.argument('<name>', '流程名称')
|
|
92
92
|
.argument('[desc]', '流程描述', '')
|
|
93
|
+
.option('--workflow-type <type>', '工作流类型:名称(如"公文审批")或 ID(默认 -1=其它)', '-1')
|
|
93
94
|
.option('--no-menu', '不自动添加发起菜单(默认建流程后自动加,指向表单新建页)')
|
|
95
|
+
.option('--no-auto-layout', '跳过建后自动排版节点(默认建完跑 auto-layout)')
|
|
94
96
|
.action(async (appId, formObjId, name, desc, cmdOpts) => {
|
|
95
97
|
const opts = program.opts();
|
|
96
98
|
const auth = await AuthSession.fromOptions(opts);
|
|
@@ -106,6 +108,18 @@ export function registerWorkflowCommands(program) {
|
|
|
106
108
|
process.exit(1);
|
|
107
109
|
}
|
|
108
110
|
console.error(` objId ${formObjId} -> formId ${realFormId}`);
|
|
111
|
+
// 工作流类型:认 ID(如 -1=其它)或名称(如"公文审批")。名称走 workflowPathTypeBrowser 解析。
|
|
112
|
+
// eb 流程也有流程类型概念,只是默认 -1(其它)。
|
|
113
|
+
let workflowType = cmdOpts.workflowType || '-1';
|
|
114
|
+
if (workflowType !== '-1' && !/^-?\d+$/.test(workflowType)) {
|
|
115
|
+
const tRes = await client.post(`${baseUrl}/api/workflow/pathdef/common/browser/complete/workflowPathTypeBrowser`, { browserMultiple: false, belongType: 1, showAddBtn: true, checkDetachable: true, newly: 1, searchValue: workflowType });
|
|
116
|
+
const types = tRes?.data?.data || [];
|
|
117
|
+
const hit = types.find((t) => t.name === workflowType || t.content === workflowType) || (types.length === 1 ? types[0] : null);
|
|
118
|
+
if (!hit)
|
|
119
|
+
throw new Error(`工作流类型 "${workflowType}" 未找到(可用: ${types.map((t) => t.name).join(', ')} 或 -1=其它)`);
|
|
120
|
+
workflowType = String(hit.id);
|
|
121
|
+
console.error(` 工作流类型: ${hit.name} (${workflowType})`);
|
|
122
|
+
}
|
|
109
123
|
// Create workflow
|
|
110
124
|
const ts = Date.now();
|
|
111
125
|
const payload = {
|
|
@@ -113,7 +127,7 @@ export function registerWorkflowCommands(program) {
|
|
|
113
127
|
createClient: '0', ebFormId: realFormId, createPcShow: ['0'], wfSymbol: '',
|
|
114
128
|
orderId: '0.0', moduleCard: 0, createType: '0', workflowName: name,
|
|
115
129
|
workflowDesc: desc, relateForm: '4', isLock: '0', isFree: '0',
|
|
116
|
-
addDefaultHide: 0, createPcShowCustom: '', workflowType
|
|
130
|
+
addDefaultHide: 0, createPcShowCustom: '', workflowType, id: '0',
|
|
117
131
|
workflowNameMultiLang: { tablefiled: 'wfp_base.workflowname', targetId: String(ts), needReplaceTargetId: true },
|
|
118
132
|
createMobileShowCustom: '', status: '1', createMobileShow: ['0'],
|
|
119
133
|
formMode: '0', formId: 0, relateFormMode: '0', workflowId: -1,
|
|
@@ -179,6 +193,17 @@ export function registerWorkflowCommands(program) {
|
|
|
179
193
|
catch {
|
|
180
194
|
console.error(' 警告: 无法自动设置发起权限,请手动设置');
|
|
181
195
|
}
|
|
196
|
+
// 流程节点自动排版(建好即布局,避免节点堆叠在原点;与工作流程 create-workflow 对齐)。
|
|
197
|
+
if (cmdOpts.autoLayout) {
|
|
198
|
+
try {
|
|
199
|
+
const { autoLayoutWorkflow } = await import('../services/workflow-layout.js');
|
|
200
|
+
await autoLayoutWorkflow({ client, baseUrl, workflowId });
|
|
201
|
+
console.error(' 节点已自动排版(auto-layout)');
|
|
202
|
+
}
|
|
203
|
+
catch (e) {
|
|
204
|
+
console.error(` 警告: 自动排版失败: ${e.message}(可用 workflow auto-layout <wf> 手动重排)`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
182
207
|
const workflowUrl = `${baseUrl}/sp/workflow/flowpage/create/${workflowId}`;
|
|
183
208
|
// Auto-add 发起 menu (LAYOUT → form create page, triggers bound workflow)
|
|
184
209
|
let menuId = null;
|
|
@@ -256,7 +281,7 @@ export function registerWorkflowCommands(program) {
|
|
|
256
281
|
const baseUrl = auth.getBaseUrl();
|
|
257
282
|
const body = {
|
|
258
283
|
isTemplate: 0,
|
|
259
|
-
belongType: parseInt(cmdOpts.belong)
|
|
284
|
+
belongType: cmdOpts.belong !== undefined && cmdOpts.belong !== '' ? parseInt(cmdOpts.belong) : 1,
|
|
260
285
|
current: parseInt(cmdOpts.pageNo) || 1,
|
|
261
286
|
pageSize: parseInt(cmdOpts.pageSize) || 20,
|
|
262
287
|
searchParams: {
|
|
@@ -2324,18 +2349,70 @@ export function registerWorkflowCommands(program) {
|
|
|
2324
2349
|
const fieldName = parsed.fieldName || '';
|
|
2325
2350
|
const value = String(parsed.value);
|
|
2326
2351
|
const nodeName = parsed.nodeName || '节点';
|
|
2327
|
-
const
|
|
2352
|
+
const client = new ApiClient(auth);
|
|
2353
|
+
const baseUrl = auth.getBaseUrl();
|
|
2354
|
+
// 触发时机(抓包确认):正向离开=after+["1"] / 退回到达=pre+["2"]。
|
|
2355
|
+
// trigger 值:pre(到达) / after 或 leave(正向离开) / back-arrive(退回到达) / delete / save / revert / pause / cancel
|
|
2356
|
+
// trigger 含 '-' 时为时机别名,拆出 triggerType + executeTime;其余直接当 triggerType,executeTime 默认 ["1"]。
|
|
2357
|
+
const rawTrigger = parsed.trigger || 'pre';
|
|
2358
|
+
let triggerType = rawTrigger;
|
|
2359
|
+
let executeTime = ['1'];
|
|
2360
|
+
if (rawTrigger === 'leave' || rawTrigger === 'after') {
|
|
2361
|
+
triggerType = 'after';
|
|
2362
|
+
executeTime = ['1'];
|
|
2363
|
+
}
|
|
2364
|
+
else if (rawTrigger === 'back-arrive' || rawTrigger === 'back') {
|
|
2365
|
+
triggerType = 'pre';
|
|
2366
|
+
executeTime = ['2'];
|
|
2367
|
+
}
|
|
2368
|
+
else if (Array.isArray(parsed.executeTime))
|
|
2369
|
+
executeTime = parsed.executeTime;
|
|
2370
|
+
// Select/SelectMultiple 字段常量赋值 customValue 必须存选项 valueKey:
|
|
2371
|
+
// 流程表单 Select valueKey=序号(0/1/2);eb 表 Select valueKey=雪花id(=selectionId)。
|
|
2372
|
+
// 存选项名会导致设计器打开值空、actionName 值部分被清。
|
|
2373
|
+
// 两类表单字段读取接口不同,需兼容:先 workflow 接口(流程表单),读不到再 eb 接口(eb 表关联流程)。
|
|
2374
|
+
// formId 从 getDisplayLayoutForm 反查(流程表单=formId,eb 表=关联 eb 表 formId)。
|
|
2375
|
+
let customValue = value;
|
|
2376
|
+
try {
|
|
2377
|
+
const dl = await client.get(`${baseUrl}/api/bs/workflow/pathdef/nodeLayout/getDisplayLayoutForm?workflowId=${wf}&nodeId=${nodeId}`);
|
|
2378
|
+
const fid = String(dl?.data?.formId || '');
|
|
2379
|
+
if (fid && parsed.fieldId) {
|
|
2380
|
+
let f = {};
|
|
2381
|
+
// ① workflow 接口(流程表单 Select,valueKey=0/1/2)
|
|
2382
|
+
try {
|
|
2383
|
+
const gf = await client.post(`${baseUrl}/api/workflow/core/form/field/manage/getFormField`, { module: 'workflow', formTableField: { formField: { id: parsed.fieldId, form: { id: fid } } } }, { ebbusinessid: fid });
|
|
2384
|
+
f = gf?.data || {};
|
|
2385
|
+
}
|
|
2386
|
+
catch { /* try eb */ }
|
|
2387
|
+
// ② workflow 接口读不到 options(eb 流程字段在 eb 表)→ eb 接口(valueKey=雪花id)
|
|
2388
|
+
// eb 接口需 customParam:{objId}(用 formId 当 objId 即可读到 options,抓包确认)
|
|
2389
|
+
if (!Array.isArray(f.options) || f.options.length === 0) {
|
|
2390
|
+
try {
|
|
2391
|
+
const gf2 = await client.post(`${baseUrl}/api/ebuilder/form/form/field/manage/getFormField`, { module: 'ebuilderform', customParam: { objId: fid }, formTableField: { formField: { id: parsed.fieldId, form: { id: fid } } } }, { ebbusinessid: fid });
|
|
2392
|
+
f = gf2?.data || {};
|
|
2393
|
+
}
|
|
2394
|
+
catch { /* 保持 */ }
|
|
2395
|
+
}
|
|
2396
|
+
if (/select/i.test(String(f.type || f.componentKey || ''))) {
|
|
2397
|
+
const opts = Array.isArray(f.options) ? f.options : [];
|
|
2398
|
+
const hit = opts.find((o) => o.name === value);
|
|
2399
|
+
if (hit)
|
|
2400
|
+
customValue = String(hit.valueKey);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
catch { /* 解析失败保持原值(非 Select 或字段读不到) */ }
|
|
2328
2405
|
payload = {
|
|
2329
2406
|
workflowId: wf, objId: nodeId, triggerType: 'all',
|
|
2330
2407
|
data: [{
|
|
2331
2408
|
id: tempIdNeg(),
|
|
2332
2409
|
actionName: `${fieldName} = ${value}`.trim(),
|
|
2333
|
-
executeTime:
|
|
2334
|
-
dateRuleStr: '', triggerType:
|
|
2410
|
+
executeTime: executeTime, open: true, async: 0, actionType: 0,
|
|
2411
|
+
dateRuleStr: '', triggerType: triggerType, order: 0,
|
|
2335
2412
|
targetValue: parsed.fieldId,
|
|
2336
2413
|
firstValue: 'custom',
|
|
2337
2414
|
operatorValue: '', secondValue: '',
|
|
2338
|
-
customValue
|
|
2415
|
+
customValue,
|
|
2339
2416
|
dateRule: [], isCreate: false,
|
|
2340
2417
|
}],
|
|
2341
2418
|
isNodeFlag: '1', objName: nodeName,
|