@steedos-labs/plugin-workflow 3.0.56 → 3.0.58

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.
@@ -5,7 +5,7 @@
5
5
  <link rel="shortcut icon" type="image/svg+xml" href="/images/logo.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>designer</title>
8
- <script type="module" crossorigin src="/api/workflow/designer-v2/assets/index-B9naSD1C.js"></script>
8
+ <script type="module" crossorigin src="/api/workflow/designer-v2/assets/index-0cQynRDB.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/api/workflow/designer-v2/assets/index-DEEcIiu0.css">
10
10
  </head>
11
11
  <body>
@@ -17,65 +17,9 @@ amis_schema: |-
17
17
  "title": "${'CustomAction.instances.instance_related' | t}",
18
18
  "body": [
19
19
  {
20
- "type": "form",
21
- "data": {
22
- "initApiFinished": false,
23
- "appId": "${app_id}"
24
- },
25
- "body": [
26
- {
27
- "type": "steedos-field",
28
- "config": {
29
- "type": "lookup",
30
- "label": "字段1",
31
- "name": "related_instances",
32
- "id": "u:ff88cc3375b5",
33
- "reference_to": "instances",
34
- "pickerSchema": {
35
- "rowClassNameExpr": "<%= data.__selected === true ? 'hidden' : '' %>",
36
- "perPage": 20
37
- },
38
- "searchable_default": {
39
- "submit_date": "${[STARTOF(DATEMODIFY(NOW(), -180, 'day'), 'day'),ENDOF(NOW(), 'day')]}"
40
- },
41
- "amis": {
42
- "id": "u:f0273e374d19",
43
- "embed": true,
44
- "label": false,
45
- "multiple": true,
46
- "visibleOn": "initApiFinished == true",
47
- "labelField": "name",
48
- "valueField": "_id",
49
- "menuTpl": null,
50
- "source": {
51
- "method": "post",
52
- "url": "${context.rootUrl}/graphql",
53
- "requestAdaptor": "var searchableDefaultConfig = {\"submit_date\": \"${[STARTOF(DATEMODIFY(NOW(), -180, 'day'), 'day'),ENDOF(NOW(), 'day')]}\"};\nvar filterFormValues = JSON.parse(JSON.stringify(searchableDefaultConfig));\nif (_.isObject(filterFormValues)) {\n _.each(filterFormValues, function(v, k) {\n var isAmisFormulaValue = typeof v === \"string\" && v.indexOf(\"${\") > -1;\n if (isAmisFormulaValue) {\n filterFormValues[k] = AmisCore.evaluate(v, context);\n }\n });\n var fields = api.data.$self.uiSchema && api.data.$self.uiSchema.fields;\n filterFormValues = SteedosUI.getSearchFilterFormValues(filterFormValues, fields);\n}\nvar selfData = JSON.parse(JSON.stringify(api.data.$self));\nvar searchableFilter = SteedosUI.getSearchFilter(Object.assign({}, filterFormValues, selfData)) || []; const { pageNo, pageSize, keywords = '' } = api.data;\nvar keywordsFilters = SteedosUI.getKeywordsSearchFilter(api.data.$self.__keywords_lookup__related_instances__to__instances, [\"name\", \"flow_name\",\"submitter\",\"submit_date\"]);\nif (keywordsFilters && keywordsFilters.length > 0) {\n searchableFilter.push(keywordsFilters);\n}\nconsole.log(\"===\", JSON.stringify(api.data));\napi.data = {\n query: `\n query{\n rows: instances__getRelatedInstances(keywords: \"${keywords}\", top: ${pageSize || 20}, skip: ${(pageNo - 1) * pageSize}, filters: ${JSON.stringify(searchableFilter)}){\n _id,\n name,\n flow_name,\n submit_date,\n submitter\n _display:_ui{\n submit_date,\n submitter\n }\n },\n count: instances__getRelatedInstances__count(filters: ${JSON.stringify(searchableFilter)}, keywords: \"${keywords}\")\n }\n `\n};\nreturn api;",
54
- "headers": {
55
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
56
- },
57
- "adaptor": "payload.data.rows = payload.data.rows?.concat(api.body.$self.selectedRelatedInstances || []); return payload",
58
- "data": {
59
- "orderBy": "${orderBy}",
60
- "orderDir": "${orderDir}",
61
- "pageNo": "${page}",
62
- "pageSize": 20,
63
- "$self": "$$",
64
- "keywords": "${keywords}",
65
- "ids": "${ids}"
66
- }
67
- }
68
- }
69
- },
70
- "id": "u:774bdcbde030"
71
- }
72
- ],
73
- "initApi": {
74
- "method": "post",
75
- "url": "${context.rootUrl}/graphql",
76
- "requestAdaptor": "const { _id: recordId } = api.data.record;\napi.data = {\n query:`\n {\n instance: instances__findOne(id:\"${recordId}\"){\n related_instances: related_instances__expand{\n _id,\n name\n }\n }\n }\n `\n }\n return api;",
77
- "adaptor": "payload.data = {initApiFinished: true, \n related_instances: _.map(payload.data.instance?.related_instances, '_id'),\n selectedRelatedInstances: _.map(payload.data.instance?.related_instances, (item)=>{item.__selected=true;return item})};console.log('====payload', payload);\nreturn payload;"
78
- }
20
+ "type": "antd-related-instances",
21
+ "name": "related_instances",
22
+ "id": "u:ff88cc3375b5"
79
23
  }
80
24
  ],
81
25
  "id": "u:47c202e8149b",
@@ -35,5 +35,6 @@ extra_columns:
35
35
  - extras
36
36
  - values
37
37
  disableSwitch: true
38
- searchable_default:
39
- submit_date: "${[STARTOF(DATEMODIFY(NOW(), -180, 'day'), 'day'),ENDOF(NOW(), 'day')]}"
38
+ # filter_required: true
39
+ # searchable_default:
40
+ # submit_date: "${[STARTOF(DATEMODIFY(NOW(), -180, 'day'), 'day'),ENDOF(NOW(), 'day')]}"
@@ -37,7 +37,7 @@
37
37
  "actions": [
38
38
  {
39
39
  "actionType": "custom",
40
- "script": "if(event.data.value){$('.instance-file-list').show()}else{$('.instance-file-list').hide()}"
40
+ "script": "if(event.data.value){$('.instance-file-list').show(); $('.instance-related-list').show()}else{$('.instance-file-list').hide(); $('.instance-related-list').hide()}"
41
41
  }
42
42
  ]
43
43
  }
@@ -47,6 +47,7 @@
47
47
  "name": "his",
48
48
  "type": "checkbox",
49
49
  "id": "u:his",
50
+ "value": true,
50
51
  "label": false,
51
52
  "option": "签核历程",
52
53
  "mode": "inline",
@@ -55,7 +56,7 @@
55
56
  "actions": [
56
57
  {
57
58
  "actionType": "custom",
58
- "script": "if(event.data.value){$('.instance-approve-history').show()}else{doAction({actionType: 'setValue', componentId: 'u:mini', args: {value: false}});$('.instance-approve-history').hide()}"
59
+ "script": "if(event.data.value){$('.instance-approve-history').show()}else{doAction({actionType: 'setValue', componentId: 'u:mini', args: {value: false}});if(window._simplifyApprovalHistory)window._simplifyApprovalHistory(false);$('.instance-approve-history').hide()}"
59
60
  }
60
61
  ]
61
62
  }
@@ -73,7 +74,7 @@
73
74
  "actions": [
74
75
  {
75
76
  "actionType": "custom",
76
- "script": "if(event.data.value){doAction({actionType: 'setValue', componentId: 'u:his', args: {value: true}}); $('.steedos-amis-instance-view').addClass('simplify-traces'); $('.instance-approve-history').show()}else{$('.steedos-amis-instance-view').removeClass('simplify-traces');}"
77
+ "script": "if(event.data.value){doAction({actionType: 'setValue', componentId: 'u:his', args: {value: true}});$('.instance-approve-history').show();setTimeout(function(){if(window._simplifyApprovalHistory)window._simplifyApprovalHistory(true);},200);}else{if(window._simplifyApprovalHistory)window._simplifyApprovalHistory(false);}"
77
78
  }
78
79
  ]
79
80
  }
@@ -106,7 +107,7 @@
106
107
  "actions": [
107
108
  {
108
109
  "actionType": "custom",
109
- "script": "doAction({actionType: 'setValue', componentId: 'u:print-width', args: {value: Number(event.data.value)}}); $('.steedos-instance-related-view-wrapper .instance-form').css('width', event.data.value + 'mm'); $('.steedos-instance-related-view-wrapper .instance-approve-history').css('width', event.data.value + 'mm');"
110
+ "script": "doAction({actionType: 'setValue', componentId: 'u:print-width', args: {value: Number(event.data.value)}}); $('.steedos-instance-related-view-wrapper .instance-form').css('width', event.data.value + 'mm'); $('.steedos-instance-related-view-wrapper .instance-approve-history').css('width', event.data.value + 'mm'); var orientation = event.data.value === '277' ? 'landscape' : 'portrait'; var styleEl = document.getElementById('print-page-orientation'); if (!styleEl) { styleEl = document.createElement('style'); styleEl.id = 'print-page-orientation'; document.head.appendChild(styleEl); } styleEl.textContent = '@page { size: A4 ' + orientation + '; }';"
110
111
  }
111
112
  ]
112
113
  }
@@ -289,14 +290,19 @@
289
290
  "padding-left": "10px"
290
291
  },
291
292
  ".instance-approve-history": {
292
- "display": "none"
293
293
  },
294
294
  ".instance-file-list": {
295
295
  "display": "none"
296
296
  },
297
+ ".instance-file-list .no-print": {
298
+ "display": "none !important"
299
+ },
297
300
  ".instance-related-list": {
298
301
  "display": "none"
299
302
  },
303
+ ".instance-related-list .no-print": {
304
+ "display": "none !important"
305
+ },
300
306
  ".antd-Form-star":{
301
307
  "display": "none !important"
302
308
  },
@@ -312,45 +318,6 @@
312
318
  ".steedos-instance-print-wrapper .instance-template .table-page-body": {
313
319
  "width": "100%"
314
320
  },
315
- ".simplify-traces .step-type-start":{
316
- "display": "none !important"
317
- },
318
- ".simplify-traces .step-type-end":{
319
- "display": "none !important"
320
- },
321
- ".simplify-traces .rejected": {
322
- "display": "none !important"
323
- },
324
- ".simplify-traces .relocated": {
325
- "display": "none !important"
326
- },
327
- ".simplify-traces .retrieved": {
328
- "display": "none !important"
329
- },
330
- ".simplify-traces .returned": {
331
- "display": "none !important"
332
- },
333
- ".simplify-traces .approve-judge-reassigned": {
334
- "display": "none !important"
335
- },
336
- ".simplify-traces .approve-judge-retrieved": {
337
- "display": "none !important"
338
- },
339
- ".simplify-traces .approve-judge-returned": {
340
- "display": "none !important"
341
- },
342
- ".simplify-traces .approve-judge-rejected": {
343
- "display": "none !important"
344
- },
345
- ".simplify-traces approve-type-cc": {
346
- "display": "none !important"
347
- },
348
- ".simplify-traces approve-type-distribute": {
349
- "display": "none !important"
350
- },
351
- ".simplify-traces approve-type-forward": {
352
- "display": "none !important"
353
- },
354
321
  ".text-muted": {
355
322
  "display": "none !important"
356
323
  },
@@ -429,7 +396,11 @@
429
396
  "actions": [
430
397
  {
431
398
  "actionType": "custom",
432
- "script": "document.querySelectorAll('link[rel=\"stylesheet\"]').forEach(link => { if (link.href.includes('salesforce-lightning-design-system.min.css')) { link.remove(); } });"
399
+ "script": "document.querySelectorAll('link[rel=\"stylesheet\"]').forEach(link => { if (link.href.includes('salesforce-lightning-design-system.min.css')) { link.remove(); } }); var styleEl = document.createElement('style'); styleEl.id = 'print-page-orientation'; styleEl.textContent = '@page { size: A4 portrait; }'; document.head.appendChild(styleEl);"
400
+ },
401
+ {
402
+ "actionType": "custom",
403
+ "script": "window._simplifyApprovalHistory=function(enable){var c=document.querySelector('.instance-approve-history');if(!c)return;var prev=c.querySelector('.simplify-clone');if(prev)prev.remove();var orig=c.querySelector('table:not(.simplify-clone)');if(!orig)return;if(!enable){orig.style.display='';return;}var t=orig.cloneNode(true);t.classList.add('simplify-clone');var tb=t.querySelector('tbody');if(!tb)return;var rows=Array.from(tb.children);var hc=['step-type-start','step-type-end','approve-judge-reassigned','approve-judge-retrieved','approve-judge-returned','approve-judge-rejected','approve-type-cc','approve-type-distribute','approve-type-forward'];function sh(r){for(var j=0;j<hc.length;j++)if(r.classList.contains(hc[j]))return true;return false;}var i=0;while(i<rows.length){var r=rows[i];var ft=r.cells&&r.cells[0];var rs=ft?parseInt(ft.getAttribute('rowspan')||'0'):0;if(rs>1){var tr=rows.slice(i,i+rs);var cn=rs/2,vc=0,fvr=null,rm=[];var sn=ft;for(var cc=0;cc<cn;cc++){var r1=tr[cc*2],r2=tr[cc*2+1];if(r1&&sh(r1)){rm.push(r1);if(r2)rm.push(r2);}else{vc++;if(!fvr)fvr=r1;}}rm.forEach(function(x){x.remove();});if(vc>0){var nrs=vc*2;if(fvr===tr[0]){sn.setAttribute('rowspan',nrs);}else{var nsn=sn.cloneNode(true);nsn.setAttribute('rowspan',nrs);fvr.insertBefore(nsn,fvr.firstChild);}}i+=rs;}else{if(sh(r))r.remove();i++;}}orig.style.display='none';c.appendChild(t);};"
433
404
  }
434
405
  ]
435
406
  }
@@ -30,7 +30,7 @@ router.get('/api/workflow/instances/redirect/:insId', requireAuthentication, asy
30
30
  if(ins.submitter === userId){
31
31
  redirectUrl = `/app/approve_workflow/instances/view/${insId}?side_object=instance_tasks&side_listview_id=${ins.state === 'completed' ? 'completed' : 'pending'}`
32
32
  }else{
33
- redirectUrl = `/app/approve_workflow/instances/view/${insId}?side_object=instance_tasks&side_listview_id=outbox`
33
+ redirectUrl = `/app/approve_workflow/instance_tasks/view/${insId}?side_object=instance_tasks&side_listview_id=outbox`
34
34
  }
35
35
  }
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos-labs/plugin-workflow",
3
- "version": "3.0.56",
3
+ "version": "3.0.58",
4
4
  "main": "package.service.js",
5
5
  "license": "MIT",
6
6
  "files": [