@tachybase/plugin-workflow-approval 0.23.8 → 0.23.16
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/h5/initiations/hook/useActionReminder.d.ts +3 -0
- package/dist/client/h5/initiations/provider/ActionReminder.provider.d.ts +1 -0
- package/dist/client/index.js +73 -28
- package/dist/client/pc/configuration/trigger/launcher-interface/LauncherActionConfig.component.d.ts +1 -0
- package/dist/client/pc/usage/block/BlockInitItem.schema.d.ts +2 -5
- package/dist/client/pc/usage/block/FeatureCard.component.d.ts +2 -0
- package/dist/client/pc/usage/block/FeatureCard.style.d.ts +3 -0
- package/dist/client/pc/usage/block/FeatureList.component.d.ts +2 -0
- package/dist/client/pc/usage/block/FeatureList.style.d.ts +3 -0
- package/dist/client/pc/usage/block/FeatureModal.schema.d.ts +32 -0
- package/dist/client/pc/usage/block/FeatureModal.view.d.ts +2 -0
- package/dist/client/pc/usage/block/initiations/hooks/useActionReminder.d.ts +3 -0
- package/dist/client/pc/usage/block/initiations/providers/ActionReminder.provider.d.ts +1 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +27 -0
- package/dist/externalVersion.js +10 -10
- package/dist/locale/en-US.json +5 -1
- package/dist/locale/zh-CN.json +5 -1
- package/dist/server/actions/approvals.d.ts +1 -0
- package/dist/server/actions/approvals.js +40 -0
- package/dist/server/collections/workflows.d.ts +2 -0
- package/dist/server/collections/workflows.js +38 -0
- package/package.json +14 -15
- package/.turbo/turbo-build.log +0 -14
|
@@ -3,11 +3,7 @@ export declare const getSchemaBlockInitItem: (params: any) => {
|
|
|
3
3
|
name: string;
|
|
4
4
|
'x-uid': string;
|
|
5
5
|
'x-decorator': any;
|
|
6
|
-
'x-decorator-props':
|
|
7
|
-
collection: any;
|
|
8
|
-
params: any;
|
|
9
|
-
action: any;
|
|
10
|
-
};
|
|
6
|
+
'x-decorator-props': any;
|
|
11
7
|
'x-component': string;
|
|
12
8
|
'x-designer': string;
|
|
13
9
|
'x-toolbar': any;
|
|
@@ -16,6 +12,7 @@ export declare const getSchemaBlockInitItem: (params: any) => {
|
|
|
16
12
|
block: {
|
|
17
13
|
type: string;
|
|
18
14
|
'x-component': any;
|
|
15
|
+
'x-component-props': any;
|
|
19
16
|
};
|
|
20
17
|
};
|
|
21
18
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const getSchemaFeatureModal: (workflow: any) => {
|
|
2
|
+
type: string;
|
|
3
|
+
properties: {
|
|
4
|
+
[x: string]: {
|
|
5
|
+
type: string;
|
|
6
|
+
title: any;
|
|
7
|
+
'x-decorator': string;
|
|
8
|
+
'x-decorator-props': {
|
|
9
|
+
workflow: any;
|
|
10
|
+
};
|
|
11
|
+
'x-component': string;
|
|
12
|
+
'x-component-props': {
|
|
13
|
+
className: string;
|
|
14
|
+
};
|
|
15
|
+
properties: {
|
|
16
|
+
[x: number]: {
|
|
17
|
+
type: string;
|
|
18
|
+
'x-decorator': string;
|
|
19
|
+
'x-decorator-props': {
|
|
20
|
+
name: string;
|
|
21
|
+
dataSource: string;
|
|
22
|
+
};
|
|
23
|
+
'x-component': string;
|
|
24
|
+
'x-component-props': {
|
|
25
|
+
uid: any;
|
|
26
|
+
noForm: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProviderActionReminder: (props: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NAMESPACE = "@tachybase/plugin-workflow-approval";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var constants_exports = {};
|
|
19
|
+
__export(constants_exports, {
|
|
20
|
+
NAMESPACE: () => NAMESPACE
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(constants_exports);
|
|
23
|
+
const NAMESPACE = "@tachybase/plugin-workflow-approval";
|
|
24
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
+
0 && (module.exports = {
|
|
26
|
+
NAMESPACE
|
|
27
|
+
});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "0.23.
|
|
3
|
-
"@tachybase/module-workflow": "0.23.
|
|
4
|
-
"@tachybase/server": "0.23.
|
|
2
|
+
"@tachybase/client": "0.23.16",
|
|
3
|
+
"@tachybase/module-workflow": "0.23.16",
|
|
4
|
+
"@tachybase/server": "0.23.16",
|
|
5
5
|
"lodash": "4.17.21",
|
|
6
6
|
"react": "18.3.1",
|
|
7
|
-
"@tachybase/schema": "0.23.
|
|
7
|
+
"@tachybase/schema": "0.23.16",
|
|
8
8
|
"@ant-design/icons": "5.3.7",
|
|
9
|
-
"@tachybase/actions": "0.23.
|
|
10
|
-
"@tachybase/database": "0.23.
|
|
11
|
-
"@tachybase/data-source": "0.23.
|
|
12
|
-
"@tachybase/module-ui-schema": "0.23.
|
|
13
|
-
"@tachybase/utils": "0.23.
|
|
9
|
+
"@tachybase/actions": "0.23.16",
|
|
10
|
+
"@tachybase/database": "0.23.16",
|
|
11
|
+
"@tachybase/data-source": "0.23.16",
|
|
12
|
+
"@tachybase/module-ui-schema": "0.23.16",
|
|
13
|
+
"@tachybase/utils": "0.23.16",
|
|
14
14
|
"sequelize": "6.37.5",
|
|
15
15
|
"antd": "5.22.5",
|
|
16
16
|
"ahooks": "3.8.4",
|
|
17
17
|
"react-router-dom": "6.28.1",
|
|
18
|
-
"@tachybase/components": "0.23.
|
|
18
|
+
"@tachybase/components": "0.23.16"
|
|
19
19
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -180,6 +180,7 @@
|
|
|
180
180
|
"My Pending Tasks": "My Pending Tasks",
|
|
181
181
|
"Negotiation": "Negotiation",
|
|
182
182
|
"Negotiation mode": "Negotiation mode",
|
|
183
|
+
"New Initiate Request": "New Initiate Request",
|
|
183
184
|
"No end": "No end",
|
|
184
185
|
"No limit": "No limit",
|
|
185
186
|
"No repeat": "No repeat",
|
|
@@ -218,6 +219,8 @@
|
|
|
218
219
|
"Reject": "Reject",
|
|
219
220
|
"Rejected": "Rejected",
|
|
220
221
|
"Related approvals": "Related approvals",
|
|
222
|
+
"Reminder": "Reminder",
|
|
223
|
+
"Reminder {{user}} successful": "Reminder {{user}} successful",
|
|
221
224
|
"Repeat limit": "Repeat limit",
|
|
222
225
|
"Repeat mode": "Repeat mode",
|
|
223
226
|
"Resource": "Resource",
|
|
@@ -307,5 +310,6 @@
|
|
|
307
310
|
"concat": "concat",
|
|
308
311
|
"ms": "ms",
|
|
309
312
|
"needAuthorization": "needAuthorization",
|
|
310
|
-
"workflow loop!": "workflow loop!"
|
|
313
|
+
"workflow loop!": "workflow loop!",
|
|
314
|
+
"{{user}} reminder": "{{user}} reminder"
|
|
311
315
|
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -221,6 +221,7 @@
|
|
|
221
221
|
"My Pending Tasks": "我的待办",
|
|
222
222
|
"Negotiation": "协商机制",
|
|
223
223
|
"Negotiation mode": "协商模式",
|
|
224
|
+
"New Initiate Request": "发起申请(新)",
|
|
224
225
|
"No data yet": "暂无数据",
|
|
225
226
|
"No end": "不结束",
|
|
226
227
|
"No limit": "不限",
|
|
@@ -264,6 +265,8 @@
|
|
|
264
265
|
"Rejected": "否决",
|
|
265
266
|
"Rejected from a manual node.": "被人工节点拒绝继续。",
|
|
266
267
|
"Related approvals": "相关审批",
|
|
268
|
+
"Reminder": "催签",
|
|
269
|
+
"Reminder {{user}} successful": "催签 {{user}} 成功",
|
|
267
270
|
"Repeat limit": "重复次数",
|
|
268
271
|
"Repeat mode": "重复模式",
|
|
269
272
|
"Resolved": "完成",
|
|
@@ -384,5 +387,6 @@
|
|
|
384
387
|
"concat": "连接",
|
|
385
388
|
"ms": "毫秒",
|
|
386
389
|
"needAuthorization": "是否携带权限校验",
|
|
387
|
-
"workflow loop!": "存在环形调用!"
|
|
390
|
+
"workflow loop!": "存在环形调用!",
|
|
391
|
+
"{{user}} reminder": "{{user}} 催签"
|
|
388
392
|
}
|
|
@@ -34,6 +34,7 @@ var import_actions = __toESM(require("@tachybase/actions"));
|
|
|
34
34
|
var import_data_source = require("@tachybase/data-source");
|
|
35
35
|
var import_database = require("@tachybase/database");
|
|
36
36
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
37
|
+
var import_constants = require("../../common/constants");
|
|
37
38
|
var import_status = require("../constants/status");
|
|
38
39
|
var import_tools = require("../tools");
|
|
39
40
|
const approvals = {
|
|
@@ -267,6 +268,45 @@ const approvals = {
|
|
|
267
268
|
}
|
|
268
269
|
});
|
|
269
270
|
return await import_actions.default.list(context, next);
|
|
271
|
+
},
|
|
272
|
+
async reminder(context, next) {
|
|
273
|
+
var _a, _b, _c;
|
|
274
|
+
const { filterByTk } = context.action.params;
|
|
275
|
+
const repository = import_actions.utils.getRepositoryFromParams(context);
|
|
276
|
+
const approval = await repository.findOne({
|
|
277
|
+
filterByTk,
|
|
278
|
+
appends: ["records", "workflow", "createdBy.nickname"]
|
|
279
|
+
});
|
|
280
|
+
if (!approval) {
|
|
281
|
+
return context.throw(404);
|
|
282
|
+
}
|
|
283
|
+
if (approval.createdById !== ((_a = context.state.currentUser) == null ? void 0 : _a.id)) {
|
|
284
|
+
return context.throw(403);
|
|
285
|
+
}
|
|
286
|
+
if ([import_status.APPROVAL_STATUS.APPROVED, import_status.APPROVAL_STATUS.REJECTED, import_status.APPROVAL_STATUS.ERROR].includes(approval.status)) {
|
|
287
|
+
return context.throw(400);
|
|
288
|
+
}
|
|
289
|
+
if (((_b = approval.records) == null ? void 0 : _b.length) === 0) {
|
|
290
|
+
return context.throw(400);
|
|
291
|
+
}
|
|
292
|
+
const assignees = approval.records.map((record) => record.userId);
|
|
293
|
+
for (const userId of assignees) {
|
|
294
|
+
const message = {
|
|
295
|
+
userId,
|
|
296
|
+
title: `{{t("Approval", { ns: '${import_constants.NAMESPACE}' })}}`,
|
|
297
|
+
content: `{{t("{{user}} reminder", { ns: "${import_constants.NAMESPACE}", user: "${approval.createdBy.nickname}" })}}`,
|
|
298
|
+
collectionName: approval.collectionName,
|
|
299
|
+
jsonContent: approval.summary,
|
|
300
|
+
schemaName: (_c = approval.workflow) == null ? void 0 : _c.config.applyDetail
|
|
301
|
+
};
|
|
302
|
+
context.app.messageManager.sendMessage(+userId, message);
|
|
303
|
+
}
|
|
304
|
+
await next();
|
|
305
|
+
context.status = 200;
|
|
306
|
+
context.body = {
|
|
307
|
+
message: "reminder sent",
|
|
308
|
+
success: true
|
|
309
|
+
};
|
|
270
310
|
}
|
|
271
311
|
};
|
|
272
312
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var workflows_exports = {};
|
|
19
|
+
__export(workflows_exports, {
|
|
20
|
+
default: () => workflows_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(workflows_exports);
|
|
23
|
+
var import_database = require("@tachybase/database");
|
|
24
|
+
var workflows_default = (0, import_database.extendCollection)({
|
|
25
|
+
name: "workflows",
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
name: "color",
|
|
29
|
+
type: "string",
|
|
30
|
+
interface: "color"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "icon",
|
|
34
|
+
type: "string",
|
|
35
|
+
interface: "icon"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
});
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-workflow-approval",
|
|
3
3
|
"displayName": "Approval",
|
|
4
|
-
"version": "0.23.
|
|
4
|
+
"version": "0.23.16",
|
|
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": {
|
|
11
|
+
"dependencies": {},
|
|
12
|
+
"devDependencies": {
|
|
12
13
|
"@ant-design/icons": "~5.3.7",
|
|
14
|
+
"@types/file-saver": "^2.0.7",
|
|
13
15
|
"@types/lodash": "^4.17.13",
|
|
14
16
|
"ahooks": "^3.8.4",
|
|
15
17
|
"antd": "5.22.5",
|
|
@@ -22,20 +24,17 @@
|
|
|
22
24
|
"react-router-dom": "6.28.1",
|
|
23
25
|
"sequelize": "^6.37.5"
|
|
24
26
|
},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"@types/file-saver": "^2.0.7"
|
|
27
|
-
},
|
|
28
27
|
"peerDependencies": {
|
|
29
|
-
"@tachybase/actions": "0.23.
|
|
30
|
-
"@tachybase/
|
|
31
|
-
"@tachybase/
|
|
32
|
-
"@tachybase/
|
|
33
|
-
"@tachybase/
|
|
34
|
-
"@tachybase/
|
|
35
|
-
"@tachybase/
|
|
36
|
-
"@tachybase/
|
|
37
|
-
"@tachybase/
|
|
38
|
-
"@tachybase/
|
|
28
|
+
"@tachybase/actions": "0.23.16",
|
|
29
|
+
"@tachybase/components": "0.23.16",
|
|
30
|
+
"@tachybase/client": "0.23.16",
|
|
31
|
+
"@tachybase/database": "0.23.16",
|
|
32
|
+
"@tachybase/data-source": "0.23.16",
|
|
33
|
+
"@tachybase/module-workflow": "0.23.16",
|
|
34
|
+
"@tachybase/schema": "0.23.16",
|
|
35
|
+
"@tachybase/utils": "0.23.16",
|
|
36
|
+
"@tachybase/test": "0.23.16",
|
|
37
|
+
"@tachybase/server": "0.23.16"
|
|
39
38
|
},
|
|
40
39
|
"description.zh-CN": "审批系统是一个强大的BPM工具,为业务流程自动化提供基础支持,同时具备高度灵活性和可扩展性,确保审批流程的效率和合规性,助力企业释放创新潜力。",
|
|
41
40
|
"displayName.zh-CN": "审批",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
> @tachybase/plugin-workflow-approval@0.23.7 build /Users/seal/Documents/projects/tachybase/packages/plugin-workflow-approval
|
|
4
|
-
> tachybase-build --no-dts @tachybase/plugin-workflow-approval
|
|
5
|
-
|
|
6
|
-
[33m[33mThe CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.[39m[39m
|
|
7
|
-
[4m[95m@tachybase/plugin-workflow-approval[39m[24m: [1mplugin-workflow-approval[22m build start
|
|
8
|
-
[4m[95m@tachybase/plugin-workflow-approval[39m[24m: build plugin client
|
|
9
|
-
[2K[1G[2K[1G[2K[1G[4m[95m@tachybase/plugin-workflow-approval[39m[24m: build plugin server source
|
|
10
|
-
[4m[95m@tachybase/plugin-workflow-approval[39m[24m: delete server files
|
|
11
|
-
[4m[95m@tachybase/plugin-workflow-approval[39m[24m: build plugin server dependencies
|
|
12
|
-
[4m[95m@tachybase/plugin-workflow-approval[39m[24m: These packages [33m@tachybase/module-workflow, @tachybase/server, lodash, @tachybase/actions, @tachybase/database, @tachybase/data-source, @tachybase/module-ui-schema, @tachybase/utils, sequelize[39m will be [3mexclude[23m.
|
|
13
|
-
[4m[95m@tachybase/plugin-workflow-approval[39m[24m: write external version
|
|
14
|
-
|