@donglegeyu/company-ui 1.2.7 → 1.2.8

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 (28) hide show
  1. package/dist/cjs/basic-components/CompanyFloatButton/index.d.ts +12 -2
  2. package/dist/cjs/basic-components/CompanyFloatButton/index.js +28 -2
  3. package/dist/cjs/template-components/DetailPageTemplate/index.d.ts +35 -0
  4. package/dist/cjs/template-components/DetailPageTemplate/index.js +152 -0
  5. package/dist/cjs/template-components/DetailPageTemplate/index.scss +177 -0
  6. package/dist/cjs/template-components/SmartListTemplate/index.js +13 -3
  7. package/dist/cjs/template-components/StatisticsListPage/index.d.ts +78 -0
  8. package/dist/cjs/template-components/StatisticsListPage/index.js +427 -0
  9. package/dist/cjs/template-components/StatisticsListPage/index.scss +191 -0
  10. package/dist/cjs/template-components/index.d.ts +3 -1
  11. package/dist/cjs/template-components/index.js +5 -2
  12. package/dist/cjs/types/index.d.ts +7 -0
  13. package/dist/es/basic-components/CompanyFloatButton/index.d.ts +12 -2
  14. package/dist/es/basic-components/CompanyFloatButton/index.js +26 -2
  15. package/dist/es/template-components/DetailPageTemplate/index.d.ts +35 -0
  16. package/dist/es/template-components/DetailPageTemplate/index.js +145 -0
  17. package/dist/es/template-components/DetailPageTemplate/index.scss +177 -0
  18. package/dist/es/template-components/SmartListTemplate/index.js +15 -3
  19. package/dist/es/template-components/StatisticsListPage/index.d.ts +78 -0
  20. package/dist/es/template-components/{CommonListPage → StatisticsListPage}/index.js +474 -198
  21. package/dist/es/template-components/StatisticsListPage/index.scss +191 -0
  22. package/dist/es/template-components/index.d.ts +3 -1
  23. package/dist/es/template-components/index.js +2 -1
  24. package/dist/es/types/index.d.ts +7 -0
  25. package/package.json +1 -1
  26. package/dist/cjs/template-components/CommonListPage/index.d.ts +0 -33
  27. package/dist/cjs/template-components/CommonListPage/index.js +0 -186
  28. package/dist/es/template-components/CommonListPage/index.d.ts +0 -33
@@ -1,3 +1,13 @@
1
1
  import React from "react";
2
- import type { FloatButtonProps } from "antd";
3
- export declare const CompanyFloatButton: React.FC<FloatButtonProps>;
2
+ import { FloatButton } from "antd";
3
+ import type { FloatButtonProps, FloatButtonRef, FloatButtonGroupProps } from "antd";
4
+ export type CompanyFloatButtonProps = FloatButtonProps;
5
+ export type CompanyFloatButtonRef = FloatButtonRef;
6
+ export type CompanyFloatButtonGroupProps = FloatButtonGroupProps;
7
+ export type CompanyFloatButtonBackTopProps = React.ComponentProps<typeof FloatButton.BackTop>;
8
+ export declare const CompanyFloatButton: React.ForwardRefExoticComponent<FloatButtonProps & React.RefAttributes<import("antd/es/float-button/FloatButton").FloatButtonElement>> & {
9
+ Group: React.FC<Readonly<FloatButtonGroupProps>>;
10
+ BackTop: React.ForwardRefExoticComponent<import("antd/es/float-button/BackTop").BackTopProps & React.RefAttributes<FloatButtonRef>>;
11
+ _InternalPanelDoNotUseOrYouWillBeFired: React.FC<import("antd/es/float-button/PurePanel").PurePanelProps>;
12
+ };
13
+ export declare const CompanyBackTop: React.FC<CompanyFloatButtonBackTopProps>;
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,21 +16,45 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/basic-components/CompanyFloatButton/index.tsx
20
30
  var CompanyFloatButton_exports = {};
21
31
  __export(CompanyFloatButton_exports, {
32
+ CompanyBackTop: () => CompanyBackTop,
22
33
  CompanyFloatButton: () => CompanyFloatButton
23
34
  });
24
35
  module.exports = __toCommonJS(CompanyFloatButton_exports);
36
+ var import_react = __toESM(require("react"));
25
37
  var import_antd = require("antd");
26
38
  var import_theme = require("../../theme");
27
39
  var import_jsx_runtime = require("react/jsx-runtime");
28
- var CompanyFloatButton = (props) => {
29
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.FloatButton, { ...props }) });
40
+ var CompanyFloatButtonComponent = import_react.default.forwardRef((props, ref) => {
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.FloatButton, { ref, ...props }) });
42
+ });
43
+ var CompanyFloatButtonGroup = (props) => {
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.FloatButton.Group, { ...props }) });
45
+ };
46
+ var CompanyFloatButtonBackTop = (props) => {
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.FloatButton.BackTop, { ...props }) });
48
+ };
49
+ var CompanyFloatButton = Object.assign(CompanyFloatButtonComponent, {
50
+ Group: CompanyFloatButtonGroup,
51
+ BackTop: CompanyFloatButtonBackTop
52
+ });
53
+ var CompanyBackTop = (props) => {
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.FloatButton.BackTop, { ...props }) });
30
55
  };
31
56
  // Annotate the CommonJS export names for ESM import in node:
32
57
  0 && (module.exports = {
58
+ CompanyBackTop,
33
59
  CompanyFloatButton
34
60
  });
@@ -0,0 +1,35 @@
1
+ import { type ReactNode } from 'react';
2
+ import './index.scss';
3
+ export interface DetailFieldItem {
4
+ label: string;
5
+ value: ReactNode;
6
+ }
7
+ export interface DetailTagItem {
8
+ text: ReactNode;
9
+ variant?: 'default' | 'volcano' | 'success' | 'warning';
10
+ }
11
+ export interface DetailTabItem {
12
+ key: string;
13
+ label: ReactNode;
14
+ children: ReactNode;
15
+ disabled?: boolean;
16
+ }
17
+ interface DetailPageTemplateProps {
18
+ title: string;
19
+ showBack?: boolean;
20
+ onBack?: () => void;
21
+ titleActions?: ReactNode;
22
+ avatar?: ReactNode;
23
+ primaryName?: ReactNode;
24
+ tags?: DetailTagItem[];
25
+ infoFields?: DetailFieldItem[];
26
+ infoColumns?: number;
27
+ infoArea?: ReactNode;
28
+ tabs?: DetailTabItem[];
29
+ activeTab?: string;
30
+ onTabChange?: (key: string) => void;
31
+ showDivider?: boolean;
32
+ children?: ReactNode;
33
+ }
34
+ export default function DetailPageTemplate({ title, showBack, onBack, titleActions, avatar, primaryName, tags, infoFields, infoColumns, infoArea, tabs, activeTab: controlledActiveTab, onTabChange, showDivider, children, }: DetailPageTemplateProps): import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -0,0 +1,152 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/template-components/DetailPageTemplate/index.tsx
30
+ var DetailPageTemplate_exports = {};
31
+ __export(DetailPageTemplate_exports, {
32
+ default: () => DetailPageTemplate
33
+ });
34
+ module.exports = __toCommonJS(DetailPageTemplate_exports);
35
+ var import_react = require("react");
36
+ var import_basic_components = require("../../basic-components");
37
+ var import_PageTitle = __toESM(require("../../shared-components/PageTitle"));
38
+ var import_index = require("./index.scss");
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+ function DetailPageTemplate({
41
+ title,
42
+ showBack = false,
43
+ onBack,
44
+ titleActions,
45
+ avatar,
46
+ primaryName,
47
+ tags,
48
+ infoFields,
49
+ infoColumns = 3,
50
+ infoArea,
51
+ tabs,
52
+ activeTab: controlledActiveTab,
53
+ onTabChange,
54
+ showDivider = true,
55
+ children
56
+ }) {
57
+ var _a;
58
+ const [internalActiveTab, setInternalActiveTab] = (0, import_react.useState)(((_a = tabs == null ? void 0 : tabs[0]) == null ? void 0 : _a.key) ?? "");
59
+ const [isScrolling, setIsScrolling] = (0, import_react.useState)(false);
60
+ const scrollTimeoutRef = (0, import_react.useRef)(null);
61
+ const activeTab = controlledActiveTab ?? internalActiveTab;
62
+ const handleTabChange = (0, import_react.useCallback)(
63
+ (key) => {
64
+ if (onTabChange) {
65
+ onTabChange(key);
66
+ } else {
67
+ setInternalActiveTab(key);
68
+ }
69
+ },
70
+ [onTabChange]
71
+ );
72
+ const handleScroll = (0, import_react.useCallback)((e) => {
73
+ const target = e.currentTarget;
74
+ setIsScrolling(true);
75
+ if (scrollTimeoutRef.current) {
76
+ clearTimeout(scrollTimeoutRef.current);
77
+ }
78
+ scrollTimeoutRef.current = setTimeout(() => {
79
+ setIsScrolling(false);
80
+ }, 150);
81
+ if (target.scrollTop > 0) {
82
+ target.classList.add("scrolled");
83
+ } else {
84
+ target.classList.remove("scrolled");
85
+ }
86
+ }, []);
87
+ const tagVariantClass = {
88
+ default: "dpt-tag-default",
89
+ volcano: "dpt-tag-volcano",
90
+ success: "dpt-tag-success",
91
+ warning: "dpt-tag-warning"
92
+ };
93
+ const hasHeader = avatar !== void 0 || primaryName !== void 0 || tags && tags.length > 0;
94
+ const hasInfoCard = hasHeader || infoFields && infoFields.length > 0 || infoArea;
95
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "detail-page-template", children: [
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
97
+ import_PageTitle.default,
98
+ {
99
+ title,
100
+ showBack,
101
+ onBack,
102
+ className: "dpt-page-title",
103
+ actions: titleActions
104
+ }
105
+ ),
106
+ hasInfoCard && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dpt-info-card", children: [
107
+ hasHeader && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dpt-info-top", children: [
108
+ (avatar !== void 0 || primaryName !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dpt-info-identity", children: [
109
+ avatar !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dpt-avatar", children: avatar }),
110
+ primaryName !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpt-primary-name", children: primaryName })
111
+ ] }),
112
+ tags && tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dpt-info-tags", children: tags.map((tag, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyTag, { className: tagVariantClass[tag.variant ?? "default"], children: tag.text }, index)) })
113
+ ] }),
114
+ infoFields && infoFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
115
+ "div",
116
+ {
117
+ className: "dpt-info-fields",
118
+ style: { gridTemplateColumns: `repeat(${infoColumns}, minmax(0, 1fr))` },
119
+ children: infoFields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dpt-field-item", children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dpt-field-label", children: [
121
+ field.label,
122
+ ":"
123
+ ] }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpt-field-value", children: field.value ?? "--" })
125
+ ] }, index))
126
+ }
127
+ ),
128
+ infoArea
129
+ ] }),
130
+ showDivider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dpt-divider" }),
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dpt-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
132
+ "div",
133
+ {
134
+ className: `dpt-content${isScrolling ? " scrolling" : ""}`,
135
+ onScroll: handleScroll,
136
+ children: tabs && tabs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
137
+ import_basic_components.CompanyTabs,
138
+ {
139
+ activeKey: activeTab,
140
+ onChange: handleTabChange,
141
+ items: tabs.map((tab) => ({
142
+ key: tab.key,
143
+ label: tab.label,
144
+ disabled: tab.disabled,
145
+ children: tab.children
146
+ }))
147
+ }
148
+ ) : children
149
+ }
150
+ ) })
151
+ ] });
152
+ }
@@ -0,0 +1,177 @@
1
+ .detail-page-template {
2
+ width: 100%;
3
+ display: flex;
4
+ flex-direction: column;
5
+ padding: 0 0.75rem;
6
+ flex-grow: 1;
7
+ align-self: stretch;
8
+ z-index: 1;
9
+ overflow: hidden;
10
+ background: #f5f5f5;
11
+
12
+ .dpt-page-title {
13
+ position: sticky;
14
+ top: 0;
15
+ z-index: 20;
16
+ background: var(--ant-color-bg-container);
17
+ }
18
+
19
+ .dpt-info-card {
20
+ display: flex;
21
+ flex-direction: column;
22
+ gap: 16px;
23
+ padding: 16px;
24
+ background: #ffffff;
25
+ border-radius: 6px;
26
+
27
+ .dpt-info-top {
28
+ display: flex;
29
+ align-items: center;
30
+ gap: 8px;
31
+
32
+ .dpt-info-identity {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: 4px;
36
+
37
+ .dpt-avatar {
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ width: 24px;
42
+ height: 24px;
43
+ border-radius: 66px;
44
+ background: #f95914;
45
+ color: #fff;
46
+ font-size: 14px;
47
+ line-height: 22px;
48
+ font-weight: 400;
49
+ }
50
+
51
+ .dpt-primary-name {
52
+ font-size: 16px;
53
+ font-weight: 500;
54
+ color: rgba(0, 0, 0, 0.88);
55
+ line-height: 24px;
56
+ }
57
+ }
58
+
59
+ .dpt-info-tags {
60
+ display: flex;
61
+ align-items: center;
62
+ gap: 4px;
63
+ }
64
+ }
65
+
66
+ .dpt-info-fields {
67
+ display: grid;
68
+ gap: 8px 24px;
69
+
70
+ .dpt-field-item {
71
+ display: flex;
72
+ align-items: center;
73
+ line-height: 22px;
74
+
75
+ .dpt-field-label {
76
+ font-size: 14px;
77
+ color: rgba(0, 0, 0, 0.45);
78
+ white-space: nowrap;
79
+ }
80
+
81
+ .dpt-field-value {
82
+ font-size: 14px;
83
+ color: rgba(0, 0, 0, 0.88);
84
+ word-break: break-all;
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ .dpt-tag-default {
91
+ font-size: 12px;
92
+ line-height: 20px;
93
+ padding: 1px 8px;
94
+ border-radius: 4px;
95
+ background: rgba(0, 0, 0, 0.06);
96
+ border-color: rgba(0, 0, 0, 0.15);
97
+ color: rgba(0, 0, 0, 0.88);
98
+ }
99
+
100
+ .dpt-tag-volcano {
101
+ font-size: 12px;
102
+ line-height: 20px;
103
+ padding: 1px 8px;
104
+ border-radius: 4px;
105
+ background: #fff2e8;
106
+ border-color: #ffbb96;
107
+ color: #fa541c;
108
+ }
109
+
110
+ .dpt-tag-success {
111
+ font-size: 12px;
112
+ line-height: 20px;
113
+ padding: 1px 8px;
114
+ border-radius: 4px;
115
+ background: #f6ffed;
116
+ border-color: #b7eb8f;
117
+ color: #52c41a;
118
+ }
119
+
120
+ .dpt-tag-warning {
121
+ font-size: 12px;
122
+ line-height: 20px;
123
+ padding: 1px 8px;
124
+ border-radius: 4px;
125
+ background: #fffbe6;
126
+ border-color: #ffe58f;
127
+ color: #faad14;
128
+ }
129
+
130
+ .dpt-divider {
131
+ height: 12px;
132
+ flex-shrink: 0;
133
+ background: #f5f5f5;
134
+ }
135
+
136
+ .dpt-container {
137
+ width: 100%;
138
+ flex: 1;
139
+ display: flex;
140
+ flex-direction: column;
141
+ flex-grow: 1;
142
+ align-self: stretch;
143
+ z-index: 3;
144
+ border-radius: 6px 6px 0 0;
145
+ background: #ffffff;
146
+ overflow: hidden;
147
+ }
148
+
149
+ .dpt-content {
150
+ flex: 1;
151
+ overflow-y: auto;
152
+ overflow-x: hidden;
153
+ scrollbar-width: thin;
154
+ scrollbar-color: transparent transparent;
155
+ padding: 0 16px 16px;
156
+
157
+ &::-webkit-scrollbar {
158
+ width: 6px;
159
+ }
160
+
161
+ &::-webkit-scrollbar-track {
162
+ background: transparent;
163
+ }
164
+
165
+ &::-webkit-scrollbar-thumb {
166
+ background-color: transparent;
167
+ border-radius: 3px;
168
+ }
169
+
170
+ &:hover::-webkit-scrollbar-thumb,
171
+ &:active::-webkit-scrollbar-thumb,
172
+ &:focus::-webkit-scrollbar-thumb,
173
+ &.scrolling::-webkit-scrollbar-thumb {
174
+ background-color: rgba(0, 0, 0, 0.2);
175
+ }
176
+ }
177
+ }
@@ -846,9 +846,19 @@ function SmartListTemplate({
846
846
  cellPaddingInlineSM: 16,
847
847
  rowSelection,
848
848
  rowKey,
849
- defaultExpandAllRows: (treeConfig == null ? void 0 : treeConfig.enabled) ? defaultExpandAll : void 0,
850
- onChange: handleTableChange,
851
- onExpand: (treeConfig == null ? void 0 : treeConfig.enabled) ? handleExpand : void 0
849
+ childrenColumnName: (treeConfig == null ? void 0 : treeConfig.enabled) ? treeConfig.childrenColumnName || "children" : void 0,
850
+ expandable: (treeConfig == null ? void 0 : treeConfig.enabled) ? {
851
+ defaultExpandAllRows: defaultExpandAll,
852
+ expandedRowKeys: expandedRowKeys.length > 0 ? expandedRowKeys : void 0,
853
+ onExpandedRowsChange: (keys) => {
854
+ setExpandedRowKeys(keys.map((k) => String(k)));
855
+ },
856
+ onExpand: (expanded, record) => {
857
+ handleExpand(expanded, record);
858
+ },
859
+ indentSize: (treeConfig == null ? void 0 : treeConfig.levelIndent) || 16
860
+ } : void 0,
861
+ onChange: handleTableChange
852
862
  }
853
863
  ) }),
854
864
  paginationProp !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pagination", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { locale: import_zh_CN.default, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -0,0 +1,78 @@
1
+ import { ReactNode } from 'react';
2
+ import type { PageResponse } from '../../types';
3
+ import type { TableColumnsType } from 'antd';
4
+ import './index.scss';
5
+ /** 标准分页响应结构,对齐后端契约 */
6
+ export type { PageResponse } from '../../types';
7
+ /** 统计卡片配置 */
8
+ export interface StatisticCardConfig {
9
+ key: string;
10
+ title: string;
11
+ value: ReactNode;
12
+ }
13
+ /** 高级筛选项类型 */
14
+ export type StatisticsFilterType = 'input' | 'select' | 'date';
15
+ /** 高级筛选项配置(抽屉内) */
16
+ export interface StatisticsFilterField {
17
+ key: string;
18
+ label: string;
19
+ type: StatisticsFilterType;
20
+ placeholder?: string;
21
+ options?: Array<{
22
+ label: string;
23
+ value: string | number;
24
+ }>;
25
+ }
26
+ /** 已应用的筛选标签 */
27
+ export interface StatisticsFilterTag {
28
+ key: string;
29
+ label: string;
30
+ value: string;
31
+ displayText: string;
32
+ }
33
+ /** 表格列定义(支持 visible 控制与 fixed 固定列) */
34
+ export interface StatisticsColumn<T = Record<string, unknown>> {
35
+ key: string;
36
+ label: string;
37
+ visible?: boolean;
38
+ width?: number;
39
+ fixed?: 'left' | 'right';
40
+ render?: TableColumnsType<T>[number]['render'];
41
+ }
42
+ /** 通用统计列表页 Props */
43
+ export interface StatisticsListPageProps<T = Record<string, unknown>> {
44
+ /** 页面标题 */
45
+ title?: string;
46
+ /** 标题右侧自定义区域(如月份选择器、操作按钮) */
47
+ titleSuffix?: ReactNode;
48
+ /** 统计卡片区配置(不传则不渲染卡片区) */
49
+ statisticCards?: StatisticCardConfig[];
50
+ /** 顶部搜索框占位符 */
51
+ searchPlaceholder?: string;
52
+ /** 顶部搜索对应字段 key(提交到 fetchData 的参数名) */
53
+ searchKey?: string;
54
+ /** 高级筛选字段(抽屉内) */
55
+ filterFields?: StatisticsFilterField[];
56
+ /** 表格列配置 */
57
+ columns: StatisticsColumn<T>[];
58
+ /** 数据请求函数 - 严格对齐 PageResponse 契约 */
59
+ fetchData?: (params: Record<string, unknown>) => Promise<PageResponse<T>>;
60
+ /** 默认分页大小 */
61
+ defaultPageSize?: number;
62
+ /** 表格行 key */
63
+ rowKey?: string | ((record: T) => string);
64
+ /** 表格尺寸 */
65
+ size?: 'small' | 'middle' | 'large';
66
+ /** 表格 Y 轴滚动高度(默认自适应视口) */
67
+ scrollY?: string | number;
68
+ /** 表格空状态文案 */
69
+ emptyText?: ReactNode;
70
+ /** 工具栏左侧自定义区域(搜索框右侧) */
71
+ toolbarLeftExtra?: ReactNode;
72
+ /** 工具栏右侧自定义区域(列设置图标左侧) */
73
+ toolbarRightExtra?: ReactNode;
74
+ /** 自定义 className */
75
+ className?: string;
76
+ }
77
+ export declare const StatisticsListPage: <T extends Record<string, unknown>>(props: StatisticsListPageProps<T>) => import("react/jsx-runtime").JSX.Element;
78
+ export default StatisticsListPage;