@voplus/morpho-workspace 6.0.115 → 6.0.117

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,18 +1,32 @@
1
- import React from "react";
1
+ import React, { ReactNode } from "react";
2
+ export type WorkTableListCardProps = {
3
+ /** filter by contactId */
4
+ contactId?: string;
5
+ /** 是否允许新增 */
6
+ addAble?: boolean;
7
+ /** status of works shown on the list. */
8
+ status?: string;
9
+ isHeader?: boolean;
10
+ /** 预选 contact */
11
+ primaryContact?: {
12
+ id: string;
13
+ name: string;
14
+ };
15
+ tableListProps?: {
16
+ isHeader?: boolean;
17
+ title?: ReactNode;
18
+ };
19
+ tableCardProps?: {
20
+ className?: string;
21
+ isHeader?: boolean;
22
+ title?: ReactNode;
23
+ };
24
+ };
2
25
  declare const WorkTableListCard: {
3
- (props: {
4
- /** filter by contactId */
5
- contactId?: string;
6
- /** 是否允许新增 */
7
- addAble?: boolean;
8
- /** 预选 contact */
9
- primaryContact?: {
10
- id: string;
11
- name: string;
12
- };
13
- }): React.JSX.Element;
26
+ (props: WorkTableListCardProps): React.JSX.Element;
14
27
  defaultProps: {
15
28
  addAble: boolean;
29
+ isHeader: boolean;
16
30
  };
17
31
  };
18
32
  export default WorkTableListCard;
@@ -5,21 +5,24 @@ import { observe, useRenderOnChange } from "@voplus/morpho-ui";
5
5
  import DocumentTableListCard from "@voplus/morpho-ui/es/components/DocumentTableListCard";
6
6
  import TableListCard from "@voplus/morpho-ui/es/components/TableListCard";
7
7
  import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
8
- import { Badge, Button } from "antd";
9
- import React, { useState } from "react";
8
+ import { Button } from "antd";
9
+ import React, { useState, useEffect } from "react";
10
10
  import { useWorkListEffect } from "../../../../data/work";
11
11
  import NewWorkFormDialog from "../NewWorkForm/NewWorkFormDialog";
12
12
  import TableCell from "./TableCell";
13
+ import classnames from "classnames";
13
14
  const WorkTableListCard = (props) => {
15
+ var _a;
14
16
  const { contactId } = props;
15
17
  const [visible, setVisible] = useState(false);
16
18
  const [workTotal, setWorkTotal] = useState(0);
19
+ const [status, setStatus] = useState((_a = props.status) !== null && _a !== void 0 ? _a : "Active");
17
20
  /** 建立 ListView 和useDocumentListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
18
21
  const list = useCreateListDataState({
19
22
  filterDefaults: {
20
23
  filters: filters(),
21
24
  },
22
- }, [contactId]);
25
+ }, [contactId, status]);
23
26
  const columnsList = [
24
27
  {
25
28
  title: (React.createElement(React.Fragment, null,
@@ -66,7 +69,12 @@ const WorkTableListCard = (props) => {
66
69
  };
67
70
  });
68
71
  /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
69
- useAutoUpdateListData(list, (d) => d.type === "Work");
72
+ useAutoUpdateListData(list, (d) => {
73
+ if (status) {
74
+ return d.type === "Work" && d.workStatus === status;
75
+ }
76
+ return d.type === "Work";
77
+ });
70
78
  useRenderOnChange(() => list.filters.options);
71
79
  /** 把ListDataState传给useWorkListEffect,使之可以自動更新loading, hasmore. */
72
80
  useWorkListEffect(list, (result, total) => {
@@ -76,15 +84,21 @@ const WorkTableListCard = (props) => {
76
84
  Total: true,
77
85
  ...list.filters.options,
78
86
  });
87
+ useEffect(() => {
88
+ if (props.status)
89
+ setStatus(props.status);
90
+ }, [props.status]);
79
91
  return observe(() => (React.createElement(React.Fragment, null,
80
92
  React.createElement(ListDataContext.Provider, { value: list },
81
- React.createElement(DocumentTableListCard, { isHeader: true, header: React.createElement(React.Fragment, null,
93
+ React.createElement(DocumentTableListCard, { isHeader: props.isHeader, header: React.createElement(React.Fragment, null,
82
94
  React.createElement("div", null,
83
- React.createElement("span", { className: "title" },
84
- "Work ",
85
- workTotal ? React.createElement(Badge, { count: workTotal, overflowCount: 99 }) : null)),
95
+ React.createElement("span", { className: "title" }, "Work"),
96
+ React.createElement(Button, { className: classnames({ current: status === "Active" }), onClick: () => setStatus("Active") }, "Active"),
97
+ React.createElement(Button, { className: classnames({ current: status === "Done" }), onClick: () => setStatus("Done") }, "Done")),
86
98
  React.createElement("div", null, props.addAble && (React.createElement(Button, { className: "create-new", type: "link", onClick: () => setVisible(true) }, "+Create New")))) },
87
- React.createElement(TableListCard, { tableListProps: { columns: columns, components: components } }))),
99
+ React.createElement(TableListCard, { tableListProps: { columns: columns, components: components }, ...props.tableCardProps, ...props.tableListProps, title: React.createElement(React.Fragment, null,
100
+ props.status,
101
+ workTotal ? ` (${workTotal})` : null) }))),
88
102
  visible && (React.createElement(NewWorkFormDialog, { contact: props.primaryContact, onCancel: () => setVisible(false), onSave: () => setVisible(false) })))));
89
103
  function filters() {
90
104
  let filter = [];
@@ -99,9 +113,17 @@ const WorkTableListCard = (props) => {
99
113
  },
100
114
  ];
101
115
  }
116
+ if (status) {
117
+ filter.push({
118
+ c: "WorkStatus",
119
+ o: "=",
120
+ l: "And",
121
+ v1: status,
122
+ });
123
+ }
102
124
  return filter;
103
125
  }
104
126
  };
105
- WorkTableListCard.defaultProps = { addAble: true };
127
+ WorkTableListCard.defaultProps = { addAble: true, isHeader: true };
106
128
  export default WorkTableListCard;
107
129
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkTableListCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAgB,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,qBAAqB,MAAM,uDAAuD,CAAC;AAC1F,OAAO,aAAa,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM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C,IAAI,CAAC,kBAEjE,CACT,CACI,CACJ;gBAGJ,oBAAC,aAAa,IAAC,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,GAAI,CACxD,CACE;QAC1B,OAAO,IAAI,CACX,oBAAC,iBAAiB,IACjB,OAAO,EAAE,KAAK,CAAC,cAAc,EAC7B,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EACjC,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAC9B,CACF,CACC,CACH,CAAC,CAAC;IAEH,SAAS,OAAO;QACf,IAAI,MAAM,GAAmB,EAAE,CAAC;QAChC,IAAI,SAAS,EAAE,CAAC;YACf,MAAM,GAAG;gBACR,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE;gBACjD;oBACC,CAAC,EAAE,YAAY;oBACf,CAAC,EAAE,UAAU;oBACb,CAAC,EAAE,KAAK;oBACR,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;iBACrC;aACD,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;AACF,CAAC,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAEnD,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkTableListCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAgB,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,OAAO,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G,CAAC,CAAC,CAAC,IAAI,CACnC,GAEH,CACqB,CACE;QAC1B,OAAO,IAAI,CACX,oBAAC,iBAAiB,IACjB,OAAO,EAAE,KAAK,CAAC,cAAc,EAC7B,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EACjC,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAC9B,CACF,CACC,CACH,CAAC,CAAC;IAEH,SAAS,OAAO;QACf,IAAI,MAAM,GAAmB,EAAE,CAAC;QAChC,IAAI,SAAS,EAAE,CAAC;YACf,MAAM,GAAG;gBACR,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE;gBACjD;oBACC,CAAC,EAAE,YAAY;oBACf,CAAC,EAAE,UAAU;oBACb,CAAC,EAAE,KAAK;oBACR,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;iBACrC;aACD,CAAC;QACH,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,CAAC,IAAI,CAAC;gBACX,CAAC,EAAE,YAAY;gBACf,CAAC,EAAE,GAAG;gBACN,CAAC,EAAE,KAAK;gBACR,EAAE,EAAE,MAAM;aACM,CAAC,CAAC;QACpB,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;AACF,CAAC,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEnE,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { WorkTableListCardProps } from "../WorkTableListCard";
3
+ import "./index.less";
4
+ declare const WorkTableListCards: (props: WorkTableListCardProps) => React.JSX.Element;
5
+ export default WorkTableListCards;
@@ -0,0 +1,21 @@
1
+ import React, { useState } from "react";
2
+ import { Button } from "antd";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ import NewWorkFormDialog from "../NewWorkForm/NewWorkFormDialog";
5
+ import WorkTableListCard from "../WorkTableListCard";
6
+ import { Scrollbars } from "react-custom-scrollbars-2";
7
+ import "./index.less";
8
+ const WorkTableListCards = (props) => {
9
+ const [visible, setVisible] = useState(false);
10
+ return observe(() => (React.createElement(Scrollbars, { autoHide: true },
11
+ React.createElement("div", { className: "work-list-cards" },
12
+ React.createElement("div", { className: "work-list-cards-header" },
13
+ React.createElement("div", { className: "title" }, "Works"),
14
+ React.createElement("div", null,
15
+ React.createElement(Button, { className: "create-new", type: "link", onClick: () => setVisible(true) }, "+Create New"))),
16
+ React.createElement(WorkTableListCard, { isHeader: false, status: "Active", tableListProps: { isHeader: true }, ...props }),
17
+ React.createElement(WorkTableListCard, { isHeader: false, status: "Done", tableListProps: { isHeader: true }, ...props })),
18
+ visible && (React.createElement(NewWorkFormDialog, { contact: props.primaryContact, onCancel: () => setVisible(false), onSave: () => setVisible(false) })))));
19
+ };
20
+ export default WorkTableListCards;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkTableListCards/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,iBAA6C,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,cAAc,CAAC;AAEtB,MAAM,kBAAkB,GAAG,CAAC,KAA6B,EAAE,EAAE;IAC5D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,UAAU,IAAC,QAAQ;QACnB,6BAAK,SAAS,EAAC,iBAAiB;YAC/B,6BAAK,SAAS,EAAC,wBAAwB;gBACtC,6BAAK,SAAS,EAAC,OAAO,YAAY;gBAClC;oBACC,oBAAC,MAAM,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,kBAEjE,CACJ,CACD;YACN,oBAAC,iBAAiB,IACjB,QAAQ,EAAE,KAAK,EACf,MAAM,EAAC,QAAQ,EACf,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAC9B,KAAK,GACR;YACF,oBAAC,iBAAiB,IACjB,QAAQ,EAAE,KAAK,EACf,MAAM,EAAC,MAAM,EACb,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAC9B,KAAK,GACR,CACG;QACL,OAAO,IAAI,CACX,oBAAC,iBAAiB,IACjB,OAAO,EAAE,KAAK,CAAC,cAAc,EAC7B,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EACjC,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAC9B,CACF,CACW,CACb,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,26 @@
1
+ :global {
2
+ .work-list-cards {
3
+ padding: 0 15px;
4
+ .work-list-cards-header {
5
+ display: flex;
6
+ justify-content: space-between;
7
+ font-size: 14px;
8
+ line-height: 30px;
9
+ color: #217eb2;
10
+ font-weight: bold;
11
+ padding: 16px 0 12px 0;
12
+ .title {
13
+ font-size: 16px;
14
+ }
15
+ .create-new {
16
+ color: #217eb2;
17
+ font-weight: bold;
18
+ border: none;
19
+ }
20
+ }
21
+ .document-table-list-card {
22
+ padding: 0 10px 15px 10px;
23
+ margin-bottom: 15px;
24
+ }
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voplus/morpho-workspace",
3
- "version": "6.0.115",
3
+ "version": "6.0.117",
4
4
  "description": "morpho workspace module",
5
5
  "repository": {
6
6
  "type": "git",