@steedos-labs/plugin-workflow 3.0.0-beta.28 → 3.0.0-beta.30

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.
@@ -1,7 +1,8 @@
1
- // Steedos.authRequest("/api/workflow/v2/get_object_workflows", {
2
- // type: 'get',
3
- // success: (data)=>{
4
- // window.Creator.object_workflows = data;
5
- // Creator.dataInit.set(true);
6
- // }
7
- // });
1
+ waitForThing(Builder, 'settings.context.user.authToken').then(function(){
2
+ Steedos.authRequest("/api/workflow/v2/get_object_workflows", {
3
+ type: 'get',
4
+ success: (data)=>{
5
+ window.Steedos.object_workflows = data;
6
+ }
7
+ });
8
+ })
@@ -295,6 +295,19 @@ async function objectWorkflow(spaceId, flowId, objectName, doc) {
295
295
  }
296
296
  }
297
297
 
298
+ // 如果没有name字段,则给name赋值code
299
+ function addFieldName(fields) {
300
+ return _.map(fields, function (f) {
301
+ if (!f.name && f.code) {
302
+ f.name = f.code;
303
+ }
304
+ if (f.type === 'section' || f.type === 'table') {
305
+ f.fields = addFieldName(f.fields);
306
+ }
307
+ return f;
308
+ });
309
+ }
310
+
298
311
  async function workflow(uid, spaceId, form, enabled, company_id, options = {}) {
299
312
  const { upgrade = false, formId: upgradeFormId, flowId: upgradeFlowId } = options;
300
313
  const new_form_ids = [];
@@ -395,6 +408,8 @@ async function workflow(uid, spaceId, form, enabled, company_id, options = {}) {
395
408
  form.modified = form.created;
396
409
  form.modified_by = uid;
397
410
  form.historys = [];
411
+
412
+ const fields = addFieldName(form.current?.fields || []);
398
413
 
399
414
  form.current = {
400
415
  _id: _makeNewID(),
@@ -404,7 +419,7 @@ async function workflow(uid, spaceId, form, enabled, company_id, options = {}) {
404
419
  created_by: uid,
405
420
  modified: new Date(),
406
421
  modified_by: uid,
407
- fields: form.current?.fields || [],
422
+ fields: fields,
408
423
  form_script: form.current?.form_script || '',
409
424
  name_forumla: form.current?.name_forumla || ''
410
425
  };
@@ -1,22 +1,10 @@
1
1
  /*
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2022-12-20 14:49:06
4
- * @LastEditors: sunhaolin@hotoa.com
5
- * @LastEditTime: 2022-12-28 15:31:18
4
+ * @LastEditors: 孙浩林 sunhaolin@steedos.com
5
+ * @LastEditTime: 2025-10-03 14:58:33
6
6
  * @Description:
7
7
  */
8
- require('./approve_manager')
9
- require('./export')
10
- require('./flow_manager')
11
- require('./form_manager')
12
- require('./get_handlers_manager')
13
- require('./import')
14
- require('./instance_manager')
15
- require('./permission_manager')
16
- require('./push_manager')
17
- require('./step_manager')
18
- require('./uuflow_manager')
19
- require('./workflow_manager')
20
8
 
21
9
  module.exports = {
22
10
  instance_tasks_manager: require('./instance_tasks_manager')