@voplus/morpho-csp 10.0.5 → 10.0.7

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 (67) hide show
  1. package/es/components/RegisterTable/index.d.ts +31 -0
  2. package/es/components/RegisterTable/index.js +55 -0
  3. package/es/components/RegisterTable/index.js.map +1 -0
  4. package/es/components/StatusLabel/index.d.ts +36 -0
  5. package/es/components/StatusLabel/index.js +16 -0
  6. package/es/components/StatusLabel/index.js.map +1 -0
  7. package/es/modules/corporate/company/controller-register/components/ControllerTableList/TableCell.d.ts +13 -1
  8. package/es/modules/corporate/company/controller-register/components/ControllerTableList/TableCell.js +94 -39
  9. package/es/modules/corporate/company/controller-register/components/ControllerTableList/TableCell.js.map +1 -1
  10. package/es/modules/corporate/company/controller-register/components/ControllerTableList/index.d.ts +0 -1
  11. package/es/modules/corporate/company/controller-register/components/ControllerTableList/index.js +66 -95
  12. package/es/modules/corporate/company/controller-register/components/ControllerTableList/index.js.map +1 -1
  13. package/es/modules/corporate/company/controller-register/controls/ControllerStatusLabel/ControllerStatusLabel2.js +23 -13
  14. package/es/modules/corporate/company/controller-register/controls/ControllerStatusLabel/ControllerStatusLabel2.js.map +1 -1
  15. package/es/modules/corporate/company/member-register/components/{MemberTableListCard → MemberTableList}/TableCellDetail.d.ts +13 -1
  16. package/es/modules/corporate/company/member-register/components/MemberTableList/TableCellDetail.js +125 -0
  17. package/es/modules/corporate/company/member-register/components/MemberTableList/TableCellDetail.js.map +1 -0
  18. package/es/modules/corporate/company/member-register/components/MemberTableList/index.d.ts +2 -3
  19. package/es/modules/corporate/company/member-register/components/MemberTableList/index.js +63 -9
  20. package/es/modules/corporate/company/member-register/components/MemberTableList/index.js.map +1 -1
  21. package/es/modules/corporate/company/member-register/components/MemberTableListCard/MemberRegisterContainer.d.ts +21 -0
  22. package/es/modules/corporate/company/member-register/components/MemberTableListCard/MemberRegisterContainer.js +86 -0
  23. package/es/modules/corporate/company/member-register/components/MemberTableListCard/MemberRegisterContainer.js.map +1 -0
  24. package/es/modules/corporate/company/member-register/components/MemberTableListCard/index.d.ts +1 -16
  25. package/es/modules/corporate/company/member-register/components/MemberTableListCard/index.js +17 -133
  26. package/es/modules/corporate/company/member-register/components/MemberTableListCard/index.js.map +1 -1
  27. package/es/modules/corporate/company/member-register/controls/MemberStatusLabel/MemberStatusLabel2.js +15 -12
  28. package/es/modules/corporate/company/member-register/controls/MemberStatusLabel/MemberStatusLabel2.js.map +1 -1
  29. package/es/modules/corporate/company/officer-register/components/{OfficerTableListCard → OfficerTableList}/TableCellDetail.d.ts +13 -1
  30. package/es/modules/corporate/company/officer-register/components/OfficerTableList/TableCellDetail.js +140 -0
  31. package/es/modules/corporate/company/officer-register/components/OfficerTableList/TableCellDetail.js.map +1 -0
  32. package/es/modules/corporate/company/officer-register/components/OfficerTableList/index.d.ts +2 -3
  33. package/es/modules/corporate/company/officer-register/components/OfficerTableList/index.js +74 -11
  34. package/es/modules/corporate/company/officer-register/components/OfficerTableList/index.js.map +1 -1
  35. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/OfficerRegisterContainer.d.ts +23 -0
  36. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/OfficerRegisterContainer.js +87 -0
  37. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/OfficerRegisterContainer.js.map +1 -0
  38. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/index.d.ts +3 -24
  39. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/index.js +22 -140
  40. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/index.js.map +1 -1
  41. package/es/modules/corporate/company/officer-register/controls/OfficerStatusLabel/OfficerStatusLabel2.d.ts +0 -2
  42. package/es/modules/corporate/company/officer-register/controls/OfficerStatusLabel/OfficerStatusLabel2.js +20 -37
  43. package/es/modules/corporate/company/officer-register/controls/OfficerStatusLabel/OfficerStatusLabel2.js.map +1 -1
  44. package/es/modules/corporate/company/pages/RegisterTablePage/index.d.ts +10 -0
  45. package/es/modules/corporate/company/pages/RegisterTablePage/index.js +151 -0
  46. package/es/modules/corporate/company/pages/RegisterTablePage/index.js.map +1 -0
  47. package/package.json +2 -1
  48. package/es/modules/corporate/company/controller-register/components/ControllerTableList/TableCellSimple.d.ts +0 -13
  49. package/es/modules/corporate/company/controller-register/components/ControllerTableList/TableCellSimple.js +0 -63
  50. package/es/modules/corporate/company/controller-register/components/ControllerTableList/TableCellSimple.js.map +0 -1
  51. package/es/modules/corporate/company/controller-register/components/ControllerTableList/index.css +0 -122
  52. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCellDetail.js +0 -77
  53. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCellDetail.js.map +0 -1
  54. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCellSimple.d.ts +0 -13
  55. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCellSimple.js +0 -52
  56. package/es/modules/corporate/company/member-register/components/MemberTableListCard/TableCellSimple.js.map +0 -1
  57. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCellDetail.js +0 -87
  58. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCellDetail.js.map +0 -1
  59. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCellSimple.d.ts +0 -13
  60. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCellSimple.js +0 -65
  61. package/es/modules/corporate/company/officer-register/components/OfficerTableListCard/TableCellSimple.js.map +0 -1
  62. package/es/page/RegisterTablePage/Controller.d.ts +0 -3
  63. package/es/page/RegisterTablePage/Controller.js +0 -134
  64. package/es/page/RegisterTablePage/Controller.js.map +0 -1
  65. package/es/page/RegisterTablePage/index.d.ts +0 -3
  66. package/es/page/RegisterTablePage/index.js +0 -63
  67. package/es/page/RegisterTablePage/index.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ import React, { useState } from "react";
2
+ import { Modal } from "antd";
3
+ import { useApplicationContext, useDeepMemo } from "@voplus/morpho-data";
4
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
5
+ import { observe, useRenderOnChange } from "@voplus/morpho-ui";
6
+ import { useAutoUpdateListData } from "@voplus/morpho-document-core";
7
+ import UnitsSelectDialog from "@voplus/morpho-org/es/components/UnitsSelectDialog";
8
+ import { useCorporate } from "../../../../../../data/corporate";
9
+ import { useOfficerListEffect, useOfficerStore } from "../../../../../../data/officer";
10
+ import OfficerQuickViewDialog from "../OfficerQuickView";
11
+ import SelectOfficerForm from "../SelectOfficerForm";
12
+ import { State } from "./state";
13
+ const OfficerRegisterContainer = (props) => {
14
+ const { officersRegisterId, corporateId, isFilterPresent, onDelete, children } = props;
15
+ const { user } = useApplicationContext();
16
+ const officerStore = useOfficerStore();
17
+ const corporate = useCorporate(corporateId, { reload: (i) => !i.p, includes: "permissions" });
18
+ const [visible, setVisible] = useState(false);
19
+ const [totalCount, setTotalCount] = useState(0);
20
+ const state = useDeepMemo(() => new State(), [officersRegisterId]);
21
+ function filters() {
22
+ const filter = [
23
+ { c: "ParentNodeId", o: "=", l: "And", v1: officersRegisterId },
24
+ ];
25
+ if (isFilterPresent) {
26
+ filter.push({ c: "Present", o: "=", l: "And", v1: "Yes" });
27
+ }
28
+ return filter;
29
+ }
30
+ const list = useCreateListDataState({
31
+ filterDefaults: {
32
+ filters: filters(),
33
+ includes: "tags,permissions",
34
+ },
35
+ }, [officersRegisterId]);
36
+ useAutoUpdateListData(list, (d) => d.parentId === officersRegisterId);
37
+ useRenderOnChange(() => list.filters.options);
38
+ useOfficerListEffect(list, (result, total) => {
39
+ list.union(result);
40
+ setTotalCount(total !== null && total !== void 0 ? total : 0);
41
+ }, {
42
+ Total: true,
43
+ ...list.filters.options,
44
+ });
45
+ async function onSave(unit) {
46
+ /** SelectLegalContactDialog 选择/新增有identity信息的unit */
47
+ if (unit) {
48
+ const res = await officerStore.create({
49
+ data: { RegisterId: officersRegisterId, UnitId: unit[0].id, Position: state.position },
50
+ error: "message",
51
+ });
52
+ list.union([res]);
53
+ }
54
+ state.addAble = false;
55
+ }
56
+ const handleDelete = () => {
57
+ Modal.confirm({
58
+ title: "Confirm Delete",
59
+ content: "Are you sure you want to delete this register?",
60
+ okText: "Delete",
61
+ cancelText: "Cancel",
62
+ onOk: () => onDelete === null || onDelete === void 0 ? void 0 : onDelete(corporateId, officersRegisterId),
63
+ });
64
+ };
65
+ return observe(() => (React.createElement(React.Fragment, null,
66
+ React.createElement(ListDataContext.Provider, { value: list }, children({
67
+ list,
68
+ state,
69
+ dataSource: list.data.map((e, i) => {
70
+ return { key: i, ...e };
71
+ }),
72
+ totalCount,
73
+ setVisible,
74
+ handleDelete,
75
+ corporate,
76
+ user,
77
+ })),
78
+ state.addAble && (React.createElement(UnitsSelectDialog, { type: "click", multiSelect: false, onSelect: onSave, onCancel: () => {
79
+ state.addAble = false;
80
+ } })),
81
+ visible && (React.createElement(SelectOfficerForm, { parentId: officersRegisterId, onCancel: () => setVisible(false) })),
82
+ state.visibleQuickView && (React.createElement(OfficerQuickViewDialog, { id: state.quickId, visible: true, onCancel: () => {
83
+ state.visibleQuickView = false;
84
+ } })))));
85
+ };
86
+ export default OfficerRegisterContainer;
87
+ //# sourceMappingURL=OfficerRegisterContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OfficerRegisterContainer.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/components/OfficerTableListCard/OfficerRegisterContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,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EAAE;gBACd,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC;YAChC,CAAC,GACA,CACF,CACC,CACH,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -1,25 +1,4 @@
1
- import React, { ReactNode } from "react";
2
- import { ListHeaderToolProps } from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
3
- import "./index.css";
4
- export type OfficerListProps = {
5
- officersRegisterId: string;
6
- corporateId: string;
7
- /** 是否显示 send notice */
8
- sendForm?: boolean;
9
- isFilterPresent?: boolean;
10
- tableCardProps?: {
11
- className?: string;
12
- isHeader?: boolean;
13
- title?: ReactNode;
14
- };
15
- /** 头部的btn显示默认样式 还是 card 的样式; 是否是card */
16
- type?: "card";
17
- /** 是否显示详细的table内容 */
18
- tableDetail?: boolean;
19
- listHeaderToolProps?: ListHeaderToolProps;
20
- onRedirect?: () => void;
21
- onSelectCorporateUnit?: (params?: any) => void;
22
- onDelete?: (corporateId: string, officerRegisterId: string) => void;
23
- };
24
- declare const OfficerTableListCard: (props: OfficerListProps) => React.JSX.Element;
1
+ import React from "react";
2
+ import { OfficerTableListProps } from "./OfficerRegisterContainer";
3
+ declare const OfficerTableListCard: (props: OfficerTableListProps) => React.JSX.Element;
25
4
  export default OfficerTableListCard;
@@ -1,98 +1,27 @@
1
- import React, { useState, useRef, useEffect } from "react";
2
- import TableCellDetail, { columnsListDetail } from "./TableCellDetail";
3
- import TableCellSimple, { columnsSimpleList } from "./TableCellSimple";
4
- import TableCell, { columnsList } from "./TableCell";
5
- import { Badge, Button, Menu, Dropdown, Modal } from "antd";
6
- import { State } from "./state";
7
- import { useCorporate } from "../../../../../../data/corporate";
8
- import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
9
- import { useOfficerListEffect, useOfficerStore } from "../../../../../../data/officer";
10
- import { useDeepMemo, useApplicationContext } from "@voplus/morpho-data";
11
- import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
12
- import { faPrintSolid, faEllipsisVerticalSolid, faTrashSolid, FontAwesomeIcon as FAIcon, } from "@voplus/morpho-ui/es/faIcons";
13
- import { useAutoUpdateListData } from "@voplus/morpho-document-core";
14
- import { observe, useRenderOnChange, useAsideContentContext } from "@voplus/morpho-ui";
1
+ import React from "react";
15
2
  import DocumentTableListCard from "@voplus/morpho-ui/es/components/DocumentTableListCard";
3
+ import Scrollbars from "react-custom-scrollbars-2";
4
+ import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
5
+ import OfficerStatusFilter from "../../controls/OfficerStatusFilter";
6
+ import TableCell, { columnsList } from "./TableCell";
16
7
  import TableListCard from "@voplus/morpho-ui/es/components/TableListCard";
17
- import UnitsSelectDialog from "@voplus/morpho-org/es/components/UnitsSelectDialog";
8
+ import { observe } from "@voplus/morpho-ui";
18
9
  import AddDropDown2 from "@voplus/morpho-ui/es/components/layout/ListView/controls/AddDropDown2";
19
- import OfficerStatusFilter from "../../controls/OfficerStatusFilter";
20
- import OfficerPropertiesView from "../OfficerPropertiesView";
21
- import OfficerQuickViewDialog from "../OfficerQuickView";
22
- import SelectOfficerForm from "../SelectOfficerForm";
23
- import Scrollbars from "react-custom-scrollbars-2";
24
- import classnames from "classnames";
25
- import "./index.css";
10
+ import { Badge, Menu, Button } from "antd";
11
+ import OfficerRegisterContainer from "./OfficerRegisterContainer";
26
12
  const OfficerTableListCard = (props) => {
27
- const { officersRegisterId, corporateId, isFilterPresent, tableDetail } = props;
28
- const { user } = useApplicationContext();
29
- const [visible, setVisible] = useState(false);
30
- const [officerTotal, setOfficerTotal] = useState(0);
31
- const [height, setHeight] = useState(0);
32
- const ref = useRef(null);
33
- const officerStore = useOfficerStore();
34
- const asideContext = useAsideContentContext();
35
- const corporate = useCorporate(corporateId, { includes: "permissions" });
36
- const state = useDeepMemo(() => new State(), [officersRegisterId]);
37
- /** 建立 ListView 和useDocumentListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
38
- const list = useCreateListDataState({
39
- filterDefaults: {
40
- filters: filters(),
41
- includes: "tags,permissions",
42
- },
43
- }, [officersRegisterId]);
44
- useEffect(() => {
45
- if (ref.current) {
46
- setHeight(ref.current.offsetHeight);
47
- }
48
- }, [ref]);
49
- /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
50
- useAutoUpdateListData(list, (d) => d.parentId === officersRegisterId);
51
- useRenderOnChange(() => list.filters.options);
52
- /** 把ListDataState传给useOfficerListEffect,使之可以自動更新loading, hasmore. */
53
- useOfficerListEffect(list, (result, total) => {
54
- list.union(result);
55
- setOfficerTotal(total !== null && total !== void 0 ? total : 0);
56
- }, {
57
- Total: true,
58
- ...list.filters.options,
59
- });
60
- // spec:1777 — CSP: Officers table header offers Send Form, Print, and Delete Register actions only with edit permission
61
- const items = [
62
- {
63
- key: "print",
64
- label: (React.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: window.location.origin + `/officer/print/${corporateId}` }, "Print")),
65
- icon: React.createElement(FAIcon, { icon: faPrintSolid }),
66
- },
67
- {
68
- key: "delete-register",
69
- label: React.createElement("span", null, "Delete"),
70
- icon: React.createElement(FAIcon, { icon: faTrashSolid }),
71
- onClick: () => {
72
- Modal.confirm({
73
- title: "Confirm Delete",
74
- content: "Are you sure you want to delete this register?",
75
- okText: "Delete",
76
- cancelText: "Cancel",
77
- onOk: () => { var _a; return (_a = props.onDelete) === null || _a === void 0 ? void 0 : _a.call(props, corporateId, officersRegisterId); },
78
- });
79
- },
80
- },
81
- ];
82
- return observe(() => (React.createElement(React.Fragment, null,
83
- React.createElement(ListDataContext.Provider, { value: list },
84
- React.createElement(DocumentTableListCard, { isHeader: true, header: React.createElement(ListHeaderTool, { addAble: false, sortable: false, searchHeader: false, className: classnames("officer-table-list-header", { card: props.type === "card" }),
13
+ return observe(() => (React.createElement(OfficerRegisterContainer, { ...props, children: ({ state, totalCount, setVisible, handleDelete, corporate, user }) => {
14
+ return (React.createElement(DocumentTableListCard, { isHeader: true, header: React.createElement(ListHeaderTool, { addAble: false, sortable: false, searchHeader: false, className: "officer-table-list-header card",
85
15
  // spec:1778 — CSP: Active officers register defaults to a Present-only filter
86
16
  filterViewProps: {
87
17
  columns: [
88
- React.createElement(OfficerStatusFilter, { key: "OfficerStatusFilter", defaultValue: isFilterPresent ? ["Yes"] : [] }),
18
+ React.createElement(OfficerStatusFilter, { key: "OfficerStatusFilter", defaultValue: props.isFilterPresent ? ["Yes"] : [] }),
89
19
  ],
90
20
  }, preExtra: () => (React.createElement("div", { className: "title" },
91
21
  "Officers Register",
92
22
  " ",
93
- officerTotal ? React.createElement(Badge, { count: officerTotal, overflowCount: 99 }) : null)), rightExtra: () => (React.createElement(React.Fragment, null,
94
- props.type !== "card" && user.can("edit", corporate.p) && (React.createElement(Button, { className: "send-form-btn", onClick: () => setVisible(true) }, "Send Form")),
95
- user.can("edit", corporate.p) && (React.createElement(AddDropDown2, { trigger: ["click"], btnType: props.type === "card" ? "icon" : "text", overlay: React.createElement(Menu, { onClick: state.onSelect, items: [
23
+ totalCount ? React.createElement(Badge, { count: totalCount, overflowCount: 99 }) : null)), rightExtra: () => (React.createElement(React.Fragment, null,
24
+ user.can("edit", corporate.p) && (React.createElement(AddDropDown2, { trigger: ["click"], btnType: "icon", overlay: React.createElement(Menu, { onClick: state.onSelect, items: [
96
25
  { key: "Director", label: "Director" },
97
26
  { key: "Managing Director", label: "Managing Director" },
98
27
  { key: "Nominee Director", label: "Nominee Director" },
@@ -104,22 +33,15 @@ const OfficerTableListCard = (props) => {
104
33
  { key: "Auditor", label: "Auditor" },
105
34
  { key: "Manager", label: "Manager" },
106
35
  ] }) })),
107
- props.type !== "card" && user.can("edit", corporate.p) && (React.createElement(Dropdown, { classNames: { root: "officer-table-list-dropdown" }, trigger: ["click", "hover"], menu: { items } },
108
- React.createElement(Button, null,
109
- React.createElement(FAIcon, { icon: faEllipsisVerticalSolid })))),
110
- props.type === "card" && user.can("edit", corporate.p) && (React.createElement(Button, { className: "send-form-btn", onClick: () => setVisible(true) }, "Send Form")))), ...props.listHeaderToolProps }) },
111
- React.createElement("div", { ref: ref, className: "officer-table-list-card", style: { height: props.type === "card" ? 298 : "100%" } },
36
+ user.can("edit", corporate.p) && (React.createElement(Button, { className: "send-form-btn", onClick: () => setVisible(true) }, "Send Form")))) }) },
37
+ React.createElement("div", { className: "officer-table-list-card", style: { height: 298 } },
112
38
  React.createElement(Scrollbars, { autoHide: true },
113
39
  React.createElement(TableListCard
114
40
  // spec:1774 — CSP: Officers table renders three column layouts depending on view density
115
41
  , {
116
42
  // spec:1774 — CSP: Officers table renders three column layouts depending on view density
117
43
  tableListProps: {
118
- columns: (tableDetail
119
- ? (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent)
120
- ? columnsSimpleList
121
- : columnsListDetail
122
- : columnsList).map((col) => {
44
+ columns: columnsList.map((col) => {
123
45
  return {
124
46
  ...col,
125
47
  onCell: (record, rowIndex) => {
@@ -132,62 +54,22 @@ const OfficerTableListCard = (props) => {
132
54
  };
133
55
  }),
134
56
  components: {
135
- body: {
136
- cell: tableDetail
137
- ? (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent)
138
- ? TableCellSimple
139
- : TableCellDetail
140
- : TableCell,
141
- },
57
+ body: { cell: TableCell },
142
58
  },
143
- scrollH: props.type === "card" ? 240 : height - 72,
59
+ scrollH: 240,
144
60
  // spec:1775 — CSP: Clicking an officer row opens an aside Properties panel or a Quick View dialog
145
61
  tableProps: {
146
62
  onRow: (record) => {
147
63
  return {
148
64
  onClick: (e) => {
149
- if (tableDetail) {
150
- asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(OfficerPropertiesView, { id: record.id }), {
151
- span: 12,
152
- });
153
- }
154
- else {
155
- state.quickId = record.id;
156
- state.visibleQuickView = true;
157
- }
65
+ state.quickId = record.id;
66
+ state.visibleQuickView = true;
158
67
  },
159
68
  };
160
69
  },
161
70
  },
162
- }, ...props.tableCardProps }))))),
163
- state.addAble && (React.createElement(UnitsSelectDialog, { type: "click", multiSelect: false, onSelect: onSave, onCancel: () => {
164
- state.addAble = false;
165
- } })),
166
- visible && (React.createElement(SelectOfficerForm, { parentId: officersRegisterId, onCancel: () => setVisible(false) })),
167
- state.visibleQuickView && (React.createElement(OfficerQuickViewDialog, { id: state.quickId, visible: true, onCancel: () => {
168
- state.visibleQuickView = false;
169
- } })))));
170
- function filters() {
171
- const filter = [
172
- { c: "ParentNodeId", o: "=", l: "And", v1: officersRegisterId },
173
- ];
174
- if (isFilterPresent) {
175
- filter.push({ c: "Present", o: "=", l: "And", v1: "Yes" });
176
- }
177
- return filter;
178
- }
179
- /** 新增officerItem */
180
- async function onSave(unit) {
181
- /** SelectLegalContactDialog 选择/新增有identity信息的unit */
182
- if (unit) {
183
- const res = await officerStore.create({
184
- data: { RegisterId: officersRegisterId, UnitId: unit[0].id, Position: state.position },
185
- error: "message",
186
- });
187
- list.union([res]);
188
- }
189
- state.addAble = false;
190
- }
71
+ } })))));
72
+ } })));
191
73
  };
192
74
  export default OfficerTableListCard;
193
75
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/components/OfficerTableListCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,eAAe,EAAE,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,eAAe,EAAE,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SA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,IAAmD;QACxE,qDAAqD;QACrD,IAAI,IAAI,EAAE,CAAC;YACV,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC;gBACrC,IAAI,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;gBACtF,KAAK,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,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/components/OfficerTableListCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,qBAAqB,MAAM,uDAAuD,CAAC;AAC1F,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,cAAc,MAAM,wEAAwE,CAAC;AACpG,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,aAAa,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,uEAAuE,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,wBAAmD,MAAM,4BAA4B,CAAC;AAE7F,MAAM,oBAAoB,GAAG,CAAC,KAA4B,EAAE,EAAE;IAC7D,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,wBAAwB,OACpB,KAAK,EACT,QAAQ,EAAE,CAAC,EAAE,KAAK,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E,EAAE;wCACjB,OAAO;4CACN,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gDACd,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC;gDAC1B,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;4CAC/B,CAAC;yCACD,CAAC;oCACH,CAAC;iCACD;6BACD,GACA,CACU,CACR,CACiB,CACxB,CAAC;QACH,CAAC,GACA,CACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,6 +1,4 @@
1
1
  import React from "react";
2
- import "./index.css";
3
- export declare function getColor(name: string): string;
4
2
  declare const OfficerStatusLabel: (props: {
5
3
  status?: string;
6
4
  className?: string;
@@ -1,46 +1,29 @@
1
1
  import React from "react";
2
2
  import classnames from "classnames";
3
- import "./index.css";
4
- import { Tooltip } from "antd";
5
- import { faBanSolid, faHourglassSolid, faPenSolid, faCircleCheckSolid, FontAwesomeIcon as FAIcon, } from "@voplus/morpho-ui/es/faIcons";
6
3
  import { observe } from "@voplus/morpho-ui";
7
- export function getColor(name) {
8
- let color = "";
9
- switch (name) {
10
- case "Present":
11
- color = "#217EB2";
12
- break;
13
- case "Need Identity":
14
- color = "#868686";
15
- break;
16
- case "Past":
17
- color = "#B22121";
18
- break;
19
- case "Draft":
20
- color = "#AA8900";
21
- break;
22
- default:
23
- break;
24
- }
25
- return color;
26
- }
27
4
  // spec:1770 — CSP: Officer status icon shows Present, Past, Need Identity, or Draft with distinct iconography
28
5
  const OfficerStatusLabel = (props) => {
29
- var _a;
30
- const item = transformStatus((_a = props.status) !== null && _a !== void 0 ? _a : "");
31
- return observe(() => (React.createElement(Tooltip, { title: item.displayName, color: getColor(item.displayName) },
32
- React.createElement("span", { className: classnames("officer-status-button2", props.className, item.colorName) }, item.displayName ? (React.createElement(React.Fragment, null,
33
- item.displayName === "Present" && (React.createElement(FAIcon, { icon: faCircleCheckSolid, color: getColor(item.displayName) })),
34
- item.displayName === "Need Identity" && (React.createElement(FAIcon, { icon: faBanSolid, color: getColor(item.displayName) })),
35
- item.displayName === "Past" && (React.createElement(FAIcon, { icon: faHourglassSolid, color: getColor(item.displayName) })),
36
- item.displayName === "Draft" && (React.createElement(FAIcon, { icon: faPenSolid, color: getColor(item.displayName) })))) : null))));
37
- function transformStatus(name, displayName) {
38
- return {
39
- name: name,
40
- displayName: displayName || (name === null || name === void 0 ? void 0 : name.split(/(?=[A-Z])/).join(" ")),
41
- colorName: `${name === null || name === void 0 ? void 0 : name.split(/(?=[A-Z])/).join("-").toLowerCase()}`,
6
+ const { status, className } = props;
7
+ return observe(() => {
8
+ const getColors = () => {
9
+ switch (status === null || status === void 0 ? void 0 : status.replace(/\s+/g, "")) {
10
+ case "Present":
11
+ return { text: "text-green-data", dot: "bg-green-data" };
12
+ case "Need Identity":
13
+ return { text: "text-brown-data", dot: "bg-brown-data" };
14
+ case "Past":
15
+ return { text: "text-bg-red", dot: "bg-bg-red" };
16
+ case "Draft":
17
+ return { text: "text-font-grey", dot: "bg-font-grey" };
18
+ default:
19
+ return { text: "text-font-grey", dot: "bg-font-grey" };
20
+ }
42
21
  };
43
- }
22
+ const colors = getColors();
23
+ return status ? (React.createElement("span", { className: classnames("inline-flex items-center gap-1 py-1 rounded-xl text-xs font-bold uppercase", colors.text, className) },
24
+ React.createElement("i", { className: classnames("inline-block w-1.5 h-1.5 rounded-full", colors.dot) }),
25
+ React.createElement("span", null, status))) : (React.createElement("span", { className: "text-font-primary" }, "__"));
26
+ });
44
27
  };
45
28
  export default OfficerStatusLabel;
46
29
  //# sourceMappingURL=OfficerStatusLabel2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OfficerStatusLabel2.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/controls/OfficerStatusLabel/OfficerStatusLabel2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,aAA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IAAI,CAAC,WAAW,KAAK,eAAe,IAAI,CACxC,oBAAC,MAAM,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAI,CAC/D;YACA,IAAI,CAAC,WAAW,KAAK,MAAM,IAAI,CAC/B,oBAAC,MAAM,IAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAI,CACrE;YACA,IAAI,CAAC,WAAW,KAAK,OAAO,IAAI,CAChC,oBAAC,MAAM,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAI,CAC/D,CACC,CACH,CAAC,CAAC,CAAC,IAAI,CACF,CACE,CACV,CAAC,CAAC;IAEH,SAAS,eAAe,CAAC,IAAY,EAAE,WAAoB;QAC1D,OAAO;YACN,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,WAAW,KAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;YAC9D,SAAS,EAAE,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CACf,KAAK,CAAC,WAAW,EAClB,IAAI,CAAC,GAAG,EACR,WAAW,EAAE,EAAE;SACjB,CAAC;IACH,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"OfficerStatusLabel2.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer-register/controls/OfficerStatusLabel/OfficerStatusLabel2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,8GAA8G;AAC9G,MAAM,kBAAkB,GAAG,CAAC,KAA8C,EAAE,EA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: string;
5
+ membersRegisterId?: string;
6
+ officersRegisterId?: string;
7
+ shareTransactionId?: string;
8
+ url: string;
9
+ }) => React.JSX.Element;
10
+ export default RegisterTablePage;
@@ -0,0 +1,151 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import { Tabs, Menu, message } from "antd";
3
+ import { useCorporate, useCorporateStore } from "../../../../../data/corporate";
4
+ import { faShieldHalvedSolid, faUsersSolid, faComputerMouseSolid, faCoinsSolid, } from "@voplus/morpho-ui/es/faIcons";
5
+ import { useLayout } from "@voplus/morpho-data";
6
+ import { useParams } from "react-router-dom";
7
+ import { FontAwesomeIcon as FAIcon } from "@voplus/morpho-ui/es/faIcons";
8
+ import PageHeadDashboard from "@voplus/morpho-ui/es/components/layout/headers/PageHeadDashboard";
9
+ import MemberTableList from "../../member-register/components/MemberTableList";
10
+ import ControllerTableList from "../../controller-register/components/ControllerTableList";
11
+ import OfficerTableList from "../../officer-register/components/OfficerTableList";
12
+ import AddDropDown from "@voplus/morpho-ui/es/components/layout/ListView/controls/AddDropDown2";
13
+ import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
14
+ import { State } from "../../../../../components/CorporateNavMenu/state";
15
+ import { ConfigProvider } from "antd";
16
+ import antdTheme from "@voplus/morpho-theme/antdTheme";
17
+ import { observe } from "@voplus/morpho-ui";
18
+ const RegisterTablePage = (props) => {
19
+ const { corporateId, controllerRegisterId, membersRegisterId, officersRegisterId, shareTransactionId, url, } = props;
20
+ const layout = useLayout();
21
+ const params = useParams();
22
+ const store = useCorporateStore();
23
+ const [asideContext] = useState(AsideContent.createContext());
24
+ const [loaded, setLoaded] = useState(true);
25
+ const [activeKey, setActiveKey] = useState("");
26
+ const [state] = useState(new State(corporateId));
27
+ const corporate = useCorporate(corporateId, { includes: "registers" });
28
+ const pStatus = params.status
29
+ ? params.status
30
+ : controllerRegisterId
31
+ ? "controller"
32
+ : membersRegisterId
33
+ ? "members"
34
+ : officersRegisterId
35
+ ? "officers"
36
+ : shareTransactionId
37
+ ? "shareTransactions"
38
+ : "";
39
+ useEffect(() => {
40
+ setActiveKey(pStatus);
41
+ }, [pStatus]);
42
+ useEffect(() => {
43
+ state.update(corporate);
44
+ }, [corporate.registers]);
45
+ // 顶部卡片数据
46
+ const statCards = [
47
+ {
48
+ title: "TOTAL REGISTERS",
49
+ value: "24",
50
+ icon: React.createElement(FAIcon, { icon: faUsersSolid, className: "text-font-secondary text-2xl" }),
51
+ borderColor: "border-font-secondary",
52
+ textColor: "text-font-secondary",
53
+ bgIcon: "bg-bg-blue-data",
54
+ },
55
+ {
56
+ title: "VERIFICATION RATES",
57
+ value: "92%",
58
+ icon: React.createElement(FAIcon, { icon: faShieldHalvedSolid, className: "text-green-data text-2xl" }),
59
+ borderColor: "border-green-data",
60
+ textColor: "text-green-data",
61
+ bgIcon: "bg-bg-green-data",
62
+ },
63
+ {
64
+ title: "PENDING ACTIONS",
65
+ value: "03",
66
+ icon: React.createElement(FAIcon, { icon: faComputerMouseSolid, className: "text-brown-data text-2xl" }),
67
+ borderColor: "border-brown-data",
68
+ textColor: "text-brown-data",
69
+ bgIcon: "bg-bg-brown-data",
70
+ },
71
+ ];
72
+ return observe(() => {
73
+ var _a;
74
+ return (React.createElement(ConfigProvider, { theme: antdTheme },
75
+ React.createElement(AsideContent, { context: asideContext },
76
+ React.createElement("div", { className: "flex flex-col h-full" },
77
+ React.createElement(PageHeadDashboard, { avatarIcon: React.createElement(FAIcon, { icon: faCoinsSolid }), title: "Corporate Stakeholder Registry", description: "Effortlessly Manage and Track Controller, Officers, and Company Members" }),
78
+ React.createElement("div", { className: "p-6 bg-bg-blue h-full overflow-hidden font-sans flex flex-col gap-6" },
79
+ React.createElement("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 shrink-0" }, statCards.map((card, idx) => (React.createElement("div", { key: idx, className: `bg-white rounded-lg p-5 shadow-sm border-l-8 ${card.borderColor} flex items-center gap-5.5` },
80
+ React.createElement("div", { className: `w-14 h-14 flex items-center justify-center rounded-lg ${card.bgIcon}` }, card.icon),
81
+ React.createElement("div", null,
82
+ React.createElement("div", { className: "text-font-primary text-sm font-semibold mb-1 uppercase" }, card.title),
83
+ React.createElement("div", { className: `${card.textColor} text-2xl font-bold` }, card.value)))))),
84
+ React.createElement("div", { className: "flex-1 bg-white rounded-lg shadow-sm border border-border overflow-hidden" },
85
+ React.createElement(Tabs, { activeKey: activeKey, onChange: onChange, className: "w-full h-full -mb-px [&_.ant-tabs-nav]:bg-bg-table! [&_.ant-tabs-nav]:m-0! [&_.ant-tabs-tab]:px-3! [&_.ant-tabs-tab-active_.ant-tabs-tab-btn]:text-font-secondary! [&_.ant-tabs-ink-bar]:bg-font-secondary! [&_.ant-tabs-tab]:text-font-primary! [&_.ant-tabs-tab:hover]:text-font-secondary!", items: [
86
+ ...(controllerRegisterId
87
+ ? [
88
+ {
89
+ key: "controller",
90
+ label: (React.createElement("div", { className: "font-semibold text-sm py-1.5 px-8" }, "Controller")),
91
+ children: loaded ? (React.createElement(ControllerTableList, { controllerRegisterId: controllerRegisterId, corporateId: corporateId, onReload: onReload, onDelete: () => onDeleteRegister(corporateId, controllerRegisterId) })) : null,
92
+ },
93
+ ]
94
+ : []),
95
+ ...(membersRegisterId
96
+ ? [
97
+ {
98
+ key: "members",
99
+ label: React.createElement("div", { className: "font-semibold text-sm py-1.5 px-8" }, "Members"),
100
+ children: (React.createElement(MemberTableList, { membersRegisterId: membersRegisterId, corporateId: corporateId, onDelete: () => onDeleteRegister(corporateId, membersRegisterId) })),
101
+ },
102
+ ]
103
+ : []),
104
+ ...(officersRegisterId
105
+ ? [
106
+ {
107
+ key: "officers",
108
+ label: React.createElement("div", { className: "font-semibold text-sm py-1.5 px-8" }, "Officers"),
109
+ children: (React.createElement(OfficerTableList, { officersRegisterId: officersRegisterId, corporateId: corporateId, onDelete: () => onDeleteRegister(corporateId, officersRegisterId) })),
110
+ },
111
+ ]
112
+ : []),
113
+ ], tabBarExtraContent: React.createElement("div", { className: "pr-7" },
114
+ React.createElement(AddDropDown, { trigger: ["click"], btnType: React.createElement("button", { type: "button", className: "underline-button uppercase" }, "ADD REGISTER"), overlay: React.createElement(Menu, { onClick: (e) => onAddRegister(e.key), items: (_a = state.addRegister) === null || _a === void 0 ? void 0 : _a.map((r, i) => {
115
+ return {
116
+ key: r.name,
117
+ label: React.createElement(React.Fragment, null,
118
+ "Register of ",
119
+ r.label),
120
+ disabled: r.name !== "OfficersRegister" &&
121
+ r.name !== "ShareTransactionsRegister" &&
122
+ r.name !== "MembersRegister" &&
123
+ r.name !== "ControllerRegister"
124
+ ? true
125
+ : false,
126
+ };
127
+ }) }) })) })))))));
128
+ });
129
+ function onReload() {
130
+ setLoaded(false);
131
+ setTimeout(() => {
132
+ setLoaded(true);
133
+ }, 100);
134
+ }
135
+ function onChange(key) {
136
+ layout.history.push(`${url}/registers/${key}`);
137
+ }
138
+ async function onAddRegister(name) {
139
+ const data = await store.register(corporateId, name, {
140
+ error: (error) => message.error(error.message),
141
+ });
142
+ state.update(data);
143
+ }
144
+ async function onDeleteRegister(corporateId, registerId) {
145
+ await store.registersDelete(corporateId, registerId, {
146
+ error: (error) => message.error(error.message),
147
+ });
148
+ }
149
+ };
150
+ export default RegisterTablePage;
151
+ //# sourceMappingURL=index.js.map