@tachybase/plugin-workflow-approval 1.3.21 → 1.3.23
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/client/base/Execution.schema.d.ts +1 -1
- package/dist/client/index.js +39 -39
- package/dist/client/system-settings/instruction-approval/Approval.instruction.d.ts +2 -2
- package/dist/client/system-settings/instruction-approval/initializers/forms/Approval.options.d.ts +1 -1
- package/dist/client/system-settings/instruction-carbon-copy/ApprovalCarbonCopy.instruction.d.ts +2 -2
- package/dist/client/user-interface/h5/todos/component/ViewTodosUserJobsContent.d.ts +1 -1
- package/dist/externalVersion.js +8 -11
- package/dist/server/actions/approvalCarbonCopy.js +3 -14
- package/dist/server/actions/approvalRecords.js +3 -13
- package/dist/server/actions/approvals.js +12 -24
- package/dist/server/actions/workflows.js +2 -12
- package/dist/server/collections/approvalCarbonCopy.d.ts +1 -1
- package/dist/server/collections/approvalCarbonCopy.js +2 -2
- package/dist/server/collections/approvalExecutions.d.ts +1 -1
- package/dist/server/collections/approvalExecutions.js +2 -2
- package/dist/server/collections/approvalRecords.d.ts +1 -1
- package/dist/server/collections/approvalRecords.js +2 -2
- package/dist/server/collections/approvals.d.ts +1 -1
- package/dist/server/collections/approvals.js +2 -2
- package/dist/server/collections/workflows.d.ts +1 -1
- package/dist/server/collections/workflows.js +2 -2
- package/dist/server/instructions/Approval.js +4 -5
- package/dist/server/instructions/ApprovalCarbonCopy.js +2 -2
- package/dist/server/plugin.d.ts +1 -1
- package/dist/server/plugin.js +4 -4
- package/dist/server/triggers/Approval.js +5 -6
- package/package.json +13 -22
|
@@ -24,8 +24,8 @@ export declare class ApprovalInstruction extends Instruction {
|
|
|
24
24
|
onChange: any;
|
|
25
25
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
RadioWithTooltip: typeof RadioWithTooltip;
|
|
27
|
-
ArrayItems: import("
|
|
28
|
-
Item: import("
|
|
27
|
+
ArrayItems: import("@tachybase/schema").ReactFC<React.HTMLAttributes<HTMLDivElement>> & import("@tego/client").ArrayBaseMixins & {
|
|
28
|
+
Item: import("@tachybase/schema").ReactFC<React.HTMLAttributes<HTMLDivElement> & {
|
|
29
29
|
type?: "card" | "divide";
|
|
30
30
|
}>;
|
|
31
31
|
};
|
package/dist/client/system-settings/instruction-approval/initializers/forms/Approval.options.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaInitializerItemType } from '@tachybase/client';
|
|
2
2
|
import { JOB_STATUS } from '@tachybase/module-workflow/client';
|
|
3
3
|
import { ISchema } from '@tachybase/schema';
|
|
4
|
-
import { Registry } from '@
|
|
4
|
+
import { Registry } from '@tego/client';
|
|
5
5
|
type ValueOf<T> = T[keyof T];
|
|
6
6
|
export type FormType = {
|
|
7
7
|
type: 'create' | 'update' | 'custom';
|
package/dist/client/system-settings/instruction-carbon-copy/ApprovalCarbonCopy.instruction.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export declare class ApprovalCarbonCopyInstruction extends Instruction {
|
|
|
7
7
|
color: string;
|
|
8
8
|
description: string;
|
|
9
9
|
components: {
|
|
10
|
-
ArrayItems: import("
|
|
11
|
-
Item: import("
|
|
10
|
+
ArrayItems: import("@tachybase/schema").ReactFC<import("react").HTMLAttributes<HTMLDivElement>> & import("@tego/client").ArrayBaseMixins & {
|
|
11
|
+
Item: import("@tachybase/schema").ReactFC<React.HTMLAttributes<HTMLDivElement> & {
|
|
12
12
|
type?: "card" | "divide";
|
|
13
13
|
}>;
|
|
14
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Registry } from '@
|
|
1
|
+
import { Registry } from '@tego/client';
|
|
2
2
|
import { ManualFormType } from '../../constants';
|
|
3
3
|
import '../../style/style.css';
|
|
4
4
|
export declare const ViewTodosUserJobsContent: import("react").MemoExoticComponent<import("@tachybase/schema").ReactFC<unknown>>;
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "1.3.
|
|
3
|
-
"@tachybase/module-workflow": "1.3.
|
|
4
|
-
"@
|
|
2
|
+
"@tachybase/client": "1.3.23",
|
|
3
|
+
"@tachybase/module-workflow": "1.3.23",
|
|
4
|
+
"@tego/server": "1.3.43",
|
|
5
5
|
"lodash": "4.17.21",
|
|
6
6
|
"react": "18.3.1",
|
|
7
|
-
"@tachybase/schema": "1.3.
|
|
7
|
+
"@tachybase/schema": "1.3.43",
|
|
8
8
|
"antd": "5.22.5",
|
|
9
|
-
"@tachybase/
|
|
10
|
-
"@tachybase/database": "1.3.21",
|
|
11
|
-
"@tachybase/data-source": "1.3.21",
|
|
12
|
-
"@tachybase/module-ui-schema": "1.3.21",
|
|
13
|
-
"@tachybase/utils": "1.3.21",
|
|
9
|
+
"@tachybase/module-ui-schema": "1.3.23",
|
|
14
10
|
"sequelize": "6.37.5",
|
|
15
|
-
"@
|
|
16
|
-
"@ant-design/icons": "5.
|
|
11
|
+
"@tego/client": "1.3.43",
|
|
12
|
+
"@ant-design/icons": "5.6.1",
|
|
13
|
+
"dayjs": "1.11.13",
|
|
17
14
|
"ahooks": "3.9.0",
|
|
18
15
|
"react-router-dom": "6.28.1"
|
|
19
16
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,23 +14,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var approvalCarbonCopy_exports = {};
|
|
29
19
|
__export(approvalCarbonCopy_exports, {
|
|
30
20
|
approvalCarbonCopy: () => approvalCarbonCopy
|
|
31
21
|
});
|
|
32
22
|
module.exports = __toCommonJS(approvalCarbonCopy_exports);
|
|
33
|
-
var import_actions = __toESM(require("@tachybase/actions"));
|
|
34
|
-
var import_database = require("@tachybase/database");
|
|
35
23
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
24
|
+
var import_server = require("@tego/server");
|
|
36
25
|
var import_status = require("../constants/status");
|
|
37
26
|
var import_utils = require("../utils");
|
|
38
27
|
const approvalCarbonCopy = {
|
|
@@ -49,12 +38,12 @@ const approvalCarbonCopy = {
|
|
|
49
38
|
workflowId: centralizedApprovalFlow.map((item) => item.id),
|
|
50
39
|
approval: {
|
|
51
40
|
status: {
|
|
52
|
-
[
|
|
41
|
+
[import_server.Op.ne]: import_status.APPROVAL_STATUS.DRAFT
|
|
53
42
|
}
|
|
54
43
|
}
|
|
55
44
|
}
|
|
56
45
|
});
|
|
57
|
-
await
|
|
46
|
+
await import_server.actions.list(context, next);
|
|
58
47
|
if (context.body.rows) {
|
|
59
48
|
context.body.rows = (0, import_utils.findUniqueObjects)(
|
|
60
49
|
context.body.rows,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,22 +14,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var approvalRecords_exports = {};
|
|
29
19
|
__export(approvalRecords_exports, {
|
|
30
20
|
approvalRecords: () => approvalRecords
|
|
31
21
|
});
|
|
32
22
|
module.exports = __toCommonJS(approvalRecords_exports);
|
|
33
|
-
var import_actions = __toESM(require("@tachybase/actions"));
|
|
34
23
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
24
|
+
var import_server = require("@tego/server");
|
|
35
25
|
var import_error_code = require("../constants/error-code");
|
|
36
26
|
var import_status = require("../constants/status");
|
|
37
27
|
const approvalRecords = {
|
|
@@ -48,11 +38,11 @@ const approvalRecords = {
|
|
|
48
38
|
workflowId: centralizedApprovalFlow.map((item) => item.id)
|
|
49
39
|
}
|
|
50
40
|
});
|
|
51
|
-
return
|
|
41
|
+
return import_server.actions.list(context, next);
|
|
52
42
|
},
|
|
53
43
|
async submit(context, next) {
|
|
54
44
|
var _a, _b;
|
|
55
|
-
const repository =
|
|
45
|
+
const repository = import_server.utils.getRepositoryFromParams(context);
|
|
56
46
|
const { filterByTk, values } = context.action.params;
|
|
57
47
|
const { data, status, needUpdateRecord } = values || {};
|
|
58
48
|
const { currentUser } = context.state;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,31 +14,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var approvals_exports = {};
|
|
29
19
|
__export(approvals_exports, {
|
|
30
20
|
approvals: () => approvals
|
|
31
21
|
});
|
|
32
22
|
module.exports = __toCommonJS(approvals_exports);
|
|
33
|
-
var import_actions = __toESM(require("@tachybase/actions"));
|
|
34
|
-
var import_data_source = require("@tachybase/data-source");
|
|
35
|
-
var import_database = require("@tachybase/database");
|
|
36
23
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
24
|
+
var import_server = require("@tego/server");
|
|
37
25
|
var import_constants = require("../../common/constants");
|
|
38
26
|
var import_status = require("../constants/status");
|
|
39
27
|
var import_tools = require("../tools");
|
|
40
28
|
const approvals = {
|
|
41
29
|
async create(context, next) {
|
|
42
30
|
const { status, collectionName, data, workflowId, workflowKey } = context.action.params.values ?? {};
|
|
43
|
-
const [dataSourceName, cName] = (0,
|
|
31
|
+
const [dataSourceName, cName] = (0, import_server.parseCollectionName)(collectionName);
|
|
44
32
|
const dataSource = context.app.dataSourceManager.dataSources.get(dataSourceName);
|
|
45
33
|
if (!dataSource) {
|
|
46
34
|
return context.throw(400, `Data source "${dataSourceName}" not found`);
|
|
@@ -75,7 +63,7 @@ const approvals = {
|
|
|
75
63
|
const { repository, model } = collection;
|
|
76
64
|
const values = await repository.create({
|
|
77
65
|
values: {
|
|
78
|
-
...(0,
|
|
66
|
+
...(0, import_server.traverseJSON)(data, { collection }),
|
|
79
67
|
createdBy: context.state.currentUser.id,
|
|
80
68
|
updatedBy: context.state.currentUser.id
|
|
81
69
|
},
|
|
@@ -103,11 +91,11 @@ const approvals = {
|
|
|
103
91
|
summary
|
|
104
92
|
}
|
|
105
93
|
});
|
|
106
|
-
return
|
|
94
|
+
return import_server.actions.create(context, next);
|
|
107
95
|
},
|
|
108
96
|
async update(context, next) {
|
|
109
97
|
const { collectionName, data, status, updateAssociationValues, summaryConfig } = context.action.params.values ?? {};
|
|
110
|
-
const [dataSourceName, cName] = (0,
|
|
98
|
+
const [dataSourceName, cName] = (0, import_server.parseCollectionName)(collectionName);
|
|
111
99
|
const dataSource = context.app.dataSourceManager.dataSources.get(dataSourceName);
|
|
112
100
|
const collection = dataSource.collectionManager.getCollection(cName);
|
|
113
101
|
const [target] = await collection.repository.update({
|
|
@@ -127,7 +115,7 @@ const approvals = {
|
|
|
127
115
|
summary
|
|
128
116
|
}
|
|
129
117
|
});
|
|
130
|
-
return
|
|
118
|
+
return import_server.actions.update(context, next);
|
|
131
119
|
},
|
|
132
120
|
async destroy(context, next) {
|
|
133
121
|
const {
|
|
@@ -137,7 +125,7 @@ const approvals = {
|
|
|
137
125
|
if (status !== import_status.APPROVAL_STATUS.DRAFT) {
|
|
138
126
|
return context.throw(400);
|
|
139
127
|
}
|
|
140
|
-
const repository =
|
|
128
|
+
const repository = import_server.utils.getRepositoryFromParams(context);
|
|
141
129
|
const approval = await repository.findOne({
|
|
142
130
|
filterByTk,
|
|
143
131
|
filter: {
|
|
@@ -147,12 +135,12 @@ const approvals = {
|
|
|
147
135
|
if (!approval) {
|
|
148
136
|
return context.throw(404);
|
|
149
137
|
}
|
|
150
|
-
return
|
|
138
|
+
return import_server.actions.destroy(context, next);
|
|
151
139
|
},
|
|
152
140
|
async withdraw(context, next) {
|
|
153
141
|
var _a;
|
|
154
142
|
const { filterByTk } = context.action.params;
|
|
155
|
-
const repository =
|
|
143
|
+
const repository = import_server.utils.getRepositoryFromParams(context);
|
|
156
144
|
const approval = await repository.findOne({
|
|
157
145
|
filterByTk,
|
|
158
146
|
appends: ["workflow"],
|
|
@@ -227,12 +215,12 @@ const approvals = {
|
|
|
227
215
|
workflowId: centralizedApprovalFlow.map((item) => item.id)
|
|
228
216
|
}
|
|
229
217
|
});
|
|
230
|
-
return await
|
|
218
|
+
return await import_server.actions.list(context, next);
|
|
231
219
|
},
|
|
232
220
|
async reminder(context, next) {
|
|
233
221
|
var _a, _b, _c;
|
|
234
222
|
const { filterByTk } = context.action.params;
|
|
235
|
-
const repository =
|
|
223
|
+
const repository = import_server.utils.getRepositoryFromParams(context);
|
|
236
224
|
const approval = await repository.findOne({
|
|
237
225
|
filterByTk,
|
|
238
226
|
appends: ["records", "workflow", "createdBy.nickname"]
|
|
@@ -251,7 +239,7 @@ const approvals = {
|
|
|
251
239
|
}
|
|
252
240
|
const assignees = approval.records.map((record) => record.userId);
|
|
253
241
|
for (const userId of assignees) {
|
|
254
|
-
const [dataSourceName] = (0,
|
|
242
|
+
const [dataSourceName] = (0, import_server.parseCollectionName)(approval.collectionName);
|
|
255
243
|
const collection = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName).collectionManager.getCollection(approval.collectionName);
|
|
256
244
|
const message = {
|
|
257
245
|
userId,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,21 +14,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var workflows_exports = {};
|
|
29
19
|
__export(workflows_exports, {
|
|
30
20
|
workflows: () => workflows
|
|
31
21
|
});
|
|
32
22
|
module.exports = __toCommonJS(workflows_exports);
|
|
33
|
-
var
|
|
23
|
+
var import_server = require("@tego/server");
|
|
34
24
|
const workflows = {
|
|
35
25
|
async listApprovalFlows(context, next) {
|
|
36
26
|
context.action.mergeParams({
|
|
@@ -40,7 +30,7 @@ const workflows = {
|
|
|
40
30
|
// TODO: 仅显示当前用户有权限的流程
|
|
41
31
|
}
|
|
42
32
|
});
|
|
43
|
-
return
|
|
33
|
+
return import_server.actions.list(context, next);
|
|
44
34
|
}
|
|
45
35
|
};
|
|
46
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@
|
|
1
|
+
declare const _default: import("@tego/server").CollectionOptions;
|
|
2
2
|
export default _default;
|
|
@@ -20,9 +20,9 @@ __export(approvalCarbonCopy_exports, {
|
|
|
20
20
|
default: () => approvalCarbonCopy_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(approvalCarbonCopy_exports);
|
|
23
|
-
var
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
24
|
var import_constants = require("../../common/constants");
|
|
25
|
-
var approvalCarbonCopy_default = (0,
|
|
25
|
+
var approvalCarbonCopy_default = (0, import_server.defineCollection)({
|
|
26
26
|
namespace: "workflow.approvalCarbonCopy",
|
|
27
27
|
dumpRules: "required",
|
|
28
28
|
name: import_constants.COLLECTION_NAME_APPROVAL_CARBON_COPY,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@
|
|
1
|
+
declare const _default: import("@tego/server").CollectionOptions;
|
|
2
2
|
export default _default;
|
|
@@ -20,8 +20,8 @@ __export(approvalExecutions_exports, {
|
|
|
20
20
|
default: () => approvalExecutions_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(approvalExecutions_exports);
|
|
23
|
-
var
|
|
24
|
-
var approvalExecutions_default = (0,
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var approvalExecutions_default = (0, import_server.defineCollection)({
|
|
25
25
|
namespace: "workflow.approvalExecutions",
|
|
26
26
|
dumpRules: "required",
|
|
27
27
|
name: "approvalExecutions",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@
|
|
1
|
+
declare const _default: import("@tego/server").CollectionOptions;
|
|
2
2
|
export default _default;
|
|
@@ -20,8 +20,8 @@ __export(approvalRecords_exports, {
|
|
|
20
20
|
default: () => approvalRecords_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(approvalRecords_exports);
|
|
23
|
-
var
|
|
24
|
-
var approvalRecords_default = (0,
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var approvalRecords_default = (0, import_server.defineCollection)({
|
|
25
25
|
namespace: "workflow.approvalRecords",
|
|
26
26
|
dumpRules: "required",
|
|
27
27
|
name: "approvalRecords",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@
|
|
1
|
+
declare const _default: import("@tego/server").CollectionOptions;
|
|
2
2
|
export default _default;
|
|
@@ -20,8 +20,8 @@ __export(approvals_exports, {
|
|
|
20
20
|
default: () => approvals_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(approvals_exports);
|
|
23
|
-
var
|
|
24
|
-
var approvals_default = (0,
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var approvals_default = (0, import_server.defineCollection)({
|
|
25
25
|
namespace: "workflow.approvals",
|
|
26
26
|
dumpRules: "required",
|
|
27
27
|
name: "approvals",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@
|
|
1
|
+
declare const _default: import("@tego/server").CollectionDef;
|
|
2
2
|
export default _default;
|
|
@@ -20,8 +20,8 @@ __export(workflows_exports, {
|
|
|
20
20
|
default: () => workflows_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(workflows_exports);
|
|
23
|
-
var
|
|
24
|
-
var workflows_default = (0,
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var workflows_default = (0, import_server.extendCollection)({
|
|
25
25
|
name: "workflows",
|
|
26
26
|
fields: [
|
|
27
27
|
{
|
|
@@ -30,9 +30,8 @@ __export(Approval_exports, {
|
|
|
30
30
|
default: () => ApprovalInstruction
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(Approval_exports);
|
|
33
|
-
var import_data_source = require("@tachybase/data-source");
|
|
34
33
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
35
|
-
var
|
|
34
|
+
var import_server = require("@tego/server");
|
|
36
35
|
var import_status = require("../constants/status");
|
|
37
36
|
var import_Approval = __toESM(require("../triggers/Approval"));
|
|
38
37
|
var import_tools = require("./tools");
|
|
@@ -84,7 +83,7 @@ class ApprovalInstruction extends import_module_workflow.Instruction {
|
|
|
84
83
|
}
|
|
85
84
|
);
|
|
86
85
|
for (const userId of assignees) {
|
|
87
|
-
const [dataSourceName] = (0,
|
|
86
|
+
const [dataSourceName] = (0, import_server.parseCollectionName)(approval.collectionName);
|
|
88
87
|
const collection = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName).collectionManager.getCollection(approval.collectionName);
|
|
89
88
|
const message = {
|
|
90
89
|
userId,
|
|
@@ -177,7 +176,7 @@ class ApprovalInstruction extends import_module_workflow.Instruction {
|
|
|
177
176
|
}
|
|
178
177
|
try {
|
|
179
178
|
const approval = records[0].approval;
|
|
180
|
-
const [dataSourceName, collectionName] = (0,
|
|
179
|
+
const [dataSourceName, collectionName] = (0, import_server.parseCollectionName)(approval.collectionName);
|
|
181
180
|
const { repository } = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName).collectionManager.getCollection(collectionName);
|
|
182
181
|
const workflow = await approval.getWorkflow({
|
|
183
182
|
where: {
|
|
@@ -217,7 +216,7 @@ class ApprovalInstruction extends import_module_workflow.Instruction {
|
|
|
217
216
|
});
|
|
218
217
|
return {
|
|
219
218
|
...node.config,
|
|
220
|
-
applyDetail: (result == null ? void 0 : result["x-uid"]) ?? (0,
|
|
219
|
+
applyDetail: (result == null ? void 0 : result["x-uid"]) ?? (0, import_server.uid)()
|
|
221
220
|
};
|
|
222
221
|
}
|
|
223
222
|
}
|
|
@@ -20,8 +20,8 @@ __export(ApprovalCarbonCopy_exports, {
|
|
|
20
20
|
default: () => ApprovalCarbonCopyInstruction
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(ApprovalCarbonCopy_exports);
|
|
23
|
-
var import_data_source = require("@tachybase/data-source");
|
|
24
23
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
24
|
+
var import_server = require("@tego/server");
|
|
25
25
|
var import_constants = require("../../common/constants");
|
|
26
26
|
var import_status = require("../constants/status");
|
|
27
27
|
var import_tools = require("../tools");
|
|
@@ -69,7 +69,7 @@ class ApprovalCarbonCopyInstruction extends import_module_workflow.Instruction {
|
|
|
69
69
|
transaction: processor.transaction
|
|
70
70
|
});
|
|
71
71
|
for (const userId of targetPersonList) {
|
|
72
|
-
const [dataSourceName] = (0,
|
|
72
|
+
const [dataSourceName] = (0, import_server.parseCollectionName)(approval.collectionName);
|
|
73
73
|
const collection = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName).collectionManager.getCollection(approval.collectionName);
|
|
74
74
|
const message = {
|
|
75
75
|
userId,
|
package/dist/server/plugin.d.ts
CHANGED
package/dist/server/plugin.js
CHANGED
|
@@ -31,9 +31,9 @@ __export(plugin_exports, {
|
|
|
31
31
|
default: () => plugin_default
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(plugin_exports);
|
|
34
|
-
var
|
|
34
|
+
var import_node_path = __toESM(require("node:path"));
|
|
35
35
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
36
|
-
var import_server = require("@
|
|
36
|
+
var import_server = require("@tego/server");
|
|
37
37
|
var import_constants = require("../common/constants");
|
|
38
38
|
var import_actions = require("./actions");
|
|
39
39
|
var import_Approval = __toESM(require("./instructions/Approval"));
|
|
@@ -57,13 +57,13 @@ class PluginWorkflowApproval extends import_server.Plugin {
|
|
|
57
57
|
const { db } = this;
|
|
58
58
|
db.addMigrations({
|
|
59
59
|
namespace: "approval",
|
|
60
|
-
directory:
|
|
60
|
+
directory: import_node_path.default.resolve(__dirname, "migrations"),
|
|
61
61
|
context: {
|
|
62
62
|
plugin: this
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
await db.import({
|
|
66
|
-
directory:
|
|
66
|
+
directory: import_node_path.default.resolve(__dirname, "collections")
|
|
67
67
|
});
|
|
68
68
|
(0, import_actions.init)(this);
|
|
69
69
|
this.app.acl.allow("workflows", ["listApprovalFlows"], "loggedIn");
|
|
@@ -20,9 +20,8 @@ __export(Approval_exports, {
|
|
|
20
20
|
default: () => ApprovalTrigger
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(Approval_exports);
|
|
23
|
-
var import_data_source = require("@tachybase/data-source");
|
|
24
|
-
var import_database = require("@tachybase/database");
|
|
25
23
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
24
|
+
var import_server = require("@tego/server");
|
|
26
25
|
var import_lodash = require("lodash");
|
|
27
26
|
var import_sequelize = require("sequelize");
|
|
28
27
|
var import_status = require("../constants/status");
|
|
@@ -58,7 +57,7 @@ const _ApprovalTrigger = class _ApprovalTrigger extends import_module_workflow.T
|
|
|
58
57
|
if (!workflow || !isChangedStatus || !isAllowStatusList || isForbiddenWhenStatusChange) {
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
61
|
-
const [dataSourceName, collectionName] = (0,
|
|
60
|
+
const [dataSourceName, collectionName] = (0, import_server.parseCollectionName)(approval.collectionName);
|
|
62
61
|
const { repository } = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName).collectionManager.getCollection(collectionName);
|
|
63
62
|
const data = await repository.findOne({
|
|
64
63
|
filterByTk: approval.get("dataKey"),
|
|
@@ -202,7 +201,7 @@ const _ApprovalTrigger = class _ApprovalTrigger extends import_module_workflow.T
|
|
|
202
201
|
await next();
|
|
203
202
|
workflows.forEach(async (workflow) => {
|
|
204
203
|
const trigger = triggers.find((trigger2) => trigger2[0] === workflow.key);
|
|
205
|
-
const [dataSourceName, collectionName] = (0,
|
|
204
|
+
const [dataSourceName, collectionName] = (0, import_server.parseCollectionName)(workflow.config.collection);
|
|
206
205
|
const collecton = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName).collectionManager.getCollection(collectionName);
|
|
207
206
|
const data = await collecton.repository.create({
|
|
208
207
|
values: {
|
|
@@ -241,7 +240,7 @@ const _ApprovalTrigger = class _ApprovalTrigger extends import_module_workflow.T
|
|
|
241
240
|
(item) => item.type === _ApprovalTrigger.TYPE && triggersKeysMap.has(item.key)
|
|
242
241
|
);
|
|
243
242
|
for (const workflow of workflows) {
|
|
244
|
-
const [dataSourceName, collectionName] = (0,
|
|
243
|
+
const [dataSourceName, collectionName] = (0, import_server.parseCollectionName)(workflow.config.collection);
|
|
245
244
|
const trigger = triggers.find((trigger2) => trigger2[0] === workflow.key);
|
|
246
245
|
const { body: data } = context;
|
|
247
246
|
if (!data) {
|
|
@@ -266,7 +265,7 @@ const _ApprovalTrigger = class _ApprovalTrigger extends import_module_workflow.T
|
|
|
266
265
|
if (payload.get(field)) {
|
|
267
266
|
payload = payload.get(field);
|
|
268
267
|
} else {
|
|
269
|
-
const association = (0,
|
|
268
|
+
const association = (0, import_server.modelAssociationByKey)(payload, field);
|
|
270
269
|
payload = await payload[association.accessors.get]();
|
|
271
270
|
}
|
|
272
271
|
}
|
package/package.json
CHANGED
|
@@ -1,45 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-workflow-approval",
|
|
3
3
|
"displayName": "Approval",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.23",
|
|
5
5
|
"description": "Approval base in Workflow",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Approval",
|
|
8
8
|
"Workflow"
|
|
9
9
|
],
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
|
-
"dependencies": {},
|
|
12
11
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "
|
|
12
|
+
"@ant-design/icons": "^5.6.1",
|
|
13
|
+
"@tachybase/schema": "^1.3.43",
|
|
14
|
+
"@tachybase/test": "^1.3.43",
|
|
15
|
+
"@tego/client": "^1.3.43",
|
|
16
|
+
"@tego/server": "^1.3.43",
|
|
14
17
|
"@types/file-saver": "^2.0.7",
|
|
15
18
|
"@types/lodash": "^4.17.20",
|
|
16
19
|
"ahooks": "^3.9.0",
|
|
17
20
|
"antd": "5.22.5",
|
|
18
21
|
"antd-mobile": "^5.39.0",
|
|
19
22
|
"antd-mobile-icons": "^0.3.0",
|
|
23
|
+
"dayjs": "^1.11.13",
|
|
20
24
|
"file-saver": "^2.0.5",
|
|
21
25
|
"jsonata": "^2.0.6",
|
|
22
26
|
"lodash": "4.17.21",
|
|
23
|
-
"react-i18next": "
|
|
27
|
+
"react-i18next": "15.2.0",
|
|
24
28
|
"react-router-dom": "6.28.1",
|
|
25
|
-
"sequelize": "^6.37.5"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"@tachybase/
|
|
29
|
-
"@tachybase/client": "1.3.21",
|
|
30
|
-
"@tachybase/components": "1.3.21",
|
|
31
|
-
"@tachybase/data-source": "1.3.21",
|
|
32
|
-
"@tachybase/database": "1.3.21",
|
|
33
|
-
"@tachybase/module-ui-schema": "1.3.21",
|
|
34
|
-
"@tachybase/module-workflow": "1.3.21",
|
|
35
|
-
"@tachybase/schema": "1.3.21",
|
|
36
|
-
"@tachybase/test": "1.3.21",
|
|
37
|
-
"@tachybase/server": "1.3.21",
|
|
38
|
-
"@tachybase/utils": "1.3.21"
|
|
29
|
+
"sequelize": "^6.37.5",
|
|
30
|
+
"@tachybase/client": "1.3.23",
|
|
31
|
+
"@tachybase/module-ui-schema": "1.3.23",
|
|
32
|
+
"@tachybase/module-workflow": "1.3.23"
|
|
39
33
|
},
|
|
40
34
|
"description.zh-CN": "审批系统是一个强大的BPM工具,为业务流程自动化提供基础支持,同时具备高度灵活性和可扩展性,确保审批流程的效率和合规性,助力企业释放创新潜力。",
|
|
41
|
-
"displayName.zh-CN": "审批"
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "tachybase-build --no-dts @tachybase/plugin-workflow-approval"
|
|
44
|
-
}
|
|
35
|
+
"displayName.zh-CN": "审批"
|
|
45
36
|
}
|