@nocobase/plugin-workflow 0.10.1-alpha.1 → 0.11.1-alpha.1
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/client.d.ts +2 -3
- package/client.js +1 -30
- package/lib/client/AddButton.js +13 -11
- package/lib/client/Branch.js +10 -8
- package/lib/client/CanvasContent.js +12 -10
- package/lib/client/ExecutionCanvas.js +37 -33
- package/lib/client/ExecutionPage.js +4 -9
- package/lib/client/WorkflowCanvas.js +18 -15
- package/lib/client/WorkflowPage.js +4 -9
- package/lib/client/WorkflowProvider.js +1 -40
- package/lib/client/components/CollectionBlockInitializer.js +3 -3
- package/lib/client/components/CollectionFieldset.d.ts +1 -1
- package/lib/client/components/CollectionFieldset.js +15 -16
- package/lib/client/components/Duration.js +5 -5
- package/lib/client/components/DynamicExpression.d.ts +3 -3
- package/lib/client/components/FieldsSelect.d.ts +1 -1
- package/lib/client/components/FieldsSelect.js +10 -7
- package/lib/client/components/NodeDescription.js +45 -31
- package/lib/client/components/RadioWithTooltip.js +13 -20
- package/lib/client/components/ValueBlock.js +14 -21
- package/lib/client/components/renderEngineReference.js +1 -8
- package/lib/client/index.d.ts +12 -4
- package/lib/client/index.js +78 -15
- package/lib/client/locale/zh-CN.d.ts +5 -1
- package/lib/client/locale/zh-CN.js +6 -2
- package/lib/client/nodes/aggregate.d.ts +8 -3
- package/lib/client/nodes/aggregate.js +5 -4
- package/lib/client/nodes/calculation.d.ts +6 -4
- package/lib/client/nodes/calculation.js +22 -28
- package/lib/client/nodes/condition.d.ts +2 -10
- package/lib/client/nodes/condition.js +19 -37
- package/lib/client/nodes/create.d.ts +5 -6
- package/lib/client/nodes/create.js +1 -3
- package/lib/client/nodes/destroy.d.ts +1 -1
- package/lib/client/nodes/index.d.ts +2 -3
- package/lib/client/nodes/index.js +95 -102
- package/lib/client/nodes/loop.d.ts +1 -1
- package/lib/client/nodes/loop.js +46 -54
- package/lib/client/nodes/manual/FormBlockInitializer.js +6 -5
- package/lib/client/nodes/manual/ModeConfig.js +23 -30
- package/lib/client/nodes/manual/SchemaConfig.d.ts +4 -5
- package/lib/client/nodes/manual/SchemaConfig.js +180 -25
- package/lib/client/nodes/manual/WorkflowTodo.js +95 -110
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +2 -5
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +6 -5
- package/lib/client/nodes/manual/forms/create.js +8 -1
- package/lib/client/nodes/manual/forms/custom.js +22 -22
- package/lib/client/nodes/manual/forms/update.js +8 -1
- package/lib/client/nodes/manual/index.d.ts +6 -1
- package/lib/client/nodes/manual/index.js +5 -4
- package/lib/client/nodes/parallel.js +23 -20
- package/lib/client/nodes/query.d.ts +3 -5
- package/lib/client/nodes/query.js +1 -3
- package/lib/client/nodes/request.d.ts +2 -2
- package/lib/client/nodes/request.js +7 -7
- package/lib/client/nodes/sql.d.ts +26 -0
- package/lib/client/{triggers/schedule/DateFieldsSelect.js → nodes/sql.js} +37 -46
- package/lib/client/nodes/update.d.ts +2 -2
- package/lib/client/nodes/update.js +1 -1
- package/lib/client/schemas/collection.d.ts +3 -4
- package/lib/client/schemas/collection.js +11 -17
- package/lib/client/style.d.ts +18 -13
- package/lib/client/style.js +315 -292
- package/lib/client/triggers/collection.d.ts +13 -13
- package/lib/client/triggers/collection.js +5 -1
- package/lib/client/triggers/index.d.ts +3 -4
- package/lib/client/triggers/index.js +51 -53
- package/lib/client/triggers/schedule/EndsByField.js +11 -11
- package/lib/client/triggers/schedule/OnField.js +45 -33
- package/lib/client/triggers/schedule/RepeatField.js +4 -4
- package/lib/client/triggers/schedule/ScheduleConfig.js +24 -31
- package/lib/client/triggers/schedule/index.d.ts +1 -1
- package/lib/client/triggers/schedule/index.js +32 -20
- package/lib/client/variable.d.ts +31 -13
- package/lib/client/variable.js +44 -29
- package/lib/server/Plugin.d.ts +3 -6
- package/lib/server/Plugin.js +15 -12
- package/lib/server/Processor.d.ts +3 -5
- package/lib/server/Processor.js +2 -2
- package/lib/server/actions/nodes.js +7 -7
- package/lib/server/fields/expression-field.d.ts +1 -2
- package/lib/server/fields/expression-field.js +1 -8
- package/lib/server/functions/index.d.ts +2 -3
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +12 -0
- package/lib/server/instructions/aggregate.d.ts +1 -1
- package/lib/server/instructions/aggregate.js +5 -5
- package/lib/server/instructions/condition.d.ts +2 -1
- package/lib/server/instructions/create.d.ts +2 -2
- package/lib/server/instructions/create.js +13 -13
- package/lib/server/instructions/delay.d.ts +3 -3
- package/lib/server/instructions/delay.js +66 -64
- package/lib/server/instructions/destroy.d.ts +1 -1
- package/lib/server/instructions/index.d.ts +5 -5
- package/lib/server/instructions/index.js +1 -1
- package/lib/server/instructions/loop.d.ts +1 -2
- package/lib/server/instructions/manual/actions.js +19 -7
- package/lib/server/instructions/manual/forms/create.js +7 -1
- package/lib/server/instructions/manual/forms/index.d.ts +1 -1
- package/lib/server/instructions/manual/forms/update.js +7 -1
- package/lib/server/instructions/manual/index.d.ts +1 -1
- package/lib/server/instructions/parallel.d.ts +1 -2
- package/lib/server/instructions/query.d.ts +1 -1
- package/lib/server/instructions/query.js +8 -1
- package/lib/server/instructions/request.d.ts +3 -3
- package/lib/server/instructions/request.js +5 -2
- package/lib/server/instructions/sql.d.ts +12 -0
- package/lib/server/instructions/sql.js +34 -0
- package/lib/server/instructions/update.d.ts +1 -1
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -1
- package/lib/server/migrations/20230221121203-condition-calculation.js +1 -1
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +7 -7
- package/lib/server/migrations/20230411034722-manual-multi-form.js +1 -8
- package/lib/server/migrations/20230710115902-manual-action-values.d.ts +4 -0
- package/lib/server/migrations/20230710115902-manual-action-values.js +97 -0
- package/lib/server/triggers/collection.d.ts +1 -1
- package/lib/server/triggers/collection.js +15 -13
- package/lib/server/triggers/index.d.ts +1 -1
- package/lib/server/triggers/schedule.d.ts +1 -1
- package/lib/server/triggers/schedule.js +18 -18
- package/lib/server/{models → types}/Execution.d.ts +2 -3
- package/lib/server/{models → types}/FlowNode.d.ts +1 -2
- package/lib/server/{models → types}/Job.d.ts +1 -2
- package/lib/server/{models → types}/Workflow.d.ts +1 -2
- package/lib/server/types/index.d.ts +4 -0
- package/lib/server/types/index.js +5 -0
- package/lib/server/utils.d.ts +2 -0
- package/lib/server/utils.js +21 -0
- package/package.json +39 -18
- package/server.d.ts +2 -3
- package/server.js +1 -30
- package/src/client/AddButton.tsx +111 -0
- package/src/client/Branch.tsx +37 -0
- package/src/client/CanvasContent.tsx +25 -0
- package/src/client/ExecutionCanvas.tsx +166 -0
- package/src/client/ExecutionLink.tsx +16 -0
- package/src/client/ExecutionPage.tsx +45 -0
- package/src/client/ExecutionResourceProvider.tsx +21 -0
- package/src/client/FlowContext.ts +7 -0
- package/src/client/WorkflowCanvas.tsx +221 -0
- package/src/client/WorkflowLink.tsx +16 -0
- package/src/client/WorkflowPage.tsx +52 -0
- package/src/client/WorkflowProvider.tsx +84 -0
- package/src/client/components/CollectionBlockInitializer.tsx +71 -0
- package/src/client/components/CollectionFieldset.tsx +160 -0
- package/src/client/components/Duration.tsx +45 -0
- package/src/client/components/DynamicExpression.tsx +53 -0
- package/src/client/components/FieldsSelect.tsx +32 -0
- package/src/client/components/FilterDynamicComponent.tsx +15 -0
- package/src/client/components/NodeDescription.tsx +51 -0
- package/src/client/components/NullRender.tsx +3 -0
- package/src/client/components/OpenDrawer.tsx +24 -0
- package/src/client/components/RadioWithTooltip.tsx +38 -0
- package/src/client/components/ValueBlock.tsx +67 -0
- package/src/client/components/renderEngineReference.tsx +30 -0
- package/src/client/constants.tsx +91 -0
- package/src/client/index.tsx +51 -0
- package/src/client/interfaces/expression.tsx +25 -0
- package/src/client/locale/en-US.ts +136 -0
- package/src/client/locale/es-ES.ts +129 -0
- package/src/client/locale/index.ts +18 -0
- package/src/client/locale/ja-JP.ts +90 -0
- package/src/client/locale/pt-BR.ts +136 -0
- package/src/client/locale/ru-RU.ts +90 -0
- package/src/client/locale/tr-TR.ts +90 -0
- package/src/client/locale/zh-CN.ts +248 -0
- package/src/client/nodes/aggregate.tsx +327 -0
- package/src/client/nodes/calculation.tsx +216 -0
- package/src/client/nodes/condition.tsx +463 -0
- package/src/client/nodes/create.tsx +85 -0
- package/src/client/nodes/delay.tsx +37 -0
- package/src/client/nodes/destroy.tsx +34 -0
- package/src/client/nodes/index.tsx +485 -0
- package/src/client/nodes/loop.tsx +144 -0
- package/src/client/nodes/manual/AssigneesSelect.tsx +33 -0
- package/src/client/nodes/manual/DetailsBlockProvider.tsx +80 -0
- package/src/client/nodes/manual/FormBlockInitializer.tsx +69 -0
- package/src/client/nodes/manual/FormBlockProvider.tsx +75 -0
- package/src/client/nodes/manual/ModeConfig.tsx +84 -0
- package/src/client/nodes/manual/SchemaConfig.tsx +509 -0
- package/src/client/nodes/manual/WorkflowTodo.tsx +607 -0
- package/src/client/nodes/manual/WorkflowTodoBlockInitializer.tsx +28 -0
- package/src/client/nodes/manual/forms/create.tsx +92 -0
- package/src/client/nodes/manual/forms/custom.tsx +392 -0
- package/src/client/nodes/manual/forms/update.tsx +134 -0
- package/src/client/nodes/manual/index.tsx +162 -0
- package/src/client/nodes/manual/utils.ts +28 -0
- package/src/client/nodes/parallel.tsx +138 -0
- package/src/client/nodes/query.tsx +88 -0
- package/src/client/nodes/request.tsx +185 -0
- package/src/client/nodes/sql.tsx +37 -0
- package/src/client/nodes/update.tsx +99 -0
- package/src/client/schemas/collection.ts +75 -0
- package/src/client/schemas/executions.tsx +169 -0
- package/src/client/schemas/workflows.ts +364 -0
- package/src/client/style.tsx +347 -0
- package/src/client/triggers/collection.tsx +190 -0
- package/src/client/triggers/index.tsx +311 -0
- package/src/client/triggers/schedule/EndsByField.tsx +40 -0
- package/src/client/triggers/schedule/OnField.tsx +64 -0
- package/src/client/triggers/schedule/RepeatField.tsx +116 -0
- package/src/client/triggers/schedule/ScheduleConfig.tsx +227 -0
- package/src/client/triggers/schedule/constants.ts +4 -0
- package/src/client/triggers/schedule/index.tsx +78 -0
- package/src/client/triggers/schedule/locale/Cron.zh-CN.ts +79 -0
- package/src/client/utils.ts +36 -0
- package/src/client/variable.tsx +318 -0
- package/src/index.ts +1 -0
- package/src/server/Plugin.ts +355 -0
- package/src/server/Processor.ts +354 -0
- package/src/server/__tests__/Plugin.test.ts +398 -0
- package/src/server/__tests__/Processor.test.ts +474 -0
- package/src/server/__tests__/actions/workflows.test.ts +419 -0
- package/src/server/__tests__/collections/categories.ts +27 -0
- package/src/server/__tests__/collections/comments.ts +24 -0
- package/src/server/__tests__/collections/posts.ts +42 -0
- package/src/server/__tests__/collections/replies.ts +9 -0
- package/src/server/__tests__/collections/tags.ts +15 -0
- package/src/server/__tests__/index.ts +89 -0
- package/src/server/__tests__/instructions/aggregate.test.ts +294 -0
- package/src/server/__tests__/instructions/calculation.test.ts +265 -0
- package/src/server/__tests__/instructions/condition.test.ts +335 -0
- package/src/server/__tests__/instructions/create.test.ts +129 -0
- package/src/server/__tests__/instructions/delay.test.ts +182 -0
- package/src/server/__tests__/instructions/destroy.test.ts +58 -0
- package/src/server/__tests__/instructions/loop.test.ts +331 -0
- package/src/server/__tests__/instructions/manual.test.ts +1173 -0
- package/src/server/__tests__/instructions/parallel.test.ts +445 -0
- package/src/server/__tests__/instructions/query.test.ts +359 -0
- package/src/server/__tests__/instructions/request.test.ts +247 -0
- package/src/server/__tests__/instructions/sql.test.ts +162 -0
- package/src/server/__tests__/instructions/update.test.ts +189 -0
- package/src/server/__tests__/triggers/collection.test.ts +333 -0
- package/src/server/__tests__/triggers/schedule.test.ts +369 -0
- package/src/server/actions/index.ts +25 -0
- package/src/server/actions/nodes.ts +214 -0
- package/src/server/actions/workflows.ts +178 -0
- package/src/server/collections/executions.ts +35 -0
- package/src/server/collections/flow_nodes.ts +54 -0
- package/src/server/collections/jobs.ts +31 -0
- package/src/server/collections/workflows.ts +88 -0
- package/src/server/constants.ts +26 -0
- package/src/server/fields/expression-field.ts +11 -0
- package/src/server/fields/index.ts +7 -0
- package/src/server/functions/index.ts +16 -0
- package/src/server/index.ts +6 -0
- package/src/server/instructions/aggregate.ts +42 -0
- package/src/server/instructions/calculation.ts +41 -0
- package/src/server/instructions/condition.ts +172 -0
- package/src/server/instructions/create.ts +39 -0
- package/src/server/instructions/delay.ts +105 -0
- package/src/server/instructions/destroy.ts +23 -0
- package/src/server/instructions/index.ts +64 -0
- package/src/server/instructions/loop.ts +99 -0
- package/src/server/instructions/manual/actions.ts +91 -0
- package/src/server/instructions/manual/collecions/jobs.ts +17 -0
- package/src/server/instructions/manual/collecions/users.ts +15 -0
- package/src/server/instructions/manual/collecions/users_jobs.ts +50 -0
- package/src/server/instructions/manual/forms/create.ts +23 -0
- package/src/server/instructions/manual/forms/index.ts +12 -0
- package/src/server/instructions/manual/forms/update.ts +23 -0
- package/src/server/instructions/manual/index.ts +184 -0
- package/src/server/instructions/parallel.ts +121 -0
- package/src/server/instructions/query.ts +42 -0
- package/src/server/instructions/request.ts +88 -0
- package/src/server/instructions/sql.ts +25 -0
- package/src/server/instructions/update.ts +24 -0
- package/src/server/migrations/20221129153547-calculation-variables.ts +64 -0
- package/src/server/migrations/20230221032941-change-request-body-type.ts +76 -0
- package/src/server/migrations/20230221071831-calculation-expression.ts +102 -0
- package/src/server/migrations/20230221121203-condition-calculation.ts +82 -0
- package/src/server/migrations/20230221162902-jsonb-to-json.ts +51 -0
- package/src/server/migrations/20230411034722-manual-multi-form.ts +282 -0
- package/src/server/migrations/20230612021134-manual-collection-block.ts +138 -0
- package/src/server/migrations/20230710115902-manual-action-values.ts +78 -0
- package/src/server/triggers/collection.ts +146 -0
- package/src/server/triggers/index.ts +22 -0
- package/src/server/triggers/schedule.ts +567 -0
- package/src/server/types/Execution.ts +26 -0
- package/src/server/types/FlowNode.ts +21 -0
- package/src/server/types/Job.ts +18 -0
- package/src/server/types/Workflow.ts +36 -0
- package/src/server/types/index.ts +4 -0
- package/src/server/utils.ts +17 -0
- package/lib/client/triggers/schedule/DateFieldsSelect.d.ts +0 -2
- /package/lib/server/{models → types}/Execution.js +0 -0
- /package/lib/server/{models → types}/FlowNode.js +0 -0
- /package/lib/server/{models → types}/Job.js +0 -0
- /package/lib/server/{models → types}/Workflow.js +0 -0
|
@@ -4,67 +4,59 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.WorkflowTodo = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
7
|
+
function _css() {
|
|
8
|
+
const data = require("@emotion/css");
|
|
9
|
+
_css = function _css() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function _react() {
|
|
15
15
|
const data = require("@formily/react");
|
|
16
|
-
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _antd() {
|
|
22
|
-
const data = require("antd");
|
|
23
|
-
_antd = function _antd() {
|
|
16
|
+
_react = function _react() {
|
|
24
17
|
return data;
|
|
25
18
|
};
|
|
26
19
|
return data;
|
|
27
20
|
}
|
|
28
|
-
function
|
|
29
|
-
const data = require("@
|
|
30
|
-
|
|
21
|
+
function _client() {
|
|
22
|
+
const data = require("@nocobase/utils/client");
|
|
23
|
+
_client = function _client() {
|
|
31
24
|
return data;
|
|
32
25
|
};
|
|
33
26
|
return data;
|
|
34
27
|
}
|
|
35
|
-
function
|
|
36
|
-
const data =
|
|
37
|
-
|
|
28
|
+
function _antd() {
|
|
29
|
+
const data = require("antd");
|
|
30
|
+
_antd = function _antd() {
|
|
38
31
|
return data;
|
|
39
32
|
};
|
|
40
33
|
return data;
|
|
41
34
|
}
|
|
42
|
-
function
|
|
43
|
-
const data = require("
|
|
44
|
-
|
|
35
|
+
function _react2() {
|
|
36
|
+
const data = _interopRequireWildcard(require("react"));
|
|
37
|
+
_react2 = function _react2() {
|
|
45
38
|
return data;
|
|
46
39
|
};
|
|
47
40
|
return data;
|
|
48
41
|
}
|
|
49
42
|
function _client2() {
|
|
50
|
-
const data = require("@nocobase/
|
|
43
|
+
const data = require("@nocobase/client");
|
|
51
44
|
_client2 = function _client2() {
|
|
52
45
|
return data;
|
|
53
46
|
};
|
|
54
47
|
return data;
|
|
55
48
|
}
|
|
49
|
+
var _ = require("..");
|
|
50
|
+
var _FlowContext = require("../../FlowContext");
|
|
56
51
|
var _constants = require("../../constants");
|
|
57
52
|
var _locale = require("../../locale");
|
|
58
|
-
var _FlowContext = require("../../FlowContext");
|
|
59
|
-
var _ = require("..");
|
|
60
53
|
var _utils = require("../../utils");
|
|
61
|
-
var _SchemaConfig = require("./SchemaConfig");
|
|
62
|
-
var _FormBlockProvider = require("./FormBlockProvider");
|
|
63
54
|
var _DetailsBlockProvider = require("./DetailsBlockProvider");
|
|
55
|
+
var _FormBlockProvider = require("./FormBlockProvider");
|
|
56
|
+
var _SchemaConfig = require("./SchemaConfig");
|
|
64
57
|
const _excluded = ["nodes"],
|
|
65
58
|
_excluded2 = ["node", "workflow", "execution"],
|
|
66
59
|
_excluded3 = ["collections"];
|
|
67
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
68
60
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
69
61
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
70
62
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -218,34 +210,33 @@ const todoCollection = {
|
|
|
218
210
|
'x-component': 'DatePicker',
|
|
219
211
|
'x-component-props': {
|
|
220
212
|
showTime: true
|
|
221
|
-
}
|
|
222
|
-
'x-read-pretty': true
|
|
213
|
+
}
|
|
223
214
|
}
|
|
224
215
|
}]
|
|
225
216
|
};
|
|
226
|
-
const NodeColumn = (0,
|
|
217
|
+
const NodeColumn = (0, _react().observer)(() => {
|
|
227
218
|
var _field$value$title, _field$value, _field$value2;
|
|
228
|
-
const field = (0,
|
|
219
|
+
const field = (0, _react().useField)();
|
|
229
220
|
return (_field$value$title = field === null || field === void 0 ? void 0 : (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.title) !== null && _field$value$title !== void 0 ? _field$value$title : `#${(_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2.id}`;
|
|
230
221
|
}, {
|
|
231
222
|
displayName: 'NodeColumn'
|
|
232
223
|
});
|
|
233
|
-
const WorkflowColumn = (0,
|
|
224
|
+
const WorkflowColumn = (0, _react().observer)(() => {
|
|
234
225
|
var _field$value$title2, _field$value3, _field$value4;
|
|
235
|
-
const field = (0,
|
|
226
|
+
const field = (0, _react().useField)();
|
|
236
227
|
return (_field$value$title2 = field === null || field === void 0 ? void 0 : (_field$value3 = field.value) === null || _field$value3 === void 0 ? void 0 : _field$value3.title) !== null && _field$value$title2 !== void 0 ? _field$value$title2 : `#${(_field$value4 = field.value) === null || _field$value4 === void 0 ? void 0 : _field$value4.id}`;
|
|
237
228
|
}, {
|
|
238
229
|
displayName: 'WorkflowColumn'
|
|
239
230
|
});
|
|
240
|
-
const UserColumn = (0,
|
|
231
|
+
const UserColumn = (0, _react().observer)(() => {
|
|
241
232
|
var _field$value$nickname, _field$value5, _field$value6;
|
|
242
|
-
const field = (0,
|
|
233
|
+
const field = (0, _react().useField)();
|
|
243
234
|
return (_field$value$nickname = field === null || field === void 0 ? void 0 : (_field$value5 = field.value) === null || _field$value5 === void 0 ? void 0 : _field$value5.nickname) !== null && _field$value$nickname !== void 0 ? _field$value$nickname : (_field$value6 = field.value) === null || _field$value6 === void 0 ? void 0 : _field$value6.id;
|
|
244
235
|
}, {
|
|
245
236
|
displayName: 'UserColumn'
|
|
246
237
|
});
|
|
247
238
|
const WorkflowTodo = () => {
|
|
248
|
-
return
|
|
239
|
+
return _react2().default.createElement(_client2().SchemaComponent, {
|
|
249
240
|
components: {
|
|
250
241
|
NodeColumn,
|
|
251
242
|
WorkflowColumn,
|
|
@@ -253,8 +244,6 @@ const WorkflowTodo = () => {
|
|
|
253
244
|
},
|
|
254
245
|
schema: {
|
|
255
246
|
type: 'void',
|
|
256
|
-
name: (0, _client2().uid)(),
|
|
257
|
-
'x-component': 'div',
|
|
258
247
|
properties: {
|
|
259
248
|
actions: {
|
|
260
249
|
type: 'void',
|
|
@@ -329,7 +318,7 @@ const WorkflowTodo = () => {
|
|
|
329
318
|
'x-component': 'TableV2.Column',
|
|
330
319
|
properties: {
|
|
331
320
|
createdAt: {
|
|
332
|
-
type: '
|
|
321
|
+
type: 'string',
|
|
333
322
|
'x-component': 'CollectionField',
|
|
334
323
|
'x-read-pretty': true
|
|
335
324
|
}
|
|
@@ -353,7 +342,6 @@ const WorkflowTodo = () => {
|
|
|
353
342
|
'x-component': 'TableV2.Column',
|
|
354
343
|
properties: {
|
|
355
344
|
status: {
|
|
356
|
-
type: 'number',
|
|
357
345
|
'x-component': 'CollectionField',
|
|
358
346
|
'x-read-pretty': true
|
|
359
347
|
}
|
|
@@ -391,14 +379,14 @@ function ActionBarProvider(props) {
|
|
|
391
379
|
// * status is not done:
|
|
392
380
|
// 1. current user: show action bar
|
|
393
381
|
// 2. not current user: disabled action bar
|
|
394
|
-
const _useCurrentUserContex = (0,
|
|
382
|
+
const _useCurrentUserContex = (0, _client2().useCurrentUserContext)(),
|
|
395
383
|
user = _useCurrentUserContex.data;
|
|
396
384
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
397
385
|
userJob = _useFlowContext.userJob;
|
|
398
386
|
const status = userJob.status,
|
|
399
387
|
result = userJob.result,
|
|
400
388
|
userId = userJob.userId;
|
|
401
|
-
const buttonSchema = (0,
|
|
389
|
+
const buttonSchema = (0, _react().useFieldSchema)();
|
|
402
390
|
const _buttonSchema$parent$ = buttonSchema.parent.toJSON(),
|
|
403
391
|
name = _buttonSchema$parent$.name;
|
|
404
392
|
let content = props.children;
|
|
@@ -414,54 +402,54 @@ function ActionBarProvider(props) {
|
|
|
414
402
|
}
|
|
415
403
|
return content;
|
|
416
404
|
}
|
|
417
|
-
const ManualActionStatusContext = (0,
|
|
405
|
+
const ManualActionStatusContext = (0, _react2().createContext)(null);
|
|
418
406
|
function ManualActionStatusProvider({
|
|
419
407
|
value,
|
|
420
408
|
children
|
|
421
409
|
}) {
|
|
422
410
|
const _useFlowContext2 = (0, _FlowContext.useFlowContext)(),
|
|
423
411
|
userJob = _useFlowContext2.userJob;
|
|
424
|
-
const button = (0,
|
|
425
|
-
(0, _react().
|
|
412
|
+
const button = (0, _react().useField)();
|
|
413
|
+
const buttonSchema = (0, _react().useFieldSchema)();
|
|
414
|
+
(0, _react2().useEffect)(() => {
|
|
426
415
|
if (userJob.status) {
|
|
427
416
|
button.disabled = true;
|
|
428
|
-
button.visible = userJob.status === value;
|
|
417
|
+
button.visible = userJob.status === value && userJob.result._ === buttonSchema.name;
|
|
429
418
|
}
|
|
430
|
-
}, [userJob
|
|
431
|
-
return
|
|
419
|
+
}, [userJob, value, button]);
|
|
420
|
+
return _react2().default.createElement(ManualActionStatusContext.Provider, {
|
|
432
421
|
value: value
|
|
433
422
|
}, children);
|
|
434
423
|
}
|
|
435
424
|
function useSubmit() {
|
|
436
|
-
const api = (0,
|
|
437
|
-
const _useActionContext = (0,
|
|
425
|
+
const api = (0, _client2().useAPIClient)();
|
|
426
|
+
const _useActionContext = (0, _client2().useActionContext)(),
|
|
438
427
|
setVisible = _useActionContext.setVisible;
|
|
439
|
-
const _useForm = (0,
|
|
428
|
+
const _useForm = (0, _react().useForm)(),
|
|
440
429
|
values = _useForm.values,
|
|
441
430
|
submit = _useForm.submit;
|
|
442
|
-
const buttonSchema = (0,
|
|
443
|
-
const
|
|
444
|
-
const _useTableBlockContext = (0, _client().useTableBlockContext)(),
|
|
431
|
+
const buttonSchema = (0, _react().useFieldSchema)();
|
|
432
|
+
const _useTableBlockContext = (0, _client2().useTableBlockContext)(),
|
|
445
433
|
service = _useTableBlockContext.service;
|
|
446
434
|
const _useFlowContext3 = (0, _FlowContext.useFlowContext)(),
|
|
447
435
|
userJob = _useFlowContext3.userJob;
|
|
448
|
-
const
|
|
449
|
-
|
|
436
|
+
const actionKey = buttonSchema.name;
|
|
437
|
+
const formKey = buttonSchema.parent.parent.name;
|
|
450
438
|
return {
|
|
451
439
|
run() {
|
|
452
440
|
return _asyncToGenerator(function* () {
|
|
441
|
+
if (userJob.status) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
453
444
|
yield submit();
|
|
454
|
-
const _buttonSchema$parent$2 = buttonSchema.parent.parent.toJSON(),
|
|
455
|
-
name = _buttonSchema$parent$2.name;
|
|
456
445
|
yield api.resource('users_jobs').submit({
|
|
457
446
|
filterByTk: userJob.id,
|
|
458
447
|
values: {
|
|
459
|
-
status: nextStatus,
|
|
460
448
|
result: {
|
|
461
|
-
[
|
|
449
|
+
[formKey]: values,
|
|
450
|
+
_: actionKey
|
|
462
451
|
}
|
|
463
|
-
}
|
|
464
|
-
updateAssociationValues
|
|
452
|
+
}
|
|
465
453
|
});
|
|
466
454
|
setVisible(false);
|
|
467
455
|
service.refresh();
|
|
@@ -471,18 +459,18 @@ function useSubmit() {
|
|
|
471
459
|
}
|
|
472
460
|
function FlowContextProvider(props) {
|
|
473
461
|
var _node$config;
|
|
474
|
-
const api = (0,
|
|
475
|
-
const _useRecord = (0,
|
|
462
|
+
const api = (0, _client2().useAPIClient)();
|
|
463
|
+
const _useRecord = (0, _client2().useRecord)(),
|
|
476
464
|
id = _useRecord.id;
|
|
477
|
-
const _useState = (0,
|
|
465
|
+
const _useState = (0, _react2().useState)(null),
|
|
478
466
|
_useState2 = _slicedToArray(_useState, 2),
|
|
479
467
|
flowContext = _useState2[0],
|
|
480
468
|
setFlowContext = _useState2[1];
|
|
481
|
-
const _useState3 = (0,
|
|
469
|
+
const _useState3 = (0, _react2().useState)(null),
|
|
482
470
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
483
471
|
node = _useState4[0],
|
|
484
472
|
setNode = _useState4[1];
|
|
485
|
-
(0,
|
|
473
|
+
(0, _react2().useEffect)(() => {
|
|
486
474
|
var _api$resource$get, _api$resource;
|
|
487
475
|
if (!id) {
|
|
488
476
|
return;
|
|
@@ -518,9 +506,9 @@ function FlowContextProvider(props) {
|
|
|
518
506
|
const nodeComponents = upstreams.reduce((components, {
|
|
519
507
|
type
|
|
520
508
|
}) => Object.assign(components, _.instructions.get(type).components), {});
|
|
521
|
-
return node && flowContext ?
|
|
509
|
+
return node && flowContext ? _react2().default.createElement(_FlowContext.FlowContext.Provider, {
|
|
522
510
|
value: flowContext
|
|
523
|
-
},
|
|
511
|
+
}, _react2().default.createElement(_client2().SchemaComponent, {
|
|
524
512
|
components: _objectSpread(_objectSpread({
|
|
525
513
|
FormBlockProvider: _FormBlockProvider.FormBlockProvider,
|
|
526
514
|
DetailsBlockProvider: _DetailsBlockProvider.DetailsBlockProvider,
|
|
@@ -538,19 +526,19 @@ function FlowContextProvider(props) {
|
|
|
538
526
|
'x-component': 'Tabs',
|
|
539
527
|
properties: (_node$config = node.config) === null || _node$config === void 0 ? void 0 : _node$config.schema
|
|
540
528
|
}
|
|
541
|
-
})) :
|
|
529
|
+
})) : _react2().default.createElement(_antd().Spin, null);
|
|
542
530
|
}
|
|
543
531
|
function useFormBlockProps() {
|
|
544
532
|
var _user$data2;
|
|
545
533
|
const _useFlowContext4 = (0, _FlowContext.useFlowContext)(),
|
|
546
534
|
userJob = _useFlowContext4.userJob;
|
|
547
|
-
const record = (0,
|
|
548
|
-
const _useCurrentUserContex2 = (0,
|
|
535
|
+
const record = (0, _client2().useRecord)();
|
|
536
|
+
const _useCurrentUserContex2 = (0, _client2().useCurrentUserContext)(),
|
|
549
537
|
user = _useCurrentUserContex2.data;
|
|
550
|
-
const _useFormBlockContext = (0,
|
|
538
|
+
const _useFormBlockContext = (0, _client2().useFormBlockContext)(),
|
|
551
539
|
form = _useFormBlockContext.form;
|
|
552
540
|
const pattern = userJob.status ? record ? 'readPretty' : 'disabled' : (user === null || user === void 0 ? void 0 : (_user$data2 = user.data) === null || _user$data2 === void 0 ? void 0 : _user$data2.id) !== userJob.userId ? 'disabled' : 'editable';
|
|
553
|
-
(0,
|
|
541
|
+
(0, _react2().useEffect)(() => {
|
|
554
542
|
form === null || form === void 0 ? void 0 : form.setPattern(pattern);
|
|
555
543
|
}, [pattern, form]);
|
|
556
544
|
return {
|
|
@@ -558,51 +546,43 @@ function useFormBlockProps() {
|
|
|
558
546
|
};
|
|
559
547
|
}
|
|
560
548
|
function useDetailsBlockProps() {
|
|
561
|
-
const _useFormBlockContext2 = (0,
|
|
549
|
+
const _useFormBlockContext2 = (0, _client2().useFormBlockContext)(),
|
|
562
550
|
form = _useFormBlockContext2.form;
|
|
563
551
|
return {
|
|
564
552
|
form
|
|
565
553
|
};
|
|
566
554
|
}
|
|
567
|
-
function
|
|
568
|
-
|
|
569
|
-
const
|
|
570
|
-
const _useRecord2 = (0, _client().useRecord)(),
|
|
571
|
-
id = _useRecord2.id,
|
|
572
|
-
node = _useRecord2.node,
|
|
573
|
-
workflow = _useRecord2.workflow,
|
|
555
|
+
function FooterStatus() {
|
|
556
|
+
const compile = (0, _client2().useCompile)();
|
|
557
|
+
const _useRecord2 = (0, _client2().useRecord)(),
|
|
574
558
|
status = _useRecord2.status,
|
|
575
559
|
updatedAt = _useRecord2.updatedAt;
|
|
576
560
|
const statusOption = _constants.JobStatusOptionsMap[status];
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
'x-content': statusOption.label
|
|
596
|
-
}
|
|
597
|
-
} : null;
|
|
598
|
-
return _react().default.createElement(_client().SchemaComponentContext.Provider, {
|
|
561
|
+
return status ? _react2().default.createElement(_antd().Space, null, _react2().default.createElement("time", {
|
|
562
|
+
className: (0, _css().css)`
|
|
563
|
+
margin-right: 0.5em;
|
|
564
|
+
`
|
|
565
|
+
}, (0, _client().dayjs)(updatedAt).format('YYYY-MM-DD HH:mm:ss')), _react2().default.createElement(_antd().Tag, {
|
|
566
|
+
icon: statusOption.icon,
|
|
567
|
+
color: statusOption.color
|
|
568
|
+
}, compile(statusOption.label))) : null;
|
|
569
|
+
}
|
|
570
|
+
function Drawer() {
|
|
571
|
+
var _node$title;
|
|
572
|
+
const ctx = (0, _react2().useContext)(_client2().SchemaComponentContext);
|
|
573
|
+
const _useRecord3 = (0, _client2().useRecord)(),
|
|
574
|
+
id = _useRecord3.id,
|
|
575
|
+
node = _useRecord3.node,
|
|
576
|
+
workflow = _useRecord3.workflow,
|
|
577
|
+
status = _useRecord3.status;
|
|
578
|
+
return _react2().default.createElement(_client2().SchemaComponentContext.Provider, {
|
|
599
579
|
value: _objectSpread(_objectSpread({}, ctx), {}, {
|
|
600
580
|
reset() {},
|
|
601
581
|
designable: false
|
|
602
582
|
})
|
|
603
|
-
},
|
|
583
|
+
}, _react2().default.createElement(_client2().SchemaComponent, {
|
|
604
584
|
components: {
|
|
605
|
-
|
|
585
|
+
FooterStatus,
|
|
606
586
|
FlowContextProvider
|
|
607
587
|
},
|
|
608
588
|
schema: {
|
|
@@ -621,7 +601,12 @@ function Drawer() {
|
|
|
621
601
|
footer: {
|
|
622
602
|
type: 'void',
|
|
623
603
|
'x-component': 'Action.Drawer.Footer',
|
|
624
|
-
properties:
|
|
604
|
+
properties: {
|
|
605
|
+
content: {
|
|
606
|
+
type: 'void',
|
|
607
|
+
'x-component': 'FooterStatus'
|
|
608
|
+
}
|
|
609
|
+
}
|
|
625
610
|
}
|
|
626
611
|
}
|
|
627
612
|
}
|
|
@@ -631,7 +616,7 @@ function Decorator({
|
|
|
631
616
|
params = {},
|
|
632
617
|
children
|
|
633
618
|
}) {
|
|
634
|
-
const _useCollectionManager = (0,
|
|
619
|
+
const _useCollectionManager = (0, _client2().useCollectionManager)(),
|
|
635
620
|
collections = _useCollectionManager.collections,
|
|
636
621
|
cm = _objectWithoutProperties(_useCollectionManager, _excluded3);
|
|
637
622
|
const blockProps = {
|
|
@@ -649,9 +634,9 @@ function Decorator({
|
|
|
649
634
|
showIndex: true,
|
|
650
635
|
dragSort: false
|
|
651
636
|
};
|
|
652
|
-
return
|
|
637
|
+
return _react2().default.createElement(_client2().CollectionManagerProvider, _objectSpread(_objectSpread({}, cm), {}, {
|
|
653
638
|
collections: [...collections, nodeCollection, workflowCollection, todoCollection]
|
|
654
|
-
}),
|
|
639
|
+
}), _react2().default.createElement(_client2().TableBlockProvider, _objectSpread({}, blockProps), children));
|
|
655
640
|
}
|
|
656
641
|
WorkflowTodo.Drawer = Drawer;
|
|
657
642
|
WorkflowTodo.Decorator = Decorator;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WorkflowTodoBlockInitializer =
|
|
6
|
+
exports.WorkflowTodoBlockInitializer = void 0;
|
|
7
7
|
function _react() {
|
|
8
8
|
const data = _interopRequireDefault(require("react"));
|
|
9
9
|
_react = function _react() {
|
|
@@ -34,12 +34,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
34
34
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
35
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
36
36
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
37
|
-
|
|
37
|
+
const WorkflowTodoBlockInitializer = _ref => {
|
|
38
38
|
let insert = _ref.insert,
|
|
39
|
-
|
|
39
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
40
|
return _react().default.createElement(_client().SchemaInitializer.Item, _objectSpread(_objectSpread({
|
|
41
41
|
icon: _react().default.createElement(_icons().TableOutlined, null)
|
|
42
|
-
},
|
|
42
|
+
}, rest), {}, {
|
|
43
43
|
onClick: () => {
|
|
44
44
|
insert({
|
|
45
45
|
type: 'void',
|
|
@@ -56,4 +56,5 @@ function WorkflowTodoBlockInitializer(_ref) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}));
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
|
+
exports.WorkflowTodoBlockInitializer = WorkflowTodoBlockInitializer;
|
|
@@ -87,7 +87,14 @@ var _default = {
|
|
|
87
87
|
forms[formKey] = {
|
|
88
88
|
type: 'create',
|
|
89
89
|
title: ((_formBlock$xComponen = formBlock['x-component-props']) === null || _formBlock$xComponen === void 0 ? void 0 : _formBlock$xComponen.title) || formKey,
|
|
90
|
-
actions: (0, _utils.findSchema)(formSchema.properties.actions, item => item['x-component'] === 'Action').map(item =>
|
|
90
|
+
actions: (0, _utils.findSchema)(formSchema.properties.actions, item => item['x-component'] === 'Action').map(item => {
|
|
91
|
+
var _item$xActionSettin, _item$xActionSettin$a;
|
|
92
|
+
return {
|
|
93
|
+
status: item['x-decorator-props'].value,
|
|
94
|
+
values: (_item$xActionSettin = item['x-action-settings']) === null || _item$xActionSettin === void 0 ? void 0 : (_item$xActionSettin$a = _item$xActionSettin.assignedValues) === null || _item$xActionSettin$a === void 0 ? void 0 : _item$xActionSettin$a.values,
|
|
95
|
+
key: item.name
|
|
96
|
+
};
|
|
97
|
+
}),
|
|
91
98
|
collection: formBlock['x-decorator-props'].collection
|
|
92
99
|
};
|
|
93
100
|
});
|
|
@@ -11,9 +11,9 @@ function _react() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = require("
|
|
16
|
-
|
|
14
|
+
function _antdV() {
|
|
15
|
+
const data = require("@formily/antd-v5");
|
|
16
|
+
_antdV = function _antdV() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
@@ -32,13 +32,6 @@ function _react2() {
|
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
|
-
function _antd() {
|
|
36
|
-
const data = require("@formily/antd");
|
|
37
|
-
_antd = function _antd() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
35
|
function _client() {
|
|
43
36
|
const data = require("@nocobase/client");
|
|
44
37
|
_client = function _client() {
|
|
@@ -150,7 +143,8 @@ function CustomFormBlockInitializer(_ref) {
|
|
|
150
143
|
'x-component-props': {
|
|
151
144
|
layout: 'one-column',
|
|
152
145
|
style: {
|
|
153
|
-
marginTop: '1.5em'
|
|
146
|
+
marginTop: '1.5em',
|
|
147
|
+
flexWrap: 'wrap'
|
|
154
148
|
}
|
|
155
149
|
},
|
|
156
150
|
'x-initializer': 'AddActionButton',
|
|
@@ -167,8 +161,7 @@ function CustomFormBlockInitializer(_ref) {
|
|
|
167
161
|
type: 'primary',
|
|
168
162
|
useAction: '{{ useSubmit }}'
|
|
169
163
|
},
|
|
170
|
-
'x-designer': '
|
|
171
|
-
'x-action': `${_constants.JOB_STATUS.RESOLVED}`
|
|
164
|
+
'x-designer': 'ManualActionDesigner'
|
|
172
165
|
}
|
|
173
166
|
}
|
|
174
167
|
}
|
|
@@ -196,7 +189,7 @@ function getOptions(interfaces) {
|
|
|
196
189
|
const _schema$group = schema.group,
|
|
197
190
|
group = _schema$group === void 0 ? 'others' : _schema$group;
|
|
198
191
|
fields[group] = fields[group] || {};
|
|
199
|
-
(
|
|
192
|
+
_client2().lodash.set(fields, [group, type], schema);
|
|
200
193
|
});
|
|
201
194
|
return Object.keys(GroupLabels).filter(groupName => ['basic', 'choices', 'datetime', 'media'].includes(groupName)).map(groupName => ({
|
|
202
195
|
title: GroupLabels[groupName],
|
|
@@ -247,12 +240,12 @@ function AddCustomFormField(props) {
|
|
|
247
240
|
return _react().default.createElement(AddCustomFormFieldButtonContext.Provider, {
|
|
248
241
|
value: {
|
|
249
242
|
onAddField(item) {
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
unique =
|
|
253
|
-
type =
|
|
254
|
-
properties = _objectWithoutProperties(
|
|
255
|
-
options = _objectWithoutProperties(
|
|
243
|
+
const _lodash$cloneDeep = _client2().lodash.cloneDeep(item),
|
|
244
|
+
_lodash$cloneDeep$pro = _lodash$cloneDeep.properties,
|
|
245
|
+
unique = _lodash$cloneDeep$pro.unique,
|
|
246
|
+
type = _lodash$cloneDeep$pro.type,
|
|
247
|
+
properties = _objectWithoutProperties(_lodash$cloneDeep$pro, _excluded2),
|
|
248
|
+
options = _objectWithoutProperties(_lodash$cloneDeep, _excluded3);
|
|
256
249
|
delete properties.name['x-disabled'];
|
|
257
250
|
setInterface(_objectSpread(_objectSpread({}, options), {}, {
|
|
258
251
|
properties
|
|
@@ -356,7 +349,7 @@ function AddCustomFormField(props) {
|
|
|
356
349
|
})
|
|
357
350
|
},
|
|
358
351
|
components: {
|
|
359
|
-
ArrayTable:
|
|
352
|
+
ArrayTable: _antdV().ArrayTable
|
|
360
353
|
}
|
|
361
354
|
}) : null));
|
|
362
355
|
}
|
|
@@ -411,7 +404,14 @@ var _default = {
|
|
|
411
404
|
forms[formKey] = {
|
|
412
405
|
type: 'custom',
|
|
413
406
|
title: ((_formBlock$xComponen = formBlock['x-component-props']) === null || _formBlock$xComponen === void 0 ? void 0 : _formBlock$xComponen.title) || formKey,
|
|
414
|
-
actions: (0, _utils.findSchema)(formSchema.properties.actions, item => item['x-component'] === 'Action').map(item =>
|
|
407
|
+
actions: (0, _utils.findSchema)(formSchema.properties.actions, item => item['x-component'] === 'Action').map(item => {
|
|
408
|
+
var _item$xActionSettin, _item$xActionSettin$a;
|
|
409
|
+
return {
|
|
410
|
+
status: item['x-decorator-props'].value,
|
|
411
|
+
values: (_item$xActionSettin = item['x-action-settings']) === null || _item$xActionSettin === void 0 ? void 0 : (_item$xActionSettin$a = _item$xActionSettin.assignedValues) === null || _item$xActionSettin$a === void 0 ? void 0 : _item$xActionSettin$a.values,
|
|
412
|
+
key: item.name
|
|
413
|
+
};
|
|
414
|
+
}),
|
|
415
415
|
collection: formBlock['x-decorator-props'].collection
|
|
416
416
|
};
|
|
417
417
|
});
|
|
@@ -145,7 +145,14 @@ var _default = {
|
|
|
145
145
|
forms[formKey] = _objectSpread(_objectSpread({}, formBlock['x-decorator-props']), {}, {
|
|
146
146
|
type: 'update',
|
|
147
147
|
title: ((_formBlock$xComponen = formBlock['x-component-props']) === null || _formBlock$xComponen === void 0 ? void 0 : _formBlock$xComponen.title) || formKey,
|
|
148
|
-
actions: (0, _utils.findSchema)(formSchema.properties.actions, item => item['x-component'] === 'Action').map(item =>
|
|
148
|
+
actions: (0, _utils.findSchema)(formSchema.properties.actions, item => item['x-component'] === 'Action').map(item => {
|
|
149
|
+
var _item$xActionSettin, _item$xActionSettin$a;
|
|
150
|
+
return {
|
|
151
|
+
status: item['x-decorator-props'].value,
|
|
152
|
+
values: (_item$xActionSettin = item['x-action-settings']) === null || _item$xActionSettin === void 0 ? void 0 : (_item$xActionSettin$a = _item$xActionSettin.assignedValues) === null || _item$xActionSettin$a === void 0 ? void 0 : _item$xActionSettin$a.values,
|
|
153
|
+
key: item.name
|
|
154
|
+
};
|
|
155
|
+
})
|
|
149
156
|
});
|
|
150
157
|
});
|
|
151
158
|
return forms;
|
|
@@ -62,8 +62,13 @@ declare const _default: {
|
|
|
62
62
|
id: any;
|
|
63
63
|
title: any;
|
|
64
64
|
config: any;
|
|
65
|
-
}, { types }: {
|
|
65
|
+
}, { types, fieldNames }: {
|
|
66
66
|
types: any;
|
|
67
|
+
fieldNames?: {
|
|
68
|
+
readonly label: "label";
|
|
69
|
+
readonly value: "value";
|
|
70
|
+
readonly children: "children";
|
|
71
|
+
};
|
|
67
72
|
}): {
|
|
68
73
|
value: string;
|
|
69
74
|
label: any;
|
|
@@ -98,7 +98,8 @@ var _default = {
|
|
|
98
98
|
title,
|
|
99
99
|
config
|
|
100
100
|
}, {
|
|
101
|
-
types
|
|
101
|
+
types,
|
|
102
|
+
fieldNames = _variable.defaultFieldNames
|
|
102
103
|
}) {
|
|
103
104
|
var _config$forms;
|
|
104
105
|
const compile = (0, _client().useCompile)();
|
|
@@ -128,9 +129,9 @@ var _default = {
|
|
|
128
129
|
} : null;
|
|
129
130
|
}).filter(Boolean);
|
|
130
131
|
return options.length ? {
|
|
131
|
-
value: `${id}`,
|
|
132
|
-
label: title,
|
|
133
|
-
children: options
|
|
132
|
+
[fieldNames.value]: `${id}`,
|
|
133
|
+
[fieldNames.label]: title,
|
|
134
|
+
[fieldNames.children]: options
|
|
134
135
|
} : null;
|
|
135
136
|
},
|
|
136
137
|
useInitializers(node) {
|