@giteeteam/apps-team-components 1.4.1 → 1.5.0
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/README.md +8 -9
- package/dist/components/fields/status/SelectFlowHandler.d.ts +2 -1
- package/dist/components/fields/status/SelectFlowHandler.js +2 -1
- package/dist/components/fields/status/SelectTransition.d.ts +1 -1
- package/dist/components/fields/status/TransitionButton.d.ts +1 -1
- package/dist/components/fields/status/TransitionButton.js +1 -1
- package/dist/components/fields/status/TransitionPanel.js +10 -6
- package/dist/lib/global.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,14 +14,13 @@ pnpm i
|
|
|
14
14
|
pnpm storybook
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
- team最低版本为4.16.0
|
|
17
|
+
# 版本对应
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
| 组件库版本 | team版本 |
|
|
20
|
+
| --| -- |
|
|
21
|
+
| 1.1.x | >=4.16.0 |
|
|
22
|
+
| 1.2.x | >=4.21.0 |
|
|
23
|
+
| 1.3.x | >=4.23.0 |
|
|
24
|
+
| 1.4.x | >=4.24.0 |
|
|
25
|
+
| 1.5.x | >=4.27.0 |
|
|
22
26
|
|
|
23
|
-
# 1.3.x版本
|
|
24
|
-
- team最低版本为4.23.0
|
|
25
|
-
|
|
26
|
-
# 1.4.x版本
|
|
27
|
-
- team最低版本为4.24.0
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { NodeItemProps } from '../../../lib/types/workflow';
|
|
2
3
|
interface SelectFlowHandlerProps {
|
|
3
4
|
itemId: string;
|
|
4
5
|
onBack: () => void;
|
|
@@ -7,7 +8,7 @@ interface SelectFlowHandlerProps {
|
|
|
7
8
|
loading: boolean;
|
|
8
9
|
loadingUser: boolean;
|
|
9
10
|
fetchUsers: (itemId: string, status: string, keyword?: string) => Promise<void>;
|
|
10
|
-
handleTransition: (updateTask: string, screenId: string, script: string, flowHandler?: Array<{
|
|
11
|
+
handleTransition: (updateTask: string, screenId: string, script: string, target: NodeItemProps, flowHandler?: Array<{
|
|
11
12
|
label: string;
|
|
12
13
|
value: string;
|
|
13
14
|
}>) => void;
|
|
@@ -55,7 +55,7 @@ const SelectFlowHandler = ({ itemId, task, onBack, users, loading, loadingUser,
|
|
|
55
55
|
label: user.nickname ? `${user.nickname}(${user.username})` : user.username,
|
|
56
56
|
value: user.objectId,
|
|
57
57
|
}));
|
|
58
|
-
handleTransition(task.name, (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.screen) === null || _b === void 0 ? void 0 : _b.key, (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.scriptValidator, submitUsers);
|
|
58
|
+
handleTransition(task.name, (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.screen) === null || _b === void 0 ? void 0 : _b.key, (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.scriptValidator, task.target, submitUsers);
|
|
59
59
|
}, [
|
|
60
60
|
handleTransition,
|
|
61
61
|
selectedUserIds.length,
|
|
@@ -63,6 +63,7 @@ const SelectFlowHandler = ({ itemId, task, onBack, users, loading, loadingUser,
|
|
|
63
63
|
task.name,
|
|
64
64
|
(_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.screen) === null || _b === void 0 ? void 0 : _b.key,
|
|
65
65
|
(_c = task.parameters) === null || _c === void 0 ? void 0 : _c.scriptValidator,
|
|
66
|
+
task.target,
|
|
66
67
|
]);
|
|
67
68
|
const OverflowText = () => {
|
|
68
69
|
var _a, _b;
|
|
@@ -14,7 +14,7 @@ interface SelectTransitionProps {
|
|
|
14
14
|
workflowData: WorkflowDataProps;
|
|
15
15
|
approval: ApprovalData;
|
|
16
16
|
checkIn: CheckInData;
|
|
17
|
-
handleTransition: (updateTask: string, screenId: string, script: string) => void;
|
|
17
|
+
handleTransition: (updateTask: string, screenId: string, script: string, target?: any) => void;
|
|
18
18
|
readonly: boolean;
|
|
19
19
|
flowHandlerActive?: boolean;
|
|
20
20
|
}
|
|
@@ -5,7 +5,7 @@ interface TransitionButtonProps {
|
|
|
5
5
|
text: string;
|
|
6
6
|
screenId: string;
|
|
7
7
|
scriptValidator: string;
|
|
8
|
-
handleTransition: (updateTask: string, screenId: string, script: string) => void;
|
|
8
|
+
handleTransition: (updateTask: string, screenId: string, script: string, target: NodeItemProps) => void;
|
|
9
9
|
target: NodeItemProps & {
|
|
10
10
|
type?: string;
|
|
11
11
|
};
|
|
@@ -27,7 +27,7 @@ const TransitionButton = ({ loading, screenId, text, scriptValidator, handleTran
|
|
|
27
27
|
return (jsx(ClassNames, { children: ({ cx, css }) => {
|
|
28
28
|
return conditionCheck ? ((conditionCheck === null || conditionCheck === void 0 ? void 0 : conditionCheck.result) && !readonly ? (jsx("div", { className: cx(css(flowBtnStyle), loading ? css(notAllowedStyle) : css(pointerStyle)), onClick: () => {
|
|
29
29
|
if (!loading) {
|
|
30
|
-
handleTransition(text, screenId, scriptValidator);
|
|
30
|
+
handleTransition(text, screenId, scriptValidator, target);
|
|
31
31
|
}
|
|
32
32
|
}, children: jsx(OverflowText, { text: text, target: target }) })) : (jsx(Tooltip, { title: tipContent, placement: "right", children: jsx("div", { className: cx(css(flowBtnStyle), css(notAllowedStyle)), children: jsx(OverflowText, { text: text, target: target }) }) }))) : null;
|
|
33
33
|
} }));
|
|
@@ -269,13 +269,16 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
|
|
|
269
269
|
const submitTransition = useCallback(async (itemDetail) => {
|
|
270
270
|
await submitHandle(updateTransitionText, itemDetail);
|
|
271
271
|
}, [submitHandle, updateTransitionText]);
|
|
272
|
-
const handleTransition = useCallback(async (transitionText, screenId, scriptValidator, flowHandler) => {
|
|
272
|
+
const handleTransition = useCallback(async (transitionText, screenId, scriptValidator, target, flowHandler) => {
|
|
273
273
|
if (flowHandlerActive) {
|
|
274
274
|
if (transitionStep === TransitionStepType.SelectTransition) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
275
|
+
const nextStateTransition = workflowData.transitions.find(t => t.source.id === target.key);
|
|
276
|
+
if (nextStateTransition) {
|
|
277
|
+
setCurrentFlowHandler(undefined);
|
|
278
|
+
setFlowTask(tasks.find(task => task.name === transitionText));
|
|
279
|
+
setTransitionStep(TransitionStepType.SelectFlowHandler);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
279
282
|
}
|
|
280
283
|
else {
|
|
281
284
|
console.info('flowHandler', flowHandler);
|
|
@@ -318,8 +321,9 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
|
|
|
318
321
|
}
|
|
319
322
|
}, [
|
|
320
323
|
flowHandlerActive,
|
|
321
|
-
transitionStep,
|
|
322
324
|
setFlowing,
|
|
325
|
+
transitionStep,
|
|
326
|
+
workflowData.transitions,
|
|
323
327
|
tasks,
|
|
324
328
|
itemId,
|
|
325
329
|
itemType,
|
package/dist/lib/global.js
CHANGED
|
@@ -81,9 +81,9 @@ var WorkflowStatusType;
|
|
|
81
81
|
WorkflowStatusType["Finished"] = "Finished";
|
|
82
82
|
})(WorkflowStatusType || (WorkflowStatusType = {}));
|
|
83
83
|
const WorkFlowStatusColor = {
|
|
84
|
-
[WorkflowStatusType.Start]: { color: '#
|
|
85
|
-
[WorkflowStatusType.InProgress]: { color: '#
|
|
86
|
-
[WorkflowStatusType.Finished]: { color: '#
|
|
84
|
+
[WorkflowStatusType.Start]: { color: '#FFFFFF', bgColor: '#3683FF' },
|
|
85
|
+
[WorkflowStatusType.InProgress]: { color: '#FFFFFF', bgColor: '#FFBF36' },
|
|
86
|
+
[WorkflowStatusType.Finished]: { color: '#FFFFFF', bgColor: '#29C477' },
|
|
87
87
|
};
|
|
88
88
|
const CustomFieldComponentTypes = {
|
|
89
89
|
Date: 'Date',
|