@voplus/morpho-workspace 5.0.21 → 5.0.22
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/es/modules/work/components/WorkErrorPropertiesView/index.js +15 -43
- package/es/modules/work/components/WorkErrorPropertiesView/index.js.map +1 -1
- package/es/modules/work/components/WorkErrorPropertiesView/index.less +1 -5
- package/es/modules/work/components/WorkErrorTabs/index.js +10 -5
- package/es/modules/work/components/WorkErrorTabs/index.js.map +1 -1
- package/package.json +1 -1
@@ -1,15 +1,12 @@
|
|
1
|
-
import React, {
|
2
|
-
import { Skeleton,
|
1
|
+
import React, { useMemo } from "react";
|
2
|
+
import { Skeleton, Tag } from "antd";
|
3
3
|
import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
4
4
|
import { useWorkError, useWorkErrorStore } from "../../../../data/workerror";
|
5
|
-
import
|
5
|
+
import WorkErrorTabs from "../WorkErrorTabs";
|
6
6
|
import AvatarList from "@voplus/morpho-org/es/components/AvatarList";
|
7
|
-
import DescriptionEditor from "@voplus/morpho-document/es/controls/DescriptionEditor";
|
8
|
-
import DocumentList from "@voplus/morpho-document/es/components/DocumentList";
|
9
7
|
import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
|
10
8
|
import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
|
11
9
|
import WorkErrorMenu from "../../controls/WorkErrorMenu";
|
12
|
-
import WorkErrorProperties from "../WorkErrorProperties";
|
13
10
|
import moment from "moment";
|
14
11
|
import { observe } from "@voplus/morpho-ui";
|
15
12
|
import styles from "./index.less";
|
@@ -20,46 +17,21 @@ const WorkErrorPropertiesView = (props) => {
|
|
20
17
|
const workerror = useWorkError(id);
|
21
18
|
const store = useWorkErrorStore();
|
22
19
|
const { user } = useApplicationContext();
|
23
|
-
/**Tabs 当前激活 tab 面板的 key */
|
24
|
-
const [activeKey, setActiveKey] = useState("Properties");
|
25
|
-
useEffect(() => {
|
26
|
-
setActiveKey("Properties");
|
27
|
-
}, [props.id]);
|
28
20
|
return observe(() => (React.createElement(ViewContext.Provider, { value: view },
|
29
21
|
React.createElement("div", { className: styles["workerror-properties-view"] },
|
30
|
-
workerror.loaded !== true ? (React.createElement(Skeleton, { active: true })) : (React.createElement(
|
31
|
-
React.createElement("div", { className: "workerror-header" },
|
32
|
-
React.createElement("div", { className: "
|
33
|
-
React.createElement("div", { className: "
|
34
|
-
|
35
|
-
|
36
|
-
React.createElement(
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
store.edit(id, { data: { CauserIds: ids }, error: "message" });
|
42
|
-
} })),
|
43
|
-
React.createElement(DescriptionEditor, { id: id, description: workerror.description, onSave: (description) => {
|
44
|
-
store.edit(id, { data: { Description: description }, error: "message" });
|
22
|
+
workerror.loaded !== true ? (React.createElement(Skeleton, { active: true })) : (React.createElement("div", { className: "workerror-header" },
|
23
|
+
React.createElement("div", { className: "workerror-header-content" },
|
24
|
+
React.createElement("div", { className: "document-name-content" },
|
25
|
+
React.createElement("div", { className: "workerror-info" }, workerror.type),
|
26
|
+
React.createElement(Tag, { color: "purple" }, workerror.severity)),
|
27
|
+
React.createElement(ToolBar, { id: props.id, showMenu: false },
|
28
|
+
React.createElement(Open, { size: "small", url: `/work-error/${props.id}` }),
|
29
|
+
React.createElement(WorkErrorMenu, { id: props.id, closeAside: true }))),
|
30
|
+
React.createElement("div", { className: "workerror-date" }, moment(workerror.due).format("DD MMM yyyy")),
|
31
|
+
React.createElement(AvatarList, { organizationId: user.info.organizationId, list: workerror.causers || [], onChange: (ids) => {
|
32
|
+
store.edit(id, { data: { CauserIds: ids }, error: "message" });
|
45
33
|
} }))),
|
46
|
-
React.createElement(
|
47
|
-
{
|
48
|
-
key: "Properties",
|
49
|
-
label: "Properties",
|
50
|
-
children: React.createElement(WorkErrorProperties, { id: id, workTypeId: workTypeId }),
|
51
|
-
},
|
52
|
-
{ key: "Activities", label: "Activities", children: React.createElement(ActivityLog, { id: id, title: " " }) },
|
53
|
-
{
|
54
|
-
key: "Document",
|
55
|
-
label: "Document",
|
56
|
-
children: React.createElement(DocumentList, { id: id, multiple: true, viewTitle: " ", total: false }),
|
57
|
-
},
|
58
|
-
] })))));
|
59
|
-
/**切换面板的回调*/
|
60
|
-
function onChange(activeKey) {
|
61
|
-
setActiveKey(activeKey);
|
62
|
-
}
|
34
|
+
React.createElement(WorkErrorTabs, { id: id, propertie: true })))));
|
63
35
|
};
|
64
36
|
export default WorkErrorPropertiesView;
|
65
37
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkErrorPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkErrorPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EACN,WAAW,EACX,eAAe,GACf,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,UAAU,MAAM,6CAA6C,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;AAC3E,OAAO,OAAO,MAAM,sDAAsD,CAAC;AAC3E,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAA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CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAO;gBACnF,oBAAC,UAAU,IACV,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EACxC,IAAI,EAAE,SAAS,CAAC,OAAO,IAAI,EAAE,EAC7B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;wBACjB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;oBAChE,CAAC,GACA,CACG,CACN;YACD,oBAAC,aAAa,IAAC,EAAE,EAAE,EAAE,EAAE,SAAS,SAAG,CAC9B,CACgB,CACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
3
|
+
import { Badge, Tabs } from "antd";
|
3
4
|
import ActivityLog from "@voplus/morpho-org/es/components/ActivityLog/ActivityLog2";
|
4
5
|
import DocumentList from "@voplus/morpho-document/es/components/DocumentList";
|
5
|
-
import { Tabs } from "antd";
|
6
6
|
import WorkErrorProperties from "../WorkErrorProperties";
|
7
7
|
import { useDocumentListEffect } from "@voplus/morpho-document-core";
|
8
8
|
const WorkErrorTabs = (props) => {
|
9
9
|
const { id, propertie, workTypeId } = props;
|
10
10
|
const [docTotals, setDocTotals] = useState(0);
|
11
|
-
const [taskTotal, setTaskTotal] = useState();
|
12
11
|
/**Tabs 当前激活 tab 面板的 key */
|
13
12
|
const [activeKey, setActiveKey] = useState(propertie ? "Properties" : "Activities");
|
14
13
|
useDocumentListEffect(null, (result, total) => setDocTotals(total || 0), {
|
@@ -20,10 +19,16 @@ const WorkErrorTabs = (props) => {
|
|
20
19
|
],
|
21
20
|
});
|
22
21
|
const items = [
|
23
|
-
{
|
22
|
+
{
|
23
|
+
key: "Activities",
|
24
|
+
label: "Activities",
|
25
|
+
children: React.createElement(React.Fragment, null, activeKey === "Activities" ? React.createElement(ActivityLog, { id: id, title: " " }) : null),
|
26
|
+
},
|
24
27
|
{
|
25
28
|
key: "Document",
|
26
|
-
label:
|
29
|
+
label: (React.createElement(React.Fragment, null,
|
30
|
+
"Document",
|
31
|
+
React.createElement(Badge, { count: docTotals, className: "margin-left-10" }))),
|
27
32
|
children: React.createElement(DocumentList, { id: id, multiple: true, viewTitle: " ", total: false }),
|
28
33
|
},
|
29
34
|
];
|
@@ -33,7 +38,7 @@ const WorkErrorTabs = (props) => {
|
|
33
38
|
label: "Properties",
|
34
39
|
children: React.createElement(WorkErrorProperties, { id: id, workTypeId: workTypeId }),
|
35
40
|
});
|
36
|
-
return observe(() => (React.createElement(Tabs, { activeKey: activeKey, className: "
|
41
|
+
return observe(() => (React.createElement(Tabs, { activeKey: activeKey, className: "element-tabs", onChange: onChange, items: items })));
|
37
42
|
/**切换面板的回调*/
|
38
43
|
function onChange(activeKey) {
|
39
44
|
setActiveKey(activeKey);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkErrorTabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkErrorTabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,WAAW,MAAM,2DAA2D,CAAC;AAEpF,OAAO,YAAY,MAAM,oDAAoD,CA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