@voplus/morpho-workspace 6.0.145 → 6.0.146
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ILoadable } from "@voplus/morpho-data";
|
2
|
+
import { INode } from "@voplus/morpho-document-core";
|
2
3
|
export type WorkTypeStatus = "Active" | "Disabled";
|
3
4
|
export interface ICheckListItem {
|
4
5
|
key?: string;
|
@@ -23,7 +24,7 @@ export interface IAuditAuditorInfo {
|
|
23
24
|
id: string;
|
24
25
|
}[];
|
25
26
|
}
|
26
|
-
export interface IWorkType extends ILoadable {
|
27
|
+
export interface IWorkType extends ILoadable, INode {
|
27
28
|
/** id of the workType */
|
28
29
|
id: string;
|
29
30
|
sequence?: ISequenceInfo;
|
@@ -34,11 +35,6 @@ export interface IWorkType extends ILoadable {
|
|
34
35
|
defaultDue?: number;
|
35
36
|
status?: string;
|
36
37
|
autoAccept?: boolean;
|
37
|
-
actions?: {
|
38
|
-
canDelete: boolean;
|
39
|
-
canEnable: boolean;
|
40
|
-
canDisable: boolean;
|
41
|
-
};
|
42
38
|
defaultFolder?: {
|
43
39
|
id: string;
|
44
40
|
name: string;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Access, Delete } from "@voplus/morpho-org/es/controls/NodeMenu/items";
|
3
3
|
import { Button } from "antd";
|
4
|
+
import { useApplicationContext } from "@voplus/morpho-data";
|
4
5
|
import { useWorkType, useWorkTypeStore } from "../../../../../data/worktype";
|
5
6
|
import { faUserLock, faUserUnlock } from "@fortawesome/pro-light-svg-icons";
|
6
7
|
import { observe } from "@voplus/morpho-ui";
|
@@ -10,26 +11,22 @@ import Select from "./item/Select";
|
|
10
11
|
const WorkTypeMenu = (props) => {
|
11
12
|
/** 加class name 为了方便做integration tests */
|
12
13
|
const classId = "workType-menu";
|
13
|
-
const
|
14
|
-
|
15
|
-
includes: "actions",
|
16
|
-
});
|
14
|
+
const { id } = props;
|
15
|
+
const { user } = useApplicationContext();
|
17
16
|
const store = useWorkTypeStore();
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
React.createElement("span", null, "Enable")))) }));
|
30
|
-
});
|
17
|
+
const worktype = useWorkType(id, { reload: (i) => !i.p, includes: "permissions" });
|
18
|
+
return observe(() => (React.createElement(NodeMenu, { id: id, icon: props.icon, store: store, menus: React.createElement(React.Fragment, null,
|
19
|
+
React.createElement(Access, null),
|
20
|
+
React.createElement(Select, { id: id, className: classId + "-move" }),
|
21
|
+
user.can("delete", worktype.p) && React.createElement(Delete, { closeAside: props.closeAside }),
|
22
|
+
user.can("disable", worktype.p) && (React.createElement(Button, { type: "link", onClick: () => onChangeStatus("Disabled"), className: classId + "-disabled" },
|
23
|
+
React.createElement(FAIcon, { icon: faUserLock }),
|
24
|
+
React.createElement("span", null, "Disabled"))),
|
25
|
+
user.can("enable", worktype.p) && (React.createElement(Button, { type: "link", onClick: () => onChangeStatus("Enable"), className: classId + "-enable" },
|
26
|
+
React.createElement(FAIcon, { icon: faUserUnlock }),
|
27
|
+
React.createElement("span", null, "Enable")))) })));
|
31
28
|
function onChangeStatus(status) {
|
32
|
-
store.edit(
|
29
|
+
store.edit(id, { data: { Status: status }, error: "message" });
|
33
30
|
}
|
34
31
|
};
|
35
32
|
export default WorkTypeMenu;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-type/controls/WorkTypeMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-type/controls/WorkTypeMenu/index.tsx"],"names":[],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