@voplus/morpho-workspace 1.3.160 → 1.3.162

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.
Files changed (81) hide show
  1. package/es/data/work-schedule/WorkScheduleStore.d.ts +33 -0
  2. package/es/data/work-schedule/WorkScheduleStore.js +115 -0
  3. package/es/data/work-schedule/WorkScheduleStore.js.map +1 -0
  4. package/es/data/work-schedule/hooks.d.ts +10 -0
  5. package/es/data/work-schedule/hooks.js +19 -0
  6. package/es/data/work-schedule/hooks.js.map +1 -0
  7. package/es/data/work-schedule/index.d.ts +4 -0
  8. package/es/data/work-schedule/index.js +5 -0
  9. package/es/data/work-schedule/index.js.map +1 -0
  10. package/es/data/work-schedule/interfaces.d.ts +16 -0
  11. package/es/data/work-schedule/interfaces.js +2 -0
  12. package/es/data/work-schedule/interfaces.js.map +1 -0
  13. package/es/data/work-schedule/types.d.ts +25 -0
  14. package/es/data/work-schedule/types.js +2 -0
  15. package/es/data/work-schedule/types.js.map +1 -0
  16. package/es/data/work-schedule/work-schedule-events/index.d.ts +3 -0
  17. package/es/data/work-schedule/work-schedule-events/index.js +4 -0
  18. package/es/data/work-schedule/work-schedule-events/index.js.map +1 -0
  19. package/es/data/work-schedule/work-schedule-events/useAutoUpdateListData.d.ts +4 -0
  20. package/es/data/work-schedule/work-schedule-events/useAutoUpdateListData.js +15 -0
  21. package/es/data/work-schedule/work-schedule-events/useAutoUpdateListData.js.map +1 -0
  22. package/es/data/work-schedule/work-schedule-events/useOnDeleteWorkSchedule.d.ts +4 -0
  23. package/es/data/work-schedule/work-schedule-events/useOnDeleteWorkSchedule.js +16 -0
  24. package/es/data/work-schedule/work-schedule-events/useOnDeleteWorkSchedule.js.map +1 -0
  25. package/es/data/work-schedule/work-schedule-events/useOnNewWorkSchedule.d.ts +4 -0
  26. package/es/data/work-schedule/work-schedule-events/useOnNewWorkSchedule.js +17 -0
  27. package/es/data/work-schedule/work-schedule-events/useOnNewWorkSchedule.js.map +1 -0
  28. package/es/modules/Routes.d.ts +6 -0
  29. package/es/modules/Routes.js +13 -0
  30. package/es/modules/Routes.js.map +1 -1
  31. package/es/modules/work/work-schedule/components/NewWorkScheduleForm/index.d.ts +15 -0
  32. package/es/modules/work/work-schedule/components/NewWorkScheduleForm/index.js +62 -0
  33. package/es/modules/work/work-schedule/components/NewWorkScheduleForm/index.js.map +1 -0
  34. package/es/modules/work/work-schedule/components/NewWorkScheduleForm/index.less +10 -0
  35. package/es/modules/work/work-schedule/components/NewWorkScheduleForm/state.d.ts +13 -0
  36. package/es/modules/work/work-schedule/components/NewWorkScheduleForm/state.js +35 -0
  37. package/es/modules/work/work-schedule/components/NewWorkScheduleForm/state.js.map +1 -0
  38. package/es/modules/work/work-schedule/components/WorkScheduleHeader/index.d.ts +6 -0
  39. package/es/modules/work/work-schedule/components/WorkScheduleHeader/index.js +18 -0
  40. package/es/modules/work/work-schedule/components/WorkScheduleHeader/index.js.map +1 -0
  41. package/es/modules/work/work-schedule/components/WorkScheduleHeader/index.less +12 -0
  42. package/es/modules/work/work-schedule/components/WorkScheduleItem/index.d.ts +6 -0
  43. package/es/modules/work/work-schedule/components/WorkScheduleItem/index.js +80 -0
  44. package/es/modules/work/work-schedule/components/WorkScheduleItem/index.js.map +1 -0
  45. package/es/modules/work/work-schedule/components/WorkScheduleItem/index.less +61 -0
  46. package/es/modules/work/work-schedule/components/WorkScheduleList/index.d.ts +20 -0
  47. package/es/modules/work/work-schedule/components/WorkScheduleList/index.js +71 -0
  48. package/es/modules/work/work-schedule/components/WorkScheduleList/index.js.map +1 -0
  49. package/es/modules/work/work-schedule/components/WorkScheduleList/index.less +12 -0
  50. package/es/modules/work/work-schedule/components/WorkScheduleProperties/index.d.ts +20 -0
  51. package/es/modules/work/work-schedule/components/WorkScheduleProperties/index.js +87 -0
  52. package/es/modules/work/work-schedule/components/WorkScheduleProperties/index.js.map +1 -0
  53. package/es/modules/work/work-schedule/components/WorkSchedulePropertiesView/index.d.ts +6 -0
  54. package/es/modules/work/work-schedule/components/WorkSchedulePropertiesView/index.js +15 -0
  55. package/es/modules/work/work-schedule/components/WorkSchedulePropertiesView/index.js.map +1 -0
  56. package/es/modules/work/work-schedule/components/WorkScheduleQuickViewDialog/index.d.ts +15 -0
  57. package/es/modules/work/work-schedule/components/WorkScheduleQuickViewDialog/index.js +30 -0
  58. package/es/modules/work/work-schedule/components/WorkScheduleQuickViewDialog/index.js.map +1 -0
  59. package/es/modules/work/work-schedule/components/WorkScheduleQuickViewDialog/index.less +25 -0
  60. package/es/modules/work/work-schedule/components/WorkScheduleTabs/index.d.ts +6 -0
  61. package/es/modules/work/work-schedule/components/WorkScheduleTabs/index.js +29 -0
  62. package/es/modules/work/work-schedule/components/WorkScheduleTabs/index.js.map +1 -0
  63. package/es/modules/work/work-schedule/controls/WorkScheduleMenu/index.d.ts +13 -0
  64. package/es/modules/work/work-schedule/controls/WorkScheduleMenu/index.js +44 -0
  65. package/es/modules/work/work-schedule/controls/WorkScheduleMenu/index.js.map +1 -0
  66. package/es/modules/work/work-schedule/controls/WorkScheduleMenu/index.less +39 -0
  67. package/es/modules/work/work-schedule/controls/WorkScheduleStatusFilter/index.d.ts +5 -0
  68. package/es/modules/work/work-schedule/controls/WorkScheduleStatusFilter/index.js +29 -0
  69. package/es/modules/work/work-schedule/controls/WorkScheduleStatusFilter/index.js.map +1 -0
  70. package/es/modules/work/work-schedule/controls/WorkScheduleStatusFilter/state.d.ts +19 -0
  71. package/es/modules/work/work-schedule/controls/WorkScheduleStatusFilter/state.js +56 -0
  72. package/es/modules/work/work-schedule/controls/WorkScheduleStatusFilter/state.js.map +1 -0
  73. package/es/modules/work/work-schedule/controls/WorkScheduleStatusLabel/index.d.ts +10 -0
  74. package/es/modules/work/work-schedule/controls/WorkScheduleStatusLabel/index.js +12 -0
  75. package/es/modules/work/work-schedule/controls/WorkScheduleStatusLabel/index.js.map +1 -0
  76. package/es/modules/work/work-schedule/controls/WorkScheduleStatusLabel/index.less +21 -0
  77. package/es/modules/work/work-schedule/pages/WorkScheduleDefaultView/index.d.ts +3 -0
  78. package/es/modules/work/work-schedule/pages/WorkScheduleDefaultView/index.js +30 -0
  79. package/es/modules/work/work-schedule/pages/WorkScheduleDefaultView/index.js.map +1 -0
  80. package/es/modules/work/work-schedule/pages/WorkScheduleDefaultView/index.less +22 -0
  81. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ :global {
2
+ .work-schedule-header {
3
+ font-size: 24px;
4
+ display: flex;
5
+ justify-content: space-between;
6
+ padding: 10px 20px;
7
+
8
+ .tools-bar {
9
+ text-align: right;
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const WorkScheduleItem: (props: {
3
+ id: string;
4
+ avatar?: boolean;
5
+ }) => JSX.Element;
6
+ export default WorkScheduleItem;
@@ -0,0 +1,80 @@
1
+ import React, { useState } from "react";
2
+ import { observe, useAsideContentContext } from "@voplus/morpho-ui";
3
+ import { useViewContext } from "@voplus/morpho-document-core/es/data/context/ViewContext";
4
+ import { useWorkSchedule } from "../../../../../data/work-schedule";
5
+ import { Skeleton } from "@voplus/antd";
6
+ import { useLayout } from "@voplus/morpho-data";
7
+ import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
8
+ import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
9
+ import PropertiesView from "../WorkSchedulePropertiesView";
10
+ import WorkScheduleMenu from "../../controls/WorkScheduleMenu";
11
+ import WorkScheduleQuickViewDialog from "../WorkScheduleQuickViewDialog";
12
+ import UnitAvatar from "@voplus/morpho-org/es/components/UnitAvatar";
13
+ import moment from "moment";
14
+ import classnames from "classnames";
15
+ import styles from "./index.less";
16
+ const WorkScheduleItem = (props) => {
17
+ const { id, avatar } = props;
18
+ const workSchedule = useWorkSchedule(id);
19
+ const asideContext = useAsideContentContext();
20
+ const layout = useLayout();
21
+ const view = useViewContext();
22
+ const [isHover, setIsHover] = useState(false);
23
+ const [visibleQuickView, setVisibleQuickView] = useState(false);
24
+ return observe(() => {
25
+ var _a, _b, _c;
26
+ return (React.createElement("div", { className: classnames(styles["work-schedule-item"]), onClick: onQuickView, onMouseOver: () => setIsHover(true), onMouseLeave: () => setIsHover(false) },
27
+ workSchedule.loading ? (React.createElement(Skeleton, { avatar: avatar, paragraph: { rows: 1 } })) : (React.createElement(React.Fragment, null,
28
+ avatar && (React.createElement("div", { className: "avatar" },
29
+ React.createElement(UnitAvatar, { id: (_a = workSchedule === null || workSchedule === void 0 ? void 0 : workSchedule.contact) === null || _a === void 0 ? void 0 : _a.id, size: "large" }))),
30
+ React.createElement("div", { className: "work-schedule-item-content" },
31
+ React.createElement("div", { className: "work-schedule-item-info" },
32
+ React.createElement("div", { className: "work-schedule-item-name font-medium truncate" }, (_b = workSchedule.workType) === null || _b === void 0 ? void 0 : _b.name),
33
+ React.createElement("div", { className: "work-schedule-item-data-bar" },
34
+ React.createElement("span", { className: "text-sm text-gray-500 margin-right-15" }, `Contact: ${(_c = workSchedule.contact) === null || _c === void 0 ? void 0 : _c.name}`))),
35
+ React.createElement("div", { className: classnames("work-schedule-item-menus", { hide: isHover }) },
36
+ React.createElement("div", { className: "work-schedule-item-status" },
37
+ React.createElement("div", { className: classnames("risk-profile-status-label flex items-baseline text-xl font-semibold commission-amount") }, workSchedule.schedule && (React.createElement("span", null, moment(workSchedule === null || workSchedule === void 0 ? void 0 : workSchedule.schedule).format("YYYY-MM-DD"))))),
38
+ React.createElement("div", { className: "work-schedule-item-schedule" }, workSchedule.status)),
39
+ React.createElement("div", { className: classnames("work-schedule-item-tool", { show: isHover }), onClick: (e) => e.stopPropagation() },
40
+ React.createElement(ToolBar, { id: id, showMenu: false },
41
+ React.createElement(Open, { url: `/work-schedule/${id}` }),
42
+ React.createElement(WorkScheduleMenu, { id: id, closeAside: true })))))),
43
+ visibleQuickView && (React.createElement(WorkScheduleQuickViewDialog, { id: id, visible: true, onCancel: toggleQuickView }))));
44
+ });
45
+ /** Quick View */
46
+ function toggleQuickView() {
47
+ /* 手机模式 */
48
+ if (layout.ui.mobile) {
49
+ const element = asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent;
50
+ asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement("div", { style: {
51
+ width: "100%",
52
+ height: "100%",
53
+ background: "#fff",
54
+ position: "absolute",
55
+ top: "0",
56
+ } },
57
+ React.createElement(WorkScheduleQuickViewDialog, { id: id, visible: true, onCancel: () => {
58
+ if (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent)
59
+ asideContext.closeAside();
60
+ asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(element, { span: 12 });
61
+ } })), { span: 12 });
62
+ }
63
+ else {
64
+ setVisibleQuickView(!visibleQuickView);
65
+ }
66
+ }
67
+ /** Quick View */
68
+ function onQuickView() {
69
+ if ((view === null || view === void 0 ? void 0 : view.Type) === "PropertiesView" || (view === null || view === void 0 ? void 0 : view.Type) === "QuickView") {
70
+ toggleQuickView();
71
+ }
72
+ else {
73
+ asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(PropertiesView, { id: id }), {
74
+ span: 12,
75
+ });
76
+ }
77
+ }
78
+ };
79
+ export default WorkScheduleItem;
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-schedule/components/WorkScheduleItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0DAA0D,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAq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CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,WAAW,EAAE;YAClE,eAAe,EAAE,CAAC;SAClB;aAAM;YACN,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,CAAC,oBAAC,cAAc,IAAC,EAAE,EAAE,EAAE,GAAI,EAAE;gBACnD,IAAI,EAAE,EAAE;aACR,CAAC,CAAC;SACH;IACF,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,61 @@
1
+ .work-schedule-item {
2
+ display: flex;
3
+ min-height: 68px;
4
+ align-items: center;
5
+ margin: 0 20px;
6
+ padding: 10px 0;
7
+ border-bottom: 1px solid #f2f2f2;
8
+
9
+ :global {
10
+ .avatar {
11
+ margin-right: 10px;
12
+ }
13
+
14
+ .work-schedule-item-content {
15
+ display: flex;
16
+ justify-content: space-between;
17
+ align-items: center;
18
+ width: 100%;
19
+
20
+ .work-schedule-item-info {
21
+ display: flex;
22
+ flex-direction: column;
23
+
24
+ .work-schedule-item-data-bar {
25
+ min-height: 22px;
26
+ }
27
+ }
28
+
29
+ .work-schedule-item-menus {
30
+ display: flex;
31
+ flex-direction: column;
32
+
33
+ &.hide {
34
+ display: none;
35
+ }
36
+
37
+ .work-schedule-item-status {
38
+ display: flex;
39
+ justify-content: end;
40
+ width: 100%;
41
+ }
42
+
43
+ .work-schedule-item-schedule {
44
+ display: flex;
45
+ justify-content: end;
46
+ width: 100%;
47
+ color: #00000073;
48
+ font-size: 12px;
49
+ }
50
+ }
51
+
52
+ .work-schedule-item-tool {
53
+ display: none;
54
+
55
+ &.show {
56
+ display: block;
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { IWorkSchedule } from "../../../../../data/work-schedule";
3
+ declare const WorkScheduleList: {
4
+ (props: {
5
+ /** filter by contactId */
6
+ contactId?: string | undefined;
7
+ /** title */
8
+ viewTitle?: React.ReactNode;
9
+ /** 是否允在 listView 内部打开 aside */
10
+ asideable?: boolean | undefined;
11
+ /** Call back when received total number of workSchedule. */
12
+ onTotal?: ((total: number) => void) | undefined;
13
+ /** Call back when an item has been clicked on the list. */
14
+ onClickItem?: ((item: IWorkSchedule) => void) | undefined;
15
+ }): JSX.Element;
16
+ defaultProps: {
17
+ viewTitle: string;
18
+ };
19
+ };
20
+ export default WorkScheduleList;
@@ -0,0 +1,71 @@
1
+ import React, { useState } from "react";
2
+ import { observe } from "@voplus/morpho-ui";
3
+ import { useRenderOnChange } from "@voplus/morpho-ui";
4
+ import { useWorkScheduleListEffect } from "../../../../../data/work-schedule";
5
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
6
+ import { useAutoUpdateListData } from "../../../../../data/work-schedule/work-schedule-events";
7
+ import NewWorkScheduleForm from "../NewWorkScheduleForm";
8
+ import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
9
+ import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
10
+ import WorkScheduleItem from "../WorkScheduleItem";
11
+ import styles from "./index.less";
12
+ const WorkScheduleList = (props) => {
13
+ const { contactId, viewTitle, asideable } = props;
14
+ const [activeId, setActiveId] = useState("");
15
+ const list = useCreateListDataState({
16
+ filterDefaults: {
17
+ filters: filters(),
18
+ },
19
+ }, [contactId]);
20
+ /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
21
+ useAutoUpdateListData(list, (d) => {
22
+ if (contactId) {
23
+ return d.contact.id === contactId;
24
+ }
25
+ else {
26
+ return true;
27
+ }
28
+ });
29
+ useRenderOnChange(() => list.filters.options);
30
+ /** 把ListDataState传给useWorkScheduleListEffect,使之可以自動更新loading, hasmore. */
31
+ useWorkScheduleListEffect(list, (result, total) => {
32
+ var _a;
33
+ list.union(result);
34
+ (_a = props.onTotal) === null || _a === void 0 ? void 0 : _a.call(props, total);
35
+ }, {
36
+ Total: true,
37
+ ...list.filters.options,
38
+ });
39
+ return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
40
+ React.createElement("div", { className: styles["work-schedule-list"] },
41
+ React.createElement(ListView, { headerProps: {
42
+ viewTitle: viewTitle,
43
+ sortable: false,
44
+ quickSearch: true,
45
+ // filterViewProps: {
46
+ // columns: [<WorkScheduleStatusFilter key="WorkScheduleStatusFilter" />],
47
+ // onFilter,
48
+ // },
49
+ }, asideable: asideable, className: "work-schedule-list-content", formView: React.createElement(NewWorkScheduleForm, null), renderItem: ({ item, connectDragSource }) => (React.createElement(DocumentItemFrame, { key: item.id, frameProps: { active: activeId === item.id }, onClick: () => {
50
+ var _a;
51
+ setActiveId(item.id);
52
+ (_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, item);
53
+ } },
54
+ React.createElement(WorkScheduleItem, { id: item.id }))) })))));
55
+ function filters() {
56
+ const filter = [];
57
+ if (contactId) {
58
+ filter.push({ c: "Contact", o: "=", l: "And", v1: contactId });
59
+ }
60
+ return filter;
61
+ }
62
+ function onFilter(context) {
63
+ context.paging.Page = 1;
64
+ context.filter();
65
+ }
66
+ };
67
+ WorkScheduleList.defaultProps = {
68
+ viewTitle: " ",
69
+ };
70
+ export default WorkScheduleList;
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-schedule/components/WorkScheduleList/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,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAiB,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/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Y,GAAG;IAC/B,SAAS,EAAE,GAAG;CACd,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,12 @@
1
+ .work-schedule-list {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+
6
+ :global {
7
+ .work-schedule-list-content {
8
+ background-color: #fff;
9
+ padding: 0 !important;
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ export declare type WorkSchedulePropertiesName = "Schedule" | "WorkType";
3
+ declare const WorkScheduleProperties: {
4
+ (props: {
5
+ id: string;
6
+ headerVisible?: boolean;
7
+ workScheduleTitle?: string;
8
+ workScheduleProperties?: {
9
+ name: WorkSchedulePropertiesName;
10
+ visible?: boolean;
11
+ }[];
12
+ }): JSX.Element;
13
+ defaultProps: {
14
+ workScheduleTitle: string;
15
+ workScheduleProperties: {
16
+ name: string;
17
+ }[];
18
+ };
19
+ };
20
+ export default WorkScheduleProperties;
@@ -0,0 +1,87 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { Form } from "@voplus/antd";
3
+ import { observe, InlineEdit } from "@voplus/morpho-ui";
4
+ import { useWorkSchedule, useWorkScheduleStore } from "../../../../../data/work-schedule";
5
+ import { Scrollbars } from "react-custom-scrollbars";
6
+ import { faEllipsisVertical } from "@fortawesome/pro-light-svg-icons";
7
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
8
+ import FolderEdit from "@voplus/morpho-document/es/controls/FolderEdit";
9
+ import WorkTypeSelect from "../../../work-type/components/WorkTypeSelect";
10
+ import PropertiesSection from "@voplus/morpho-ui/es/controls/PropertiesSection";
11
+ import WorkScheduleMenu from "../../controls/WorkScheduleMenu";
12
+ import DateInputEditor from "@voplus/morpho-ui/es/controls/InlineEdit/editors/DateInputEditor";
13
+ import VerificationInformation from "@voplus/morpho-document/es/components/VerificationInformation";
14
+ import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
15
+ import classnames from "classnames";
16
+ import moment from "moment";
17
+ const WorkScheduleProperties = (props) => {
18
+ const { id, headerVisible, workScheduleTitle, workScheduleProperties } = props;
19
+ const workSchedule = useWorkSchedule(id);
20
+ const store = useWorkScheduleStore();
21
+ const [showWorkTypeEditIcon, setShowWorkTypeEditIcon] = useState(true);
22
+ const [workTypeEditable, setWorkTypeEditable] = useState(false);
23
+ const clickEvent = (e) => {
24
+ if (!e.target.className.toString())
25
+ return;
26
+ if (!e.target.className.toString().includes("ant-select-selection-search-input")) {
27
+ setWorkTypeEditable(false);
28
+ setShowWorkTypeEditIcon(true);
29
+ }
30
+ };
31
+ useEffect(() => {
32
+ if (workTypeEditable) {
33
+ window.addEventListener("click", clickEvent, true);
34
+ }
35
+ return () => {
36
+ window.removeEventListener("click", clickEvent, true);
37
+ };
38
+ }, [workTypeEditable]);
39
+ const filterPro = workScheduleProperties === null || workScheduleProperties === void 0 ? void 0 : workScheduleProperties.filter((i) => (i === null || i === void 0 ? void 0 : i.visible) !== false);
40
+ return observe(() => {
41
+ var _a;
42
+ return (React.createElement("div", { className: "properties-list" },
43
+ headerVisible && (React.createElement("div", { className: "properties-header" },
44
+ React.createElement("div", { className: "title" }, (_a = workSchedule === null || workSchedule === void 0 ? void 0 : workSchedule.workType) === null || _a === void 0 ? void 0 : _a.name),
45
+ React.createElement(ToolBar, { id: id, showMenu: false },
46
+ React.createElement(WorkScheduleMenu, { id: id, icon: React.createElement(FAIcon, { icon: faEllipsisVertical }) })))),
47
+ React.createElement(Scrollbars, { autoHide: true },
48
+ React.createElement(PropertiesSection, { title: "Verification Information", properties: React.createElement(VerificationInformation, { id: id }) }),
49
+ React.createElement(PropertiesSection, { title: workScheduleTitle, properties: React.createElement(Form, { labelAlign: "left", labelCol: { span: 10 }, scrollToFirstError: true }, filterPro === null || filterPro === void 0 ? void 0 : filterPro.map((i) => (React.createElement(React.Fragment, { key: i.name }, renderProp(i))))) }))));
50
+ });
51
+ function renderProp(item) {
52
+ var _a, _b;
53
+ switch (item.name) {
54
+ case "Schedule":
55
+ return (React.createElement(Form.Item, { label: "Schedule" },
56
+ React.createElement(InlineEdit, { defaultValue: moment(workSchedule.schedule !== "" ? workSchedule.schedule : undefined), content: (v) => workSchedule.schedule ? (React.createElement("span", null, moment(workSchedule.schedule).format("YYYY-MM-DD"))) : (React.createElement("span", { className: "add-info-style" }, "Add Schedule")), editor: DateInputEditor, onSave: (date) => {
57
+ if (workSchedule.schedule && moment(date).isSame(workSchedule.schedule, "day"))
58
+ return;
59
+ store.edit(props.id, {
60
+ data: { Schedule: date !== null ? moment(date).format("YYYY-MM-DD") : "" },
61
+ });
62
+ } })));
63
+ case "WorkType":
64
+ return (React.createElement(Form.Item, { label: "WorkType" },
65
+ React.createElement(FolderEdit, { showEditIcon: showWorkTypeEditIcon, onEditIconClick: () => {
66
+ setWorkTypeEditable(true);
67
+ setShowWorkTypeEditIcon(false);
68
+ } }, workTypeEditable ? (React.createElement(WorkTypeSelect, { onChange: (_, data) => store
69
+ .edit(id, {
70
+ data: { WorkTypeId: data.id },
71
+ error: "message",
72
+ })
73
+ .then(() => {
74
+ setShowWorkTypeEditIcon(true);
75
+ setWorkTypeEditable(false);
76
+ }) })) : (React.createElement("span", { className: classnames({
77
+ "add-info-style": !((_a = workSchedule.workType) === null || _a === void 0 ? void 0 : _a.name),
78
+ }) }, ((_b = workSchedule.workType) === null || _b === void 0 ? void 0 : _b.name) || "Select Work Type")))));
79
+ }
80
+ }
81
+ };
82
+ WorkScheduleProperties.defaultProps = {
83
+ workScheduleTitle: "WorkSchedule Properties",
84
+ workScheduleProperties: [{ name: "Schedule" }, { name: "WorkType" }],
85
+ };
86
+ export default WorkScheduleProperties;
87
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-schedule/components/WorkScheduleProperties/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,M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,YAAY,GAAG;IACrC,iBAAiB,EAAE,yBAAyB;IAC5C,sBAAsB,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;CACpE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const WorkSchedulePropertiesView: (props: {
3
+ id: string;
4
+ default?: boolean;
5
+ }) => JSX.Element;
6
+ export default WorkSchedulePropertiesView;
@@ -0,0 +1,15 @@
1
+ import React, { useMemo } from "react";
2
+ import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
3
+ import WorkScheduleHeader from "../WorkScheduleHeader";
4
+ import WorkScheduleTabs from "../WorkScheduleTabs";
5
+ import { observe } from "@voplus/morpho-ui";
6
+ const WorkSchedulePropertiesView = (props) => {
7
+ const id = props.id;
8
+ const view = useMemo(() => new ViewContextData("PropertiesView"), []);
9
+ return observe(() => (React.createElement(ViewContext.Provider, { value: view },
10
+ React.createElement("div", { className: "module-detail-view work-schedule-properties-view" },
11
+ React.createElement(WorkScheduleHeader, { id: id }),
12
+ React.createElement(WorkScheduleTabs, { id: id, properties: true })))));
13
+ };
14
+ export default WorkSchedulePropertiesView;
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-schedule/components/WorkSchedulePropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EACN,WAAW,EACX,eAAe,GACf,MAAM,0DAA0D,CAAC;AAClE,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,0BAA0B,GAAG,CAAC,KAAwC,EAAE,EAAE;IAC/E,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEtE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;QAChC,6BAAK,SAAS,EAAC,kDAAkD;YAChE,oBAAC,kBAAkB,IAAC,EAAE,EAAE,EAAE,GAAI;YAC9B,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,SAAG,CAClC,CACgB,CACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ declare const WorkScheduleQuickViewDialog: {
4
+ (props: {
5
+ id: string;
6
+ visible?: boolean;
7
+ onCancel?: () => void;
8
+ /** show close button or not. */
9
+ closeVisible?: boolean;
10
+ }): JSX.Element;
11
+ defaultProps: {
12
+ closeVisible: boolean;
13
+ };
14
+ };
15
+ export default WorkScheduleQuickViewDialog;
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { observe } from "@voplus/morpho-ui";
3
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
4
+ import { faTimes } from "@fortawesome/pro-light-svg-icons";
5
+ import WorkScheduleHeader from "../WorkScheduleHeader";
6
+ import WorkScheduleProperties from "../WorkScheduleProperties";
7
+ import FlexDialog from "@voplus/morpho-document/es/components/FlexDialog";
8
+ import "./index.less";
9
+ const WorkScheduleQuickViewDialog = (props) => {
10
+ const { id } = props;
11
+ return observe(() => (React.createElement(FlexDialog, { modalProps: {
12
+ className: "quickView-modal-style",
13
+ width: "500px",
14
+ destroyOnClose: true,
15
+ closable: false,
16
+ footer: false,
17
+ visible: props.visible,
18
+ onCancel: props.onCancel,
19
+ }, closeAside: props.onCancel },
20
+ React.createElement("div", { className: "quickView-content" },
21
+ props.closeVisible && (React.createElement("div", { className: "work-schedule-close-icon" },
22
+ React.createElement(FAIcon, { icon: faTimes, onClick: props.onCancel }))),
23
+ React.createElement(WorkScheduleHeader, { id: id }),
24
+ React.createElement(WorkScheduleProperties, { id: id })))));
25
+ };
26
+ WorkScheduleQuickViewDialog.defaultProps = {
27
+ closeVisible: true,
28
+ };
29
+ export default WorkScheduleQuickViewDialog;
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-schedule/components/WorkScheduleQuickViewDialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,UAAU,MAAM,kDAAkD,CAAC;AAC1E,OAAO,cAAc,CAAC;AAEtB,MAAM,2BAA2B,GAAG,CAAC,KAMpC,EAAE,EAAE;IACJ,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,UAAU,IACV,UAAU,EAAE;YACX,SAAS,EAAE,uBAAuB;YAClC,KAAK,EAAE,OAAO;YACd,cAAc,EAAE,IAAI;YACpB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACxB,EACD,UAAU,EAAE,KAAK,CAAC,QAAQ;QAE1B,6BAAK,SAAS,EAAC,mBAAmB;YAChC,KAAK,CAAC,YAAY,IAAI,CACtB,6BAAK,SAAS,EAAC,0BAA0B;gBACxC,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,GAAI,CAC7C,CACN;YACD,oBAAC,kBAAkB,IAAC,EAAE,EAAE,EAAE,GAAI;YAC9B,oBAAC,sBAAsB,IAAC,EAAE,EAAE,EAAE,GAAI,CAC7B,CACM,CACb,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,2BAA2B,CAAC,YAAY,GAAG;IAC1C,YAAY,EAAE,IAAI;CAClB,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,25 @@
1
+ :global {
2
+ .quickView-modal-style {
3
+ .ant-modal-close-x {
4
+ color: #575757;
5
+ }
6
+
7
+ .quickView-content {
8
+ position: relative;
9
+ width: 100%;
10
+
11
+ .work-schedule-close-icon {
12
+ position: absolute;
13
+ right: 20px;
14
+ top: 14px;
15
+ font-size: 22px;
16
+ text-align: right;
17
+ cursor: pointer;
18
+ }
19
+
20
+ .work-schedule-header {
21
+ padding: 10px 44px 10px 20px;
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const WorkScheduleTabs: (props: {
3
+ id: string;
4
+ properties?: boolean;
5
+ }) => JSX.Element;
6
+ export default WorkScheduleTabs;
@@ -0,0 +1,29 @@
1
+ import React, { useState } from "react";
2
+ import { Badge } from "@voplus/antd";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ import { useDocumentListEffect } from "@voplus/morpho-document-core";
5
+ import DocumentTabs from "@voplus/morpho-document/es/components/DocumentTabs";
6
+ import WorkScheduleProperties from "../WorkScheduleProperties";
7
+ const WorkScheduleTabs = (props) => {
8
+ const { id, properties } = props;
9
+ const [docTotals, setDocTotals] = useState(0);
10
+ useDocumentListEffect(null, (result, total) => setDocTotals(total || 0), {
11
+ Total: true,
12
+ List: false,
13
+ Filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: id }],
14
+ });
15
+ const preData = [];
16
+ properties &&
17
+ preData.unshift({
18
+ key: "Properties",
19
+ title: "Properties",
20
+ content: React.createElement(WorkScheduleProperties, { id: id }),
21
+ });
22
+ return observe(() => (React.createElement(DocumentTabs, { id: id, active: properties ? "Properties" : "Document", isLinks: false, docTabOptions: {
23
+ title: (React.createElement(React.Fragment, null,
24
+ "Document",
25
+ React.createElement(Badge, { count: docTotals, className: "margin-left-10" }))),
26
+ }, preData: preData })));
27
+ };
28
+ export default WorkScheduleTabs;
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-schedule/components/WorkScheduleTabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAC9E,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAE/D,MAAM,gBAAgB,GAAG,CAAC,KAA2C,EAAE,EAAE;IACxE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE9C,qBAAqB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE;QACxE,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;KAC1D,CAAC,CAAC;IAEH,MAAM,OAAO,GAAU,EAAE,CAAC;IAE1B,UAAU;QACT,OAAO,CAAC,OAAO,CAAC;YACf,GAAG,EAAE,YAAY;YACjB,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,oBAAC,sBAAsB,IAAC,EAAE,EAAE,EAAE,GAAI;SACpC,CAAC,CAAC;IAEX,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,YAAY,IACZ,EAAE,EAAE,EAAE,EACN,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,EAC9C,OAAO,EAAE,KAAK,EACd,aAAa,EAAE;YACd,KAAK,EAAE,CACN;;gBAEC,oBAAC,KAAK,IAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAC,gBAAgB,GAAG,CACpD,CACH;SACD,EACD,OAAO,EAAE,OAAO,GACf,CACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ declare const WorkScheduleMenu: {
3
+ (props: {
4
+ id: string;
5
+ className?: string;
6
+ closeAside?: boolean;
7
+ icon?: React.ReactNode;
8
+ }): JSX.Element;
9
+ defaultProps: {
10
+ icon: JSX.Element;
11
+ };
12
+ };
13
+ export default WorkScheduleMenu;
@@ -0,0 +1,44 @@
1
+ import React, { useState } from "react";
2
+ import { Button, Dropdown, Modal } from "@voplus/antd";
3
+ import { useWorkScheduleStore } from "../../../../../data/work-schedule";
4
+ import { observe, useAsideContentContext } from "@voplus/morpho-ui";
5
+ import { faTrashAlt, faUserEdit, faCircleEllipsis } from "@fortawesome/pro-light-svg-icons";
6
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
7
+ import PermissionModal from "@voplus/morpho-org/es/controls/PermissionModal";
8
+ import classnames from "classnames";
9
+ import styles from "./index.less";
10
+ const WorkScheduleMenu = (props) => {
11
+ const [visible, setVisible] = useState(false);
12
+ const asideContext = useAsideContentContext();
13
+ const store = useWorkScheduleStore();
14
+ return observe(() => (React.createElement(Dropdown, { placement: "bottomRight", overlay: React.createElement("div", { className: classnames(styles["work-schedule-menu"], props.className) },
15
+ React.createElement(Button, { type: "link", onClick: () => setVisible(!visible) },
16
+ React.createElement(FAIcon, { icon: faUserEdit }),
17
+ React.createElement("span", null, "Access")),
18
+ React.createElement(Button, { type: "link", onClick: onClick },
19
+ React.createElement(FAIcon, { icon: faTrashAlt, color: "#f5222d" }),
20
+ React.createElement("span", { className: "delete" }, "Delete")),
21
+ visible && React.createElement(PermissionModal, { id: props.id || "", onChange: () => setVisible(!visible) })) },
22
+ React.createElement(Button, { size: "small", type: "link" }, props.icon))));
23
+ function onClick() {
24
+ /** 如果文件下有子文件, 询问是否删除所有子文件 */
25
+ Modal.confirm({
26
+ title: "Do you want to delete this item?",
27
+ async onOk() {
28
+ await store.delete([props.id], {
29
+ data: { DeleteChilds: true },
30
+ error: "message",
31
+ });
32
+ /** 删除后是否关闭Aside */
33
+ if (!!props.closeAside && (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent))
34
+ asideContext === null || asideContext === void 0 ? void 0 : asideContext.closeAside();
35
+ return;
36
+ },
37
+ });
38
+ }
39
+ };
40
+ WorkScheduleMenu.defaultProps = {
41
+ icon: React.createElement(FAIcon, { icon: faCircleEllipsis }),
42
+ };
43
+ export default WorkScheduleMenu;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/work/work-schedule/controls/WorkScheduleMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,cAAc,CA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