@voplus/morpho-csp 6.0.111 → 6.0.113

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 (68) hide show
  1. package/es/components/CorporateNavMenu/CorporateNavMenu.js +47 -17
  2. package/es/components/CorporateNavMenu/CorporateNavMenu.js.map +1 -1
  3. package/es/components/CorporateNavMenu/index.js +1 -11
  4. package/es/components/CorporateNavMenu/index.js.map +1 -1
  5. package/es/components/CorporateNavMenu/state.d.ts +22 -2
  6. package/es/components/CorporateNavMenu/state.js +197 -3
  7. package/es/components/CorporateNavMenu/state.js.map +1 -1
  8. package/es/data/corporate/interfaces.d.ts +10 -6
  9. package/es/data/officer/interfaces.d.ts +8 -0
  10. package/es/modules/corporate/company/components/CapitalCard/index.d.ts +7 -0
  11. package/es/modules/corporate/company/components/CapitalCard/index.js +40 -0
  12. package/es/modules/corporate/company/components/CapitalCard/index.js.map +1 -0
  13. package/es/modules/corporate/company/components/CapitalCard/index.less +54 -0
  14. package/es/modules/corporate/company/components/CompanyPageHead/index.js +41 -5
  15. package/es/modules/corporate/company/components/CompanyPageHead/index.js.map +1 -1
  16. package/es/modules/corporate/company/components/CompanyPageHead/index.less +78 -32
  17. package/es/modules/corporate/company/components/InlineEditCountry/index.d.ts +4 -1
  18. package/es/modules/corporate/company/components/InlineEditCountry/index.js +3 -1
  19. package/es/modules/corporate/company/components/InlineEditCountry/index.js.map +1 -1
  20. package/es/modules/corporate/company/components/SharesCard2/SharesReportChart.d.ts +7 -0
  21. package/es/modules/corporate/company/components/SharesCard2/SharesReportChart.js +31 -0
  22. package/es/modules/corporate/company/components/SharesCard2/SharesReportChart.js.map +1 -0
  23. package/es/modules/corporate/company/components/SharesCard2/index.d.ts +7 -0
  24. package/es/modules/corporate/company/components/SharesCard2/index.js +58 -0
  25. package/es/modules/corporate/company/components/SharesCard2/index.js.map +1 -0
  26. package/es/modules/corporate/company/components/SharesCard2/index.less +58 -0
  27. package/es/modules/corporate/company/components/SharesCard2/state.d.ts +15 -0
  28. package/es/modules/corporate/company/components/SharesCard2/state.js +74 -0
  29. package/es/modules/corporate/company/components/SharesCard2/state.js.map +1 -0
  30. package/es/modules/corporate/company/member-register/components/CompanyMemberList/index.d.ts +3 -2
  31. package/es/modules/corporate/company/member-register/components/CompanyMemberList/index.js.map +1 -1
  32. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCell.d.ts +4 -0
  33. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCell.js +43 -0
  34. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCell.js.map +1 -0
  35. package/es/modules/corporate/company/member-register/components/MemberTableListCard/index.d.ts +14 -0
  36. package/es/modules/corporate/company/member-register/components/MemberTableListCard/index.js +130 -0
  37. package/es/modules/corporate/company/member-register/components/MemberTableListCard/index.js.map +1 -0
  38. package/es/modules/corporate/company/member-register/components/MemberTableListCard/index.less +59 -0
  39. package/es/modules/corporate/company/member-register/controls/MemberStatusLabel/index.d.ts +2 -2
  40. package/es/modules/corporate/company/member-register/controls/MemberStatusLabel/index.less +8 -2
  41. package/es/modules/corporate/company/officer-register/components/OfficerHead/index.js +6 -3
  42. package/es/modules/corporate/company/officer-register/components/OfficerHead/index.js.map +1 -1
  43. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCell.d.ts +4 -0
  44. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCell.js +37 -0
  45. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCell.js.map +1 -0
  46. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/index.d.ts +14 -0
  47. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/index.js +145 -0
  48. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/index.js.map +1 -0
  49. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/index.less +53 -0
  50. package/es/modules/corporate/company/officer-register/controls/OfficerStatusLabel/index.d.ts +7 -0
  51. package/es/modules/corporate/company/officer-register/controls/OfficerStatusLabel/index.js +7 -0
  52. package/es/modules/corporate/company/officer-register/controls/OfficerStatusLabel/index.js.map +1 -0
  53. package/es/modules/corporate/company/officer-register/controls/OfficerStatusLabel/index.less +18 -0
  54. package/es/modules/corporate/company/pages/CompanyPage/Dashboard.js +24 -16
  55. package/es/modules/corporate/company/pages/CompanyPage/Dashboard.js.map +1 -1
  56. package/es/modules/corporate/company/pages/CompanyPage/index.less +7 -0
  57. package/es/modules/corporate/filing-record/components/FilingTimeLineCard/index.d.ts +6 -0
  58. package/es/modules/corporate/filing-record/components/FilingTimeLineCard/index.js +66 -0
  59. package/es/modules/corporate/filing-record/components/FilingTimeLineCard/index.js.map +1 -0
  60. package/es/modules/corporate/filing-record/components/FilingTimeLineCard/index.less +73 -0
  61. package/es/modules/corporate/filing-record/components/FilingTimeLineCard/state.d.ts +11 -0
  62. package/es/modules/corporate/filing-record/components/FilingTimeLineCard/state.js +42 -0
  63. package/es/modules/corporate/filing-record/components/FilingTimeLineCard/state.js.map +1 -0
  64. package/es/modules/corporate/filing-record/filing-type/components/NewFilingTypeForm/index.js +1 -1
  65. package/es/modules/corporate/filing-record/filing-type/components/NewFilingTypeForm/index.js.map +1 -1
  66. package/es/modules/self-registration/incorporation-clda/components/NewIncorporationCLDAForm/index.js +1 -1
  67. package/es/modules/self-registration/incorporation-clda/components/NewIncorporationCLDAForm/index.js.map +1 -1
  68. package/package.json +1 -1
@@ -0,0 +1,130 @@
1
+ import { faBarsProgress, faReceipt, faThumbtack } from "@fortawesome/pro-solid-svg-icons";
2
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
3
+ import { useDeepMemo, useApplicationContext } from "@voplus/morpho-data";
4
+ import { useAutoUpdateListData } from "@voplus/morpho-document-core";
5
+ import { observe, useRenderOnChange } from "@voplus/morpho-ui";
6
+ import DocumentTableListCard from "@voplus/morpho-ui/es/components/DocumentTableListCard";
7
+ import TableListCard from "@voplus/morpho-ui/es/components/TableListCard";
8
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
9
+ import UnitsSelectDialog from "@voplus/morpho-org/es/components/UnitsSelectDialog";
10
+ import AddDropDown2 from "@voplus/morpho-ui/es/components/layout/ListView/controls/AddDropDown2";
11
+ import { Badge } from "antd";
12
+ import React, { useState } from "react";
13
+ import MemberStatusFilter from "../../controls/MemberStatusFilter";
14
+ import { useCorporate } from "../../../../../../data/corporate";
15
+ import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
16
+ import { useMemberListEffect, useMemberStore } from "../../../../../../data/member";
17
+ import TableCell from "./TableCell";
18
+ import { State } from "../CompanyMemberList/state";
19
+ import "./index.less";
20
+ const MemberTableListCard = (props) => {
21
+ const { membersRegisterId, corporateId, selectDialog } = props;
22
+ const [visible, setVisible] = useState(false);
23
+ const [memberTotal, setMemberTotal] = useState(0);
24
+ const memberStore = useMemberStore();
25
+ const { user } = useApplicationContext();
26
+ const corporate = useCorporate(corporateId !== null && corporateId !== void 0 ? corporateId : "", { includes: "permissions" });
27
+ const state = useDeepMemo(() => new State(), [membersRegisterId]);
28
+ /** 建立 ListView 和useDocumentListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
29
+ const list = useCreateListDataState({
30
+ filterDefaults: {
31
+ filters: filters(),
32
+ },
33
+ }, [membersRegisterId]);
34
+ const columnsList = [
35
+ {
36
+ title: (React.createElement(React.Fragment, null,
37
+ React.createElement(FAIcon, { icon: faThumbtack }),
38
+ " Members Name")),
39
+ dataIndex: "name",
40
+ },
41
+ {
42
+ title: (React.createElement(React.Fragment, null,
43
+ React.createElement(FAIcon, { icon: faReceipt }),
44
+ " Contact")),
45
+ dataIndex: "contact",
46
+ width: "30%",
47
+ },
48
+ {
49
+ title: (React.createElement(React.Fragment, null,
50
+ React.createElement(FAIcon, { icon: faBarsProgress }),
51
+ " Status")),
52
+ dataIndex: "status",
53
+ width: "18%",
54
+ },
55
+ {
56
+ title: " ",
57
+ dataIndex: "menu",
58
+ width: "68px",
59
+ },
60
+ ];
61
+ const components = {
62
+ body: {
63
+ // row: DragTableRow,
64
+ cell: TableCell,
65
+ },
66
+ };
67
+ const columns = columnsList.map((col) => {
68
+ return {
69
+ ...col,
70
+ onCell: (record, rowIndex) => {
71
+ return {
72
+ record,
73
+ dataIndex: col.dataIndex,
74
+ rowIndex: rowIndex,
75
+ };
76
+ },
77
+ };
78
+ });
79
+ /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
80
+ useAutoUpdateListData(list, (d) => d.parentId === membersRegisterId);
81
+ useRenderOnChange(() => list.filters.options);
82
+ /** 把ListDataState传给useMemberListEffect,使之可以自動更新loading, hasmore. */
83
+ useMemberListEffect(list, (result, total) => {
84
+ list.union(result);
85
+ setMemberTotal(total);
86
+ }, {
87
+ Total: true,
88
+ ...list.filters.options,
89
+ });
90
+ return observe(() => (React.createElement(React.Fragment, null,
91
+ React.createElement(ListDataContext.Provider, { value: list },
92
+ React.createElement(DocumentTableListCard, { isHeader: true, header: React.createElement(ListHeaderTool, { addAble: false, sortable: false, searchHeader: false, className: "member-table-list-header", filterViewProps: {
93
+ columns: [
94
+ React.createElement(MemberStatusFilter, { key: "MemberStatusFilter", defaultValue: ["Active"] }),
95
+ ],
96
+ }, preExtra: () => (React.createElement("div", { className: "title" },
97
+ "Members Register",
98
+ " ",
99
+ memberTotal ? React.createElement(Badge, { count: memberTotal, overflowCount: 99 }) : null)), rightExtra: () => (React.createElement(React.Fragment, null, user.can("edit", corporate.p) && (React.createElement(AddDropDown2, { btnType: "icon", onClick: () => (state.addAble = true) })))) }) },
100
+ React.createElement(TableListCard, { tableListProps: { columns: columns, components: components }, ...props.tableCardProps }))),
101
+ state.addAble && (React.createElement(UnitsSelectDialog, { type: "click", multiSelect: false, onSelect: onSave, onCancel: () => (state.addAble = false) })))));
102
+ function filters() {
103
+ let filter = [];
104
+ if (membersRegisterId) {
105
+ filter = [
106
+ { c: "ParentNodeId", o: "=", l: "And", v1: membersRegisterId },
107
+ { c: "Status", o: "=", l: "And", v1: "Active" },
108
+ ];
109
+ }
110
+ if (selectDialog && corporateId) {
111
+ filter.push({ c: "CorporateId", o: "=", l: "And", v1: corporateId });
112
+ }
113
+ return filter;
114
+ }
115
+ /** 新增memberItem */
116
+ async function onSave(unit) {
117
+ /** SelectLegalContactDialog 选择/新增有identity信息的unit */
118
+ if (unit) {
119
+ const res = await memberStore.create({
120
+ data: { RegisterId: membersRegisterId, UnitId: unit[0].id },
121
+ error: "message",
122
+ });
123
+ list.union([res]);
124
+ }
125
+ state.addAble = false;
126
+ }
127
+ };
128
+ MemberTableListCard.defaultProps = {};
129
+ export default MemberTableListCard;
130
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/member-register/components/MemberTableListCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAgB,WAAW,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,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,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,YAAY,MAAM,uEAAuE,CAAC;AACjG,OAAO,EAAE,KAAK,EAAgB,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,O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+ align-items: center;
9
+ .ant-avatar {
10
+ width: 30px;
11
+ height: 30px;
12
+ border-radius: 2px;
13
+ }
14
+ .member-table-item-name {
15
+ flex: 1;
16
+ margin-left: 8px;
17
+ }
18
+ }
19
+ .member-table-status-label {
20
+ &.member-status {
21
+ width: 100px !important;
22
+ }
23
+ }
24
+ .member-table-item-contact {
25
+ color: #868686;
26
+ span {
27
+ display: inline-block;
28
+ width: 15px;
29
+ color: #cbcbcb;
30
+ margin-right: 5px;
31
+ }
32
+ }
33
+ .member-table-list-header.list-view-header-tool {
34
+ padding: 0;
35
+ flex: 1;
36
+ .header-tool-space {
37
+ display: flex;
38
+ .title {
39
+ flex: 1;
40
+ }
41
+ .filter-view-menu-icon {
42
+ font-size: 18px;
43
+ color: #cbcbcb;
44
+ border: none;
45
+ box-shadow: none;
46
+ margin-right: 7px;
47
+ &:hover {
48
+ color: #217eb2;
49
+ }
50
+ }
51
+ .send-form-btn {
52
+ color: #217eb2;
53
+ border-color: #217eb2;
54
+ padding-left: 10px;
55
+ padding-right: 10px;
56
+ }
57
+ }
58
+ }
59
+ }
@@ -3,8 +3,8 @@ import { MemberStatus } from "../../../../../../data/member";
3
3
  import "./index.less";
4
4
  declare const MemberStatusLabel: (props: {
5
5
  status: string;
6
- editable: boolean;
6
+ editable?: boolean;
7
7
  className?: string;
8
- onChange: (status: MemberStatus) => void;
8
+ onChange?: (status: MemberStatus) => void;
9
9
  }) => React.JSX.Element;
10
10
  export default MemberStatusLabel;
@@ -2,7 +2,6 @@
2
2
 
3
3
  :global {
4
4
  .member-status {
5
-
6
5
  &.active,
7
6
  &.active:hover {
8
7
  background: @active-color;
@@ -13,5 +12,12 @@
13
12
  background: @closed-color;
14
13
  }
15
14
 
15
+ &.need-identity {
16
+ font-size: 12px;
17
+ background: #faad14;
18
+ &:hover {
19
+ background: #faad14;
20
+ }
21
+ }
16
22
  }
17
- }
23
+ }
@@ -8,13 +8,15 @@ import UnitNameNoteAlert from "@voplus/morpho-org/es/components/UnitNameNoteAler
8
8
  import PositionSelect from "../PositionSelect";
9
9
  import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
10
10
  import UnitAvatar from "@voplus/morpho-org/es/components/UnitAvatar/LoadedUnitAvatar";
11
+ import { useCurrentContactContext } from "@voplus/morpho-document-core/es/data/context/CurrentContactContext";
11
12
  import "./index.less";
12
13
  const OfficerHead = (props) => {
13
14
  const { id, open } = props;
14
- const officer = useOfficer(id);
15
+ const officer = useOfficer(id, { includes: "corporate" });
15
16
  const store = useOfficerStore();
17
+ const context = useCurrentContactContext();
16
18
  return observe(() => {
17
- var _a, _b;
19
+ var _a, _b, _c;
18
20
  return (React.createElement("div", { className: "company-officer-header" },
19
21
  React.createElement(Skeleton, { active: true, loading: !officer.loaded },
20
22
  React.createElement("div", { className: "tool-bar-content" },
@@ -30,7 +32,8 @@ const OfficerHead = (props) => {
30
32
  React.createElement(UnitAvatar, { unit: officer.contact, size: 70 }),
31
33
  React.createElement("div", { className: "officer-name" },
32
34
  React.createElement(PositionSelect, { id: id, position: officer.position })),
33
- React.createElement("div", null, ((_b = officer.identity) === null || _b === void 0 ? void 0 : _b.fullName) ? (officer.identity.fullName) : officer.contact ? (React.createElement(UnitNameNoteAlert, { id: officer.contact.id, name: officer.contact.name })) : null))));
35
+ officer.corporate && officer.corporate.contact.id !== ((_b = context === null || context === void 0 ? void 0 : context.contact) === null || _b === void 0 ? void 0 : _b.id) && (React.createElement(UnitNameNoteAlert, { id: officer.corporate.contact.id, name: officer.corporate.contact.name })),
36
+ React.createElement("div", null, ((_c = officer.identity) === null || _c === void 0 ? void 0 : _c.fullName) ? (officer.identity.fullName) : officer.contact ? (React.createElement(UnitNameNoteAlert, { id: officer.contact.id, name: officer.contact.name })) : null))));
34
37
  });
35
38
  };
36
39
  export default OfficerHead;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/components/OfficerHead/index.tsx"],"names":[],"mappings":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EAAE,EAAE;oCACd,IAAI,EAAE,EAAE,SAAS,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAE,EAAE,EAAE;oCACxC,KAAK,EAAE,SAAS;iCAChB,CAAC,CAAA;6BAAA,KAEC,KAAK,CAAC,SAAS,GAClB,CACO,CACL;gBACN,oBAAC,UAAU,IAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,GAAI;gBAC/C,6BAAK,SAAS,EAAC,cAAc;oBAC5B,oBAAC,cAAc,IAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAI,CACjD;gBACN,iCACE,CAAA,MAAA,OAAO,CAAC,QAAQ,0CAAE,QAAQ,EAAC,CAAC,CAAC,CAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CACzB,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CACrB,oBAAC,iBAAiB,IAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,GAAI,CACzE,CAAC,CAAC,CAAC,IAAI,CACH,CACI,CACN,CACN,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/components/OfficerHead/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,kBAAkB,MAAM,uCAAuC,CAAC;AACvE,OAAO,iBAAiB,MAA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BACN,oBAAC,UAAU,IAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,GAAI;gBAC/C,6BAAK,SAAS,EAAC,cAAc;oBAC5B,oBAAC,cAAc,IAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAI,CACjD;gBACL,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAK,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,EAAE,CAAA,IAAI,CAC9E,oBAAC,iBAAiB,IACjB,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAChC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,GACnC,CACF;gBACD,iCACE,CAAA,MAAA,OAAO,CAAC,QAAQ,0CAAE,QAAQ,EAAC,CAAC,CAAC,CAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CACzB,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CACrB,oBAAC,iBAAiB,IAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,GAAI,CACzE,CAAC,CAAC,CAAC,IAAI,CACH,CACI,CACN,CACN,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const TableCell: (props: any) => React.JSX.Element;
4
+ export default TableCell;
@@ -0,0 +1,37 @@
1
+ import { faEllipsisVertical } from "@fortawesome/pro-solid-svg-icons";
2
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
3
+ import { useMetaStore } from "@voplus/morpho-document-core";
4
+ import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
5
+ import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
6
+ import ItemFunction from "@voplus/morpho-org/es/controls/ItemFunction";
7
+ import { observe } from "@voplus/morpho-ui";
8
+ import UnitAvatar from "@voplus/morpho-org/es/components/UnitAvatar/LoadedUnitAvatar";
9
+ import UnitNameNoteAlert from "@voplus/morpho-org/es/components/UnitNameNoteAlert";
10
+ import classnames from "classnames";
11
+ import React from "react";
12
+ import { useOfficerStore } from "../../../../../../data/officer";
13
+ import OfficerStatusLabel from "../../controls/OfficerStatusLabel";
14
+ import OfficerQuickViewDialog from "../OfficerQuickView";
15
+ import "./index.less";
16
+ const TableCell = (props) => {
17
+ const { dataIndex, record, rowIndex, children, ...restProps } = props;
18
+ const store = useOfficerStore();
19
+ const meta = useMetaStore();
20
+ return observe(() => {
21
+ var _a;
22
+ return (React.createElement("td", { ...restProps }, dataIndex === "name" ? (React.createElement(ItemFunction, { className: "officer-table-item-info", onClick: props.onClick, quickViewDialog: (onCancel) => (React.createElement(OfficerQuickViewDialog, { id: record.id, visible: true, onCancel: onCancel })) },
23
+ React.createElement(UnitAvatar, { unit: record.contact }),
24
+ React.createElement("div", { className: "officer-table-item-name" }, ((_a = record.identity) === null || _a === void 0 ? void 0 : _a.fullName) ? (record.identity.fullName) : record.contact ? (React.createElement(UnitNameNoteAlert, { id: record.contact.id, name: record.contact.name })) : null))) : dataIndex === "position" ? (React.createElement("div", { className: "officer-table-item-position" }, record.position)) : dataIndex === "status" ? (React.createElement("div", { style: { display: "flex" } },
25
+ React.createElement(OfficerStatusLabel, { className: classnames("officer-table-status-label", {
26
+ "need-identity": !record.identity,
27
+ }), status: !record.identity
28
+ ? "Need Identity Info"
29
+ : record.status && record.identity && "Present" }))) : dataIndex === "menu" ? (React.createElement(ToolBar, { id: record.id, moreProps: {
30
+ buttonProps: { size: "middle" },
31
+ icon: React.createElement(FAIcon, { icon: faEllipsisVertical }),
32
+ } },
33
+ React.createElement(Open, { size: "middle", url: `/officer/${record.id}` }))) : (children)));
34
+ });
35
+ };
36
+ export default TableCell;
37
+ //# sourceMappingURL=TableCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;AAC3E,OAAO,OAAO,MAAM,sDAAsD,CAAC;AAC3E,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,UAAU,MAAM,8DAA8D,CAAC;AACtF,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,sBAAsB,MAAM,qBAAqB,CAAC;AACzD,OAAO,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE;IAChC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACtE,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;IAE5B,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACpB,+BAAQ,SAAS,IAEf,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,CACvB,oBAAC,YAAY,IACZ,S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AAC,CAC1B,oBAAC,OAAO,IACP,EAAE,EAAE,MAAM,CAAC,EAAE,EACb,SAAS,EAAE;gBACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC/B,IAAI,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,kBAAkB,GAAI;aAC1C;YAED,oBAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,YAAY,MAAM,CAAC,EAAE,EAAE,GAAI,CAC3C,CACV,CAAC,CAAC,CAAC,CACH,QAAQ,CACR,CACG,CACL,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React, { ReactNode } from "react";
2
+ import { OfficerListProps } from "../OfficerList";
3
+ import "./index.less";
4
+ declare const OfficerTableListCard: {
5
+ (props: OfficerListProps & {
6
+ tableCardProps?: {
7
+ className?: string;
8
+ isHeader?: boolean;
9
+ title?: ReactNode;
10
+ };
11
+ }): React.JSX.Element;
12
+ defaultProps: {};
13
+ };
14
+ export default OfficerTableListCard;
@@ -0,0 +1,145 @@
1
+ import { faBarsProgress, faReceipt, faThumbtack } from "@fortawesome/pro-solid-svg-icons";
2
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
3
+ import { useDeepMemo, useApplicationContext } from "@voplus/morpho-data";
4
+ import { useAutoUpdateListData } from "@voplus/morpho-document-core";
5
+ import { observe, useRenderOnChange } from "@voplus/morpho-ui";
6
+ import DocumentTableListCard from "@voplus/morpho-ui/es/components/DocumentTableListCard";
7
+ import TableListCard from "@voplus/morpho-ui/es/components/TableListCard";
8
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
9
+ import UnitsSelectDialog from "@voplus/morpho-org/es/components/UnitsSelectDialog";
10
+ import AddDropDown2 from "@voplus/morpho-ui/es/components/layout/ListView/controls/AddDropDown2";
11
+ import { Badge, Button, Menu } from "antd";
12
+ import React, { useState } from "react";
13
+ import OfficerStatusFilter from "../../controls/OfficerStatusFilter";
14
+ import SelectOfficerForm from "../SelectOfficerForm";
15
+ import { useCorporate } from "../../../../../../data/corporate";
16
+ import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
17
+ import { useOfficerListEffect, useOfficerStore } from "../../../../../../data/officer";
18
+ import TableCell from "./TableCell";
19
+ import { State } from "../OfficerList/state";
20
+ import "./index.less";
21
+ const OfficerTableListCard = (props) => {
22
+ const { officersRegisterId, corporateId, selectDialog, isFilterPresent } = props;
23
+ const [visible, setVisible] = useState(false);
24
+ const [officerTotal, setOfficerTotal] = useState(0);
25
+ const officerStore = useOfficerStore();
26
+ const { user } = useApplicationContext();
27
+ const corporate = useCorporate(corporateId !== null && corporateId !== void 0 ? corporateId : "", { includes: "permissions" });
28
+ const state = useDeepMemo(() => new State(), [officersRegisterId]);
29
+ /** 建立 ListView 和useDocumentListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
30
+ const list = useCreateListDataState({
31
+ filterDefaults: {
32
+ filters: filters(),
33
+ },
34
+ }, [officersRegisterId]);
35
+ const columnsList = [
36
+ {
37
+ title: (React.createElement(React.Fragment, null,
38
+ React.createElement(FAIcon, { icon: faThumbtack }),
39
+ " Officer Name")),
40
+ dataIndex: "name",
41
+ },
42
+ {
43
+ title: (React.createElement(React.Fragment, null,
44
+ React.createElement(FAIcon, { icon: faReceipt }),
45
+ " Position")),
46
+ dataIndex: "position",
47
+ width: "30%",
48
+ },
49
+ {
50
+ title: (React.createElement(React.Fragment, null,
51
+ React.createElement(FAIcon, { icon: faBarsProgress }),
52
+ " Status")),
53
+ dataIndex: "status",
54
+ width: "18%",
55
+ },
56
+ {
57
+ title: " ",
58
+ dataIndex: "menu",
59
+ width: "68px",
60
+ },
61
+ ];
62
+ const components = {
63
+ body: {
64
+ // row: DragTableRow,
65
+ cell: TableCell,
66
+ },
67
+ };
68
+ const columns = columnsList.map((col) => {
69
+ return {
70
+ ...col,
71
+ onCell: (record, rowIndex) => {
72
+ return {
73
+ record,
74
+ dataIndex: col.dataIndex,
75
+ rowIndex: rowIndex,
76
+ };
77
+ },
78
+ };
79
+ });
80
+ /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
81
+ useAutoUpdateListData(list, (d) => d.parentId === officersRegisterId);
82
+ useRenderOnChange(() => list.filters.options);
83
+ /** 把ListDataState传给useOfficerListEffect,使之可以自動更新loading, hasmore. */
84
+ useOfficerListEffect(list, (result, total) => {
85
+ list.union(result);
86
+ setOfficerTotal(total);
87
+ }, {
88
+ Total: true,
89
+ ...list.filters.options,
90
+ });
91
+ return observe(() => (React.createElement(React.Fragment, null,
92
+ React.createElement(ListDataContext.Provider, { value: list },
93
+ React.createElement(DocumentTableListCard, { isHeader: true, header: React.createElement(ListHeaderTool, { addAble: false, sortable: false, searchHeader: false, className: "officer-table-list-header", filterViewProps: {
94
+ columns: [
95
+ React.createElement(OfficerStatusFilter, { key: "OfficerStatusFilter", defaultValue: isFilterPresent ? ["Yes"] : [] }),
96
+ ],
97
+ }, preExtra: () => (React.createElement("div", { className: "title" },
98
+ "Officers Register",
99
+ " ",
100
+ officerTotal ? React.createElement(Badge, { count: officerTotal, overflowCount: 99 }) : null)), rightExtra: () => (React.createElement(React.Fragment, null,
101
+ user.can("edit", corporate.p) && (React.createElement(AddDropDown2, { trigger: ["click"], btnType: "icon", overlay: React.createElement(Menu, { onClick: state.onSelect, items: [
102
+ { key: "Director", label: "Director" },
103
+ { key: "Managing Director", label: "Managing Director" },
104
+ { key: "Nominee Director", label: "Nominee Director" },
105
+ { key: "Secretary", label: "Secretary" },
106
+ { key: "DPO", label: "DPO" },
107
+ { key: "CEO", label: "CEO" },
108
+ { key: "Partner", label: "Partner" },
109
+ { key: "Owner", label: "Owner" },
110
+ { key: "Auditor", label: "Auditor" },
111
+ { key: "Manager", label: "Manager" },
112
+ ] }) })),
113
+ user.can("edit", corporate.p) && (React.createElement(Button, { className: "send-form-btn", onClick: () => setVisible(true) }, "Send Form")))) }) },
114
+ React.createElement(TableListCard, { tableListProps: { columns: columns, components: components }, ...props.tableCardProps }))),
115
+ state.addAble && (React.createElement(UnitsSelectDialog, { type: "click", multiSelect: false, onSelect: onSave, onCancel: () => (state.addAble = false) })),
116
+ visible && (React.createElement(SelectOfficerForm, { parentId: officersRegisterId, onCancel: () => setVisible(false) })))));
117
+ function filters() {
118
+ const filter = [];
119
+ if (officersRegisterId) {
120
+ filter.push({ c: "ParentNodeId", o: "=", l: "And", v1: officersRegisterId });
121
+ }
122
+ if (selectDialog && corporateId) {
123
+ filter.push({ c: "CorporateId", o: "=", l: "And", v1: corporateId });
124
+ }
125
+ if (isFilterPresent) {
126
+ filter.push({ c: "Present", o: "=", l: "And", v1: "Yes" });
127
+ }
128
+ return filter;
129
+ }
130
+ /** 新增officerItem */
131
+ async function onSave(unit) {
132
+ /** SelectLegalContactDialog 选择/新增有identity信息的unit */
133
+ if (unit) {
134
+ const res = await officerStore.create({
135
+ data: { RegisterId: officersRegisterId, UnitId: unit[0].id, Position: state.position },
136
+ error: "message",
137
+ });
138
+ list.union([res]);
139
+ }
140
+ state.addAble = false;
141
+ }
142
+ };
143
+ OfficerTableListCard.defaultProps = {};
144
+ export default OfficerTableListCard;
145
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/components/OfficerTableListCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAgB,WAAW,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MA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AK,EAAE,SAAS;aAChB,CAAC,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACnB,CAAC;QAED,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;AACF,CAAC,CAAC;AAEF,oBAAoB,CAAC,YAAY,GAAG,EAAE,CAAC;AAEvC,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,53 @@
1
+ :global {
2
+ .officer-table-item-info {
3
+ color: #5d5d5d;
4
+ font-weight: 500;
5
+ padding: 1px 0;
6
+ cursor: pointer;
7
+ display: flex;
8
+ align-items: center;
9
+ .ant-avatar {
10
+ width: 30px;
11
+ height: 30px;
12
+ border-radius: 2px;
13
+ }
14
+ .officer-table-item-name {
15
+ flex: 1;
16
+ margin-left: 8px;
17
+ }
18
+ }
19
+ .officer-table-status-label {
20
+ &.officer-status-button {
21
+ width: 100px !important;
22
+ }
23
+ }
24
+ .officer-table-item-position {
25
+ color: #5d5d5d;
26
+ }
27
+ .officer-table-list-header.list-view-header-tool {
28
+ padding: 0;
29
+ flex: 1;
30
+ .header-tool-space {
31
+ display: flex;
32
+ .title {
33
+ flex: 1;
34
+ }
35
+ .filter-view-menu-icon {
36
+ font-size: 18px;
37
+ color: #cbcbcb;
38
+ border: none;
39
+ box-shadow: none;
40
+ margin-right: 7px;
41
+ &:hover {
42
+ color: #217eb2;
43
+ }
44
+ }
45
+ .send-form-btn {
46
+ color: #217eb2;
47
+ border-color: #217eb2;
48
+ padding-left: 10px;
49
+ padding-right: 10px;
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const OfficerStatusButton: (props: {
4
+ status?: string;
5
+ className?: string;
6
+ }) => React.JSX.Element;
7
+ export default OfficerStatusButton;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import DocumentStatusLabel from "@voplus/morpho-document/es/controls/DocumentStatusLabel";
3
+ import classnames from "classnames";
4
+ import "./index.less";
5
+ const OfficerStatusButton = (props) => (React.createElement(DocumentStatusLabel, { className: classnames("officer-status-button", props.className), editable: false, list: [], status: props.status }));
6
+ export default OfficerStatusButton;
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/controls/OfficerStatusLabel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,mBAAmB,MAAM,yDAAyD,CAAC;AAC1F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,cAAc,CAAC;AAEtB,MAAM,mBAAmB,GAAG,CAAC,KAA8C,EAAE,EAAE,CAAC,CAC/E,oBAAC,mBAAmB,IACnB,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC,EAC/D,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,EAAE,EACR,MAAM,EAAE,KAAK,CAAC,MAAM,GACnB,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,18 @@
1
+ :global {
2
+ .officer-status-button {
3
+ color: white;
4
+
5
+ &.present,
6
+ &.present:hover {
7
+ background: #52c41a;
8
+ }
9
+
10
+ &.need-identity {
11
+ font-size: 12px;
12
+ background: #faad14;
13
+ &:hover {
14
+ background: #faad14;
15
+ }
16
+ }
17
+ }
18
+ }