@donglegeyu/company-ui 1.2.6 → 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.
- package/dist/cjs/basic-components/CompanyFloatButton/index.d.ts +12 -2
- package/dist/cjs/basic-components/CompanyFloatButton/index.js +28 -2
- package/dist/cjs/basic-components/CompanyTable/index.d.ts +10 -1
- package/dist/cjs/basic-components/CompanyTable/index.js +43 -2
- package/dist/cjs/template-components/ColumnSettingsPanel/index.js +1 -1
- package/dist/cjs/template-components/DetailPageTemplate/index.d.ts +35 -0
- package/dist/cjs/template-components/DetailPageTemplate/index.js +152 -0
- package/dist/cjs/template-components/DetailPageTemplate/index.scss +177 -0
- package/dist/cjs/template-components/SmartListTemplate/index.js +38 -10
- package/dist/cjs/template-components/StatisticsListPage/index.d.ts +78 -0
- package/dist/cjs/template-components/StatisticsListPage/index.js +427 -0
- package/dist/cjs/template-components/StatisticsListPage/index.scss +191 -0
- package/dist/cjs/template-components/index.d.ts +3 -1
- package/dist/cjs/template-components/index.js +5 -2
- package/dist/cjs/types/index.d.ts +7 -0
- package/dist/es/basic-components/CompanyFloatButton/index.d.ts +12 -2
- package/dist/es/basic-components/CompanyFloatButton/index.js +26 -2
- package/dist/es/basic-components/CompanyTable/index.d.ts +10 -1
- package/dist/es/basic-components/CompanyTable/index.js +30 -2
- package/dist/es/template-components/ColumnSettingsPanel/index.js +3 -3
- package/dist/es/template-components/DetailPageTemplate/index.d.ts +35 -0
- package/dist/es/template-components/DetailPageTemplate/index.js +145 -0
- package/dist/es/template-components/DetailPageTemplate/index.scss +177 -0
- package/dist/es/template-components/SmartListTemplate/index.js +92 -59
- package/dist/es/template-components/StatisticsListPage/index.d.ts +78 -0
- package/dist/es/template-components/{CommonListPage → StatisticsListPage}/index.js +474 -198
- package/dist/es/template-components/StatisticsListPage/index.scss +191 -0
- package/dist/es/template-components/index.d.ts +3 -1
- package/dist/es/template-components/index.js +2 -1
- package/dist/es/types/index.d.ts +7 -0
- package/package.json +1 -1
- package/dist/cjs/template-components/CommonListPage/index.d.ts +0 -33
- package/dist/cjs/template-components/CommonListPage/index.js +0 -186
- package/dist/es/template-components/CommonListPage/index.d.ts +0 -33
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
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
|
|
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
|
});
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import type { TableProps } from "antd";
|
|
2
|
-
|
|
2
|
+
interface CompanyTableProps<T extends object> extends TableProps<T> {
|
|
3
|
+
cellPaddingBlock?: number;
|
|
4
|
+
cellPaddingBlockMD?: number;
|
|
5
|
+
cellPaddingBlockSM?: number;
|
|
6
|
+
cellPaddingInline?: number;
|
|
7
|
+
cellPaddingInlineMD?: number;
|
|
8
|
+
cellPaddingInlineSM?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const CompanyTable: <T extends object>(props: CompanyTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -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,6 +16,14 @@ 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/CompanyTable/index.tsx
|
|
@@ -22,12 +32,43 @@ __export(CompanyTable_exports, {
|
|
|
22
32
|
CompanyTable: () => CompanyTable
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(CompanyTable_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
25
36
|
var import_antd = require("antd");
|
|
26
37
|
var import_theme = require("../../theme");
|
|
27
38
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
39
|
var HEADER_PADDING_BLOCK = 12;
|
|
29
40
|
var CompanyTable = (props) => {
|
|
30
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
components: userComponents,
|
|
43
|
+
cellPaddingBlock,
|
|
44
|
+
cellPaddingBlockMD,
|
|
45
|
+
cellPaddingBlockSM,
|
|
46
|
+
cellPaddingInline,
|
|
47
|
+
cellPaddingInlineMD,
|
|
48
|
+
cellPaddingInlineSM,
|
|
49
|
+
...restProps
|
|
50
|
+
} = props;
|
|
51
|
+
const hasCustomPadding = cellPaddingBlock !== void 0 || cellPaddingBlockMD !== void 0 || cellPaddingBlockSM !== void 0 || cellPaddingInline !== void 0 || cellPaddingInlineMD !== void 0 || cellPaddingInlineSM !== void 0;
|
|
52
|
+
const mergedTheme = import_react.default.useMemo(() => {
|
|
53
|
+
var _a;
|
|
54
|
+
if (!hasCustomPadding)
|
|
55
|
+
return import_theme.companyTheme;
|
|
56
|
+
return {
|
|
57
|
+
...import_theme.companyTheme,
|
|
58
|
+
components: {
|
|
59
|
+
...import_theme.companyTheme.components,
|
|
60
|
+
Table: {
|
|
61
|
+
...(_a = import_theme.companyTheme.components) == null ? void 0 : _a.Table,
|
|
62
|
+
...cellPaddingBlock !== void 0 ? { cellPaddingBlock } : {},
|
|
63
|
+
...cellPaddingBlockMD !== void 0 ? { cellPaddingBlockMD } : {},
|
|
64
|
+
...cellPaddingBlockSM !== void 0 ? { cellPaddingBlockSM } : {},
|
|
65
|
+
...cellPaddingInline !== void 0 ? { cellPaddingInline } : {},
|
|
66
|
+
...cellPaddingInlineMD !== void 0 ? { cellPaddingInlineMD } : {},
|
|
67
|
+
...cellPaddingInlineSM !== void 0 ? { cellPaddingInlineSM } : {}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}, [hasCustomPadding, cellPaddingBlock, cellPaddingBlockMD, cellPaddingBlockSM, cellPaddingInline, cellPaddingInlineMD, cellPaddingInlineSM]);
|
|
31
72
|
const userHeader = userComponents == null ? void 0 : userComponents.header;
|
|
32
73
|
const userCell = userHeader == null ? void 0 : userHeader.cell;
|
|
33
74
|
const mergedComponents = {
|
|
@@ -48,7 +89,7 @@ var CompanyTable = (props) => {
|
|
|
48
89
|
}
|
|
49
90
|
}
|
|
50
91
|
};
|
|
51
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme:
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: mergedTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Table, { ...restProps, components: mergedComponents }) });
|
|
52
93
|
};
|
|
53
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
54
95
|
0 && (module.exports = {
|
|
@@ -140,7 +140,7 @@ function ColumnSettingsPanel({
|
|
|
140
140
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "field-row", children: [
|
|
141
141
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shared_components.SvgIcon, { href: "drag", size: 12, className: "drag-icon" }),
|
|
142
142
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
|
-
|
|
143
|
+
import_basic_components.CompanyCheckbox,
|
|
144
144
|
{
|
|
145
145
|
checked: field.visible,
|
|
146
146
|
onChange: (e) => handleFieldToggle(field.key, e.target.checked),
|
|
@@ -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
|
+
}
|
|
@@ -84,6 +84,8 @@ function SmartListTemplate({
|
|
|
84
84
|
size: tableSize = "middle",
|
|
85
85
|
onSizeChange
|
|
86
86
|
}) {
|
|
87
|
+
const [internalSize, setInternalSize] = (0, import_react.useState)(tableSize);
|
|
88
|
+
const effectiveTableSize = onSizeChange ? tableSize : internalSize;
|
|
87
89
|
const [dropdownOpen, setDropdownOpen] = (0, import_react.useState)(false);
|
|
88
90
|
const [saveSchemeDialogVisible, setSaveSchemeDialogVisible] = (0, import_react.useState)(false);
|
|
89
91
|
const [isEditMode, setIsEditMode] = (0, import_react.useState)(false);
|
|
@@ -107,8 +109,18 @@ function SmartListTemplate({
|
|
|
107
109
|
middle: "默认",
|
|
108
110
|
large: "宽松"
|
|
109
111
|
};
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
+
const densityPadding = {
|
|
113
|
+
large: 11,
|
|
114
|
+
middle: 7,
|
|
115
|
+
small: 3
|
|
116
|
+
};
|
|
117
|
+
const currentPadding = densityPadding[effectiveTableSize];
|
|
118
|
+
const handleSizeChange = (0, import_react.useCallback)((newSize) => {
|
|
119
|
+
if (onSizeChange) {
|
|
120
|
+
onSizeChange(newSize);
|
|
121
|
+
} else {
|
|
122
|
+
setInternalSize(newSize);
|
|
123
|
+
}
|
|
112
124
|
}, [onSizeChange]);
|
|
113
125
|
const [densityOpen, setDensityOpen] = (0, import_react.useState)(false);
|
|
114
126
|
const densityMenuItems = (0, import_react.useMemo)(() => [
|
|
@@ -697,7 +709,7 @@ function SmartListTemplate({
|
|
|
697
709
|
open: dropdownOpen,
|
|
698
710
|
onOpenChange: setDropdownOpen,
|
|
699
711
|
popupRender: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
700
|
-
|
|
712
|
+
import_basic_components.CompanyMenu,
|
|
701
713
|
{
|
|
702
714
|
onClick: handleMenuClick,
|
|
703
715
|
items: dropdownMenuItems,
|
|
@@ -789,15 +801,15 @@ function SmartListTemplate({
|
|
|
789
801
|
onOpenChange: setDensityOpen,
|
|
790
802
|
trigger: ["click"],
|
|
791
803
|
popupRender: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
792
|
-
|
|
804
|
+
import_basic_components.CompanyMenu,
|
|
793
805
|
{
|
|
794
806
|
onClick: handleDensityMenuClick,
|
|
795
807
|
items: densityMenuItems,
|
|
796
|
-
selectedKeys: [
|
|
808
|
+
selectedKeys: [effectiveTableSize],
|
|
797
809
|
style: { minWidth: 80 }
|
|
798
810
|
}
|
|
799
811
|
),
|
|
800
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyTooltip, { title: `密度:${sizeLabels[
|
|
812
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyTooltip, { title: `密度:${sizeLabels[effectiveTableSize]}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
801
813
|
import_basic_components.CompanyButton,
|
|
802
814
|
{
|
|
803
815
|
type: "default",
|
|
@@ -825,12 +837,28 @@ function SmartListTemplate({
|
|
|
825
837
|
loading,
|
|
826
838
|
pagination: false,
|
|
827
839
|
scroll: { y: tableHeight },
|
|
828
|
-
size:
|
|
840
|
+
size: effectiveTableSize,
|
|
841
|
+
cellPaddingBlock: currentPadding,
|
|
842
|
+
cellPaddingBlockMD: currentPadding,
|
|
843
|
+
cellPaddingBlockSM: currentPadding,
|
|
844
|
+
cellPaddingInline: 16,
|
|
845
|
+
cellPaddingInlineMD: 16,
|
|
846
|
+
cellPaddingInlineSM: 16,
|
|
829
847
|
rowSelection,
|
|
830
848
|
rowKey,
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
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
|
|
834
862
|
}
|
|
835
863
|
) }),
|
|
836
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)(
|