@steedos-labs/plugin-workflow 3.0.71 → 3.0.73

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,8 +5,8 @@
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-BJi-ur8P.js"></script>
9
- <link rel="stylesheet" crossorigin href="/api/workflow/designer-v2/assets/index-CCteZgEe.css">
8
+ <script type="module" crossorigin src="/api/workflow/designer-v2/assets/index-BfCqQeh8.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/api/workflow/designer-v2/assets/index-B0B00DHJ.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
@@ -1,5 +1,5 @@
1
1
  waitForThing(window, 'antd').then(function(){
2
- var v = '20260505';
2
+ var v = '3.0.73';
3
3
  loadJs('/amis-renderer/amis-renderer.js?v=' + v);
4
4
  loadCss('/amis-renderer/amis-renderer.css?v=' + v)
5
5
  })
@@ -130,7 +130,7 @@ async function exportForm(formId, flowId, is_copy, company_id) {
130
130
  const field = c_fields.find(f => f.name === fieldName && f.type === 'select');
131
131
 
132
132
  if (field) {
133
- const options = field.options.split("\n");
133
+ const options = _.isArray(field.options) ? field.options.map(o => (o.value ? `${o.label}:${o.value}` : o.label)) : field.options.split("\n");
134
134
  const rule_names = options.map(o => o.split(":")[1] || o.split(":")[0]);
135
135
 
136
136
  for (const rule_name of rule_names) {
@@ -1768,6 +1768,28 @@ UUFlowManager.handleSkipProcessed = async function (instance_id, flow, maxDepth
1768
1768
  const lastTrace = _.last(instance.traces);
1769
1769
  if (!lastTrace || lastTrace.is_finished) return;
1770
1770
 
1771
+ // 环境变量控制滑步模式:是否仅连续步骤才滑步,默认 false(允许间隔步骤滑步,即现有行为)
1772
+ const consecutiveOnly = process.env.STEEDOS_WORKFLOW_SKIP_CONSECUTIVE_ONLY;
1773
+ let effectiveProcessedUserIds = processedUserIds;
1774
+ if (consecutiveOnly === 'true' || consecutiveOnly === '1') {
1775
+ // 仅连续步骤模式:只检查紧邻的上一步骤的处理人
1776
+ const previousTraceIds = lastTrace.previous_trace_ids || [];
1777
+ const previousTraces = (instance.traces || []).filter(t => previousTraceIds.includes(t._id));
1778
+ effectiveProcessedUserIds = [];
1779
+ for (const prevTrace of previousTraces) {
1780
+ if (prevTrace.approves) {
1781
+ for (const approve of prevTrace.approves) {
1782
+ if (isNormalApprove(approve) && approve.is_finished && approve.judge !== 'skipped') {
1783
+ if (!effectiveProcessedUserIds.includes(approve.user)) {
1784
+ effectiveProcessedUserIds.push(approve.user);
1785
+ }
1786
+ }
1787
+ }
1788
+ }
1789
+ }
1790
+ if (effectiveProcessedUserIds.length === 0) return;
1791
+ }
1792
+
1771
1793
  // Get the step definition for this trace
1772
1794
  let step;
1773
1795
  try {
@@ -1788,7 +1810,7 @@ UUFlowManager.handleSkipProcessed = async function (instance_id, flow, maxDepth
1788
1810
  if (normalApproves.length === 0) return;
1789
1811
 
1790
1812
  // Check which users should be skipped
1791
- const shouldSkipApproves = normalApproves.filter(a => processedUserIds.includes(a.user));
1813
+ const shouldSkipApproves = normalApproves.filter(a => effectiveProcessedUserIds.includes(a.user));
1792
1814
 
1793
1815
  if (shouldSkipApproves.length === 0) return;
1794
1816
 
@@ -2067,7 +2089,7 @@ UUFlowManager.handleSkipProcessed = async function (instance_id, flow, maxDepth
2067
2089
 
2068
2090
  for (let h = 0; h < lastTrace.approves.length; h++) {
2069
2091
  const approve = lastTrace.approves[h];
2070
- if (processedUserIds.includes(approve.user) && isNormalApprove(approve)) {
2092
+ if (effectiveProcessedUserIds.includes(approve.user) && isNormalApprove(approve)) {
2071
2093
  setObj[`traces.${traceIdx}.approves.${h}.is_finished`] = true;
2072
2094
  setObj[`traces.${traceIdx}.approves.${h}.finish_date`] = now;
2073
2095
  setObj[`traces.${traceIdx}.approves.${h}.judge`] = 'skipped';
@@ -24,6 +24,7 @@ amis_schema: |-
24
24
  {
25
25
  "dialog": {
26
26
  "type": "dialog",
27
+ "useMobileUI": false,
27
28
  "className": "instance-action-dialog",
28
29
  "title": "${'instance_action_instance_relocate_dialog_title' | t}",
29
30
  "body": [
@@ -34,8 +35,15 @@ amis_schema: |-
34
35
  {
35
36
  "type": "form",
36
37
  "title": "表单",
37
- "mode": "normal",
38
+ "mode": "vertical",
38
39
  "body": [
40
+ {
41
+ "type": "tpl",
42
+ "tpl": "<style>.antd-Modal .antd-Form-item--normal .antd-SelectControl{width:100%}</style>",
43
+ "inline": false,
44
+ "wrapperComponent": "",
45
+ "className": "hidden"
46
+ },
39
47
  {
40
48
  "type": "tpl",
41
49
  "tpl": "${'instance_action_instance_relocate_dialog_title_prefix' | t} <p class='font-medium inline'>${record.currentStep.name}</p>",
@@ -52,6 +60,7 @@ amis_schema: |-
52
60
  "multiple": false,
53
61
  "required": true,
54
62
  "searchable": true,
63
+ "useMobileUI": false,
55
64
  "source": "${stepsOption}",
56
65
  "onEvent": {
57
66
  "change": {
@@ -78,7 +87,7 @@ amis_schema: |-
78
87
  "minRows": 3,
79
88
  "maxRows": 20,
80
89
  "description": "${'instance_action_instance_relocate_dialog_field_reason' | t}",
81
- "className": "mt-3"
90
+ "className": "mt-0"
82
91
  }
83
92
  ],
84
93
  "id": "u:1779a48caedb",
@@ -152,6 +152,10 @@
152
152
  // }
153
153
  // });
154
154
 
155
+ if (Array.isArray(field.options)) {
156
+ return field.options;
157
+ }
158
+
155
159
  const splitItem = field.options.split("\n");
156
160
  splitItem.forEach(item => {
157
161
  var foo = item.split(":");
@@ -201,13 +201,13 @@ router.post('/api/workflow/forward', requireAuthentication, async function (req,
201
201
  var key = f.code;
202
202
  var old_v = old_values[key];
203
203
  if (old_v != null) {
204
- var fieldOptions = f.options && f.options.split && f.options.split("\n").map(function (n) {
204
+ var fieldOptions = _.isArray(f.options) ? f.options : (f.options && f.options.split && f.options.split("\n").map(function (n) {
205
205
  var itemSplits = n.split(":");
206
206
  return {
207
207
  label: itemSplits[0],
208
208
  value: itemSplits[1] || n
209
209
  }
210
- });
210
+ }));
211
211
  // 校验 单选,多选,下拉框 字段值是否在新表单对应字段的可选值范围内
212
212
  if (f.type == 'select' || f.type == 'radio') {
213
213
  var selectedOption = fieldOptions.find(function (item) {
@@ -243,13 +243,13 @@ router.post('/api/workflow/forward', requireAuthentication, async function (req,
243
243
  var key = f.code;
244
244
  var old_v = old_table_row_values[key];
245
245
  if (old_v != null) {
246
- var fieldOptions = f.options && f.options.split && f.options.split("\n").map(function (n) {
246
+ var fieldOptions = _.isArray(f.options) ? f.options : (f.options && f.options.split && f.options.split("\n").map(function (n) {
247
247
  var itemSplits = n.split(":");
248
248
  return {
249
249
  label: itemSplits[0],
250
250
  value: itemSplits[1] || n
251
251
  }
252
- });
252
+ }));
253
253
  // 校验 单选,多选,下拉框 字段值是否在新表单对应字段的可选值范围内
254
254
  if (f.type == 'select' || f.type == 'radio') {
255
255
  var selectedOption = fieldOptions.find(function (item) {
@@ -289,13 +289,13 @@ router.post('/api/workflow/forward', requireAuthentication, async function (req,
289
289
  var old_v = old_values[key];
290
290
  if (old_v != null) {
291
291
  // 校验 单选,多选,下拉框 字段值是否在新表单对应字段的可选值范围内
292
- var fieldOptions = field.options && field.options.split && field.options.split("\n").map(function (n) {
292
+ var fieldOptions = _.isArray(field.options) ? field.options : (field.options && field.options.split && field.options.split("\n").map(function (n) {
293
293
  var itemSplits = n.split(":");
294
294
  return {
295
295
  label: itemSplits[0],
296
296
  value: itemSplits[1] || n
297
297
  }
298
- });
298
+ }));
299
299
  if (field.type == 'select' || field.type == 'radio') {
300
300
  var selectedOption = fieldOptions.find(function (item) {
301
301
  return item.value === old_v;
@@ -259,7 +259,7 @@ router.post("/api/workflow/v2/instance/forward", requireAuthentication, async fu
259
259
  const key = f.code;
260
260
  let old_v = old_table_row_values[key];
261
261
  if (old_v != null) {
262
- const fieldOptions = f.options?.split("\n").map(n => {
262
+ const fieldOptions = _.isArray(f.options) ? f.options : f.options?.split("\n").map(n => {
263
263
  const itemSplits = n.split(":");
264
264
  return {
265
265
  label: itemSplits[0],
@@ -247,6 +247,10 @@
247
247
  // }
248
248
  // });
249
249
 
250
+ if (Array.isArray(field.options)) {
251
+ return field.options;
252
+ }
253
+
250
254
  const splitItem = field.options.split("\n");
251
255
  splitItem.forEach(item => {
252
256
  var foo = item.split(":");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos-labs/plugin-workflow",
3
- "version": "3.0.71",
3
+ "version": "3.0.73",
4
4
  "main": "package.service.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -19,7 +19,8 @@
19
19
  "scripts": {
20
20
  "build:watch": "tsc --watch",
21
21
  "build:designer": "cd designer && npm run build:all",
22
- "release": "npm run build:designer && npm publish --registry https://registry.npmjs.org && npx cnpm sync @steedos-labs/plugin-workflow",
22
+ "stamp-version": "node -e \"var fs=require('fs'),v=require('./package.json').version,f='main/default/client/flow2_render.client.js';fs.writeFileSync(f,fs.readFileSync(f,'utf8').replace(/var v = '[^']*'/,\\\"var v = '\\\"+v+\\\"'\\\"))\"",
23
+ "release": "npm run build:designer && npm run stamp-version && npm publish --registry https://registry.npmjs.org && npx cnpm sync @steedos-labs/plugin-workflow",
23
24
  "export-templates": "node run.js export",
24
25
  "convert-templates": "node convert-templates.js",
25
26
  "test:formula-compat": "node main/default/test/test_formula_compat.js"