@voplus/morpho-workspace 1.3.2 → 1.3.3
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/data/work/WorkStore.d.ts +12 -0
- package/es/data/work/WorkStore.js +21 -0
- package/es/data/work/WorkStore.js.map +1 -1
- package/es/data/work/interfaces.d.ts +17 -1
- package/es/data/worktype/WorkTypeStore.d.ts +6 -0
- package/es/data/worktype/WorkTypeStore.js +22 -0
- package/es/data/worktype/WorkTypeStore.js.map +1 -1
- package/es/data/worktype/worktype-events/index.d.ts +3 -0
- package/es/data/worktype/worktype-events/index.js +4 -0
- package/es/data/worktype/worktype-events/index.js.map +1 -0
- package/es/data/worktype/worktype-events/useAutoUpdateListData.d.ts +4 -0
- package/es/data/worktype/worktype-events/useAutoUpdateListData.js +15 -0
- package/es/data/worktype/worktype-events/useAutoUpdateListData.js.map +1 -0
- package/es/data/worktype/worktype-events/useOnDeleteWorkType.d.ts +4 -0
- package/es/data/worktype/worktype-events/useOnDeleteWorkType.js +16 -0
- package/es/data/worktype/worktype-events/useOnDeleteWorkType.js.map +1 -0
- package/es/data/worktype/worktype-events/useOnNewWorkType.d.ts +4 -0
- package/es/data/worktype/worktype-events/useOnNewWorkType.js +17 -0
- package/es/data/worktype/worktype-events/useOnNewWorkType.js.map +1 -0
- package/es/modules/work/components/NewWorkForm/index.d.ts +10 -0
- package/es/modules/work/components/NewWorkForm/index.js +60 -0
- package/es/modules/work/components/NewWorkForm/index.js.map +1 -0
- package/es/modules/work/components/NewWorkForm/index.less +17 -0
- package/es/modules/work/components/SubWorkList/index.d.ts +4 -0
- package/es/modules/work/components/SubWorkList/index.js +42 -0
- package/es/modules/work/components/SubWorkList/index.js.map +1 -0
- package/es/modules/work/components/SubWorkList/index.less +7 -0
- package/es/modules/work/components/WorkErrorList/index.js +0 -1
- package/es/modules/work/components/WorkErrorList/index.js.map +1 -1
- package/es/modules/work/components/WorkItem/index.d.ts +1 -3
- package/es/modules/work/components/WorkItem/index.js +20 -4
- package/es/modules/work/components/WorkItem/index.js.map +1 -1
- package/es/modules/work/components/WorkItem/index.less +11 -0
- package/es/modules/work/components/WorkList/index.js +4 -4
- package/es/modules/work/components/WorkList/index.js.map +1 -1
- package/es/modules/work/components/WorkPropertiesView/index.js +8 -2
- package/es/modules/work/components/WorkPropertiesView/index.js.map +1 -1
- package/es/modules/work/components/WorkTabs/index.js +10 -1
- package/es/modules/work/components/WorkTabs/index.js.map +1 -1
- package/es/modules/work/components/WorksProperties/index.js +4 -2
- package/es/modules/work/components/WorksProperties/index.js.map +1 -1
- package/es/modules/work/controls/WorkMenu/Accept.d.ts +8 -0
- package/es/modules/work/controls/WorkMenu/Accept.js +31 -0
- package/es/modules/work/controls/WorkMenu/Accept.js.map +1 -0
- package/es/modules/work/controls/WorkMenu/Reject.d.ts +8 -0
- package/es/modules/work/controls/WorkMenu/Reject.js +31 -0
- package/es/modules/work/controls/WorkMenu/Reject.js.map +1 -0
- package/es/modules/work/controls/WorkMenu/Send.d.ts +8 -0
- package/es/modules/work/controls/WorkMenu/Send.js +31 -0
- package/es/modules/work/controls/WorkMenu/Send.js.map +1 -0
- package/es/modules/work/controls/WorkMenu/index.d.ts +7 -0
- package/es/modules/work/controls/WorkMenu/index.js +27 -0
- package/es/modules/work/controls/WorkMenu/index.js.map +1 -0
- package/es/modules/work/pages/WorkDefaultView/index.less +1 -2
- package/es/modules/workspace/components/WorkspaceCardList/index.js +0 -1
- package/es/modules/workspace/components/WorkspaceCardList/index.js.map +1 -1
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js +11 -5
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js.map +1 -1
- package/es/modules/workspace/components/WorkspaceTabs/index.d.ts +5 -0
- package/es/modules/workspace/components/WorkspaceTabs/index.js +26 -0
- package/es/modules/workspace/components/WorkspaceTabs/index.js.map +1 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.js +1 -1
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.js.map +1 -1
- package/es/modules/workspace/pages/WorkspacePage/index.js +1 -1
- package/es/modules/workspace/pages/WorkspacePage/index.js.map +1 -1
- package/es/modules/worktype/components/NewTypeForm/index.d.ts +10 -0
- package/es/modules/worktype/components/NewTypeForm/index.js +44 -0
- package/es/modules/worktype/components/NewTypeForm/index.js.map +1 -0
- package/es/modules/worktype/components/NewTypeForm/index.less +5 -0
- package/es/modules/worktype/components/NewTypeForm/state.d.ts +11 -0
- package/es/modules/worktype/components/NewTypeForm/state.js +41 -0
- package/es/modules/worktype/components/NewTypeForm/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.d.ts +4 -11
- package/es/modules/worktype/components/WorkTypeCardList/index.js +3 -17
- package/es/modules/worktype/components/WorkTypeCardList/index.js.map +1 -1
- package/es/modules/worktype/components/WorkTypeCardList/index.less +7 -9
- package/es/modules/worktype/components/WorkTypeItem/index.d.ts +1 -1
- package/es/modules/worktype/components/WorkTypeItem/index.js +14 -2
- package/es/modules/worktype/components/WorkTypeItem/index.js.map +1 -1
- package/es/modules/worktype/components/WorkTypeItem/index.less +13 -0
- package/es/modules/worktype/components/WorkTypeList/index.d.ts +9 -0
- package/es/modules/worktype/components/WorkTypeList/index.js +44 -0
- package/es/modules/worktype/components/WorkTypeList/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.js +13 -8
- package/es/modules/worktype/components/WorkTypePropertiesView/index.js.map +1 -1
- package/es/modules/worktype/components/WorkTypeQA/index.js +37 -36
- package/es/modules/worktype/components/WorkTypeQA/index.js.map +1 -1
- package/es/modules/worktype/components/WorkTypeQA/index.less +7 -0
- package/es/modules/worktype/controls/ToolBar/index.d.ts +10 -0
- package/es/modules/worktype/controls/ToolBar/index.js +20 -0
- package/es/modules/worktype/controls/ToolBar/index.js.map +1 -0
- package/es/modules/worktype/controls/ToolBar/index.less +55 -0
- package/es/modules/worktype/controls/ToolBar/state.d.ts +36 -0
- package/es/modules/worktype/controls/ToolBar/state.js +57 -0
- package/es/modules/worktype/controls/ToolBar/state.js.map +1 -0
- package/es/modules/worktype/controls/WorkTypeMenu/index.d.ts +14 -0
- package/es/modules/worktype/controls/WorkTypeMenu/index.js +26 -0
- package/es/modules/worktype/controls/WorkTypeMenu/index.js.map +1 -0
- package/es/modules/worktype/controls/WorkTypeMenu/index.less +0 -0
- package/es/pages/Space/pages/MySpace/index.js +4 -4
- package/es/pages/Space/pages/MySpace/index.js.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1,41 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { makeObservable, observable } from "mobx";
|
3
|
+
export class State {
|
4
|
+
constructor(_store) {
|
5
|
+
Object.defineProperty(this, "_store", {
|
6
|
+
enumerable: true,
|
7
|
+
configurable: true,
|
8
|
+
writable: true,
|
9
|
+
value: _store
|
10
|
+
});
|
11
|
+
Object.defineProperty(this, "Params", {
|
12
|
+
enumerable: true,
|
13
|
+
configurable: true,
|
14
|
+
writable: true,
|
15
|
+
value: {
|
16
|
+
// workspaceId: "",
|
17
|
+
Name: ""
|
18
|
+
}
|
19
|
+
});
|
20
|
+
Object.defineProperty(this, "params", {
|
21
|
+
enumerable: true,
|
22
|
+
configurable: true,
|
23
|
+
writable: true,
|
24
|
+
value: this.Params
|
25
|
+
});
|
26
|
+
Object.defineProperty(this, "loading", {
|
27
|
+
enumerable: true,
|
28
|
+
configurable: true,
|
29
|
+
writable: true,
|
30
|
+
value: false
|
31
|
+
});
|
32
|
+
makeObservable(this);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
__decorate([
|
36
|
+
observable
|
37
|
+
], State.prototype, "params", void 0);
|
38
|
+
__decorate([
|
39
|
+
observable
|
40
|
+
], State.prototype, "loading", void 0);
|
41
|
+
//# sourceMappingURL=state.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/NewTypeForm/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,OAAO,KAAK;IACjB,YAA2B,MAAW;;;;;mBAAX;;QAG3B;;;;mBAAgB;gBACf,mBAAmB;gBACnB,IAAI,EAAE,EAAE;aACR;WAAC;QACU;;;;mBAAgB,IAAI,CAAC,MAAM;WAAC;QAC5B;;;;mBAAiB,KAAK;WAAC;QAPlC,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CAOD;AAFY;IAAX,UAAU;qCAA6B;AAC5B;IAAX,UAAU;sCAAwB"}
|
@@ -2,15 +2,8 @@
|
|
2
2
|
import "./index.less";
|
3
3
|
import { IWorkType } from "../../../../data/worktype";
|
4
4
|
/** A worktype list view shows worktype in card style. */
|
5
|
-
declare const WorkTypeCardList: {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
/** item onclick */
|
10
|
-
onItemClick?: ((item: IWorkType) => void) | undefined;
|
11
|
-
}): JSX.Element;
|
12
|
-
defaultProps: {
|
13
|
-
type: string;
|
14
|
-
};
|
15
|
-
};
|
5
|
+
declare const WorkTypeCardList: (props: {
|
6
|
+
/** item onclick */
|
7
|
+
onItemClick?: ((item: IWorkType) => void) | undefined;
|
8
|
+
}) => JSX.Element;
|
16
9
|
export default WorkTypeCardList;
|
@@ -2,11 +2,8 @@ import "./index.less";
|
|
2
2
|
import { useWorkTypeListEffect } from "../../../../data/worktype";
|
3
3
|
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
4
4
|
import React, { useState } from "react";
|
5
|
-
import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
|
6
5
|
import InfiniteScrollView from "@voplus/morpho-ui/es/controls/InfiniteScrollView";
|
7
6
|
import WorkTypeCard from "../WorkTypeCard";
|
8
|
-
import WorkTypeItem from "../WorkTypeItem";
|
9
|
-
import classnames from "classnames";
|
10
7
|
import { observe } from "@voplus/morpho-ui";
|
11
8
|
import { useRenderOnChange } from "@voplus/morpho-ui";
|
12
9
|
/** A worktype list view shows worktype in card style. */
|
@@ -14,7 +11,6 @@ const WorkTypeCardList = (props) => {
|
|
14
11
|
const [active, setActive] = useState(null);
|
15
12
|
const list = useCreateListDataState({
|
16
13
|
filterDefaults: {
|
17
|
-
includes: "tags",
|
18
14
|
filters: [],
|
19
15
|
},
|
20
16
|
}, []);
|
@@ -23,17 +19,10 @@ const WorkTypeCardList = (props) => {
|
|
23
19
|
/** 把ListDataState传给useWorkTypeListEffect,使之可以自動更新loading, hasmore. */
|
24
20
|
useWorkTypeListEffect(list, (result) => list.union(result), list.filters.options);
|
25
21
|
return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
|
26
|
-
React.createElement("div", { className:
|
22
|
+
React.createElement("div", { className: "worktype-list-view" },
|
27
23
|
React.createElement(InfiniteScrollView, { empty: list.isEmpty, loading: list.loading, hasMore: list.hasMore, loadMore: loadMore },
|
28
|
-
React.createElement("div", { className: "worktype-list-content" }, list.data.map((i) => (React.createElement("div", { key: i.id, onClick: () => onItemClick(i) },
|
29
|
-
React.createElement(WorkTypeCard, { id: i.id, active: active === i.id })
|
30
|
-
:
|
31
|
-
React.createElement(DocumentItemFrame, { frameProps: {
|
32
|
-
active: active === i.id,
|
33
|
-
hoverEffect: "background",
|
34
|
-
hoverBackgroundProps: { color: "#f2f2f2" },
|
35
|
-
} },
|
36
|
-
React.createElement(WorkTypeItem, { id: i.id })))))))))));
|
24
|
+
React.createElement("div", { className: "worktype-list-content" }, list.data.map((i) => (React.createElement("div", { key: i.id, onClick: () => onItemClick(i) },
|
25
|
+
React.createElement(WorkTypeCard, { id: i.id, active: active === i.id }))))))))));
|
37
26
|
function loadMore() {
|
38
27
|
list.triggerNextPage();
|
39
28
|
}
|
@@ -43,8 +32,5 @@ const WorkTypeCardList = (props) => {
|
|
43
32
|
(_a = props.onItemClick) === null || _a === void 0 ? void 0 : _a.call(props, item);
|
44
33
|
}
|
45
34
|
};
|
46
|
-
WorkTypeCardList.defaultProps = {
|
47
|
-
type: "default"
|
48
|
-
};
|
49
35
|
export default WorkTypeCardList;
|
50
36
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeCardList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAa,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeCardList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAa,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,kBAAkB,MAAM,kDAAkD,CAAC;AAClF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,yDAAyD;AACzD,MAAM,gBAAgB,GAAG,CAAC,KAGzB,EAAE,EAAE;IACJ,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAE1D,MAAM,IAAI,GAAG,sBAAsB,CAClC;QACC,cAAc,EAAE;YACf,OAAO,EAAE,EAAE;SACX;KACD,EACD,EAAE,CACF,CAAC;IAEF,uEAAuE;IACvE,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,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|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
margin: 8px;
|
11
|
-
}
|
4
|
+
padding: 0 12px;
|
5
|
+
.worktype-list-content {
|
6
|
+
display: flex;
|
7
|
+
flex-wrap: wrap;
|
8
|
+
>div {
|
9
|
+
margin: 8px;
|
12
10
|
}
|
13
11
|
}
|
14
12
|
}
|
15
|
-
}
|
13
|
+
}
|
@@ -1,11 +1,23 @@
|
|
1
1
|
import "./index.less";
|
2
|
-
import React from "react";
|
2
|
+
import React, { useState } from "react";
|
3
|
+
import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
|
4
|
+
import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
|
5
|
+
import WorkTypeMenu from "../../controls/WorkTypeMenu";
|
6
|
+
import classnames from "classnames";
|
3
7
|
import { observe } from "@voplus/morpho-ui";
|
4
8
|
import { useWorkType } from "../../../../data/worktype";
|
5
9
|
const WorkTypeItem = (props) => {
|
6
10
|
const { id, active } = props;
|
7
11
|
const worktype = useWorkType(id, { reload: false });
|
8
|
-
|
12
|
+
const [hover, setHover] = useState(false);
|
13
|
+
return observe(() => (React.createElement("div", { className: classnames("worktype-item", { active: active }), onMouseLeave: () => setHover(false), onMouseOver: () => setHover(true) },
|
14
|
+
React.createElement("div", null, worktype.name),
|
15
|
+
React.createElement("div", { className: classnames("hover-operate-icon", {
|
16
|
+
show: hover,
|
17
|
+
}) },
|
18
|
+
React.createElement(ToolBar, { id: id, showMenu: false },
|
19
|
+
React.createElement(Open, { size: "middle", url: `/workType/${id}` }),
|
20
|
+
React.createElement(WorkTypeMenu, { id: id, size: "middle", closeAside: true }))))));
|
9
21
|
};
|
10
22
|
export default WorkTypeItem;
|
11
23
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAE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,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,aAAa,EAAE,EAAE,GAAI;gBAC9C,oBAAC,YAAY,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,QAAQ,EAAC,UAAU,EAAE,IAAI,GAAI,CAC/C,CACL,CACD,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -6,6 +6,8 @@
|
|
6
6
|
font-weight: 500;
|
7
7
|
word-break: break-all;
|
8
8
|
padding: 20px;
|
9
|
+
display: flex;
|
10
|
+
align-items: center;
|
9
11
|
// background: transparent;
|
10
12
|
&:after {
|
11
13
|
position: absolute;
|
@@ -15,5 +17,16 @@
|
|
15
17
|
bottom: 0;
|
16
18
|
border-bottom: 1px solid #f2f2f2;
|
17
19
|
}
|
20
|
+
.hover-operate-icon {
|
21
|
+
display: none;
|
22
|
+
position: absolute;
|
23
|
+
right: 20px;
|
24
|
+
.ant-btn:first-child {
|
25
|
+
margin-left: 0;
|
26
|
+
}
|
27
|
+
&.show {
|
28
|
+
display: block;
|
29
|
+
}
|
30
|
+
}
|
18
31
|
}
|
19
32
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { IWorkType } from "../../../../data/worktype";
|
3
|
+
declare const WorkTypeList: (props: {
|
4
|
+
workspaceId: string;
|
5
|
+
active?: string | undefined;
|
6
|
+
/** item onclick */
|
7
|
+
onClickItem?: ((item: IWorkType) => void) | undefined;
|
8
|
+
}) => JSX.Element;
|
9
|
+
export default WorkTypeList;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
3
|
+
import { useRenderOnChange } from "@voplus/morpho-ui";
|
4
|
+
import { observe } from "@voplus/morpho-ui";
|
5
|
+
import { useAutoUpdateListData } from "../../../../data/worktype/worktype-events";
|
6
|
+
import { useWorkTypeListEffect } from "../../../../data/worktype";
|
7
|
+
// import InfiniteScrollView from "@voplus/morpho-ui/es/controls/InfiniteScrollView";
|
8
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
9
|
+
import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
|
10
|
+
import WorkTypeItem from "../WorkTypeItem";
|
11
|
+
import NewTypeForm from "../NewTypeForm";
|
12
|
+
const WorkTypeList = (props) => {
|
13
|
+
const [activeId, setActiveId] = useState("");
|
14
|
+
const [showAdd, setShowAdd] = useState(false);
|
15
|
+
const list = useCreateListDataState({
|
16
|
+
filterDefaults: {
|
17
|
+
filters: [],
|
18
|
+
},
|
19
|
+
}, []);
|
20
|
+
useAutoUpdateListData(list, (d) => true);
|
21
|
+
/** 如果 list.filters.options变更了就重渲染,使下一行的useWorkTypeListEffect 可以接收新参数*/
|
22
|
+
useRenderOnChange(() => list.filters.options);
|
23
|
+
/** 把ListDataState传给useWorkTypeListEffect,使之可以自動更新loading, hasmore. */
|
24
|
+
useWorkTypeListEffect(list, (result) => list.union(result), list.filters.options);
|
25
|
+
return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
|
26
|
+
React.createElement(ListView, { headerProps: {
|
27
|
+
viewTitle: "",
|
28
|
+
sortable: false,
|
29
|
+
onAdd: () => setShowAdd(true),
|
30
|
+
}, className: "work-type-list", formViewTitle: "Add WorkType", renderItem: ({ item, connectDragSource }) => (React.createElement(React.Fragment, null,
|
31
|
+
React.createElement(DocumentItemFrame, { key: item.id, frameProps: {
|
32
|
+
active: activeId === item.id,
|
33
|
+
hoverEffect: "background",
|
34
|
+
hoverBackgroundProps: { color: "#f2f2f2" },
|
35
|
+
}, onClick: () => {
|
36
|
+
var _a;
|
37
|
+
setActiveId(item.id);
|
38
|
+
(_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, item);
|
39
|
+
} },
|
40
|
+
React.createElement(WorkTypeItem, { id: item.id })))) }),
|
41
|
+
showAdd && (React.createElement(NewTypeForm, { workspaceId: props.workspaceId, onCancel: () => setShowAdd(false), onSave: () => setShowAdd(false) })))));
|
42
|
+
};
|
43
|
+
export default WorkTypeList;
|
44
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAa,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,qFAAqF;AACrF,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,iBAAiB,MAAM,uDAAuD,CAAC;AACtF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,MAAM,YAAY,GAAG,CAAC,KAKrB,EAAE,EAAE;IACJ,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,IAAI,GAAG,sBAAsB,CAClC;QACC,cAAc,EAAE;YACf,OAAO,EAAE,EAAE;SACX;KACD,EACD,EAAE,CACF,CAAC;IAEF,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAEzC,uEAAuE;IACvE,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OA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AU,CAAC,KAAK,CAAC,GAC9B,CACF,CACyB,CAC3B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -1,14 +1,16 @@
|
|
1
|
-
import
|
2
|
-
import { useDocumentStore } from "@voplus/morpho-document-core";
|
3
|
-
import { useApplicationContext } from "@voplus/morpho-data";
|
4
|
-
import { runInAction } from "mobx";
|
1
|
+
import "./index.less";
|
5
2
|
import { InlineEdit, observe } from "@voplus/morpho-ui";
|
3
|
+
import React, { useEffect, useState } from "react";
|
6
4
|
import { useWorkType, useWorkTypeStore } from "../../../../data/worktype";
|
5
|
+
import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
|
7
6
|
import { State } from "./state";
|
8
|
-
import
|
9
|
-
import
|
7
|
+
import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
|
8
|
+
import WorkTypeMenu from "../../controls/WorkTypeMenu";
|
10
9
|
import WorkTypePropertiesTabs from '../WorkTypePropertiesTabs';
|
11
|
-
import "
|
10
|
+
import WorktypeCompleteWorksChart from "../../controls/WorktypeCompleteWorksChart";
|
11
|
+
import { runInAction } from "mobx";
|
12
|
+
import { useApplicationContext } from "@voplus/morpho-data";
|
13
|
+
import { useDocumentStore } from "@voplus/morpho-document-core";
|
12
14
|
const WorkTypePropertiesView = (props) => {
|
13
15
|
const id = props.id;
|
14
16
|
const store = useWorkTypeStore();
|
@@ -26,7 +28,10 @@ const WorkTypePropertiesView = (props) => {
|
|
26
28
|
React.createElement("div", { className: "worktype-header" },
|
27
29
|
React.createElement("div", { className: "worktype-name" },
|
28
30
|
React.createElement(InlineEdit, { defaultValue: worktype.name, content: (v) => React.createElement("div", null, worktype.name), onSave: (value) => state.save(value, worktype.name, { Name: value }) }),
|
29
|
-
React.createElement(
|
31
|
+
React.createElement("div", { className: "tools-bar" },
|
32
|
+
React.createElement(ToolBar, { id: id, showMenu: false },
|
33
|
+
React.createElement(Open, { url: `/workType/${id}` }),
|
34
|
+
React.createElement(WorkTypeMenu, { id: id, closeAside: true }))))),
|
30
35
|
React.createElement(WorktypeCompleteWorksChart, { id: props.id }),
|
31
36
|
React.createElement(WorkTypePropertiesTabs, { id: id }))))));
|
32
37
|
// async function onChange(ids: string[], members: IUnit[]) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypePropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypePropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAI1E,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,OAAO,MAAM,sDAAsD,CAAC;AAC3E,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,sBAAsB,MAAM,2BAA2B,CAAA;AAC9D,OAAO,0BAA0B,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,MAAM,sBAAsB,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxD,MAAM,EAAE,GAAG,KAAK,CAAC,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AAK;wBAEf,oBAAC,IAAI,IAAC,GAAG,EAAE,aAAa,EAAE,EAAE,GAAI;wBAChC,oBAAC,YAAY,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CACjC,CACL,CACD,CAOD;QACN,oBAAC,0BAA0B,IAAC,EAAE,EAAE,KAAK,CAAC,EAAE,GAAI;QAC5C,oBAAC,sBAAsB,IAAC,EAAE,EAAE,EAAE,GAAI,CAClB,CACjB,CACI,CACN,CAAC,CAAC;IAEH,6DAA6D;IAC7D,4EAA4E;IAC5E,qDAAqD;IACrD,IAAI;AACL,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
@@ -1,15 +1,16 @@
|
|
1
|
-
import "./index.less";
|
2
|
-
import { Form, InputNumber } from "@voplus/antd";
|
3
1
|
import React, { useState } from "react";
|
2
|
+
import { Form, InputNumber } from "@voplus/antd";
|
3
|
+
import { Scrollbars } from "react-custom-scrollbars";
|
4
|
+
import { State } from "./state";
|
4
5
|
import { useWorkType, useWorkTypeStore } from "../../../../data/worktype";
|
6
|
+
import { observe } from "@voplus/morpho-ui";
|
7
|
+
import { runInAction } from "mobx";
|
8
|
+
import { useApplicationContext } from "@voplus/morpho-data";
|
5
9
|
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
6
10
|
import AvatarList from "@voplus/morpho-document/es/components/AvatarList";
|
7
11
|
import CheckList from "@voplus/morpho-ui/es/controls/CheckList";
|
8
|
-
import { State } from "./state";
|
9
12
|
import TaskQuickViewDialog from "../../../tasks/components/TaskQuickViewDialog";
|
10
|
-
import
|
11
|
-
import { runInAction } from "mobx";
|
12
|
-
import { useApplicationContext } from "@voplus/morpho-data";
|
13
|
+
import "./index.less";
|
13
14
|
const WorkTypeQA = (props) => {
|
14
15
|
const { id } = props;
|
15
16
|
const [form] = Form.useForm();
|
@@ -23,37 +24,37 @@ const WorkTypeQA = (props) => {
|
|
23
24
|
return observe(() => {
|
24
25
|
var _a, _b, _c, _d, _e, _f;
|
25
26
|
return (React.createElement(AsideContent, { context: asideContext },
|
26
|
-
React.createElement("div",
|
27
|
+
React.createElement("div", { className: "work-type-qa" },
|
27
28
|
React.createElement("div", { className: "work-type-qa-head" }, "Quality Assurance Setting"),
|
28
|
-
React.createElement(
|
29
|
-
React.createElement(Form
|
30
|
-
React.createElement(
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
React.createElement(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
.audit) === null || _b === void 0 ? void 0 : _b.auditors) === null || _c === void 0 ? void 0 : _c.length) && (React.createElement(React.Fragment, null,
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
29
|
+
React.createElement(Scrollbars, { autoHide: true },
|
30
|
+
React.createElement(Form, { className: "work-type-qa-content", form: form, labelAlign: "left", labelCol: { span: 10 }, scrollToFirstError: true },
|
31
|
+
React.createElement(Form.Item, { label: "Reviewer" },
|
32
|
+
React.createElement(AvatarList, { organizationId: user.info.organizationId, multiple: true, buttonText: "Ok", list: state.worktype.reviewers, onChange: (ids) => {
|
33
|
+
state.save({ ReviewerIds: ids });
|
34
|
+
} })),
|
35
|
+
React.createElement(Form.Item, { label: "Auditor" },
|
36
|
+
React.createElement(AvatarList, { organizationId: user.info.organizationId, multiple: true, buttonText: "Ok", list: (_a = state.worktype.audit) === null || _a === void 0 ? void 0 : _a.auditors, onChange: (ids) => {
|
37
|
+
state.save({ AuditorIds: ids });
|
38
|
+
} })),
|
39
|
+
((_c = (_b = state.worktype.audit) === null || _b === void 0 ? void 0 : _b.auditors) === null || _c === void 0 ? void 0 : _c.length) && (React.createElement(React.Fragment, null,
|
40
|
+
React.createElement(Form.Item, { label: "Audit Rate" }, state.auditRateEdit ? (React.createElement(InputNumber, { defaultValue: ((_d = state.worktype.audit) === null || _d === void 0 ? void 0 : _d.auditRate) || 0, min: 0, max: 100, formatter: (value) => `${value}%`, parser: (value) => value.replace("%", ""), onChange: (value) => {
|
41
|
+
state.save({ AuditRate: value });
|
42
|
+
}, onBlur: () => runInAction(() => (state.auditRateEdit = false)) })) : (React.createElement("div", { onClick: () => runInAction(() => (state.auditRateEdit = true)) }, ((_e = state.worktype.audit) === null || _e === void 0 ? void 0 : _e.auditRate)
|
43
|
+
? `${(_f = state.worktype.audit) === null || _f === void 0 ? void 0 : _f.auditRate}%`
|
44
|
+
: "Add Audit Rate"))),
|
45
|
+
React.createElement(Form.Item, { label: "Audit Task" },
|
46
|
+
React.createElement("div", { className: "open-btn", onClick: () => setVisible(true) }, "Open")))),
|
47
|
+
React.createElement(Form.Item, { label: "Reject Reasons" },
|
48
|
+
React.createElement(CheckList, { headerProps: {
|
49
|
+
viewTitle: " ",
|
50
|
+
visible: true,
|
51
|
+
}, allowAdd: true, list: state.rejectReasons, onChange: (item) => state.onChangeRejectReasons(item), onCreate: (item) => state.onCreateRejectReasons(item), onDelete: (item) => state.onDeleteRejectReasons(item) })),
|
52
|
+
React.createElement(Form.Item, { label: "Error Types" },
|
53
|
+
React.createElement(CheckList, { headerProps: {
|
54
|
+
viewTitle: " ",
|
55
|
+
visible: true,
|
56
|
+
}, allowAdd: true, list: state.errorTypes, onChange: (item) => state.onChangeErrorTypes(item), onCreate: (item) => state.onCreateErrorTypes(item), onDelete: (item) => state.onDeleteErrorTypes(item) }))),
|
57
|
+
React.createElement(TaskQuickViewDialog, { id: props.id, visible: visible, onCancel: () => setVisible(false) })))));
|
57
58
|
});
|
58
59
|
};
|
59
60
|
export default WorkTypeQA;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeQA/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src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from "@voplus/morpho-document/es/controls/ToolBar/buttons";
|
4
|
+
import { ToolBarContext, ToolBarState } from "./state";
|
5
|
+
import { useWorkTypeStore } from "../../../../data/worktype";
|
6
|
+
import "./index.less";
|
7
|
+
const Toolbar = (props) => {
|
8
|
+
const { children, visible, showMenu, moreProps: dropDownMenuProps } = props;
|
9
|
+
const store = useWorkTypeStore();
|
10
|
+
const [state] = useState(new ToolBarState(store));
|
11
|
+
state.props = props;
|
12
|
+
return observe(() => (React.createElement(ToolBarContext.Provider, { value: state }, visible !== false ? (React.createElement("span", { className: "tool-bar" },
|
13
|
+
children,
|
14
|
+
showMenu && React.createElement(More, { ...dropDownMenuProps }))) : (React.createElement(React.Fragment, null)))));
|
15
|
+
};
|
16
|
+
Toolbar.defaultProps = {
|
17
|
+
showMenu: true,
|
18
|
+
};
|
19
|
+
export default Toolbar;
|
20
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/controls/ToolBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAgB,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,cAAc,CAAC;AAEtB,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,EAAE;IACvC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAEpB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACnC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CACpB,8BAAM,SAAS,EAAC,UAAU;QACxB,QAAQ;QACR,QAAQ,IAAI,oBAAC,IAAI,OAAK,iBAAiB,GAAI,CACtC,CACP,CAAC,CAAC,CAAC,CACH,yCAAK,CACL,CACwB,CAC1B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,CAAC,YAAY,GAAG;IACtB,QAAQ,EAAE,IAAI;CACd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
:global {
|
2
|
+
.tool-bar {
|
3
|
+
.ant-btn + .ant-btn {
|
4
|
+
margin-left: 5px;
|
5
|
+
}
|
6
|
+
.ant-tooltip-disabled-compatible-wrapper {
|
7
|
+
margin: 0 5px;
|
8
|
+
& + .ant-tooltip-disabled-compatible-wrapper {
|
9
|
+
margin-left: 0;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
.archive-btn {
|
13
|
+
background: #fff;
|
14
|
+
border-color: #faad14;
|
15
|
+
color: #faad14;
|
16
|
+
}
|
17
|
+
.archive-btn:active,
|
18
|
+
.archive-btn.active,
|
19
|
+
.archive-btn:hover {
|
20
|
+
background-color: #faad14;
|
21
|
+
color: #fff;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
.tool-bar-menu {
|
25
|
+
padding: 4px 0;
|
26
|
+
list-style-type: none;
|
27
|
+
background-color: #fff;
|
28
|
+
background-clip: padding-box;
|
29
|
+
border-radius: 2px;
|
30
|
+
outline: none;
|
31
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
32
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
33
|
+
|
34
|
+
.ant-btn {
|
35
|
+
display: block;
|
36
|
+
width: 100%;
|
37
|
+
padding: 0 12px;
|
38
|
+
height: 34px;
|
39
|
+
color: #666;
|
40
|
+
text-align: left;
|
41
|
+
&[disabled] {
|
42
|
+
color: rgba(0, 0, 0, 0.25);
|
43
|
+
}
|
44
|
+
&:hover {
|
45
|
+
background-color: #f5f5f5;
|
46
|
+
}
|
47
|
+
> span {
|
48
|
+
margin-left: 10px;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
.delete {
|
52
|
+
color: #f5222d;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { ReactNode } from "react";
|
2
|
+
import { MoreButtonProps } from "@voplus/morpho-document/es/controls/ToolBar/buttons/More";
|
3
|
+
import { WorkTypeStore } from "../../../../data/worktype";
|
4
|
+
export declare type ToolBarProps = {
|
5
|
+
/** id of document */
|
6
|
+
id?: string;
|
7
|
+
children?: ReactNode;
|
8
|
+
/** show toolbar */
|
9
|
+
visible?: boolean;
|
10
|
+
/** show drop down menu */
|
11
|
+
showMenu?: boolean;
|
12
|
+
/** Props for dropd */
|
13
|
+
moreProps?: MoreButtonProps;
|
14
|
+
};
|
15
|
+
export interface IToolBarState {
|
16
|
+
disabled?: boolean;
|
17
|
+
}
|
18
|
+
export declare class ToolBarState {
|
19
|
+
store: WorkTypeStore;
|
20
|
+
/** Current tools states. */
|
21
|
+
private states;
|
22
|
+
props: ToolBarProps;
|
23
|
+
constructor(store: WorkTypeStore);
|
24
|
+
/** Try to get an existing icons state or create a new one if it's not already exists.
|
25
|
+
* @param key - Key of the icons state.
|
26
|
+
* @param factory - factor to create a new option state.
|
27
|
+
*/
|
28
|
+
getState<T extends IToolBarState>(key: string, factory: () => T): T;
|
29
|
+
/** id */
|
30
|
+
get id(): string;
|
31
|
+
collapsed: boolean;
|
32
|
+
}
|
33
|
+
/** React context for ToolBarState. */
|
34
|
+
export declare const ToolBarContext: import("react").Context<ToolBarState>;
|
35
|
+
/** React hook to retrieve the nearest ToolBarContext. */
|
36
|
+
export declare const useToolBarContext: () => ToolBarState;
|