@voplus/morpho-csp 10.0.5 → 10.0.6

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 (64) 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 +127 -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/page/RegisterTablePage/index.d.ts +8 -1
  45. package/es/page/RegisterTablePage/index.js +117 -32
  46. package/es/page/RegisterTablePage/index.js.map +1 -1
  47. package/package.json +1 -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
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { TableProps } from "antd";
3
+ /**
4
+ * 通用注册表单/列表组件属性接口。
5
+ * 抽离了计算表格容器高度和无限滚动的公共逻辑。
6
+ */
7
+ export interface RegisterTableProps<T extends {
8
+ id?: string;
9
+ }> extends Omit<TableProps<T>, "dataSource" | "columns"> {
10
+ /** 表格数据源 */
11
+ dataSource: T[];
12
+ /** 表格列定义 */
13
+ columns: TableProps<T>["columns"];
14
+ /** 加载中状态 */
15
+ loading?: boolean;
16
+ /** 触发加载下一页的回调 */
17
+ onLoadMore?: () => void;
18
+ /** 是否还有更多数据 */
19
+ hasMore?: boolean;
20
+ /** 行点击事件,用于打开侧边详情栏等操作 */
21
+ onRowClick?: (record: T) => void;
22
+ }
23
+ /**
24
+ * 具有无限滚动和自动适应高度功能的基于 antd Table 的列表组件。
25
+ * 会自动监听页面容器的高度,计算可容纳的Table Body高度并将其绑定给 `scroll={{ y: xxx }}` 以实现表头固定。
26
+ * 监听滚动到底部以触发分页加载。
27
+ */
28
+ declare function RegisterTable<T extends {
29
+ id?: string;
30
+ }>(props: RegisterTableProps<T>): React.JSX.Element;
31
+ export default RegisterTable;
@@ -0,0 +1,55 @@
1
+ import React, { useState, useRef, useEffect } from "react";
2
+ import { Table } from "antd";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ /**
5
+ * 具有无限滚动和自动适应高度功能的基于 antd Table 的列表组件。
6
+ * 会自动监听页面容器的高度,计算可容纳的Table Body高度并将其绑定给 `scroll={{ y: xxx }}` 以实现表头固定。
7
+ * 监听滚动到底部以触发分页加载。
8
+ */
9
+ function RegisterTable(props) {
10
+ const { dataSource, columns, loading, onLoadMore, hasMore, onRowClick, components, ...rest } = props;
11
+ const [tableScrollY, setTableScrollY] = useState(200);
12
+ const tableContainerRef = useRef(null);
13
+ // 监听容器高度变化来动态设置表格的 scroll.y
14
+ useEffect(() => {
15
+ const observer = new ResizeObserver((entries) => {
16
+ for (let entry of entries) {
17
+ const height = entry.contentRect.height;
18
+ // 表头高度约56px,减去表头即为Table Body的可用高度
19
+ setTableScrollY(Math.max(height - 56, 100));
20
+ }
21
+ });
22
+ if (tableContainerRef.current) {
23
+ observer.observe(tableContainerRef.current);
24
+ }
25
+ return () => observer.disconnect();
26
+ }, []);
27
+ // 处理滚动事件,触底则加载下一页
28
+ const handleScroll = (e) => {
29
+ var _a;
30
+ const target = e.target;
31
+ if ((_a = target.classList) === null || _a === void 0 ? void 0 : _a.contains("ant-table-body")) {
32
+ const { scrollTop, scrollHeight, clientHeight } = target;
33
+ if (scrollTop + clientHeight >= scrollHeight - 20) {
34
+ if (hasMore && !loading && onLoadMore) {
35
+ onLoadMore();
36
+ }
37
+ }
38
+ }
39
+ };
40
+ return observe(() => (React.createElement("div", { ref: tableContainerRef, className: "flex-1 overflow-hidden", onScrollCapture: handleScroll },
41
+ React.createElement(Table, { columns: columns, dataSource: dataSource, loading: loading, scroll: { y: tableScrollY }, components: components, onRow: (record) => {
42
+ var _a;
43
+ return {
44
+ className: "group/row",
45
+ onClick: () => {
46
+ if (onRowClick) {
47
+ onRowClick(record);
48
+ }
49
+ },
50
+ ...(_a = rest.onRow) === null || _a === void 0 ? void 0 : _a.call(rest, record),
51
+ };
52
+ }, pagination: false, className: "whitespace-nowrap [&_.ant-table-thead_>_tr_>_th]:p-5! [&_.ant-table-thead_>_tr_>_th]:text-xs! [&_.ant-table-thead_>_tr_>_th]:uppercase! [&_.ant-table-thead_>_tr_>_th]:font-bold! [&_.ant-table-thead_>_tr_>_th]:text-font-primary! [&_.ant-table-thead_>_tr_>_th]:bg-bg-table!", rowClassName: "group", rowKey: "id", ...rest }))));
53
+ }
54
+ export default RegisterTable;
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/RegisterTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAc,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB5C;;;;GAIG;AACH,SAAS,aAAa,CAA4B,KAA4B;IAC7E,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,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CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,6BAAK,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAC,wBAAwB,EAAC,eAAe,EAAE,YAAY;QAC5F,oBAAC,KAAK,IACL,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,EAAE,CAAC,EAAE,YAAY,EAAE,EAC3B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE;;gBACjB,OAAO;oBACN,SAAS,EAAE,WAAW;oBACtB,OAAO,EAAE,GAAG,EAAE;wBACb,IAAI,UAAU,EAAE,CAAC;4BAChB,UAAU,CAAC,MAAM,CAAC,CAAC;wBACpB,CAAC;oBACF,CAAC;oBACD,GAAG,MAAA,IAAI,CAAC,KAAK,qDAAG,MAAM,CAAC;iBACvB,CAAC;YACH,CAAC,EACD,UAAU,EAAE,KAAK,EACjB,SAAS,EAAC,iRAAiR,EAC3R,YAAY,EAAC,OAAO,EACpB,MAAM,EAAC,IAAI,KACP,IAAI,GACP,CACG,CACN,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ /**
3
+ * 状态标签组件的属性接口
4
+ */
5
+ interface StatusLabelProps {
6
+ /**
7
+ * 原始状态值,主要用于判定是否显示标签。
8
+ * 如果没有传入 `text`,则会将此值直接用于展示。
9
+ */
10
+ status?: string;
11
+ /**
12
+ * 覆盖默认状态的显示文本,可选项。
13
+ * 当需要实际显示的文案与后台返回的状态值 (status) 不一致时使用。
14
+ */
15
+ text?: string;
16
+ /** 组件的容器自定义 className */
17
+ className?: string;
18
+ /**
19
+ * 定义标签的各项颜色 Tailwind 类名
20
+ */
21
+ colors: {
22
+ /** 标签整体背景颜色类名 */
23
+ bg: string;
24
+ /** 标签文本颜色类名 */
25
+ text: string;
26
+ /** 前侧状态小圆点颜色类名 */
27
+ dot: string;
28
+ };
29
+ }
30
+ /**
31
+ * 通用状态 UI 组件 (共用部分提炼)。
32
+ * 根据不同的状态显示不同的文字和对应的主题色(带有左侧实心小圆点的胶囊样式)。
33
+ * 常用于 MemberRegister、ControllerRegister 等列表或详情处的状态呈现。
34
+ */
35
+ declare const StatusLabel: (props: StatusLabelProps) => React.JSX.Element;
36
+ export default StatusLabel;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import classnames from "classnames";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ /**
5
+ * 通用状态 UI 组件 (共用部分提炼)。
6
+ * 根据不同的状态显示不同的文字和对应的主题色(带有左侧实心小圆点的胶囊样式)。
7
+ * 常用于 MemberRegister、ControllerRegister 等列表或详情处的状态呈现。
8
+ */
9
+ const StatusLabel = (props) => {
10
+ const { status, text, className, colors } = props;
11
+ return observe(() => (React.createElement("span", { className: classnames("inline-flex items-center gap-1 px-2.5 py-1 rounded-xl text-[10px] font-bold uppercase", colors.bg, colors.text, className) }, status ? (React.createElement(React.Fragment, null,
12
+ React.createElement("i", { className: classnames("inline-block w-1.5 h-1.5 rounded-full", colors.dot) }),
13
+ React.createElement("span", null, text || status))) : null)));
14
+ };
15
+ export default StatusLabel;
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/StatusLabel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA+B5C;;;;GAIG;AACH,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC/C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAElD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,8BACC,SAAS,EAAE,UAAU,CACpB,uFAAuF,EACvF,MAAM,CAAC,EAAE,EACT,MAAM,CAAC,IAAI,EACX,SAAS,CACT,IAEA,MAAM,CAAC,CAAC,CAAC,CACT;QACC,2BAAG,SAAS,EAAE,UAAU,CAAC,uCAAuC,EAAE,MAAM,CAAC,GAAG,CAAC,GAAI;QACjF,kCAAO,IAAI,IAAI,MAAM,CAAQ,CAC3B,CACH,CAAC,CAAC,CAAC,IAAI,CACF,CACP,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import "./index.css";
3
2
  export declare const columnsList: ({
4
3
  title: React.JSX.Element;
5
4
  dataIndex: string;
@@ -13,5 +12,18 @@ export declare const columnsList: ({
13
12
  dataIndex: string;
14
13
  width: string;
15
14
  })[];
15
+ export declare const columnsSimpleList: ({
16
+ title: React.JSX.Element;
17
+ dataIndex: string;
18
+ width: string;
19
+ } | {
20
+ title: React.JSX.Element;
21
+ dataIndex: string;
22
+ width?: undefined;
23
+ } | {
24
+ title: string;
25
+ dataIndex: string;
26
+ width: string;
27
+ })[];
16
28
  declare const TableCell: (props: any) => React.JSX.Element;
17
29
  export default TableCell;
@@ -1,50 +1,74 @@
1
1
  import React from "react";
2
- import { faEllipsisVerticalSolid, faEnvelopeSolid, faPhoneSolid, faBarsProgressSolid, faUserGroupSolid, faCalendarDaysSolid, FontAwesomeIcon as FAIcon, } from "@voplus/morpho-ui/es/faIcons";
2
+ import { faEllipsisVerticalSolid, faEnvelopeSolid, faPhoneSolid, faCalendarXmarkSolid, faUserGroupSolid, faCalendarCheckSolid, faCalendarDaysSolid, faCalendarSolid, faUserSolid, faCertificateSolid, FontAwesomeIcon as FAIcon, } from "@voplus/morpho-ui/es/faIcons";
3
3
  import { Tooltip } from "antd";
4
- import { observe } from "@voplus/morpho-ui";
4
+ import { observe, useAsideContentContext } from "@voplus/morpho-ui";
5
5
  import { Open } from "@voplus/morpho-document-core/es/controls/ToolBar/buttons";
6
6
  import { useControllerStore, useController } from "../../../../../../data/controller";
7
7
  import UnitAvatar from "@voplus/morpho-org/es/components/UnitAvatar/LoadedUnitAvatar";
8
8
  import UnitNameNoteAlert from "@voplus/morpho-org/es/components/UnitNameNoteAlert";
9
9
  import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
10
10
  import IdentityStatus from "@voplus/morpho-org/es/modules/verification/IdentityStatus/IdentityStatus2";
11
- import TagView from "@voplus/morpho-org/es/modules/tag/TagView/TagView2";
12
11
  import CompanyControllerMenu from "../../../controls/CompanyRegisterMenu";
13
12
  import ControllerStatusLabel from "../../controls/ControllerStatusLabel/ControllerStatusLabel2";
14
13
  import ToolBar from "@voplus/morpho-document-core/es/controls/ToolBar";
15
14
  import classnames from "classnames";
16
- import "./index.css";
17
15
  export const columnsList = [
18
16
  {
19
17
  title: (React.createElement(React.Fragment, null,
20
- React.createElement(FAIcon, { icon: faUserGroupSolid }),
21
- " Controllers Name")),
18
+ React.createElement(FAIcon, { icon: faUserSolid }),
19
+ " \u00A0Controllers Name")),
22
20
  dataIndex: "name",
23
21
  width: "32%",
24
22
  },
25
23
  {
26
24
  title: (React.createElement(React.Fragment, null,
27
- React.createElement(FAIcon, { icon: faCalendarDaysSolid }),
28
- " Appointment")),
25
+ React.createElement(FAIcon, { icon: faCalendarSolid }),
26
+ " \u00A0Appointment")),
29
27
  dataIndex: "appointment",
30
28
  },
31
29
  {
32
30
  title: (React.createElement(React.Fragment, null,
33
- React.createElement(FAIcon, { icon: faCalendarDaysSolid }),
34
- " Cease")),
31
+ React.createElement(FAIcon, { icon: faCalendarXmarkSolid }),
32
+ " \u00A0Cease")),
35
33
  dataIndex: "cease",
36
34
  },
37
35
  {
38
36
  title: (React.createElement(React.Fragment, null,
39
- React.createElement(FAIcon, { icon: faBarsProgressSolid }),
40
- " Confirmation Status")),
37
+ React.createElement(FAIcon, { icon: faCalendarCheckSolid }),
38
+ " \u00A0Confirmation")),
39
+ dataIndex: "confirmation",
40
+ },
41
+ {
42
+ title: (React.createElement(React.Fragment, null,
43
+ React.createElement(FAIcon, { icon: faCertificateSolid }),
44
+ " \u00A0Identity Status")),
45
+ dataIndex: "identity",
46
+ },
47
+ {
48
+ title: " ",
49
+ dataIndex: "menu",
50
+ width: "72px",
51
+ },
52
+ ];
53
+ export const columnsSimpleList = [
54
+ {
55
+ title: (React.createElement(React.Fragment, null,
56
+ React.createElement(FAIcon, { icon: faUserGroupSolid }),
57
+ " Controller Details")),
58
+ dataIndex: "details",
59
+ width: "40%",
60
+ },
61
+ {
62
+ title: (React.createElement(React.Fragment, null,
63
+ React.createElement(FAIcon, { icon: faCalendarCheckSolid }),
64
+ " \u00A0Confirmation")),
41
65
  dataIndex: "confirmation",
42
66
  },
43
67
  {
44
68
  title: (React.createElement(React.Fragment, null,
45
- React.createElement(FAIcon, { icon: faBarsProgressSolid }),
46
- " Identity Status & Tag")),
47
- dataIndex: "tags",
69
+ React.createElement(FAIcon, { icon: faCertificateSolid }),
70
+ " Identity Status")),
71
+ dataIndex: "identity",
48
72
  },
49
73
  {
50
74
  title: " ",
@@ -52,35 +76,66 @@ export const columnsList = [
52
76
  width: "72px",
53
77
  },
54
78
  ];
79
+ const renderDate = (date) => date ? (React.createElement(UTCShortDate, { value: date, format: "DD MMM YYYY", className: "text-sm text-font-primary font-semibold" })) : (React.createElement("span", { className: "text-font-primary" }, "__"));
55
80
  const TableCell = (props) => {
81
+ var _a;
56
82
  const { dataIndex, record, rowIndex, children, ...restProps } = props;
83
+ const isAside = (_a = useAsideContentContext()) === null || _a === void 0 ? void 0 : _a.asideContent;
57
84
  const store = useControllerStore();
58
85
  return observe(() => {
59
- var _a, _b, _c, _d, _e, _f, _g, _h;
60
86
  const controller = useController(record === null || record === void 0 ? void 0 : record.id, { reload: (d) => !d.tags, includes: "tags" });
61
- return (React.createElement("td", { ...restProps }, dataIndex === "name" ? (React.createElement("div", { className: "controller-table-item-info" },
62
- React.createElement(UnitAvatar, { unit: controller.contact }),
63
- React.createElement("div", { className: "controller-table-item-name" },
64
- ((_a = controller.identity) === null || _a === void 0 ? void 0 : _a.fullName) ? (controller.identity.fullName) : controller.contact ? (React.createElement(UnitNameNoteAlert, { id: controller.contact.id, name: controller.contact.name })) : null,
65
- React.createElement("div", { className: "controller-table-item-contact" },
66
- (controller.email || ((_b = controller.contact) === null || _b === void 0 ? void 0 : _b.email)) && (React.createElement("div", null,
67
- React.createElement("span", null,
68
- React.createElement(FAIcon, { icon: faEnvelopeSolid })),
69
- controller.email || ((_c = controller.contact) === null || _c === void 0 ? void 0 : _c.email))),
70
- (controller.phone || ((_d = controller.contact) === null || _d === void 0 ? void 0 : _d.phone)) && (React.createElement("div", null,
71
- React.createElement("span", null,
72
- React.createElement(FAIcon, { icon: faPhoneSolid })),
73
- controller.phone || ((_e = controller.contact) === null || _e === void 0 ? void 0 : _e.phone))))))) : dataIndex === "identity" ? (((_f = controller.identity) === null || _f === void 0 ? void 0 : _f.id) ? (React.createElement(IdentityStatus, { id: controller.identity.id })) : null) : dataIndex === "appointment" ? (React.createElement(UTCShortDate, { value: controller.appointment, format: "DD MMM YYYY" })) : dataIndex === "cease" ? (React.createElement(UTCShortDate, { value: controller.cease, format: "DD MMM YYYY" })) : dataIndex === "confirmation" ? (React.createElement(React.Fragment, null,
74
- React.createElement(Tooltip, { title: controller.confimrationDate ? (React.createElement(React.Fragment, null,
75
- "Confimration Date:",
76
- " ",
77
- React.createElement(UTCShortDate, { value: controller.confimrationDate, format: "DD MMM YYYY" }))) : null, color: "#868686" },
78
- React.createElement("div", { className: "controller-table-status-label" },
79
- React.createElement(ControllerStatusLabel, { className: classnames({ "need-identity": !controller.identity }), status: !controller.identity ? "Need Identity" : controller.confirmationStatus }))))) : dataIndex === "tags" ? (React.createElement(React.Fragment, null,
80
- ((_g = controller.identity) === null || _g === void 0 ? void 0 : _g.id) ? (React.createElement(IdentityStatus, { id: controller.identity.id, className: "controller-table-item-identity" })) : null,
81
- React.createElement(TagView, { id: record.id, tags: controller.tags, editable: false, items: store.items, maxCount: 1 }))) : dataIndex === "menu" ? (React.createElement(ToolBar, { id: record.id, showMenu: false },
82
- React.createElement(Open, { url: `/controller/${record.id}` }),
83
- React.createElement(CompanyControllerMenu, { id: record.id, title: "Controller Menu", unitId: (_h = controller.contact) === null || _h === void 0 ? void 0 : _h.id, store: store, closeAside: true, icon: React.createElement(FAIcon, { icon: faEllipsisVerticalSolid }) }))) : (children)));
87
+ const renderContent = () => {
88
+ var _a, _b, _c, _d, _e, _f, _g, _h;
89
+ switch (dataIndex) {
90
+ case "name":
91
+ return (React.createElement("div", { className: "flex items-center gap-3.5" },
92
+ React.createElement(UnitAvatar, { unit: controller.contact, className: "w-10! h-10! rounded-md! text-sm! text-font-secondary! bg-blue-profile!" }),
93
+ React.createElement("div", { className: "flex flex-col gap-1" },
94
+ ((_a = controller.identity) === null || _a === void 0 ? void 0 : _a.fullName) ? (React.createElement("div", { className: "text-font-primary uppercase font-semibold" }, controller.identity.fullName)) : controller.contact ? (React.createElement(UnitNameNoteAlert, { id: controller.contact.id, name: controller.contact.name })) : null,
95
+ React.createElement("div", { className: "flex items-center gap-4 text-xs text-font-grey font-medium" },
96
+ React.createElement("div", null,
97
+ React.createElement(FAIcon, { icon: faEnvelopeSolid }),
98
+ controller.email || ((_b = controller.contact) === null || _b === void 0 ? void 0 : _b.email) ? (React.createElement("span", { className: "ml-1" }, controller.email || ((_c = controller.contact) === null || _c === void 0 ? void 0 : _c.email))) : (" -")),
99
+ React.createElement("div", null,
100
+ React.createElement(FAIcon, { icon: faPhoneSolid }),
101
+ controller.phone || ((_d = controller.contact) === null || _d === void 0 ? void 0 : _d.phone) ? (React.createElement("span", { className: "ml-1" }, controller.phone || ((_e = controller.contact) === null || _e === void 0 ? void 0 : _e.phone))) : (" -"))))));
102
+ case "details":
103
+ return (React.createElement("div", { className: "flex items-center gap-3.5" },
104
+ React.createElement(UnitAvatar, { unit: controller.contact, className: "w-10! h-10! rounded-md! text-sm! text-font-secondary! bg-blue-profile!" }),
105
+ React.createElement("div", { className: "flex flex-col gap-1" },
106
+ ((_f = controller.identity) === null || _f === void 0 ? void 0 : _f.fullName) ? (React.createElement("div", { className: "text-font-primary uppercase font-semibold" }, controller.identity.fullName)) : controller.contact ? (React.createElement(UnitNameNoteAlert, { id: controller.contact.id, name: controller.contact.name })) : null,
107
+ React.createElement("div", { className: "flex items-center gap-2 text-xs text-font-grey font-medium" },
108
+ React.createElement("div", { className: "flex items-center gap-0.5" },
109
+ React.createElement(FAIcon, { icon: faCalendarCheckSolid }),
110
+ controller.appointment ? (React.createElement(UTCShortDate, { value: controller.appointment, format: "DD MMM YYYY", className: "text-xs text-font-grey font-semibold" })) : (React.createElement("span", { className: "text-font-primary" }, " -"))),
111
+ React.createElement("div", { className: "flex items-center gap-0.5" },
112
+ React.createElement(FAIcon, { icon: faCalendarDaysSolid }),
113
+ controller.cease ? (React.createElement(UTCShortDate, { value: controller.cease, format: "DD MMM YYYY", className: "text-xs text-font-grey font-semibold" })) : (React.createElement("span", { className: "text-font-primary" }, " -")))))));
114
+ case "appointment":
115
+ return renderDate(controller.appointment);
116
+ case "cease":
117
+ return renderDate(controller.cease);
118
+ case "confirmation": {
119
+ const label = (React.createElement(ControllerStatusLabel, { className: classnames({ "need-identity": !controller.identity }), status: !controller.identity ? "Need Identity" : controller.confirmationStatus }));
120
+ if (isAside)
121
+ return label;
122
+ return (React.createElement(Tooltip, { title: controller.confimrationDate ? (React.createElement(React.Fragment, null,
123
+ "Confimration Date:",
124
+ " ",
125
+ React.createElement(UTCShortDate, { value: controller.confimrationDate, format: "DD MMM YYYY" }))) : null, color: "#868686" }, label));
126
+ }
127
+ case "identity":
128
+ return ((_g = controller.identity) === null || _g === void 0 ? void 0 : _g.id) ? (React.createElement(IdentityStatus, { id: controller.identity.id, className: isAside ? "gap-2.5!" : undefined })) : null;
129
+ case "menu":
130
+ return (React.createElement("div", { className: "opacity-0 group-hover/row:opacity-100 transition-opacity" },
131
+ React.createElement(ToolBar, { id: record.id, showMenu: false },
132
+ React.createElement(Open, { url: `/controller/${record.id}` }),
133
+ React.createElement(CompanyControllerMenu, { id: record.id, title: "Controller Menu", unitId: (_h = controller.contact) === null || _h === void 0 ? void 0 : _h.id, store: store, closeAside: true, icon: React.createElement(FAIcon, { icon: faEllipsisVerticalSolid }) }))));
134
+ default:
135
+ return children;
136
+ }
137
+ };
138
+ return React.createElement("td", { ...restProps }, renderContent());
84
139
  });
85
140
  };
86
141
  export default TableCell;
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/controller-register/components/ControllerTableList/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACN,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,IAAI,MAAM,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,0DAA0D,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,UAAU,MAAM,8DAA8D,CAAC;AACtF,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,cAAc,MAAM,2EAA2E,CAAC;AACvG,OAAO,OAAO,MAAM,oDAAoD,CAAC;AACzE,OAAO,qBAAqB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,qBAAqB,MAAM,6DAA6D,CAAC;AAChG,OAAO,OAAO,MAAM,kDAAkD,CAAC;AACvE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,aAAa,CA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AU,CAAC,IAAI,EACrB,QAAQ,EAAE,KAAK,EACf,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,GACV,CACA,CACH,CAAC,CAAC,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,CAC1B,oBAAC,OAAO,IAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK;YACtC,oBAAC,IAAI,IAAC,GAAG,EAAE,eAAe,MAAM,CAAC,EAAE,EAAE,GAAI;YACzC,oBAAC,qBAAqB,IACrB,EAAE,EAAE,MAAM,CAAC,EAAE,EACb,KAAK,EAAC,iBAAiB,EACvB,MAAM,EAAE,MAAA,UAAU,CAAC,OAAO,0CAAE,EAAE,EAC9B,KAAK,EAAE,KAAK,EACZ,UAAU,QACV,IAAI,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,uBAAuB,GAAI,GAC9C,CACO,CACV,CAAC,CAAC,CAAC,CACH,QAAQ,CACR,CACG,CACL,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/controller-register/components/ControllerTableList/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACN,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,eAAe,IAAI,MAAM,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,0DAA0D,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,a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;4BACzC,oBAAC,qBAAqB,IACrB,EAAE,EAAE,MAAM,CAAC,EAAE,EACb,KAAK,EAAC,iBAAiB,EACvB,MAAM,EAAE,MAAA,UAAU,CAAC,OAAO,0CAAE,EAAE,EAC9B,KAAK,EAAE,KAAK,EACZ,UAAU,QACV,IAAI,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,uBAAuB,GAAI,GAC9C,CACO,CACL,CACN,CAAC;gBACH;oBACC,OAAO,QAAQ,CAAC;YAClB,CAAC;QACF,CAAC,CAAC;QAEF,OAAO,+BAAQ,SAAS,IAAG,aAAa,EAAE,CAAM,CAAC;IAClD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import React, { ReactNode } from "react";
2
- import "./index.css";
3
2
  export type ControllerListProps = {
4
3
  controllerRegisterId: string;
5
4
  corporateId: string;
@@ -1,37 +1,29 @@
1
- import React, { useState, useRef, useEffect } from "react";
2
- import TableCell, { columnsList } from "./TableCell";
3
- import TableCellSimple, { columnsSimpleList } from "./TableCellSimple";
1
+ import React, { useState } from "react";
4
2
  import { Button, Dropdown, Modal } from "antd";
5
- import { State } from "./state";
3
+ import RegisterTable from "../../../../../../components/RegisterTable";
4
+ import { faTrashSolid, faPrintSolid, faFileImportSolid, faEllipsisVerticalSolid, faFilterSolid, faPaperPlaneSolid, faUploadSolid, } from "@voplus/morpho-ui/es/faIcons";
5
+ import TableCell, { columnsList, columnsSimpleList } from "./TableCell";
6
+ import ControllerStatusFilter from "../../controls/ControllerStatusFilter";
6
7
  import { useDeepMemo } from "@voplus/morpho-data";
7
- import { faPrintSolid, faEllipsisVerticalSolid, faFileImportSolid, faTrashSolid, FontAwesomeIcon as FAIcon, } from "@voplus/morpho-ui/es/faIcons";
8
- import { useCorporateStore } from "../../../../../../data/corporate";
9
- import { observe, useRenderOnChange, useAsideContentContext } from "@voplus/morpho-ui";
10
- import { useAutoUpdateListData } from "@voplus/morpho-document-core";
11
- import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
12
- import { useControllerListEffect, useControllerStore } from "../../../../../../data/controller";
13
- import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
14
- import AddDropDown2 from "@voplus/morpho-ui/es/components/layout/ListView/controls/AddDropDown2";
15
- import DocumentTableListCard from "@voplus/morpho-ui/es/components/DocumentTableListCard";
16
8
  import UnitsSelectDialog from "@voplus/morpho-org/es/components/UnitsSelectDialog";
17
- import ControllerStatusFilter from "../../controls/ControllerStatusFilter";
18
- import TableListCard from "@voplus/morpho-ui/es/components/TableListCard";
19
- import ControllerPropertiesView from "../ControllerPropertiesView";
9
+ import { useControllerListEffect, useControllerStore, } from "../../../../../../data/controller";
20
10
  import SelectControllerSendForm from "../SelectControllerSendForm";
21
11
  import SelectControllerForm from "../SelectControllerForm";
22
- import Scrollbars from "react-custom-scrollbars-2";
23
- import classnames from "classnames";
24
- import "./index.css";
12
+ import { State } from "./state";
13
+ import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
14
+ import { useAutoUpdateListData } from "@voplus/morpho-document-core";
15
+ import { FontAwesomeIcon as FAIcon } from "@voplus/morpho-ui/es/faIcons";
16
+ import ControllerPropertiesView from "../ControllerPropertiesView";
17
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
18
+ import { observe, useRenderOnChange, useAsideContentContext } from "@voplus/morpho-ui";
25
19
  const ControllerTableList = (props) => {
20
+ const asideContext = useAsideContentContext();
21
+ const controllerStore = useControllerStore();
26
22
  const { controllerRegisterId, corporateId } = props;
23
+ const state = useDeepMemo(() => new State(), [controllerRegisterId]);
27
24
  const [visible, setVisible] = useState(false);
28
25
  const [noticeVisible, setNoticeVisible] = useState(false);
29
- const [height, setHeight] = useState(0);
30
- const ref = useRef(null);
31
- const corporateStore = useCorporateStore();
32
- const controllerStore = useControllerStore();
33
- const asideContext = useAsideContentContext();
34
- const state = useDeepMemo(() => new State(), [controllerRegisterId]);
26
+ const [totalCount, setTotalCount] = useState(0);
35
27
  /** 建立 ListView 和useDocumentListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
36
28
  const list = useCreateListDataState({
37
29
  filterDefaults: {
@@ -47,40 +39,17 @@ const ControllerTableList = (props) => {
47
39
  includes: "tags",
48
40
  },
49
41
  }, [controllerRegisterId]);
50
- const columns = columnsList.map((col) => {
51
- return {
52
- ...col,
53
- onCell: (record, rowIndex) => {
54
- return {
55
- record,
56
- dataIndex: col.dataIndex,
57
- rowIndex: rowIndex,
58
- };
59
- },
60
- };
61
- });
62
- const columnsSimple = columnsSimpleList.map((col) => {
63
- return {
64
- ...col,
65
- onCell: (record, rowIndex) => {
66
- return {
67
- record,
68
- dataIndex: col.dataIndex,
69
- rowIndex: rowIndex,
70
- };
71
- },
72
- };
73
- });
74
- useEffect(() => {
75
- if (ref.current) {
76
- setHeight(ref.current.offsetHeight);
77
- }
78
- }, [ref]);
79
42
  /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
80
43
  useAutoUpdateListData(list, (d) => d.parentId === controllerRegisterId);
81
44
  useRenderOnChange(() => list.filters.options);
82
45
  /** 把ListDataState传给useControllerListEffect,使之可以自動更新loading, hasmore. */
83
- useControllerListEffect(list, (result, total) => list.union(result), list.filters.options);
46
+ useControllerListEffect(list, (result, total) => {
47
+ list.union(result);
48
+ setTotalCount(total || 0);
49
+ }, {
50
+ Total: true,
51
+ ...list.filters.options,
52
+ });
84
53
  // spec:1821 — CSP: Controller list overflow menu offers Send Notice, Print and Delete
85
54
  const items = [
86
55
  {
@@ -109,53 +78,55 @@ const ControllerTableList = (props) => {
109
78
  },
110
79
  },
111
80
  ];
112
- return observe(() => (React.createElement("div", { className: "registers-page-item" },
113
- React.createElement(ListDataContext.Provider, { value: list },
114
- React.createElement(DocumentTableListCard, { isHeader: true, header: React.createElement(ListHeaderTool, { addAble: false, sortable: false, className: classnames("controller-table-list-header"), searchOptions: { placeholder: "Search in register controller" },
81
+ return observe(() => {
82
+ const columns = ((asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent) ? columnsSimpleList : columnsList).map((col) => {
83
+ return {
84
+ ...col,
85
+ onCell: (record, rowIndex) => {
86
+ return {
87
+ record,
88
+ dataIndex: col.dataIndex,
89
+ rowIndex: rowIndex,
90
+ };
91
+ },
92
+ };
93
+ });
94
+ return (React.createElement(ListDataContext.Provider, { value: list },
95
+ React.createElement("div", { className: "h-full flex flex-col" },
96
+ React.createElement(ListHeaderTool, { addAble: false, sortable: false, className: "p-5! [&_.header-tool-space]:gap-3.5 [&_button]:ml-0! [&_.ant-input-outlined]:h-auto! [&_.ant-input-outlined]:bg-bg-blue! [&_.ant-input-outlined]:border-border! [&_.ant-input-outlined:hover]:border-font-secondary! [&_.ant-input-outlined:focus]:border-font-secondary! [&_.ant-input-outlined:focus-within]:border-font-secondary! [&_button]:font-semibold!", searchOptions: { placeholder: "Search in register controller" },
115
97
  // spec:1822 — CSP: Controller list filter has Unconfirmed, ConfirmedController, ConfirmedNotController
116
98
  filterViewProps: {
99
+ icon: (React.createElement(Button, null,
100
+ React.createElement(FAIcon, { icon: faFilterSolid }))),
117
101
  columns: [
118
102
  React.createElement(ControllerStatusFilter, { key: "ControllerStatusFilter", defaultValue: ["Unconfirmed", "ConfirmedController"] }),
119
103
  ],
120
104
  }, rightExtra: () => (React.createElement(React.Fragment, null,
121
- React.createElement(Button, { className: "send-form-btn", onClick: () => setVisible(true) }, "Send Form"),
122
- React.createElement(Button, { className: "import-btn", onClick: async () => await controllerStore
105
+ React.createElement(Button, { icon: React.createElement(FAIcon, { icon: faPaperPlaneSolid }), className: "text-font-primary font-semibold uppercase", onClick: () => setVisible(true) }, "Send Form"),
106
+ React.createElement(Button, { className: "text-font-primary font-semibold uppercase", icon: React.createElement(FAIcon, { icon: faUploadSolid }), onClick: async () => await controllerStore
123
107
  .importController(controllerRegisterId, { error: "message" })
124
- .then(() => props.onReload && props.onReload()) }, "Import"),
125
- React.createElement(AddDropDown2, { btnType: "text", onClick: () => {
126
- state.addAble = true;
127
- } }),
128
- React.createElement(Dropdown, { classNames: { root: "controller-table-list-dropdown" }, trigger: ["click", "hover"], menu: { items } },
129
- React.createElement(Button, null,
130
- React.createElement(FAIcon, { icon: faEllipsisVerticalSolid }))))) }) },
131
- React.createElement("div", { ref: ref, className: "controller-table-list-card" },
132
- React.createElement(Scrollbars, { autoHide: true },
133
- React.createElement(TableListCard, { tableListProps: {
134
- columns: (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent) ? columnsSimple : columns,
135
- components: {
136
- body: {
137
- // row: DragTableRow,
138
- cell: (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent) ? TableCellSimple : TableCell,
139
- },
140
- },
141
- scrollH: height - 72,
142
- tableProps: {
143
- onRow: (record) => {
144
- return {
145
- onClick: (e) => {
146
- asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(ControllerPropertiesView, { id: record.id }), {
147
- span: 12,
148
- });
149
- },
150
- };
151
- },
152
- },
153
- }, ...props.tableCardProps }))))),
154
- state.addAble && (React.createElement(UnitsSelectDialog, { type: "click", multiSelect: false, onSelect: onSave, onCancel: () => {
155
- state.addAble = false;
156
- } })),
157
- visible && (React.createElement(SelectControllerSendForm, { parentId: controllerRegisterId, onCancel: () => setVisible(false) })),
158
- noticeVisible && (React.createElement(SelectControllerForm, { parentId: controllerRegisterId, onCancel: () => setNoticeVisible(false) })))));
108
+ .then(() => props.onReload && props.onReload()) }, "SYNC"),
109
+ React.createElement(Button, { className: "primary-button", onClick: () => (state.addAble = true) }, "+ NEW ENTRY"),
110
+ React.createElement(Dropdown, { trigger: ["click", "hover"], menu: { items } },
111
+ React.createElement(Button, { className: "w-[45px]" },
112
+ React.createElement(FAIcon, { icon: faEllipsisVerticalSolid }))))) }),
113
+ React.createElement(RegisterTable, { columns: columns, dataSource: list.data.map((e, i) => {
114
+ return { key: i, ...e };
115
+ }), loading: list.loading, onLoadMore: () => list.triggerNextPage(), hasMore: list.data.length < totalCount, components: {
116
+ body: {
117
+ cell: TableCell,
118
+ },
119
+ }, onRowClick: (record) => {
120
+ asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(ControllerPropertiesView, { id: record.id }), {
121
+ span: 12,
122
+ });
123
+ } })),
124
+ state.addAble && (React.createElement(UnitsSelectDialog, { type: "click", multiSelect: false, onSelect: onSave, onCancel: () => {
125
+ state.addAble = false;
126
+ } })),
127
+ visible && (React.createElement(SelectControllerSendForm, { parentId: controllerRegisterId, onCancel: () => setVisible(false) })),
128
+ noticeVisible && (React.createElement(SelectControllerForm, { parentId: controllerRegisterId, onCancel: () => setNoticeVisible(false) }))));
129
+ });
159
130
  /** 新增controllerItem */
160
131
  async function onSave(unit) {
161
132
  /** SelectLegalContactDialog 选择/新增有identity信息的unit */