@voplus/morpho-workspace 1.3.2 → 1.3.4

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 (131) hide show
  1. package/es/data/work/WorkStore.d.ts +12 -0
  2. package/es/data/work/WorkStore.js +21 -0
  3. package/es/data/work/WorkStore.js.map +1 -1
  4. package/es/data/work/interfaces.d.ts +18 -2
  5. package/es/data/workspace/interfaces.d.ts +8 -0
  6. package/es/data/workspace/types.d.ts +1 -0
  7. package/es/data/worktype/WorkTypeStore.d.ts +6 -0
  8. package/es/data/worktype/WorkTypeStore.js +22 -0
  9. package/es/data/worktype/WorkTypeStore.js.map +1 -1
  10. package/es/data/worktype/interfaces.d.ts +4 -0
  11. package/es/data/worktype/types.d.ts +1 -0
  12. package/es/data/worktype/worktype-events/index.d.ts +3 -0
  13. package/es/data/worktype/worktype-events/index.js +4 -0
  14. package/es/data/worktype/worktype-events/index.js.map +1 -0
  15. package/es/data/worktype/worktype-events/useAutoUpdateListData.d.ts +4 -0
  16. package/es/data/worktype/worktype-events/useAutoUpdateListData.js +15 -0
  17. package/es/data/worktype/worktype-events/useAutoUpdateListData.js.map +1 -0
  18. package/es/data/worktype/worktype-events/useOnDeleteWorkType.d.ts +4 -0
  19. package/es/data/worktype/worktype-events/useOnDeleteWorkType.js +16 -0
  20. package/es/data/worktype/worktype-events/useOnDeleteWorkType.js.map +1 -0
  21. package/es/data/worktype/worktype-events/useOnNewWorkType.d.ts +4 -0
  22. package/es/data/worktype/worktype-events/useOnNewWorkType.js +17 -0
  23. package/es/data/worktype/worktype-events/useOnNewWorkType.js.map +1 -0
  24. package/es/modules/work/components/NewWorkForm/index.d.ts +10 -0
  25. package/es/modules/work/components/NewWorkForm/index.js +60 -0
  26. package/es/modules/work/components/NewWorkForm/index.js.map +1 -0
  27. package/es/modules/work/components/NewWorkForm/index.less +17 -0
  28. package/es/modules/work/components/SubWorkList/index.d.ts +4 -0
  29. package/es/modules/work/components/SubWorkList/index.js +42 -0
  30. package/es/modules/work/components/SubWorkList/index.js.map +1 -0
  31. package/es/modules/work/components/SubWorkList/index.less +7 -0
  32. package/es/modules/work/components/WorkErrorList/index.js +7 -6
  33. package/es/modules/work/components/WorkErrorList/index.js.map +1 -1
  34. package/es/modules/work/components/WorkItem/index.d.ts +1 -3
  35. package/es/modules/work/components/WorkItem/index.js +20 -4
  36. package/es/modules/work/components/WorkItem/index.js.map +1 -1
  37. package/es/modules/work/components/WorkItem/index.less +11 -0
  38. package/es/modules/work/components/WorkList/index.js +7 -5
  39. package/es/modules/work/components/WorkList/index.js.map +1 -1
  40. package/es/modules/work/components/WorkPropertiesView/index.js +8 -2
  41. package/es/modules/work/components/WorkPropertiesView/index.js.map +1 -1
  42. package/es/modules/work/components/WorkQATab/index.js +9 -7
  43. package/es/modules/work/components/WorkQATab/index.js.map +1 -1
  44. package/es/modules/work/components/WorkQATab/index.less +8 -8
  45. package/es/modules/work/components/WorkTabs/index.js +10 -1
  46. package/es/modules/work/components/WorkTabs/index.js.map +1 -1
  47. package/es/modules/work/components/WorkTaskList/index.js +8 -6
  48. package/es/modules/work/components/WorkTaskList/index.js.map +1 -1
  49. package/es/modules/work/components/WorkTaskList/index.less +3 -3
  50. package/es/modules/work/components/WorkTasksTab/index.js +4 -2
  51. package/es/modules/work/components/WorkTasksTab/index.js.map +1 -1
  52. package/es/modules/work/components/WorkTasksTab/index.less +2 -2
  53. package/es/modules/work/components/WorksProperties/index.js +5 -3
  54. package/es/modules/work/components/WorksProperties/index.js.map +1 -1
  55. package/es/modules/work/controls/WorkMenu/Accept.d.ts +8 -0
  56. package/es/modules/work/controls/WorkMenu/Accept.js +31 -0
  57. package/es/modules/work/controls/WorkMenu/Accept.js.map +1 -0
  58. package/es/modules/work/controls/WorkMenu/Reject.d.ts +8 -0
  59. package/es/modules/work/controls/WorkMenu/Reject.js +31 -0
  60. package/es/modules/work/controls/WorkMenu/Reject.js.map +1 -0
  61. package/es/modules/work/controls/WorkMenu/Send.d.ts +8 -0
  62. package/es/modules/work/controls/WorkMenu/Send.js +31 -0
  63. package/es/modules/work/controls/WorkMenu/Send.js.map +1 -0
  64. package/es/modules/work/controls/WorkMenu/index.d.ts +7 -0
  65. package/es/modules/work/controls/WorkMenu/index.js +27 -0
  66. package/es/modules/work/controls/WorkMenu/index.js.map +1 -0
  67. package/es/modules/work/pages/WorkDefaultView/index.less +1 -2
  68. package/es/modules/workspace/components/MyWorkspaces/index.js +9 -7
  69. package/es/modules/workspace/components/MyWorkspaces/index.js.map +1 -1
  70. package/es/modules/workspace/components/MyWorkspaces/index.less +2 -2
  71. package/es/modules/workspace/components/WorkspaceCard/index.js +9 -4
  72. package/es/modules/workspace/components/WorkspaceCard/index.js.map +1 -1
  73. package/es/modules/workspace/components/WorkspaceCard/index.less +12 -0
  74. package/es/modules/workspace/components/WorkspaceCardList/index.js +3 -5
  75. package/es/modules/workspace/components/WorkspaceCardList/index.js.map +1 -1
  76. package/es/modules/workspace/components/WorkspacePropertiesView/index.js +11 -5
  77. package/es/modules/workspace/components/WorkspacePropertiesView/index.js.map +1 -1
  78. package/es/modules/workspace/components/WorkspaceTabs/index.d.ts +5 -0
  79. package/es/modules/workspace/components/WorkspaceTabs/index.js +26 -0
  80. package/es/modules/workspace/components/WorkspaceTabs/index.js.map +1 -0
  81. package/es/modules/workspace/controls/WorkspaceMenu/index.js +38 -14
  82. package/es/modules/workspace/controls/WorkspaceMenu/index.js.map +1 -1
  83. package/es/modules/workspace/pages/WorkspaceDefaultView/index.js +1 -1
  84. package/es/modules/workspace/pages/WorkspaceDefaultView/index.js.map +1 -1
  85. package/es/modules/workspace/pages/WorkspacePage/index.js +1 -1
  86. package/es/modules/workspace/pages/WorkspacePage/index.js.map +1 -1
  87. package/es/modules/worktype/components/NewTypeForm/index.d.ts +10 -0
  88. package/es/modules/worktype/components/NewTypeForm/index.js +42 -0
  89. package/es/modules/worktype/components/NewTypeForm/index.js.map +1 -0
  90. package/es/modules/worktype/components/NewTypeForm/index.less +8 -0
  91. package/es/modules/worktype/components/NewTypeForm/state.d.ts +11 -0
  92. package/es/modules/worktype/components/NewTypeForm/state.js +41 -0
  93. package/es/modules/worktype/components/NewTypeForm/state.js.map +1 -0
  94. package/es/modules/worktype/components/WorkTypeCardList/index.d.ts +4 -11
  95. package/es/modules/worktype/components/WorkTypeCardList/index.js +3 -17
  96. package/es/modules/worktype/components/WorkTypeCardList/index.js.map +1 -1
  97. package/es/modules/worktype/components/WorkTypeCardList/index.less +7 -9
  98. package/es/modules/worktype/components/WorkTypeItem/index.d.ts +1 -1
  99. package/es/modules/worktype/components/WorkTypeItem/index.js +14 -2
  100. package/es/modules/worktype/components/WorkTypeItem/index.js.map +1 -1
  101. package/es/modules/worktype/components/WorkTypeItem/index.less +13 -0
  102. package/es/modules/worktype/components/WorkTypeList/index.d.ts +10 -0
  103. package/es/modules/worktype/components/WorkTypeList/index.js +46 -0
  104. package/es/modules/worktype/components/WorkTypeList/index.js.map +1 -0
  105. package/es/modules/worktype/components/WorkTypeList/index.less +7 -0
  106. package/es/modules/worktype/components/WorkTypeProperties/index.js +24 -3
  107. package/es/modules/worktype/components/WorkTypeProperties/index.js.map +1 -1
  108. package/es/modules/worktype/components/WorkTypeProperties/index.less +27 -2
  109. package/es/modules/worktype/components/WorkTypePropertiesView/index.js +13 -8
  110. package/es/modules/worktype/components/WorkTypePropertiesView/index.js.map +1 -1
  111. package/es/modules/worktype/components/WorkTypeQA/index.js +37 -36
  112. package/es/modules/worktype/components/WorkTypeQA/index.js.map +1 -1
  113. package/es/modules/worktype/components/WorkTypeQA/index.less +7 -0
  114. package/es/modules/worktype/components/WorkTypeTabs/index.js +4 -2
  115. package/es/modules/worktype/components/WorkTypeTabs/index.js.map +1 -1
  116. package/es/modules/worktype/controls/WorkTypeMenu/index.d.ts +14 -0
  117. package/es/modules/worktype/controls/WorkTypeMenu/index.js +26 -0
  118. package/es/modules/worktype/controls/WorkTypeMenu/index.js.map +1 -0
  119. package/es/modules/worktype/controls/WorkTypeMenu/index.less +0 -0
  120. package/es/pages/Routes.js +3 -3
  121. package/es/pages/Routes.js.map +1 -1
  122. package/es/pages/Space/components/Tasks/index.js +22 -24
  123. package/es/pages/Space/components/Tasks/index.js.map +1 -1
  124. package/es/pages/Space/pages/MySpace/index.js +5 -5
  125. package/es/pages/Space/pages/MySpace/index.js.map +1 -1
  126. package/es/pages/Space/pages/MySpace/state.d.ts +3 -2
  127. package/es/pages/Space/pages/MySpace/state.js +19 -5
  128. package/es/pages/Space/pages/MySpace/state.js.map +1 -1
  129. package/es/pages/WorkType/WorkTypeSelect/index.js +5 -1
  130. package/es/pages/WorkType/WorkTypeSelect/index.js.map +1 -1
  131. package/package.json +1 -1
@@ -5,6 +5,18 @@ export declare class WorkStore extends DocumentTypeStore<IWork, LoadDocumentOpti
5
5
  /** Name of the store */
6
6
  readonly name: string;
7
7
  constructor(endpoint: ApiEndPoint, documents: DocumentStore);
8
+ /** send work.
9
+ * @param {string} id - id of the work.
10
+ */
11
+ send(id: string): Promise<void>;
12
+ /** accept work.
13
+ * @param {string} id - id of the work.
14
+ */
15
+ accept(id: string): Promise<void>;
16
+ /** reject work.
17
+ * @param {string} id - id of the work.
18
+ */
19
+ reject(id: string): Promise<void>;
8
20
  }
9
21
  /** 响应钩子检索 PageStore */
10
22
  export declare const useWorkStore: () => WorkStore;
@@ -12,6 +12,27 @@ export class WorkStore extends DocumentTypeStore {
12
12
  value: StoreName
13
13
  });
14
14
  }
15
+ /** send work.
16
+ * @param {string} id - id of the work.
17
+ */
18
+ async send(id) {
19
+ await this.endpoint.post(`/api/works/${id}/send`);
20
+ this.edit(id, { data: { workStatus: "New" }, error: "message" });
21
+ }
22
+ /** accept work.
23
+ * @param {string} id - id of the work.
24
+ */
25
+ async accept(id) {
26
+ await this.endpoint.post(`/api/works/${id}/accept`);
27
+ this.edit(id, { data: { workStatus: "Active" }, error: "message" });
28
+ }
29
+ /** reject work.
30
+ * @param {string} id - id of the work.
31
+ */
32
+ async reject(id) {
33
+ await this.endpoint.post(`/api/works/${id}/reject`);
34
+ this.edit(id, { data: { workStatus: "Rejected" }, error: "message" });
35
+ }
15
36
  }
16
37
  /** 响应钩子检索 PageStore */
17
38
  export const useWorkStore = () => {
@@ -1 +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"}
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,CA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owner?: {
18
+ owners?: {
19
+ id: string;
20
+ name: string;
21
+ }[];
22
+ workStatus?: WorkStatus;
23
+ /** work type of the work. */
24
+ workType?: {
19
25
  id: string;
20
26
  name: string;
21
27
  };
22
- WorkStatus?: WorkStatus;
28
+ /** requester of the work. */
29
+ requester?: {
30
+ id: string;
31
+ name: string;
32
+ };
33
+ /** accepters of the work. */
34
+ accepters?: {
35
+ id: string;
36
+ name: string;
37
+ }[];
23
38
  }
24
39
  /** Custom create work options type. Use TitleCase to fit server need.
25
40
  * 新建work必须属于work type request 人员(需要work type 设定requester)
@@ -29,6 +44,7 @@ export declare type CreateWorkOptions = {
29
44
  Name: string;
30
45
  };
31
46
  export interface IWorkEditOptions extends EditDocumentDataOptions {
47
+ workStatus?: string;
32
48
  /** New checklist of the work. */
33
49
  CheckList?: {
34
50
  Checked: boolean;
@@ -7,6 +7,14 @@ export interface IWorkspace extends ILoadable {
7
7
  name: string;
8
8
  /** status of the workspace. */
9
9
  status?: string;
10
+ /** stats of the workspace */
11
+ stats?: {
12
+ activeWorks: number;
13
+ };
14
+ /** actions of the workspace */
15
+ actions?: {
16
+ canDelete: boolean;
17
+ };
10
18
  /** Create date of the workspace. */
11
19
  createDate?: string;
12
20
  /** Owner of the workspace. */
@@ -20,6 +20,7 @@ export declare type CreateWorkspaceOptions = {
20
20
  */
21
21
  export declare type EditWorkspaceDataOptions = {
22
22
  Name?: string;
23
+ Status?: string;
23
24
  /** list of member unit ids */
24
25
  MemberIds?: string[];
25
26
  };
@@ -7,9 +7,15 @@ export declare class WorkTypeStore extends Store {
7
7
  readonly endpoint: ApiEndPoint;
8
8
  /** Name of the store */
9
9
  readonly name: string;
10
+ private readonly _worktypeDeleted;
11
+ private readonly _worktypeCreated;
10
12
  constructor(endpoint: ApiEndPoint);
11
13
  /** All currently used workType. */
12
14
  readonly items: CountedMap<string, IWorkType>;
15
+ /** Event fires when a delete worktype has been deleted. */
16
+ get WorkTypeDeletedEvent(): import("strongly-typed-events").IEvent<WorkTypeStore, IWorkType>;
17
+ /** Event fires when a new WorkType has been created. */
18
+ get WorkTypeCreatedEvent(): import("strongly-typed-events").IEvent<WorkTypeStore, IWorkType>;
13
19
  /** Create a new WorkType. */
14
20
  create(options: WorkTypeCreateOptions): Promise<IWorkType>;
15
21
  /** Edit an existing item on server. */
@@ -1,6 +1,7 @@
1
1
  import { RequestBuilder } from "@voplus/api";
2
2
  import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
3
3
  import { observable } from "mobx";
4
+ import { EventDispatcher } from "strongly-typed-events";
4
5
  const StoreName = "WorkTypeStore";
5
6
  /** Corporate store supply backend functions. */
6
7
  export class WorkTypeStore extends Store {
@@ -19,6 +20,18 @@ export class WorkTypeStore extends Store {
19
20
  writable: true,
20
21
  value: StoreName
21
22
  });
23
+ Object.defineProperty(this, "_worktypeDeleted", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: new EventDispatcher()
28
+ });
29
+ Object.defineProperty(this, "_worktypeCreated", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: new EventDispatcher()
34
+ });
22
35
  /** All currently used workType. */
23
36
  Object.defineProperty(this, "items", {
24
37
  enumerable: true,
@@ -27,12 +40,21 @@ export class WorkTypeStore extends Store {
27
40
  value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
28
41
  });
29
42
  }
43
+ /** Event fires when a delete worktype has been deleted. */
44
+ get WorkTypeDeletedEvent() {
45
+ return this._worktypeDeleted.asEvent();
46
+ }
47
+ /** Event fires when a new WorkType has been created. */
48
+ get WorkTypeCreatedEvent() {
49
+ return this._worktypeCreated.asEvent();
50
+ }
30
51
  /** Create a new WorkType. */
31
52
  async create(options) {
32
53
  // invariant(options.name, "Name cannot be empty.");
33
54
  return await this.action(async () => {
34
55
  const r = await this.endpoint.post(`/api/worktypes/create`, new RequestBuilder().json(options.data));
35
56
  const t = (await r.json());
57
+ this._worktypeCreated.dispatch(this, t);
36
58
  return t;
37
59
  }, options);
38
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WorkTypeStore.js","sourceRoot":"","sources":["../../../src/data/worktype/WorkTypeStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,gDAAgD;AAChD,MAAM,OAAO,aAAc,SAAQ,KAAK;IAIvC,YAAmC,QAAqB;QACvD,KAAK,EAAE,CAAC;;;;;mBAD0B;;QAHnC,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;QAMzC,mCAAmC;QACnC;;;;mBAAuD,IAAI,UAAU,CACpE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAgB,CAAA,EAC1D,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAClC;WAAC;IANF,CAAC;IAQD,6BAA6B;IACtB,KAAK,CAAC,MAAM,CAAC,OAA8B;QACjD,oDAAoD;QACpD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;YACnC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACjC,uBAAuB,EACvB,IAAI,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CACvC,CAAC;YACF,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAc,CAAC;YACxC,OAAO,CAAC,CAAC;QACV,CAAC,EAAE,OAAO,CAAC,CAAC;IACb,CAAC;IAED,uCAAuC;IAChC,KAAK,CAAC,IAAI,CAAC,EAAU,EAAE,OAA4B;Q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CACD;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACpC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KACjE;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB,CAAC;AACtD,CAAC,CAAC"}
@@ -50,6 +50,10 @@ export interface IWorkType extends ILoadable {
50
50
  name: string;
51
51
  id: string;
52
52
  }[];
53
+ owners?: {
54
+ name: string;
55
+ id: string;
56
+ }[];
53
57
  /** audit info of the workType */
54
58
  audit?: IAuditAuditorInfo;
55
59
  rejectReasons?: string[];
@@ -49,6 +49,7 @@ export interface WorkTypeEditDataOptions {
49
49
  RejectReasons?: string[];
50
50
  /** gets or the error types of the work type */
51
51
  ErrorTypes?: string[];
52
+ OwnerIds?: string[];
52
53
  }
53
54
  export declare type WorkTypeEditOptions = {
54
55
  data: WorkTypeEditDataOptions;
@@ -0,0 +1,3 @@
1
+ export * from "./useOnNewWorkType";
2
+ export * from "./useOnDeleteWorkType";
3
+ export * from "./useAutoUpdateListData";
@@ -0,0 +1,4 @@
1
+ export * from "./useOnNewWorkType";
2
+ export * from "./useOnDeleteWorkType";
3
+ export * from "./useAutoUpdateListData";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IWorkType } from "../interfaces";
2
+ import { ListDataContextState } from "@voplus/morpho-ui/es/data";
3
+ /** React hook to call action when a new WorkType has been created. */
4
+ export declare const useAutoUpdateListData: (list: ListDataContextState<any>, shouldUpdate: (d: IWorkType, event: string) => boolean) => void;
@@ -0,0 +1,15 @@
1
+ import { useOnDeleteWorkType, useOnNewWorkType } from ".";
2
+ /** React hook to call action when a new WorkType has been created. */
3
+ export const useAutoUpdateListData = (list, shouldUpdate) => {
4
+ useOnNewWorkType((s, d) => {
5
+ console.log(s, d);
6
+ console.log(shouldUpdate(d, "new"));
7
+ if (shouldUpdate(d, "new"))
8
+ list.union([d]);
9
+ });
10
+ useOnDeleteWorkType((s, d) => {
11
+ if (shouldUpdate(d, "new"))
12
+ list.remove(d.id);
13
+ });
14
+ };
15
+ //# sourceMappingURL=useAutoUpdateListData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoUpdateListData.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/useAutoUpdateListData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAK1D,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA+B,EAC/B,YAAsD,EACrD,EAAE;IACH,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;QACnC,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC5B,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 { WorkTypeStore } from "../WorkTypeStore";
2
+ import { IWorkType } from "../interfaces";
3
+ /** React hook to call action when a delete WorkType has been created. */
4
+ export declare const useOnDeleteWorkType: (action: (store: WorkTypeStore, doc: IWorkType) => void) => void;
@@ -0,0 +1,16 @@
1
+ import { useWorkTypeStore } from "../WorkTypeStore";
2
+ import { useEffect } from "react";
3
+ /** React hook to call action when a delete WorkType has been created. */
4
+ export const useOnDeleteWorkType = (action) => {
5
+ const store = useWorkTypeStore();
6
+ const onDeleteWorkType = (store, doc) => {
7
+ action(store, doc);
8
+ };
9
+ useEffect(() => {
10
+ store.WorkTypeDeletedEvent.subscribe(onDeleteWorkType);
11
+ return () => {
12
+ store.WorkTypeDeletedEvent.unsubscribe(onDeleteWorkType);
13
+ };
14
+ });
15
+ };
16
+ //# sourceMappingURL=useOnDeleteWorkType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnDeleteWorkType.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/useOnDeleteWorkType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAsD,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,CAAC,KAAoB,EAAE,GAAc,EAAE,EAAE;QACjE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAC1D,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { WorkTypeStore } from "../WorkTypeStore";
2
+ import { IWorkType } from "../interfaces";
3
+ /** React hook to call action when a new WorkType has been created. */
4
+ export declare const useOnNewWorkType: (action: (store: WorkTypeStore, doc: IWorkType) => void) => void;
@@ -0,0 +1,17 @@
1
+ import { useWorkTypeStore } from "../WorkTypeStore";
2
+ import { useEffect } from "react";
3
+ /** React hook to call action when a new WorkType has been created. */
4
+ export const useOnNewWorkType = (action) => {
5
+ const store = useWorkTypeStore();
6
+ const onNewWorkType = (store, doc) => {
7
+ // console.log(`onNewWorkType - ${doc.id} ${doc.name}`);
8
+ action(store, doc);
9
+ };
10
+ useEffect(() => {
11
+ store.WorkTypeCreatedEvent.subscribe(onNewWorkType);
12
+ return () => {
13
+ store.WorkTypeCreatedEvent.unsubscribe(onNewWorkType);
14
+ };
15
+ });
16
+ };
17
+ //# sourceMappingURL=useOnNewWorkType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnNewWorkType.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/useOnNewWorkType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAsD,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,aAAa,GAAG,CAAC,KAAoB,EAAE,GAAc,EAAE,EAAE;QAC9D,wDAAwD;QACxD,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACpD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACvD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ declare const NewWorkForm: (props: {
4
+ className?: string | undefined;
5
+ simple?: boolean | undefined;
6
+ showView?: boolean | undefined;
7
+ onSave?: ((params?: any) => void) | undefined;
8
+ onCancel?: (() => void) | undefined;
9
+ }) => JSX.Element;
10
+ export default NewWorkForm;
@@ -0,0 +1,60 @@
1
+ import "./index.less";
2
+ import { Button, Col, Form, Input, Row, Space, message } from "@voplus/antd";
3
+ import React, { useState } from "react";
4
+ import WorkPropertiesView from "../WorkPropertiesView";
5
+ import WorkTypeSelect from "../../../../pages/WorkType/WorkTypeSelect";
6
+ import classnames from "classnames";
7
+ import { observe } from "@voplus/morpho-ui";
8
+ import { useApplicationContext } from "@voplus/morpho-data";
9
+ import { useAsideContentContext } from "@voplus/morpho-ui/es/components/layout/AsideContent";
10
+ import { useWorkStore } from "../../../../data/work";
11
+ const NewWorkForm = (props) => {
12
+ const { user } = useApplicationContext();
13
+ const [form] = Form.useForm();
14
+ const [loading, setLoading] = useState(false);
15
+ const [workType, setWorkType] = useState();
16
+ const asideContext = useAsideContentContext();
17
+ const works = useWorkStore();
18
+ return observe(() => (React.createElement("div", { className: classnames("new-work-form", { "sub-work-simply-form": props.simple }, props.className) },
19
+ React.createElement(Form, { form: form, layout: "vertical", onFinish: onFinish },
20
+ !props.simple ?
21
+ React.createElement(React.Fragment, null,
22
+ React.createElement(Form.Item, { name: "Name", label: "Work Name" },
23
+ React.createElement(Input, { placeholder: "Enter a title for this work" })),
24
+ React.createElement(Form.Item, { name: "WorkTypeId", label: "Work Type" },
25
+ React.createElement(WorkTypeSelect, { onChange: (id, data) => setWorkType(data) })))
26
+ :
27
+ React.createElement(Row, { gutter: 20 },
28
+ React.createElement(Col, { span: 12 },
29
+ React.createElement(Form.Item, { name: "Name" },
30
+ React.createElement(Input, { placeholder: "Enter a title for this work" }))),
31
+ React.createElement(Col, { span: 12 },
32
+ React.createElement(Form.Item, { name: "WorkTypeId" },
33
+ React.createElement(WorkTypeSelect, { onChange: (id, data) => setWorkType(data) })))),
34
+ React.createElement(Form.Item, { className: "from-footer" },
35
+ React.createElement(Row, { justify: "end" },
36
+ React.createElement(Space, null,
37
+ React.createElement(Button, { onClick: onCancel }, "Cancel"),
38
+ React.createElement(Button, { type: "primary", htmlType: "submit", loading: loading }, "Submit"))))))));
39
+ /** submit work */
40
+ async function onFinish(values) {
41
+ var _a;
42
+ if (!values.Name)
43
+ return message.warning("Title is required");
44
+ setLoading(true);
45
+ const res = await works.create({ data: { ...values }, error: "message" });
46
+ setLoading(false);
47
+ (_a = props.onSave) === null || _a === void 0 ? void 0 : _a.call(props, values);
48
+ if (props.showView)
49
+ return asideContext.openAside(React.createElement(WorkPropertiesView, { id: res.id }), { span: 12 });
50
+ }
51
+ // cancel add work
52
+ function onCancel() {
53
+ var _a;
54
+ if (props.showView)
55
+ return asideContext.closeAside();
56
+ (_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
57
+ }
58
+ };
59
+ export default NewWorkForm;
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/NewWorkForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMxC,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,UAAU,MAAM,YAAY,CAAC;A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ACvB,IAAI,KAAK,CAAC,QAAQ;YACjB,OAAO,YAAa,CAAC,SAAS,CAAC,oBAAC,kBAAkB,IAAC,EAAE,EAAE,GAAG,CAAC,EAAE,GAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IAClB,SAAS,QAAQ;;QAChB,IAAI,KAAK,CAAC,QAAQ;YAAE,OAAO,YAAa,CAAC,UAAU,EAAE,CAAC;QACtD,MAAA,KAAK,CAAC,QAAQ,+CAAd,KAAK,CAAa,CAAC;IACpB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,17 @@
1
+ :global {
2
+ .new-work-form {
3
+ &.sub-work-simply-form {
4
+ padding: 10px 20px;
5
+ .from-footer {
6
+ margin-bottom: 0;
7
+ }
8
+ }
9
+ .ant-tabs-tabpane {
10
+ padding: 24px;
11
+ }
12
+ .new-work-form_btn {
13
+ text-align: right;
14
+ margin-top: 20px;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ declare const SubWorkList: () => JSX.Element;
4
+ export default SubWorkList;
@@ -0,0 +1,42 @@
1
+ import "./index.less";
2
+ import { useWorkListEffect } from "../../../../data/work";
3
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
4
+ import React, { useState } from "react";
5
+ import { useAutoUpdateListData, useDocumentStore } from "@voplus/morpho-document-core";
6
+ import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
7
+ import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
8
+ import NewWorkForm from "../NewWorkForm";
9
+ import WorkItem from '../WorkItem';
10
+ import { observe } from "@voplus/morpho-ui";
11
+ import { useRenderOnChange } from "@voplus/morpho-ui";
12
+ const SubWorkList = () => {
13
+ const [addAble, setAddAble] = useState(false);
14
+ const documentStore = useDocumentStore();
15
+ const list = useCreateListDataState({
16
+ filterDefaults: {}
17
+ }, []);
18
+ /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
19
+ useAutoUpdateListData(list, (d) => d.type === "Work");
20
+ useRenderOnChange(() => list.filters.options);
21
+ /** 把ListDataState传给useWorkListEffect,使之可以自動更新loading, hasmore. */
22
+ useWorkListEffect(list, (result) => { list.union(result); }, list.filters.options);
23
+ return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
24
+ React.createElement("div", { className: "sub-work-list" },
25
+ React.createElement(ListView, { headerProps: {
26
+ viewTitle: "My Works",
27
+ sortable: false,
28
+ onAdd: () => (setAddAble(!addAble)),
29
+ }, className: "work-list", moveAfter: moveAfter, renderItem: ({ item, connectDragSource }) => (React.createElement(React.Fragment, null,
30
+ React.createElement(DocumentItemFrame, { key: item.id, frameProps: {
31
+ hoverEffect: "background",
32
+ hoverBackgroundProps: { color: "#f2f2f2" },
33
+ style: { border: "none", flex: "1" },
34
+ } },
35
+ React.createElement(WorkItem, { id: item.id })))) }),
36
+ addAble && (React.createElement(NewWorkForm, { simple: true, onSave: () => setAddAble(false), onCancel: () => setAddAble(false) }))))));
37
+ async function moveAfter(id, afterId) {
38
+ await documentStore.moveAfter(id, afterId);
39
+ }
40
+ };
41
+ export default SubWorkList;
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/SubWorkList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAS,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEvF,OAAO,iBAAiB,MAAM,uDAAuD,CAAC;AACtF,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IAAI,EAAE,iBAAiB,EAAO,EAAE,EAAE,CAAC,CAC9C,oBAAC,KAAK,CAAC,QAAQ;oBACX,oBAAC,iBAAiB,IACd,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,UAAU,EAAE;4BACR,WAAW,EAAE,YAAY;4BACzB,oBAAoB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;4BAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE;yBACvC;wBAED,oBAAC,QAAQ,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,GAAI,CACT,CACP,CACpB,GACH;YACD,OAAO,IAAI,CACR,oBAAC,WAAW,IACR,MAAM,EAAE,IAAI,EACZ,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GACnC,CACL,CACC,CACiB,CAC9B,CAAC,CAAC;IAEH,KAAK,UAAU,SAAS,CAAC,EAAU,EAAE,OAAe;QAChD,MAAM,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ :global {
2
+ .sub-work-list {
3
+ display: flex;
4
+ flex-direction: column;
5
+ height: 100%;
6
+ }
7
+ }
@@ -4,7 +4,7 @@ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/da
4
4
  import React, { useState } from "react";
5
5
  import { observe, useRenderOnChange } from "@voplus/morpho-ui";
6
6
  import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
7
- import InfiniteScrollView from "@voplus/morpho-ui/es/controls/InfiniteScrollView";
7
+ import { Empty } from "@voplus/antd";
8
8
  import WorkErrorItem from "../WorkErrorItem";
9
9
  import { useAutoUpdateListData } from "../../../../data/workerror/workerror-events";
10
10
  /** A work error list view shows work error in card style. */
@@ -13,8 +13,8 @@ const WorkErrorList = (props) => {
13
13
  /** 建立 ListView 和useWorkErrorListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
14
14
  const list = useCreateListDataState({
15
15
  filterDefaults: {
16
- includes: "tags",
17
- filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: props.id }]
16
+ filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: props.id }],
17
+ page: { Page: 1, PageSize: 200 }
18
18
  },
19
19
  }, [props.id]);
20
20
  /** 如果 list.filters.options变更了就重渲染,使下一行的useWorkErrorListEffect 可以接收新参数*/
@@ -24,8 +24,8 @@ const WorkErrorList = (props) => {
24
24
  /** useOnNewWorkError, useOnDeleteWorkError的sugar syntax 自動更新list. */
25
25
  useAutoUpdateListData(list, (d) => true);
26
26
  return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
27
- React.createElement("div", { className: "workerror-list-view" },
28
- React.createElement(InfiniteScrollView, { empty: list.isEmpty, loading: list.loading, hasMore: list.hasMore, loadMore: loadMore }, list.data.map((item) => (React.createElement(DocumentItemFrame, { key: item.id, frameProps: {
27
+ React.createElement("div", { className: "workerror-list-view" }, list.data.length ?
28
+ list.data.map((item) => (React.createElement(DocumentItemFrame, { key: item.id, frameProps: {
29
29
  active: activeId === item.id,
30
30
  hoverEffect: "none",
31
31
  activeEffect: "border",
@@ -35,7 +35,8 @@ const WorkErrorList = (props) => {
35
35
  setActiveId(item.id);
36
36
  (_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, item.id);
37
37
  } },
38
- React.createElement(WorkErrorItem, { id: item.id })))))))));
38
+ React.createElement(WorkErrorItem, { id: item.id }))))
39
+ : React.createElement(Empty, null)))));
39
40
  function loadMore() {
40
41
  list.triggerNextPage();
41
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkErrorList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,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C,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;QACjC,6BAAK,SAAS,EAAC,qBAAqB,IAO/B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACpB,oBAAC,iBAAiB,IACd,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,UAAU,EAAE;oBACR,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC,EAAE;oBAC5B,WAAW,EAAE,MAAM;oBACnB,YAAY,EAAE,QAAQ;oBACtB,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;iBACrE,EACD,OAAO,EAAE,GAAG,EAAE;;oBACV,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACrB,MAAA,KAAK,CAAC,WAAW,+CAAjB,KAAK,EAAe,IAAI,CAAC,EAAE,CAAC,CAAC;gBACjC,CAAC;gBAED,oBAAC,aAAa,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,GAAI,CACd,CAEvB,CAAC;YACF,CAAC,CAAC,oBAAC,KAAK,OAAG,CAGb,CACiB,CAE9B,CAAC,CAAC;IAEH,SAAS,QAAQ;QACb,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,11 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import "./index.less";
3
- import { DocumentHeaderProps } from "@voplus/morpho-document-core/es/props/DocumentHeaderProps";
4
3
  export declare type WorkItemProps = {
5
4
  id: string;
6
5
  reload?: boolean;
7
- /** Header props */
8
- headerProps?: Partial<DocumentHeaderProps>;
6
+ toolsVisible?: boolean;
9
7
  };
10
8
  declare const WorkItem: (props: WorkItemProps) => JSX.Element;
11
9
  export default WorkItem;
@@ -1,24 +1,40 @@
1
1
  import "./index.less";
2
2
  import { CommentDataIcon, DateQuickIcon, DocumentDataIcon, UserQuickIcon, } from "@voplus/morpho-document/es/controls/data-icons";
3
- import React from "react";
3
+ import React, { useState } from "react";
4
4
  import DataIconBar from "@voplus/morpho-document/es/controls/DataIconBar";
5
5
  import DocumentHeader from "@voplus/morpho-document/es/components/DocumentHeader";
6
+ import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
7
+ import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
6
8
  import { Tooltip } from "@voplus/antd";
9
+ import WorkMenu from "../../controls/WorkMenu";
10
+ import classnames from "classnames";
7
11
  import { observe } from "@voplus/morpho-ui";
12
+ import { useMetaStore } from "@voplus/morpho-document";
8
13
  import { useWork } from "../../../../data/work";
9
14
  const WorkItem = (props) => {
10
- const { id, reload } = props;
15
+ const { id, reload, toolsVisible } = props;
16
+ const [hover, setHover] = useState(false);
17
+ const meta = useMetaStore();
11
18
  const work = useWork(id, { reload: !!reload });
12
19
  return observe(() => {
13
20
  var _a;
14
- return (React.createElement(DocumentHeader, { id: work.id, quickDataBarAlign: "left", preVisible: false, flagVisible: false, toolsVisible: false, tagsVisible: !!((_a = work.tags) === null || _a === void 0 ? void 0 : _a.length), className: "default-work-item", quickDataBar: React.createElement(React.Fragment, null,
21
+ return (React.createElement(DocumentHeader, { id: work.id, quickDataBarAlign: "left", preVisible: false, flagVisible: false, toolsVisible: toolsVisible, tagsVisible: !!((_a = work.tags) === null || _a === void 0 ? void 0 : _a.length), className: "default-work-item", onMouse: (over) => (setHover(over)), quickDataBar: React.createElement(React.Fragment, null,
15
22
  React.createElement(DataIconBar, null,
16
23
  React.createElement(DateQuickIcon, { id: id }),
17
24
  React.createElement(DocumentDataIcon, { id: id }),
18
25
  React.createElement(CommentDataIcon, { id: id }),
19
26
  React.createElement(UserQuickIcon, { id: id }),
20
27
  React.createElement(Tooltip, { title: "Work Status" },
21
- React.createElement("span", { className: "data-icon" }, work.WorkStatus)))), ...props.headerProps }));
28
+ React.createElement("span", { className: "data-icon" }, work.workStatus)))), tools: React.createElement("div", { className: classnames("hover-operate-icon", {
29
+ show: hover,
30
+ }) },
31
+ React.createElement(ToolBar, { id: id, moreProps: {
32
+ buttonProps: { size: "middle" },
33
+ menus: {
34
+ default: React.createElement(WorkMenu, { id: id })
35
+ }
36
+ } },
37
+ React.createElement(Open, { size: "middle", url: `/work/${id}` }))) }));
22
38
  });
23
39
  };
24
40
  export default WorkItem;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EACN,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,GACb,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAC1E,OAAO,cAAc,MAAM,sDAAsD,CAAC;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IACzC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE7B,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAE/C,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACpB,oBAAC,cAAc,IACd,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,iBAAiB,EAAC,MAAM,EACxB,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,KAAK,EAClB,YAAY,EAAE,KAAK,EACnB,WAAW,EAAE,CAAC,CAAC,CAAA,MAAA,IAAI,CA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