@voplus/morpho-workspace 1.3.0 → 1.3.2
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/controls/filters/WorkStatusFilter/index.d.ts +3 -0
- package/es/controls/filters/WorkStatusFilter/index.js +21 -0
- package/es/controls/filters/WorkStatusFilter/index.js.map +1 -0
- package/es/controls/filters/WorkStatusFilter/state.d.ts +17 -0
- package/es/controls/filters/WorkStatusFilter/state.js +49 -0
- package/es/controls/filters/WorkStatusFilter/state.js.map +1 -0
- package/es/data/notification/interfaces.d.ts +2 -1
- package/es/data/work/WorkStore.d.ts +10 -0
- package/es/data/work/WorkStore.js +21 -0
- package/es/data/work/WorkStore.js.map +1 -0
- package/es/data/work/hook.d.ts +9 -0
- package/es/data/work/hook.js +20 -0
- package/es/data/work/hook.js.map +1 -0
- package/es/data/work/index.d.ts +3 -0
- package/es/data/work/index.js +4 -0
- package/es/data/work/index.js.map +1 -0
- package/es/data/work/interfaces.d.ts +37 -0
- package/es/data/work/interfaces.js +2 -0
- package/es/data/work/interfaces.js.map +1 -0
- package/es/data/workerror/WorkErrorStore.d.ts +37 -0
- package/es/data/workerror/WorkErrorStore.js +117 -0
- package/es/data/workerror/WorkErrorStore.js.map +1 -0
- package/es/data/workerror/hook.d.ts +9 -0
- package/es/data/workerror/hook.js +19 -0
- package/es/data/workerror/hook.js.map +1 -0
- package/es/data/workerror/index.d.ts +4 -0
- package/es/data/workerror/index.js +5 -0
- package/es/data/workerror/index.js.map +1 -0
- package/es/data/workerror/interfaces.d.ts +20 -0
- package/es/data/workerror/interfaces.js +2 -0
- package/es/data/workerror/interfaces.js.map +1 -0
- package/es/data/workerror/types.d.ts +50 -0
- package/es/data/workerror/types.js +9 -0
- package/es/data/workerror/types.js.map +1 -0
- package/es/data/workerror/workerror-events/index.d.ts +3 -0
- package/es/data/workerror/workerror-events/index.js +4 -0
- package/es/data/workerror/workerror-events/index.js.map +1 -0
- package/es/data/workerror/workerror-events/useAutoUpdateListData.d.ts +4 -0
- package/es/data/workerror/workerror-events/useAutoUpdateListData.js +13 -0
- package/es/data/workerror/workerror-events/useAutoUpdateListData.js.map +1 -0
- package/es/data/workerror/workerror-events/useOnDeleteWorkspace.d.ts +4 -0
- package/es/data/workerror/workerror-events/useOnDeleteWorkspace.js +17 -0
- package/es/data/workerror/workerror-events/useOnDeleteWorkspace.js.map +1 -0
- package/es/data/workerror/workerror-events/useOnNewWorkspace.d.ts +4 -0
- package/es/data/workerror/workerror-events/useOnNewWorkspace.js +17 -0
- package/es/data/workerror/workerror-events/useOnNewWorkspace.js.map +1 -0
- package/es/data/workspace/WorkSpaceStore.d.ts +39 -0
- package/es/data/workspace/WorkSpaceStore.js +134 -0
- package/es/data/workspace/WorkSpaceStore.js.map +1 -0
- package/es/data/workspace/hooks.d.ts +13 -0
- package/es/data/workspace/hooks.js +23 -0
- package/es/data/workspace/hooks.js.map +1 -0
- package/es/data/workspace/index.d.ts +4 -0
- package/es/data/workspace/index.js +5 -0
- package/es/data/workspace/index.js.map +1 -0
- package/es/data/workspace/interfaces.d.ts +17 -0
- package/es/data/workspace/interfaces.js +2 -0
- package/es/data/workspace/interfaces.js.map +1 -0
- package/es/data/workspace/types.d.ts +28 -0
- package/es/data/workspace/types.js +2 -0
- package/es/data/workspace/types.js.map +1 -0
- package/es/data/workspace/useWorkSpaceCompletedWorkEffect.d.ts +10 -0
- package/es/data/workspace/useWorkSpaceCompletedWorkEffect.js +14 -0
- package/es/data/workspace/useWorkSpaceCompletedWorkEffect.js.map +1 -0
- package/es/data/workspace/workspace-events/index.d.ts +3 -0
- package/es/data/workspace/workspace-events/index.js +4 -0
- package/es/data/workspace/workspace-events/index.js.map +1 -0
- package/es/data/workspace/workspace-events/useAutoUpdateListData.d.ts +4 -0
- package/es/data/workspace/workspace-events/useAutoUpdateListData.js +13 -0
- package/es/data/workspace/workspace-events/useAutoUpdateListData.js.map +1 -0
- package/es/data/workspace/workspace-events/useOnDeleteWorkspace.d.ts +4 -0
- package/es/data/workspace/workspace-events/useOnDeleteWorkspace.js +17 -0
- package/es/data/workspace/workspace-events/useOnDeleteWorkspace.js.map +1 -0
- package/es/data/workspace/workspace-events/useOnNewWorkspace.d.ts +4 -0
- package/es/data/workspace/workspace-events/useOnNewWorkspace.js +17 -0
- package/es/data/workspace/workspace-events/useOnNewWorkspace.js.map +1 -0
- package/es/data/worktype/WorkTypeStore.d.ts +21 -0
- package/es/data/worktype/WorkTypeStore.js +75 -0
- package/es/data/worktype/WorkTypeStore.js.map +1 -0
- package/es/data/worktype/hook.d.ts +9 -0
- package/es/data/worktype/hook.js +20 -0
- package/es/data/worktype/hook.js.map +1 -0
- package/es/data/worktype/index.d.ts +4 -0
- package/es/data/worktype/index.js +5 -0
- package/es/data/worktype/index.js.map +1 -0
- package/es/data/worktype/interfaces.d.ts +57 -0
- package/es/data/worktype/interfaces.js +2 -0
- package/es/data/worktype/interfaces.js.map +1 -0
- package/es/data/worktype/types.d.ts +55 -0
- package/es/data/worktype/types.js +2 -0
- package/es/data/worktype/types.js.map +1 -0
- package/es/data/worktype/useWorkTypeCompletedWorkEffect.d.ts +10 -0
- package/es/data/worktype/useWorkTypeCompletedWorkEffect.js +14 -0
- package/es/data/worktype/useWorkTypeCompletedWorkEffect.js.map +1 -0
- package/es/modules/board/components/Board/index.js +1 -3
- package/es/modules/board/components/Board/index.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaItem/index.js +2 -2
- package/es/modules/meeting/components/AgendaList/AgendaItem/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingList/index.js +1 -2
- package/es/modules/meeting/components/MeetingList/index.js.map +1 -1
- package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.d.ts +2 -2
- package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.js +3 -3
- package/es/modules/notification/components/DocumentNotificationCard/index.js.map +1 -0
- package/es/modules/notification/components/NotificationList/index.js +2 -2
- package/es/modules/notification/components/NotificationList/index.js.map +1 -1
- package/es/modules/notification/components/NotificationList/index.less +11 -3
- package/es/modules/tasks/reports/TaskSummaryCard/index.js +2 -2
- package/es/modules/tasks/reports/TaskSummaryCard/index.js.map +1 -1
- package/es/modules/work/components/NewWorkErrorDialog/index.d.ts +9 -0
- package/es/modules/work/components/NewWorkErrorDialog/index.js +70 -0
- package/es/modules/work/components/NewWorkErrorDialog/index.js.map +1 -0
- package/es/modules/work/components/NewWorkErrorDialog/index.less +18 -0
- package/es/modules/work/components/NewWorkErrorDialog/state.d.ts +16 -0
- package/es/modules/work/components/NewWorkErrorDialog/state.js +37 -0
- package/es/modules/work/components/NewWorkErrorDialog/state.js.map +1 -0
- package/es/modules/work/components/RejectWorkDialog/index.d.ts +9 -0
- package/es/modules/work/components/RejectWorkDialog/index.js +54 -0
- package/es/modules/work/components/RejectWorkDialog/index.js.map +1 -0
- package/es/modules/work/components/RejectWorkDialog/index.less +18 -0
- package/es/modules/work/components/RejectWorkDialog/state.d.ts +12 -0
- package/es/modules/work/components/RejectWorkDialog/state.js +35 -0
- package/es/modules/work/components/RejectWorkDialog/state.js.map +1 -0
- package/es/modules/work/components/WorkErrorItem/index.d.ts +6 -0
- package/es/modules/work/components/WorkErrorItem/index.js +24 -0
- package/es/modules/work/components/WorkErrorItem/index.js.map +1 -0
- package/es/modules/work/components/WorkErrorItem/index.less +26 -0
- package/es/modules/work/components/WorkErrorList/index.d.ts +8 -0
- package/es/modules/work/components/WorkErrorList/index.js +44 -0
- package/es/modules/work/components/WorkErrorList/index.js.map +1 -0
- package/es/modules/work/components/WorkErrorList/index.less +5 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.d.ts +6 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.js +45 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.js.map +1 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.less +22 -0
- package/es/modules/work/components/WorkItem/index.d.ts +11 -0
- package/es/modules/work/components/WorkItem/index.js +25 -0
- package/es/modules/work/components/WorkItem/index.js.map +1 -0
- package/es/modules/work/components/WorkItem/index.less +17 -0
- package/es/modules/work/components/WorkList/index.d.ts +16 -0
- package/es/modules/work/components/WorkList/index.js +88 -0
- package/es/modules/work/components/WorkList/index.js.map +1 -0
- package/es/modules/work/components/WorkList/index.less +7 -0
- package/es/modules/work/components/WorkPropertiesView/index.d.ts +7 -0
- package/es/modules/work/components/WorkPropertiesView/index.js +35 -0
- package/es/modules/work/components/WorkPropertiesView/index.js.map +1 -0
- package/es/modules/work/components/WorkPropertiesView/index.less +23 -0
- package/es/{pages/Space/components/Documents → modules/work/components/WorkQATab}/index.d.ts +2 -2
- package/es/modules/work/components/WorkQATab/index.js +33 -0
- package/es/modules/work/components/WorkQATab/index.js.map +1 -0
- package/es/modules/work/components/WorkQATab/index.less +24 -0
- package/es/modules/work/components/WorkTabs/index.d.ts +7 -0
- package/es/modules/work/components/WorkTabs/index.js +45 -0
- package/es/modules/work/components/WorkTabs/index.js.map +1 -0
- package/es/modules/work/components/WorkTabs/index.less +16 -0
- package/es/modules/work/components/WorkTaskList/index.d.ts +5 -0
- package/es/modules/work/components/WorkTaskList/index.js +65 -0
- package/es/modules/work/components/WorkTaskList/index.js.map +1 -0
- package/es/modules/work/components/WorkTaskList/index.less +18 -0
- package/es/modules/work/components/WorkTaskList/state.d.ts +14 -0
- package/es/modules/work/components/WorkTaskList/state.js +23 -0
- package/es/modules/work/components/WorkTaskList/state.js.map +1 -0
- package/es/modules/work/components/WorkTasksTab/index.d.ts +6 -0
- package/es/modules/work/components/WorkTasksTab/index.js +17 -0
- package/es/modules/work/components/WorkTasksTab/index.js.map +1 -0
- package/es/modules/work/components/WorkTasksTab/index.less +7 -0
- package/es/modules/work/components/WorksProperties/index.d.ts +6 -0
- package/es/modules/work/components/WorksProperties/index.js +27 -0
- package/es/modules/work/components/WorksProperties/index.js.map +1 -0
- package/es/modules/work/components/WorksProperties/index.less +8 -0
- package/es/modules/work/pages/WorkDefaultView/index.d.ts +4 -0
- package/es/modules/work/pages/WorkDefaultView/index.js +26 -0
- package/es/modules/work/pages/WorkDefaultView/index.js.map +1 -0
- package/es/modules/work/pages/WorkDefaultView/index.less +17 -0
- package/es/modules/work/pages/WorkListPage/index.d.ts +6 -0
- package/es/modules/work/pages/WorkListPage/index.js +19 -0
- package/es/modules/work/pages/WorkListPage/index.js.map +1 -0
- package/es/modules/workspace/components/MyWorkspaces/index.d.ts +11 -0
- package/es/modules/workspace/components/MyWorkspaces/index.js +34 -0
- package/es/modules/workspace/components/MyWorkspaces/index.js.map +1 -0
- package/es/modules/workspace/components/MyWorkspaces/index.less +18 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.d.ts +10 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.js +59 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.js.map +1 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.less +18 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/state.d.ts +12 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/state.js +35 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/state.js.map +1 -0
- package/es/modules/workspace/components/WorkspaceCard/index.d.ts +8 -0
- package/es/modules/workspace/components/WorkspaceCard/index.js +18 -0
- package/es/modules/workspace/components/WorkspaceCard/index.js.map +1 -0
- package/es/modules/workspace/components/WorkspaceCard/index.less +47 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.d.ts +13 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.js +49 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.js.map +1 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.less +13 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.d.ts +6 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js +41 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js.map +1 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.less +19 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/state.d.ts +15 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/state.js +68 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/state.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.d.ts +6 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.js +68 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.less +8 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/state.d.ts +5 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/state.js +26 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/state.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.d.ts +8 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.js +36 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.less +33 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.d.ts +4 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.js +51 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.js.map +1 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.less +22 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/state.d.ts +15 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/state.js +68 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/state.js.map +1 -0
- package/es/modules/workspace/pages/WorkspacePage/index.d.ts +4 -0
- package/es/modules/workspace/pages/WorkspacePage/index.js +73 -0
- package/es/modules/workspace/pages/WorkspacePage/index.js.map +1 -0
- package/es/modules/workspace/pages/WorkspacePage/index.less +1 -0
- package/es/modules/workspace/pages/WorkspacePage/state.d.ts +23 -0
- package/es/modules/workspace/pages/WorkspacePage/state.js +108 -0
- package/es/modules/workspace/pages/WorkspacePage/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeCard/index.d.ts +8 -0
- package/es/modules/worktype/components/WorkTypeCard/index.js +18 -0
- package/es/modules/worktype/components/WorkTypeCard/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeCard/index.less +47 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.d.ts +16 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.js +50 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.less +15 -0
- package/es/modules/worktype/components/WorkTypeItem/index.d.ts +8 -0
- package/es/modules/worktype/components/WorkTypeItem/index.js +11 -0
- package/es/modules/worktype/components/WorkTypeItem/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeItem/index.less +19 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.js +55 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.less +5 -0
- package/es/modules/worktype/components/WorkTypeProperties/state.d.ts +11 -0
- package/es/modules/worktype/components/WorkTypeProperties/state.js +57 -0
- package/es/modules/worktype/components/WorkTypeProperties/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.d.ts +5 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.js +28 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.less +0 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.js +38 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.less +19 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/state.d.ts +15 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/state.js +68 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeQA/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeQA/index.js +60 -0
- package/es/modules/worktype/components/WorkTypeQA/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeQA/index.less +35 -0
- package/es/modules/worktype/components/WorkTypeQA/state.d.ts +21 -0
- package/es/modules/worktype/components/WorkTypeQA/state.js +145 -0
- package/es/modules/worktype/components/WorkTypeQA/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeStats/index.d.ts +5 -0
- package/es/modules/worktype/components/WorkTypeStats/index.js +16 -0
- package/es/modules/worktype/components/WorkTypeStats/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeStats/index.less +29 -0
- package/es/modules/worktype/components/WorkTypeStats/state.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeStats/state.js +27 -0
- package/es/modules/worktype/components/WorkTypeStats/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.js +45 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.less +16 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.d.ts +6 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.js +70 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.js.map +1 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.less +8 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/state.d.ts +5 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/state.js +26 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/state.js.map +1 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.d.ts +4 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.js +24 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.js.map +1 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.less +21 -0
- package/es/pages/Routes.d.ts +12 -0
- package/es/pages/Routes.js +29 -3
- package/es/pages/Routes.js.map +1 -1
- package/es/pages/Space/components/Notifications/index.js +1 -0
- package/es/pages/Space/components/Notifications/index.js.map +1 -1
- package/es/pages/Space/components/Tasks/index.d.ts +2 -2
- package/es/pages/Space/components/Tasks/index.js +50 -11
- package/es/pages/Space/components/Tasks/index.js.map +1 -1
- package/es/pages/Space/components/Works/index.d.ts +2 -2
- package/es/pages/Space/components/Works/index.js +13 -37
- package/es/pages/Space/components/Works/index.js.map +1 -1
- package/es/pages/Space/components/Workspaces/index.d.ts +3 -0
- package/es/pages/Space/components/Workspaces/index.js +19 -0
- package/es/pages/Space/components/Workspaces/index.js.map +1 -0
- package/es/pages/Space/pages/MySpace/index.js +49 -14
- package/es/pages/Space/pages/MySpace/index.js.map +1 -1
- package/es/pages/Space/pages/MySpace/state.d.ts +27 -6
- package/es/pages/Space/pages/MySpace/state.js +114 -24
- package/es/pages/Space/pages/MySpace/state.js.map +1 -1
- package/es/pages/Work/components/NewWorkDialog/index.js +3 -7
- package/es/pages/Work/components/NewWorkDialog/index.js.map +1 -1
- package/es/pages/Work/pages/WorkDefaultView/index.js +20 -17
- package/es/pages/Work/pages/WorkDefaultView/index.js.map +1 -1
- package/es/pages/WorkType/WorkTypeCheckList/index.d.ts +1 -2
- package/es/pages/WorkType/WorkTypeCheckList/index.js +43 -34
- package/es/pages/WorkType/WorkTypeCheckList/index.js.map +1 -1
- package/es/pages/WorkType/WorkTypeDetail/index.js +6 -10
- package/es/pages/WorkType/WorkTypeDetail/index.js.map +1 -1
- package/es/pages/WorkType/data/WorkTypeStore.js +4 -4
- package/es/pages/WorkType/data/WorkTypeStore.js.map +1 -1
- package/es/pages/WorkType/data/interfaces.d.ts +24 -7
- package/es/pages/WorkType/data/types.d.ts +19 -18
- package/es/routes.js.map +1 -1
- package/package.json +2 -2
- package/es/modules/notification/components/MentionNotificationCard/index.js.map +0 -1
- package/es/pages/Space/components/Documents/index.js +0 -26
- package/es/pages/Space/components/Documents/index.js.map +0 -1
- package/es/pages/Space/components/Documents/index.less +0 -5
- /package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.less +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useFilterOptionsContext } from "@voplus/morpho-ui/es/data";
|
|
3
|
+
import { observe } from "@voplus/morpho-ui";
|
|
4
|
+
import classnames from "classnames";
|
|
5
|
+
import { Badge } from "@voplus/antd";
|
|
6
|
+
import { State } from "./state";
|
|
7
|
+
const WorkStatusFilter = () => {
|
|
8
|
+
const context = useFilterOptionsContext();
|
|
9
|
+
const state = context.getFilterState("Status", () => new State());
|
|
10
|
+
return observe(() => (React.createElement("div", null,
|
|
11
|
+
React.createElement("div", { className: "menu-item-title" }, "Status"),
|
|
12
|
+
state.menus.map((item, index) => (React.createElement("div", { key: index, className: classnames("filter-menu-item", {
|
|
13
|
+
bold: state.status.has(item.value),
|
|
14
|
+
}), onClick: () => state.onChangeStatus(item.value) },
|
|
15
|
+
React.createElement("div", { className: "filter-name" },
|
|
16
|
+
React.createElement(Badge, { color: item.color }),
|
|
17
|
+
item.name),
|
|
18
|
+
React.createElement("span", null, item.counts)))))));
|
|
19
|
+
};
|
|
20
|
+
export default WorkStatusFilter;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controls/filters/WorkStatusFilter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAElE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB;QACC,6BAAK,SAAS,EAAC,iBAAiB,aAAa;QAC5C,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,KAAa,EAAE,EAAE,CAAC,CAC9C,6BACC,GAAG,EAAE,KAAK,EACV,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE;gBACzC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;aAClC,CAAC,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;YAE/C,6BAAK,SAAS,EAAC,aAAa;gBAC3B,oBAAC,KAAK,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI;gBAC3B,IAAI,CAAC,IAAI,CACL;YACN,kCAAO,IAAI,CAAC,MAAM,CAAQ,CACrB,CACN,CAAC,CACG,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FilterOption } from "@voplus/morpho-data";
|
|
2
|
+
import { IFilterState } from "@voplus/morpho-ui/es/data/IFilterState";
|
|
3
|
+
export declare class State implements IFilterState {
|
|
4
|
+
/** Status of filter */
|
|
5
|
+
status: Map<string, boolean>;
|
|
6
|
+
constructor();
|
|
7
|
+
/** update status */
|
|
8
|
+
onChangeStatus(value: string): void;
|
|
9
|
+
get menus(): {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
counts: string;
|
|
13
|
+
color: string;
|
|
14
|
+
}[];
|
|
15
|
+
get filters(): FilterOption[];
|
|
16
|
+
reset(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { action, makeObservable, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** Status of filter */
|
|
6
|
+
Object.defineProperty(this, "status", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: new Map()
|
|
11
|
+
});
|
|
12
|
+
makeObservable(this);
|
|
13
|
+
}
|
|
14
|
+
/** update status */
|
|
15
|
+
onChangeStatus(value) {
|
|
16
|
+
this.status.has(value) ? this.status.delete(value) : this.status.set(value, true);
|
|
17
|
+
}
|
|
18
|
+
get menus() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: "Draft", value: "Draft", counts: "n", color: "#b5f5ec" },
|
|
21
|
+
{ name: "New", value: "New", counts: "n", color: "#91d5ff" },
|
|
22
|
+
{ name: "Rejected", value: "Rejected", counts: "n", color: "#f5222d" },
|
|
23
|
+
{ name: "Active", value: "Active", counts: "n", color: "#ff85c0" },
|
|
24
|
+
{ name: "Closed", value: "Closed", counts: "n", color: "#fa8c16" },
|
|
25
|
+
{ name: "Done", value: "Done", counts: "n", color: "#52c41a" },
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
get filters() {
|
|
29
|
+
// if (this.status.size === 0) return [];
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
c: "WorkStatus",
|
|
33
|
+
o: "contains",
|
|
34
|
+
v1: JSON.stringify(Array.from(this.status.keys())),
|
|
35
|
+
l: "And",
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
reset() {
|
|
40
|
+
this.status.clear();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
__decorate([
|
|
44
|
+
observable
|
|
45
|
+
], State.prototype, "status", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
action
|
|
48
|
+
], State.prototype, "onChangeStatus", null);
|
|
49
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/controls/filters/WorkStatusFilter/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAK1D,MAAM,OAAO,KAAK;IAIjB;QAHA,uBAAuB;QACX;;;;mBAAsC,IAAI,GAAG,EAAE;WAAC;QAG3D,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,oBAAoB;IAEb,cAAc,CAAC,KAAa;QAClC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACnF,CAAC;IAED,IAAW,KAAK;QACf,OAAO;YACN,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;YAChE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;YAC5D,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;YACtE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;YACzD,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;YAC3E,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;SAC9D,CAAC;IACH,CAAC;IACD,IAAW,OAAO;QACjB,yCAAyC;QACzC,OAAO;YACN;gBACC,CAAC,EAAE,YAAY;gBACf,CAAC,EAAE,UAAU;gBACb,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBAClD,CAAC,EAAE,KAAK;aACQ;SACjB,CAAC;IACH,CAAC;IACM,KAAK;QACX,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACD;AApCY;IAAX,UAAU;qCAAiD;AAQ5D;IADC,MAAM;2CAGN"}
|
|
@@ -7,8 +7,9 @@ export interface INotification extends ILoadable {
|
|
|
7
7
|
dismissDate?: Date;
|
|
8
8
|
createDate: Date;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface IDocumentNotification extends INotification {
|
|
11
11
|
content: {
|
|
12
|
+
title: string;
|
|
12
13
|
content: string;
|
|
13
14
|
documentId: string;
|
|
14
15
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DocumentStore, DocumentTypeStore, LoadDocumentListOptions, LoadDocumentOptions } from "@voplus/morpho-document-core";
|
|
2
|
+
import { CreateWorkOptions, IWork, IWorkEditOptions } from "./interfaces";
|
|
3
|
+
import { ApiEndPoint } from "@voplus/api";
|
|
4
|
+
export declare class WorkStore extends DocumentTypeStore<IWork, LoadDocumentOptions, LoadDocumentListOptions, CreateWorkOptions, IWorkEditOptions, any> {
|
|
5
|
+
/** Name of the store */
|
|
6
|
+
readonly name: string;
|
|
7
|
+
constructor(endpoint: ApiEndPoint, documents: DocumentStore);
|
|
8
|
+
}
|
|
9
|
+
/** 响应钩子检索 PageStore */
|
|
10
|
+
export declare const useWorkStore: () => WorkStore;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DocumentTypeStore, useDocumentStore, } from "@voplus/morpho-document-core";
|
|
2
|
+
import { useService } from "@voplus/morpho-data";
|
|
3
|
+
const StoreName = "WorkStore";
|
|
4
|
+
export class WorkStore extends DocumentTypeStore {
|
|
5
|
+
constructor(endpoint, documents) {
|
|
6
|
+
super(endpoint, "/api/works", documents);
|
|
7
|
+
/** Name of the store */
|
|
8
|
+
Object.defineProperty(this, "name", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true,
|
|
12
|
+
value: StoreName
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** 响应钩子检索 PageStore */
|
|
17
|
+
export const useWorkStore = () => {
|
|
18
|
+
const documents = useDocumentStore();
|
|
19
|
+
return useService(StoreName, (context) => new WorkStore(context.api.currentEndPoint, documents));
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=WorkStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkStore.js","sourceRoot":"","sources":["../../../src/data/work/WorkStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,iBAAiB,EAIjB,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,MAAM,OAAO,SAAU,SAAQ,iBAO9B;IAIA,YAAmB,QAAqB,EAAE,SAAwB;QACjE,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QAJ1C,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;IAIzC,CAAC;CACD;AAED,uBAAuB;AACvB,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,OAAO,UAAU,CAChB,SAAS,EACT,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,CAAC,CAClE,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IWork } from ".";
|
|
2
|
+
import { LoadDocumentListOptions, LoadDocumentOptions } from "@voplus/morpho-document-core";
|
|
3
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
4
|
+
export declare const useWork: (id: string, options?: LoadDocumentOptions | undefined) => IWork;
|
|
5
|
+
/** React hook to retrieve a list of works
|
|
6
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
7
|
+
* @param options - Optional work list loading options.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useWorkListEffect: (list: ListDataContextState<IWork> | null, effect: (list: IWork[], total: number) => void, options?: LoadDocumentListOptions | undefined) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useWorkStore } from ".";
|
|
2
|
+
import { useDocumentListLoaderEffect, useDocumentStore, } from "@voplus/morpho-document-core";
|
|
3
|
+
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
4
|
+
export const useWork = (id, options) => {
|
|
5
|
+
options = options ? options : {};
|
|
6
|
+
const store = useWorkStore();
|
|
7
|
+
const documents = useDocumentStore();
|
|
8
|
+
return useLoadCountedMapItem(id, documents.items, () => store.load(id, options), options);
|
|
9
|
+
};
|
|
10
|
+
/** React hook to retrieve a list of works
|
|
11
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
12
|
+
* @param options - Optional work list loading options.
|
|
13
|
+
*/
|
|
14
|
+
export const useWorkListEffect = (list, effect, options) => {
|
|
15
|
+
const deps = options ? options : {};
|
|
16
|
+
const works = useWorkStore();
|
|
17
|
+
// Call useDocumentListEffect and ensure won't load twice for same loading options.
|
|
18
|
+
return useDocumentListLoaderEffect(list, effect, () => works.loadList(options), [deps]);
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/data/work/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,YAAY,EAAE,MAAM,GAAG,CAAC;AACxC,OAAO,EAGN,2BAA2B,EAC3B,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAU,EAAE,OAA6B,EAAE,EAAE;IACpE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA0B,CAAC;IAC1D,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IAErC,OAAO,qBAAqB,CAC3B,EAAE,EACF,SAAS,CAAC,KAAK,EACf,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAC9B,OAAO,CACE,CAAC;AACZ,CAAC,CAAC;AAIF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAChC,IAAwC,EACxC,MAA8C,EAC9C,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAE7B,mFAAmF;IACnF,OAAO,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/work/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EditDocumentDataOptions, IDocument } from "@voplus/morpho-document-core";
|
|
2
|
+
import { ICheckListItem } from "../worktype";
|
|
3
|
+
export declare type WorkStatus = "Draft" | "New" | "Rejected" | "Active" | "Closed" | "Done";
|
|
4
|
+
export interface IWork extends IDocument {
|
|
5
|
+
/** due data of the work. */
|
|
6
|
+
due?: Date;
|
|
7
|
+
/** checklist of the work. */
|
|
8
|
+
checkList: ICheckListItem[];
|
|
9
|
+
/** no of the work. */
|
|
10
|
+
no?: string;
|
|
11
|
+
number?: string;
|
|
12
|
+
/** folder of the work. */
|
|
13
|
+
folder?: {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
/** owner of the work. */
|
|
18
|
+
owner?: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
WorkStatus?: WorkStatus;
|
|
23
|
+
}
|
|
24
|
+
/** Custom create work options type. Use TitleCase to fit server need.
|
|
25
|
+
* 新建work必须属于work type request 人员(需要work type 设定requester)
|
|
26
|
+
*/
|
|
27
|
+
export declare type CreateWorkOptions = {
|
|
28
|
+
WorkTypeId: string;
|
|
29
|
+
Name: string;
|
|
30
|
+
};
|
|
31
|
+
export interface IWorkEditOptions extends EditDocumentDataOptions {
|
|
32
|
+
/** New checklist of the work. */
|
|
33
|
+
CheckList?: {
|
|
34
|
+
Checked: boolean;
|
|
35
|
+
Item: string;
|
|
36
|
+
}[];
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/work/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ApiEndPoint } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store } from "@voplus/morpho-data";
|
|
3
|
+
import { CreateWorkErrorOptions, EditWorkErrorOptions, IWorkError, LoadWorkErrorOptions } from ".";
|
|
4
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
5
|
+
export declare class WorkErrorStore extends Store {
|
|
6
|
+
readonly endpoint: ApiEndPoint;
|
|
7
|
+
/** Name of the store */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/** workerror created event dispatcher */
|
|
10
|
+
private readonly _workerrorCreated;
|
|
11
|
+
private readonly _workerrorDeleted;
|
|
12
|
+
/** Event fires when a new workerror has been created. */
|
|
13
|
+
get WorkErrorCreatedEvent(): import("strongly-typed-events").IEvent<WorkErrorStore, IWorkError>;
|
|
14
|
+
/** Event fires when a delete workerror has been deleted. */
|
|
15
|
+
get WorkErrorDeletedEvent(): import("strongly-typed-events").IEvent<WorkErrorStore, IWorkError>;
|
|
16
|
+
constructor(endpoint: ApiEndPoint);
|
|
17
|
+
/** All currently used work error. */
|
|
18
|
+
readonly items: CountedMap<string, IWorkError>;
|
|
19
|
+
/** Load a work error error from server.
|
|
20
|
+
* @param {string} id - id of the work error.
|
|
21
|
+
* @param {LoadWorkErrorOptions} options - Optional load options.
|
|
22
|
+
*/
|
|
23
|
+
load(id: string, options?: LoadWorkErrorOptions): Promise<IWorkError>;
|
|
24
|
+
/** Load a list of work error from server.
|
|
25
|
+
* @param {LoadDocumentListOptions}
|
|
26
|
+
*/
|
|
27
|
+
loadList(options?: LoadDocumentListOptions): Promise<IWorkError[]>;
|
|
28
|
+
/** Create a new work error. */
|
|
29
|
+
create(options: CreateWorkErrorOptions): Promise<IWorkError>;
|
|
30
|
+
/** Edit an existing item on server. */
|
|
31
|
+
edit(id: string, options: EditWorkErrorOptions): Promise<any>;
|
|
32
|
+
delete(ids: string[], options: {
|
|
33
|
+
DeleteChilds?: boolean;
|
|
34
|
+
}): Promise<IWorkError[]>;
|
|
35
|
+
}
|
|
36
|
+
/** 响应钩子检索 PageStore */
|
|
37
|
+
export declare const useWorkErrorStore: () => WorkErrorStore;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { RequestBuilder } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
3
|
+
import { EventDispatcher } from "strongly-typed-events";
|
|
4
|
+
import { observable } from "mobx";
|
|
5
|
+
const StoreName = "WorkErrorStore";
|
|
6
|
+
export class WorkErrorStore extends Store {
|
|
7
|
+
constructor(endpoint) {
|
|
8
|
+
super();
|
|
9
|
+
Object.defineProperty(this, "endpoint", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: endpoint
|
|
14
|
+
});
|
|
15
|
+
/** Name of the store */
|
|
16
|
+
Object.defineProperty(this, "name", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: StoreName
|
|
21
|
+
});
|
|
22
|
+
/** workerror created event dispatcher */
|
|
23
|
+
Object.defineProperty(this, "_workerrorCreated", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: new EventDispatcher()
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "_workerrorDeleted", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: new EventDispatcher()
|
|
34
|
+
});
|
|
35
|
+
/** All currently used work error. */
|
|
36
|
+
Object.defineProperty(this, "items", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** Event fires when a new workerror has been created. */
|
|
44
|
+
get WorkErrorCreatedEvent() {
|
|
45
|
+
return this._workerrorCreated.asEvent();
|
|
46
|
+
}
|
|
47
|
+
/** Event fires when a delete workerror has been deleted. */
|
|
48
|
+
get WorkErrorDeletedEvent() {
|
|
49
|
+
return this._workerrorDeleted.asEvent();
|
|
50
|
+
}
|
|
51
|
+
/** Load a work error error from server.
|
|
52
|
+
* @param {string} id - id of the work error.
|
|
53
|
+
* @param {LoadWorkErrorOptions} options - Optional load options.
|
|
54
|
+
*/
|
|
55
|
+
async load(id, options) {
|
|
56
|
+
options = options !== null && options !== void 0 ? options : {};
|
|
57
|
+
let query = "";
|
|
58
|
+
if (options.includes)
|
|
59
|
+
query = query.concat(`includes=${options.includes}`);
|
|
60
|
+
if (query)
|
|
61
|
+
query = "?".concat(query);
|
|
62
|
+
const r = await this.endpoint.get(`/api/work-errors/${id}${query}`);
|
|
63
|
+
return await r.json();
|
|
64
|
+
}
|
|
65
|
+
/** Load a list of work error from server.
|
|
66
|
+
* @param {LoadDocumentListOptions}
|
|
67
|
+
*/
|
|
68
|
+
async loadList(options) {
|
|
69
|
+
let query = "";
|
|
70
|
+
if (options === null || options === void 0 ? void 0 : options.Includes) {
|
|
71
|
+
query = query.concat(`includes=${options.Includes}`);
|
|
72
|
+
}
|
|
73
|
+
if (query)
|
|
74
|
+
query = "?".concat(query);
|
|
75
|
+
const r = await this.endpoint.post(`/api/work-errors${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
|
|
76
|
+
return (await r.json());
|
|
77
|
+
}
|
|
78
|
+
/** Create a new work error. */
|
|
79
|
+
async create(options) {
|
|
80
|
+
return await this.action(async () => {
|
|
81
|
+
const r = await this.endpoint.post(`/api/work-errors/create`, new RequestBuilder().json(options.data));
|
|
82
|
+
const t = (await r.json());
|
|
83
|
+
this._workerrorCreated.dispatch(this, t);
|
|
84
|
+
return t;
|
|
85
|
+
}, options);
|
|
86
|
+
}
|
|
87
|
+
/** Edit an existing item on server. */
|
|
88
|
+
async edit(id, options) {
|
|
89
|
+
return this.action(async () => {
|
|
90
|
+
const r = await this.endpoint.post(`/api/work-errors/${id}`, new RequestBuilder().json(options.data));
|
|
91
|
+
const t = (await r.json());
|
|
92
|
+
this.items.overwrite(t.id, t);
|
|
93
|
+
return t;
|
|
94
|
+
}, options);
|
|
95
|
+
}
|
|
96
|
+
async delete(ids, options) {
|
|
97
|
+
await this.endpoint.delete(`/api/work-errors/delete`, new RequestBuilder().json({ Ids: ids, Options: options }));
|
|
98
|
+
const deleted = [];
|
|
99
|
+
for (const id of ids) {
|
|
100
|
+
const item = this.items.peek(id);
|
|
101
|
+
if (item) {
|
|
102
|
+
deleted.push(item);
|
|
103
|
+
this._workerrorDeleted.dispatch(this, item);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return deleted;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** 响应钩子检索 PageStore */
|
|
110
|
+
export const useWorkErrorStore = () => {
|
|
111
|
+
const context = useApplicationContext();
|
|
112
|
+
if (!context.getService(StoreName)) {
|
|
113
|
+
context.registerService(new WorkErrorStore(context.api.currentEndPoint));
|
|
114
|
+
}
|
|
115
|
+
return context.getService(StoreName);
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=WorkErrorStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkErrorStore.js","sourceRoot":"","sources":["../../../src/data/workerror/WorkErrorStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC,MAAM,OAAO,cAAe,SAAQ,KAAK;IAkBxC,YAAmC,QAAqB;QACvD,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ACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IWorkError, LoadWorkErrorOptions } from ".";
|
|
2
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
3
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
4
|
+
export declare const useWorkError: (id: string, options?: LoadWorkErrorOptions | undefined) => IWorkError;
|
|
5
|
+
/** React hook to retrieve a list of work error
|
|
6
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
7
|
+
* @param options - Optional work error list loading options.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useWorkErrorListEffect: (list: ListDataContextState<IWorkError> | null, effect: (list: IWorkError[], total: number) => void, options?: LoadDocumentListOptions | undefined) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useWorkErrorStore } from ".";
|
|
2
|
+
import { useListLoaderEffect } from "@voplus/morpho-ui/es/hooks";
|
|
3
|
+
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
4
|
+
export const useWorkError = (id, options) => {
|
|
5
|
+
options = options ? options : {};
|
|
6
|
+
const store = useWorkErrorStore();
|
|
7
|
+
return useLoadCountedMapItem(id, store.items, () => store.load(id, options), options);
|
|
8
|
+
};
|
|
9
|
+
/** React hook to retrieve a list of work error
|
|
10
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
11
|
+
* @param options - Optional work error list loading options.
|
|
12
|
+
*/
|
|
13
|
+
export const useWorkErrorListEffect = (list, effect, options) => {
|
|
14
|
+
const deps = options ? options : {};
|
|
15
|
+
const store = useWorkErrorStore();
|
|
16
|
+
// Call useListLoaderEffect and ensure won't load twice for same loading options.
|
|
17
|
+
return useListLoaderEffect(list, store.items, effect, () => store.loadList(options), [deps]);
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/data/workerror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
import { ILoadable } from "@voplus/morpho-data";
|
|
2
|
+
export interface IWorkError extends ILoadable {
|
|
3
|
+
/** id of the work error. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** name of the work error. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** type of the work error. */
|
|
8
|
+
type?: string;
|
|
9
|
+
/** seriousness(严重成度) of the work error. */
|
|
10
|
+
seriousness?: string;
|
|
11
|
+
/** due data of the work error. */
|
|
12
|
+
due?: string;
|
|
13
|
+
/** causer(责任人) of the work error. */
|
|
14
|
+
causers?: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}[];
|
|
18
|
+
/** Description of the work error */
|
|
19
|
+
description?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/workerror/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LoadOptions, StoreActionOptions } from "@voplus/morpho-data";
|
|
2
|
+
import { IWorkError } from ".";
|
|
3
|
+
export declare enum ErrorSeverity {
|
|
4
|
+
S0 = 0,
|
|
5
|
+
S1 = 1,
|
|
6
|
+
S2 = 2,
|
|
7
|
+
S3 = 3,
|
|
8
|
+
S4 = 4
|
|
9
|
+
}
|
|
10
|
+
/** Custom load contact options type */
|
|
11
|
+
export declare type LoadWorkErrorOptions = {
|
|
12
|
+
/** Comma separated include options e.g. path */
|
|
13
|
+
includes?: string;
|
|
14
|
+
} & LoadOptions<IWorkError>;
|
|
15
|
+
/** Custom create work error options type. Use TitleCase to fit server need. */
|
|
16
|
+
export declare type CreateWorkErrorDataOptions = {
|
|
17
|
+
/** work id of the error */
|
|
18
|
+
WorkId: string;
|
|
19
|
+
/** severity of the error */
|
|
20
|
+
Severity: string;
|
|
21
|
+
/** type of the error */
|
|
22
|
+
Type: string;
|
|
23
|
+
/** description of the error */
|
|
24
|
+
Description?: string;
|
|
25
|
+
/** list of causer's unit id */
|
|
26
|
+
CauserIds?: string[];
|
|
27
|
+
/** incident date of the error */
|
|
28
|
+
IncidentDate?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type CreateWorkErrorOptions = {
|
|
31
|
+
data: CreateWorkErrorDataOptions;
|
|
32
|
+
} & StoreActionOptions;
|
|
33
|
+
/**
|
|
34
|
+
* Custom edit work error options type. Use TitleCase to fit server need.
|
|
35
|
+
*/
|
|
36
|
+
export declare type EditWorkErrorDataOptions = {
|
|
37
|
+
/** severity of the error */
|
|
38
|
+
Severity?: ErrorSeverity;
|
|
39
|
+
/** type of the error */
|
|
40
|
+
Type?: string;
|
|
41
|
+
/** description of the error */
|
|
42
|
+
Description?: string;
|
|
43
|
+
/** list of causer's unit id */
|
|
44
|
+
CauserIds?: string[];
|
|
45
|
+
/** incident date of the error */
|
|
46
|
+
IncidentDate?: string;
|
|
47
|
+
};
|
|
48
|
+
export declare type EditWorkErrorOptions = {
|
|
49
|
+
data: EditWorkErrorDataOptions;
|
|
50
|
+
} & StoreActionOptions;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var ErrorSeverity;
|
|
2
|
+
(function (ErrorSeverity) {
|
|
3
|
+
ErrorSeverity[ErrorSeverity["S0"] = 0] = "S0";
|
|
4
|
+
ErrorSeverity[ErrorSeverity["S1"] = 1] = "S1";
|
|
5
|
+
ErrorSeverity[ErrorSeverity["S2"] = 2] = "S2";
|
|
6
|
+
ErrorSeverity[ErrorSeverity["S3"] = 3] = "S3";
|
|
7
|
+
ErrorSeverity[ErrorSeverity["S4"] = 4] = "S4";
|
|
8
|
+
})(ErrorSeverity || (ErrorSeverity = {}));
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/data/workerror/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACxB,6CAAM,CAAA;IACN,6CAAE,CAAA;IAAE,6CAAE,CAAA;IAAE,6CAAE,CAAA;IAAE,6CAAE,CAAA;AACf,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/workerror/workerror-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IWorkError } from "../interfaces";
|
|
2
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
3
|
+
/** React hook to call action when a new workerror has been created. */
|
|
4
|
+
export declare const useAutoUpdateListData: (list: ListDataContextState<any>, shouldUpdate: (d: IWorkError, event: string) => boolean) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useOnDeleteWorkError, useOnNewWorkError } from ".";
|
|
2
|
+
/** React hook to call action when a new workerror has been created. */
|
|
3
|
+
export const useAutoUpdateListData = (list, shouldUpdate) => {
|
|
4
|
+
useOnNewWorkError((s, d) => {
|
|
5
|
+
if (shouldUpdate(d, "new"))
|
|
6
|
+
list.union([d]);
|
|
7
|
+
});
|
|
8
|
+
useOnDeleteWorkError((s, d) => {
|
|
9
|
+
if (shouldUpdate(d, "new"))
|
|
10
|
+
list.remove(d.id);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useAutoUpdateListData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoUpdateListData.js","sourceRoot":"","sources":["../../../../src/data/workerror/workerror-events/useAutoUpdateListData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAK5D,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA+B,EAC/B,YAAuD,EACtD,EAAE;IACH,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WorkErrorStore } from "../WorkErrorStore";
|
|
2
|
+
import { IWorkError } from "../interfaces";
|
|
3
|
+
/** React hook to call action when a delete workerror has been created. */
|
|
4
|
+
export declare const useOnDeleteWorkError: (action: (store: WorkErrorStore, doc: IWorkError) => void) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useWorkErrorStore } from "../WorkErrorStore";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
/** React hook to call action when a delete workerror has been created. */
|
|
4
|
+
export const useOnDeleteWorkError = (action) => {
|
|
5
|
+
const store = useWorkErrorStore();
|
|
6
|
+
const onDeleteWorkError = (store, doc) => {
|
|
7
|
+
console.log(`onDeleteWorkError - ${doc.id} ${doc.name}`);
|
|
8
|
+
action(store, doc);
|
|
9
|
+
};
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
store.WorkErrorDeletedEvent.subscribe(onDeleteWorkError);
|
|
12
|
+
return () => {
|
|
13
|
+
store.WorkErrorDeletedEvent.unsubscribe(onDeleteWorkError);
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useOnDeleteWorkspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnDeleteWorkspace.js","sourceRoot":"","sources":["../../../../src/data/workerror/workerror-events/useOnDeleteWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAwD,EAAE,EAAE;IAChG,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,iBAAiB,GAAG,CAAC,KAAqB,EAAE,GAAe,EAAE,EAAE;QACpE,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,qBAAqB,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QACzD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC5D,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|