@voplus/morpho-workspace 6.0.21 → 6.0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/es/controls/filters/EventsFilter/index.js +5 -10
  2. package/es/controls/filters/EventsFilter/index.js.map +1 -1
  3. package/es/controls/filters/EventsFilter/state.d.ts +0 -2
  4. package/es/controls/filters/EventsFilter/state.js +0 -11
  5. package/es/controls/filters/EventsFilter/state.js.map +1 -1
  6. package/es/controls/filters/TaskStatusFilter/index.js +7 -9
  7. package/es/controls/filters/TaskStatusFilter/index.js.map +1 -1
  8. package/es/controls/filters/TaskStatusFilter/state.d.ts +0 -2
  9. package/es/controls/filters/TaskStatusFilter/state.js +0 -11
  10. package/es/controls/filters/TaskStatusFilter/state.js.map +1 -1
  11. package/es/controls/filters/WorkStatusFilter/index.js +9 -11
  12. package/es/controls/filters/WorkStatusFilter/index.js.map +1 -1
  13. package/es/controls/filters/WorkStatusFilter/state.d.ts +0 -2
  14. package/es/controls/filters/WorkStatusFilter/state.js +0 -11
  15. package/es/controls/filters/WorkStatusFilter/state.js.map +1 -1
  16. package/es/controls/filters/WorkTypesFilter/index.d.ts +1 -1
  17. package/es/controls/filters/WorkTypesFilter/index.js +9 -11
  18. package/es/controls/filters/WorkTypesFilter/index.js.map +1 -1
  19. package/es/controls/filters/WorkTypesFilter/state.d.ts +0 -2
  20. package/es/controls/filters/WorkTypesFilter/state.js +0 -11
  21. package/es/controls/filters/WorkTypesFilter/state.js.map +1 -1
  22. package/es/data/work/WorkStore.d.ts +4 -1
  23. package/es/data/work/WorkStore.js +4 -0
  24. package/es/data/work/WorkStore.js.map +1 -1
  25. package/es/data/work/interfaces.d.ts +11 -0
  26. package/es/modules/work/components/WorkCashReport/WorkCashReportTemplate.d.ts +8 -0
  27. package/es/modules/work/components/WorkCashReport/WorkCashReportTemplate.js +24 -0
  28. package/es/modules/work/components/WorkCashReport/WorkCashReportTemplate.js.map +1 -0
  29. package/es/modules/work/components/WorkCashReport/index.d.ts +5 -0
  30. package/es/modules/work/components/WorkCashReport/index.js +44 -0
  31. package/es/modules/work/components/WorkCashReport/index.js.map +1 -0
  32. package/es/modules/work/components/WorkCashReport/index.less +35 -0
  33. package/es/modules/work/components/WorkCashReport/state.d.ts +18 -0
  34. package/es/modules/work/components/WorkCashReport/state.js +103 -0
  35. package/es/modules/work/components/WorkCashReport/state.js.map +1 -0
  36. package/es/modules/work/components/WorkList/index.js +2 -0
  37. package/es/modules/work/components/WorkList/index.js.map +1 -1
  38. package/es/modules/work/work-type/components/AutoSequenceLink/index.js +9 -3
  39. package/es/modules/work/work-type/components/AutoSequenceLink/index.js.map +1 -1
  40. package/es/modules/work/work-type/components/WorkTypeIcon/index.js +5 -4
  41. package/es/modules/work/work-type/components/WorkTypeIcon/index.js.map +1 -1
  42. package/es/modules/work/work-type/components/WorkTypeProperties/Properties.d.ts +1 -1
  43. package/es/modules/work/work-type/components/WorkTypeProperties/Properties.js +4 -9
  44. package/es/modules/work/work-type/components/WorkTypeProperties/Properties.js.map +1 -1
  45. package/es/modules/work/work-type/components/WorkTypeProperties/WorkTypePropertiesCard.js +0 -1
  46. package/es/modules/work/work-type/components/WorkTypeProperties/WorkTypePropertiesCard.js.map +1 -1
  47. package/es/modules/work/work-type/components/WorkTypeProperties/index.js +0 -1
  48. package/es/modules/work/work-type/components/WorkTypeProperties/index.js.map +1 -1
  49. package/es/modules/workspace/components/WorkspaceIcon/index.js +6 -5
  50. package/es/modules/workspace/components/WorkspaceIcon/index.js.map +1 -1
  51. package/es/modules/workspace/components/WorkspaceIcon/index.less +66 -64
  52. package/es/modules/workspace/pages/WorkspacePage/WorkTypeWorksDashBoard.d.ts +7 -0
  53. package/es/modules/workspace/pages/WorkspacePage/WorkTypeWorksDashBoard.js +43 -0
  54. package/es/modules/workspace/pages/WorkspacePage/WorkTypeWorksDashBoard.js.map +1 -0
  55. package/es/modules/workspace/pages/WorkspacePage/index.js +2 -1
  56. package/es/modules/workspace/pages/WorkspacePage/index.js.map +1 -1
  57. package/es/modules/workspace/pages/WorkspacePage/index.less +12 -4
  58. package/package.json +1 -1
@@ -3,25 +3,20 @@ import { Badge } from "antd";
3
3
  import { State } from "./state";
4
4
  import classnames from "classnames";
5
5
  import { observe } from "@voplus/morpho-ui";
6
- import { runInAction } from "mobx";
7
6
  import { useFilterOptionsContext } from "@voplus/morpho-ui/es/data";
8
7
  const EventsFilter = (props) => {
9
8
  const context = useFilterOptionsContext();
10
9
  const state = context.getFilterState("Events", () => new State());
11
- // defaultValue 为传入的预选状态
12
10
  useEffect(() => {
13
- state.showDefaultValue &&
14
- props.defaultValue &&
15
- props.defaultValue.map((value) => state.onChangeEvents(value));
16
- }, [state.showDefaultValue]);
11
+ var _a;
12
+ state.reset();
13
+ (_a = props.defaultValue) === null || _a === void 0 ? void 0 : _a.map((value) => state.onChangeEvents(value));
14
+ }, [props.defaultValue]);
17
15
  return observe(() => (React.createElement("div", null,
18
16
  React.createElement("div", { className: "menu-item-title" }, "Events"),
19
17
  state.menus.map((item, index) => (React.createElement("div", { key: index, className: classnames("filter-menu-item", {
20
18
  bold: state.events.has(item.value),
21
- }), onClick: () => {
22
- state.onChangeEvents(item.value);
23
- runInAction(() => (state.showDefaultValue = false));
24
- } },
19
+ }), onClick: () => state.onChangeEvents(item.value) },
25
20
  React.createElement("div", { className: "filter-name" },
26
21
  React.createElement(Badge, { color: item.color }),
27
22
  item.name),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controls/filters/EventsFilter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,C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,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,YAAY,CAAC"}
@@ -1,8 +1,6 @@
1
1
  import { FilterOption } from "@voplus/morpho-data";
2
2
  import { IFilterState } from "@voplus/morpho-ui/es/data/IFilterState";
3
3
  export declare class State implements IFilterState {
4
- /** 是否显示预选status */
5
- showDefaultValue: boolean;
6
4
  /** events of filter */
7
5
  events: Map<string, boolean>;
8
6
  constructor();
@@ -2,13 +2,6 @@ import { __decorate } from "tslib";
2
2
  import { action, makeObservable, observable } from "mobx";
3
3
  export class State {
4
4
  constructor() {
5
- /** 是否显示预选status */
6
- Object.defineProperty(this, "showDefaultValue", {
7
- enumerable: true,
8
- configurable: true,
9
- writable: true,
10
- value: true
11
- });
12
5
  /** events of filter */
13
6
  Object.defineProperty(this, "events", {
14
7
  enumerable: true,
@@ -41,12 +34,8 @@ export class State {
41
34
  }
42
35
  reset() {
43
36
  this.events.clear();
44
- this.showDefaultValue = true;
45
37
  }
46
38
  }
47
- __decorate([
48
- observable
49
- ], State.prototype, "showDefaultValue", void 0);
50
39
  __decorate([
51
40
  observable
52
41
  ], State.prototype, "events", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/controls/filters/EventsFilter/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAK1D,MAAM,OAAO,KAAK;IAMjB;QALA,mBAAmB;QACA;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CACD;AAhCmB;IAAlB,UAAU;qCAAiD;AAQrD;IADN,MAAM;2CAGN"}
@@ -1,24 +1,22 @@
1
1
  import { Badge } from "antd";
2
- import React from "react";
2
+ import React, { useEffect } from "react";
3
3
  import { State } from "./state";
4
4
  import classnames from "classnames";
5
5
  import { observe } from "@voplus/morpho-ui";
6
- import { runInAction } from "mobx";
7
6
  import { useFilterOptionsContext } from "@voplus/morpho-ui/es/data";
8
7
  const TaskStatusFilter = (props) => {
9
8
  const context = useFilterOptionsContext();
10
9
  const state = context.getFilterState("Status", () => new State());
11
- state.showDefaultValue &&
12
- props.defaultValue &&
13
- props.defaultValue.map((item) => state.onChangeStatus(item));
10
+ useEffect(() => {
11
+ var _a;
12
+ state.reset();
13
+ (_a = props.defaultValue) === null || _a === void 0 ? void 0 : _a.map((value) => state.onChangeStatus(value));
14
+ }, [props.defaultValue]);
14
15
  return observe(() => (React.createElement("div", null,
15
16
  React.createElement("div", { className: "menu-item-title" }, "Status"),
16
17
  state.menus.map((item, index) => (React.createElement("div", { key: index, className: classnames("filter-menu-item", {
17
18
  bold: state.status.has(item.value),
18
- }), onClick: () => {
19
- state.onChangeStatus(item.value);
20
- runInAction(() => (state.showDefaultValue = false));
21
- } },
19
+ }), onClick: () => state.onChangeStatus(item.value) },
22
20
  React.createElement("div", { className: "filter-name" },
23
21
  React.createElement(Badge, { color: item.color }),
24
22
  item.name),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controls/filters/TaskStatusFilter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC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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"}
@@ -1,8 +1,6 @@
1
1
  import { FilterOption } from "@voplus/morpho-data";
2
2
  import { IFilterState } from "@voplus/morpho-ui/es/data/IFilterState";
3
3
  export declare class State implements IFilterState {
4
- /** 是否显示预选status */
5
- showDefaultValue: boolean;
6
4
  /** Status of filter */
7
5
  status: Map<string, boolean>;
8
6
  constructor();
@@ -2,13 +2,6 @@ import { __decorate } from "tslib";
2
2
  import { action, makeObservable, observable } from "mobx";
3
3
  export class State {
4
4
  constructor() {
5
- /** 是否显示预选status */
6
- Object.defineProperty(this, "showDefaultValue", {
7
- enumerable: true,
8
- configurable: true,
9
- writable: true,
10
- value: true
11
- });
12
5
  /** Status of filter */
13
6
  Object.defineProperty(this, "status", {
14
7
  enumerable: true,
@@ -44,12 +37,8 @@ export class State {
44
37
  }
45
38
  reset() {
46
39
  this.status.clear();
47
- this.showDefaultValue = true;
48
40
  }
49
41
  }
50
- __decorate([
51
- observable
52
- ], State.prototype, "showDefaultValue", void 0);
53
42
  __decorate([
54
43
  observable
55
44
  ], State.prototype, "status", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/controls/filters/TaskStatusFilter/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAK1D,MAAM,OAAO,KAAK;IAMjB;QALA,mBAAmB;QACA;;;;mBAAmB,IAAI;WAAC;QAC3C,uBAAuB;QACJ;;;;mBAA+B,IAAI,GAAG,EAAE;WAAC;QAG3D,cAAc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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;AAnCmB;IAAlB,UAAU;qCAAiD;AAQrD;IADN,MAAM;2CAGN"}
@@ -1,25 +1,23 @@
1
- import { Badge } from "antd";
2
- import React from "react";
1
+ import React, { useEffect } from "react";
3
2
  import { State } from "./state";
4
- import classnames from "classnames";
3
+ import { Badge } from "antd";
5
4
  import { observe } from "@voplus/morpho-ui";
6
- import { runInAction } from "mobx";
7
5
  import { useFilterOptionsContext } from "@voplus/morpho-ui/es/data";
6
+ import classnames from "classnames";
8
7
  const WorkStatusFilter = (props) => {
9
8
  const context = useFilterOptionsContext();
10
9
  const state = context.getFilterState("WorkStatus", () => new State());
11
10
  // defaultValue 为传入的预选状态
12
- state.showDefaultValue &&
13
- props.defaultValue &&
14
- props.defaultValue.map((value) => state.onChangeStatus(value));
11
+ useEffect(() => {
12
+ var _a;
13
+ state.reset();
14
+ (_a = props.defaultValue) === null || _a === void 0 ? void 0 : _a.map((value) => state.onChangeStatus(value));
15
+ }, [props.defaultValue]);
15
16
  return observe(() => (React.createElement("div", null,
16
17
  React.createElement("div", { className: "menu-item-title" }, "WorkStatus"),
17
18
  state.menus.map((item, index) => (React.createElement("div", { key: index, className: classnames("filter-menu-item", {
18
19
  bold: state.status.has(item.value),
19
- }), onClick: () => {
20
- state.onChangeStatus(item.value);
21
- runInAction(() => (state.showDefaultValue = false));
22
- } },
20
+ }), onClick: () => state.onChangeStatus(item.value) },
23
21
  React.createElement("div", { className: "filter-name" },
24
22
  React.createElement(Badge, { color: item.color }),
25
23
  item.name),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controls/filters/WorkStatusFilter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,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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"}
@@ -1,8 +1,6 @@
1
1
  import { FilterOption } from "@voplus/morpho-data";
2
2
  import { IFilterState } from "@voplus/morpho-ui/es/data/IFilterState";
3
3
  export declare class State implements IFilterState {
4
- /** 是否显示预选status */
5
- showDefaultValue: boolean;
6
4
  /** Status of filter */
7
5
  status: Map<string, boolean>;
8
6
  constructor();
@@ -2,13 +2,6 @@ import { __decorate } from "tslib";
2
2
  import { action, makeObservable, observable } from "mobx";
3
3
  export class State {
4
4
  constructor() {
5
- /** 是否显示预选status */
6
- Object.defineProperty(this, "showDefaultValue", {
7
- enumerable: true,
8
- configurable: true,
9
- writable: true,
10
- value: true
11
- });
12
5
  /** Status of filter */
13
6
  Object.defineProperty(this, "status", {
14
7
  enumerable: true,
@@ -44,12 +37,8 @@ export class State {
44
37
  }
45
38
  reset() {
46
39
  this.status.clear();
47
- this.showDefaultValue = true;
48
40
  }
49
41
  }
50
- __decorate([
51
- observable
52
- ], State.prototype, "showDefaultValue", void 0);
53
42
  __decorate([
54
43
  observable
55
44
  ], State.prototype, "status", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":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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;YAClE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE;YACnE,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,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;AAnCmB;IAAlB,UAAU;qCAAiD;AAQrD;IADN,MAAM;2CAGN"}
@@ -1,5 +1,5 @@
1
- import { IWorkType } from "../../../data/worktype";
2
1
  import React from "react";
2
+ import { IWorkType } from "../../../data/worktype";
3
3
  declare const WorkTypesFilter: (props: {
4
4
  workTypeList: IWorkType[];
5
5
  defaultValue?: string[];
@@ -1,26 +1,24 @@
1
- import { Badge } from "antd";
2
- import React from "react";
1
+ import React, { useEffect } from "react";
3
2
  import { State } from "./state";
4
- import classnames from "classnames";
3
+ import { Badge } from "antd";
5
4
  import { observe } from "@voplus/morpho-ui";
6
- import { runInAction } from "mobx";
7
5
  import { useFilterOptionsContext } from "@voplus/morpho-ui/es/data";
6
+ import classnames from "classnames";
8
7
  const WorkTypesFilter = (props) => {
9
8
  const context = useFilterOptionsContext();
10
9
  const state = context.getFilterState("WorkTypes", () => new State());
11
10
  state.workTypeList = props.workTypeList;
12
11
  // defaultValue 为传入的预选状态
13
- state.showDefaultValue &&
14
- props.defaultValue &&
15
- props.defaultValue.map((value) => state.onChangeTypes(value));
12
+ useEffect(() => {
13
+ var _a;
14
+ state.reset();
15
+ (_a = props.defaultValue) === null || _a === void 0 ? void 0 : _a.map((value) => state.onChangeTypes(value));
16
+ }, [props.defaultValue]);
16
17
  return observe(() => (React.createElement("div", null,
17
18
  React.createElement("div", { className: "menu-item-title" }, "WorkTypes"),
18
19
  state.menus.map((item, index) => (React.createElement("div", { key: index, className: classnames("filter-menu-item", {
19
20
  bold: state.types.has(item.value),
20
- }), onClick: () => {
21
- state.onChangeTypes(item.value);
22
- runInAction(() => (state.showDefaultValue = false));
23
- } },
21
+ }), onClick: () => state.onChangeTypes(item.value) },
24
22
  React.createElement("div", { className: "filter-name" },
25
23
  React.createElement(Badge, { color: item.color }),
26
24
  item.name),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controls/filters/WorkTypesFilter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,eAAe,GAAG,CAAC,KAA6D,EAAE,EAAE;IACzF,MAAM,OAAO,GAAG,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AI,CAAC,KAAK,CAAC;YAE9C,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,eAAe,CAAC"}
@@ -2,8 +2,6 @@ import { FilterOption } from "@voplus/morpho-data";
2
2
  import { IFilterState } from "@voplus/morpho-ui/es/data/IFilterState";
3
3
  import { IWorkType } from "../../../data/worktype";
4
4
  export declare class State implements IFilterState {
5
- /** 是否显示预选types */
6
- showDefaultValue: boolean;
7
5
  /** types of filter */
8
6
  types: Map<string, boolean>;
9
7
  workTypeList: IWorkType[];
@@ -2,13 +2,6 @@ import { __decorate } from "tslib";
2
2
  import { action, makeObservable, observable } from "mobx";
3
3
  export class State {
4
4
  constructor() {
5
- /** 是否显示预选types */
6
- Object.defineProperty(this, "showDefaultValue", {
7
- enumerable: true,
8
- configurable: true,
9
- writable: true,
10
- value: true
11
- });
12
5
  /** types of filter */
13
6
  Object.defineProperty(this, "types", {
14
7
  enumerable: true,
@@ -53,12 +46,8 @@ export class State {
53
46
  }
54
47
  reset() {
55
48
  this.types.clear();
56
- this.showDefaultValue = true;
57
49
  }
58
50
  }
59
- __decorate([
60
- observable
61
- ], State.prototype, "showDefaultValue", void 0);
62
51
  __decorate([
63
52
  observable
64
53
  ], State.prototype, "types", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/controls/filters/WorkTypesFilter/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAM1D,MAAM,OAAO,KAAK;IAOjB;QANA,kBAAkB;QACC;;;;mBAAmB,IAAI;WAAC;QAC3C,sBAAsB;QACH;;;;mBAA8B,IAA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;aACQ;SACjB,CAAC;IACH,CAAC;IACM,KAAK;QACX,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD;AAvCmB;IAAlB,UAAU;oCAAgD;AACxC;IAAlB,UAAU;2CAAkC;AAQtC;IADN,MAAM;0CASN"}
@@ -1,6 +1,6 @@
1
1
  import { DocumentStore, DocumentTypeStore, LoadDocumentListOptions, LoadDocumentOptions } from "@voplus/morpho-document-core";
2
2
  import { CreateWorkOptions, IWork, IWorkEditOptions, WorkSendFormOptions } from "./interfaces";
3
- import { StoreActionOptions } from "@voplus/morpho-data";
3
+ import { StoreActionOptions, FilterOption } from "@voplus/morpho-data";
4
4
  import { ApiEndPoint } from "@voplus/api";
5
5
  export declare class WorkStore extends DocumentTypeStore<IWork, LoadDocumentOptions, LoadDocumentListOptions, CreateWorkOptions, IWorkEditOptions, any> {
6
6
  /** Name of the store */
@@ -18,6 +18,9 @@ export declare class WorkStore extends DocumentTypeStore<IWork, LoadDocumentOpti
18
18
  * @param {string} id - id of the work.
19
19
  */
20
20
  reject(id: string, options: StoreActionOptions): Promise<any>;
21
+ loadWorkReport(options?: {
22
+ Filters?: FilterOption[];
23
+ }): Promise<any>;
21
24
  }
22
25
  /** 响应钩子检索 PageStore */
23
26
  export declare const useWorkStore: () => WorkStore;
@@ -49,6 +49,10 @@ export class WorkStore extends DocumentTypeStore {
49
49
  }
50
50
  }, options);
51
51
  }
52
+ async loadWorkReport(options) {
53
+ const r = await this.endpoint.post(`/api/works/reports/monthly`, new RequestBuilder().json(options ? options : { Filters: [] }));
54
+ return await r.json();
55
+ }
52
56
  }
53
57
  /** 响应钩子检索 PageStore */
54
58
  export const useWorkStore = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"WorkStore.js","sourceRoot":"","sources":["../../../src/data/work/WorkStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,iBAAiB,EAGjB,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAs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M,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;YACpD,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBACnC,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAU,CAAC;gBACnD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC9B,CAAC;QACF,CAAC,EAAE,OAAO,CAAC,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,OAAsC;QACjE,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACjC,4BAA4B,EAC5B,IAAI,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC9D,CAAC;QACF,OAAO,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACvB,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"}
@@ -66,3 +66,14 @@ export type WorkSendFormOptions = {
66
66
  Message: string;
67
67
  };
68
68
  } & StoreActionOptions;
69
+ export interface IWorkReport {
70
+ id: string;
71
+ start: string;
72
+ end: string;
73
+ items: IWorkReportItem[];
74
+ }
75
+ export interface IWorkReportItem {
76
+ year: number;
77
+ month: number;
78
+ total: number;
79
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ declare const WorkCashReportTemplate: (props: {
3
+ data: {
4
+ date: string;
5
+ total: number;
6
+ }[];
7
+ }) => React.JSX.Element;
8
+ export default WorkCashReportTemplate;
@@ -0,0 +1,24 @@
1
+ import React, { useEffect } from "react";
2
+ import { Chart } from "@antv/g2";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ const WorkCashReportTemplate = (props) => {
5
+ useEffect(() => init(), []);
6
+ const init = () => {
7
+ const chart = new Chart({
8
+ container: "work-report-container",
9
+ autoFit: true,
10
+ height: 280,
11
+ });
12
+ chart.data(props.data);
13
+ chart.scale("total", {
14
+ nice: true,
15
+ });
16
+ chart.interval().position("date*total");
17
+ chart.interaction("active-region");
18
+ chart.interaction('element-active');
19
+ chart.render();
20
+ };
21
+ return observe(() => React.createElement("div", { id: "work-report-container" }));
22
+ };
23
+ export default WorkCashReportTemplate;
24
+ //# sourceMappingURL=WorkCashReportTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkCashReportTemplate.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkCashReport/WorkCashReportTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,sBAAsB,GAAG,CAAC,KAAkD,EAAE,EAAE;IACrF,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAE5B,MAAM,IAAI,GAAG,GAAG,EAAE;QACjB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC;YACvB,SAAS,EAAE,uBAAuB;YAClC,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,GAAG;SACX,CAAC,CAAC;QAEH,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE;YACpB,IAAI,EAAE,IAAI;SACV,CAAC,CAAC;QAEH,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAExC,KAAK,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACnC,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAEpC,KAAK,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,6BAAK,EAAE,EAAC,uBAAuB,GAAG,CAAC,CAAC;AAC1D,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ declare const WorkCashReport: (props: {
3
+ id: string;
4
+ }) => React.JSX.Element;
5
+ export default WorkCashReport;
@@ -0,0 +1,44 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { observe } from "@voplus/morpho-ui";
3
+ import { FilterOptionsContext, ListDataContext, useCreateListDataState, } from "@voplus/morpho-ui/es/data";
4
+ import { useWorkStore } from "../../../../data/work";
5
+ import { State } from "./state";
6
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
7
+ import { faBarsFilter } from "@fortawesome/pro-light-svg-icons";
8
+ import { Skeleton } from "antd";
9
+ import { CloseOutlined } from "@ant-design/icons";
10
+ import { WorkStatusFilter } from "../../../../controls/filters";
11
+ import WorkCashReportTemplate from "./WorkCashReportTemplate";
12
+ import FilterView from "@voplus/morpho-ui/es/controls/FilterView";
13
+ import styles from "./index.less";
14
+ const WorkCashReport = (props) => {
15
+ const list = useCreateListDataState();
16
+ const store = useWorkStore();
17
+ const [state] = useState(new State(props.id, store));
18
+ useEffect(() => state.onLoad(), [props.id]);
19
+ return observe(() => {
20
+ var _a;
21
+ return (React.createElement(ListDataContext.Provider, { value: list },
22
+ React.createElement("div", { className: styles["work-report-g2"] },
23
+ React.createElement(FilterOptionsContext.Provider, { value: list.filters },
24
+ React.createElement("div", { className: "work-report-header" },
25
+ React.createElement("div", { className: "selected-filter" }, (_a = state.filterV1Val) === null || _a === void 0 ? void 0 : _a.map((type) => (React.createElement("div", { className: "selected-filter-item" },
26
+ React.createElement("span", { className: "prosemirror-mention-node" }, type),
27
+ React.createElement(CloseOutlined, { className: "selected-filter-item-del", onClick: () => state.onResetFilter(type) }))))),
28
+ React.createElement("div", { className: "filter-component" },
29
+ React.createElement(FilterView, { className: "ml-2.5", icon: React.createElement(FAIcon, { icon: faBarsFilter, size: "lg" }), columns: [
30
+ React.createElement(WorkStatusFilter, { key: "WorkStatusFilter", defaultValue: state.filterV1Val }),
31
+ ], onFilter: (c) => {
32
+ var _a, _b;
33
+ c.filter();
34
+ state.onFilter((state.filterV1Val = ((_a = c === null || c === void 0 ? void 0 : c.options) === null || _a === void 0 ? void 0 : _a.Filters)
35
+ ? JSON.parse((_b = c === null || c === void 0 ? void 0 : c.options) === null || _b === void 0 ? void 0 : _b.Filters[0].v1)
36
+ : []));
37
+ }, onReset: () => state.onFilter([]) })))),
38
+ React.createElement("div", { className: "work-report-content" },
39
+ React.createElement(Skeleton, { loading: state.loading, active: true },
40
+ React.createElement(WorkCashReportTemplate, { data: state.dataList }))))));
41
+ });
42
+ };
43
+ export default WorkCashReport;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkCashReport/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,sBAAsB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gC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}
8
+
9
+ .selected-filter {
10
+ }
11
+
12
+ .selected-filter-item {
13
+ position: relative;
14
+ display: inline-block;
15
+
16
+ .selected-filter-item-del {
17
+ position: absolute;
18
+ font-size: 12px;
19
+ right: 12px;
20
+ top: 11px;
21
+ display: none;
22
+ }
23
+
24
+ &:hover {
25
+ .prosemirror-mention-node {
26
+ padding-right: 24px;
27
+ }
28
+
29
+ .selected-filter-item-del {
30
+ display: block;
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,18 @@
1
+ import { WorkStore, IWorkReport } from "../../../../data/work";
2
+ import { FilterOption } from "@voplus/morpho-data";
3
+ export declare class State {
4
+ private worktypeId;
5
+ private store;
6
+ loading: boolean;
7
+ filterV1Val: string[];
8
+ filter: FilterOption[];
9
+ dataList: {
10
+ date: string;
11
+ total: number;
12
+ }[];
13
+ constructor(worktypeId: string, store: WorkStore);
14
+ onLoad(filterOption?: FilterOption[]): void;
15
+ loadCashList(workReport: IWorkReport): void;
16
+ onResetFilter(item: string): void;
17
+ onFilter(filterV1Val: string[]): void;
18
+ }