@donglegeyu/company-ui 2.4.0 → 2.6.0
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/shared-components/IconExplorer/index.js +3 -2
- package/dist/cjs/shared-components/IconParkGallery/index.js +4 -4
- package/dist/cjs/shared-components/IconParkGallery/useIconPark.d.ts +3 -3
- package/dist/cjs/shared-components/IconParkGallery/useIconPark.js +57 -20
- package/dist/cjs/shared-components/SvgIcon/icon-manifest.js +523 -5
- package/dist/cjs/shared-components/SvgIcon/icon-meta.json +2741 -81
- package/dist/cjs/shared-components/SvgIcon/icons.js +23076 -770
- package/dist/cjs/shared-components/SvgIcon/index.js +1 -2
- package/dist/cjs/sidebar-config.js +1 -0
- package/dist/cjs/template-components/StatisticsListPage/index.d.ts +5 -0
- package/dist/cjs/template-components/StatisticsListPage/index.js +4 -1
- package/dist/cjs/template-components/TreeTableTemplate/index.d.ts +62 -0
- package/dist/cjs/template-components/TreeTableTemplate/index.js +271 -0
- package/dist/cjs/template-components/TreeTableTemplate/index.scss +188 -0
- package/dist/cjs/template-components/index.d.ts +1 -0
- package/dist/cjs/template-components/index.js +3 -1
- package/dist/es/shared-components/IconExplorer/index.js +4 -2
- package/dist/es/shared-components/IconParkGallery/index.js +4 -4
- package/dist/es/shared-components/IconParkGallery/useIconPark.d.ts +3 -3
- package/dist/es/shared-components/IconParkGallery/useIconPark.js +111 -31
- package/dist/es/shared-components/SvgIcon/icon-manifest.js +1793 -1
- package/dist/es/shared-components/SvgIcon/icon-meta.json +2741 -81
- package/dist/es/shared-components/SvgIcon/icons.js +2 -1901
- package/dist/es/shared-components/SvgIcon/index.js +3 -5
- package/dist/es/sidebar-config.js +3 -0
- package/dist/es/template-components/StatisticsListPage/index.d.ts +5 -0
- package/dist/es/template-components/StatisticsListPage/index.js +6 -1
- package/dist/es/template-components/TreeTableTemplate/index.d.ts +62 -0
- package/dist/es/template-components/TreeTableTemplate/index.js +318 -0
- package/dist/es/template-components/TreeTableTemplate/index.scss +188 -0
- package/dist/es/template-components/index.d.ts +1 -0
- package/dist/es/template-components/index.js +1 -0
- package/package.json +1 -1
- package/dist/cjs/shared-components/SvgIcon/all-icons.d.ts +0 -19
- package/dist/cjs/shared-components/SvgIcon/all-icons.js +0 -137145
- package/dist/es/shared-components/SvgIcon/all-icons.d.ts +0 -19
- package/dist/es/shared-components/SvgIcon/all-icons.js +0 -3
|
@@ -23,7 +23,6 @@ __export(SvgIcon_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(SvgIcon_exports);
|
|
25
25
|
var import_icons = require("./icons");
|
|
26
|
-
var import_all_icons = require("./all-icons");
|
|
27
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
27
|
var FALLBACK_ICON = "folder-open";
|
|
29
28
|
function toCssSize(size, fallback) {
|
|
@@ -43,7 +42,7 @@ function SvgIcon({
|
|
|
43
42
|
onClick
|
|
44
43
|
}) {
|
|
45
44
|
const key = name ?? href;
|
|
46
|
-
let icon = key ? (0, import_icons.getIconDefinition)(key)
|
|
45
|
+
let icon = key ? (0, import_icons.getIconDefinition)(key) : void 0;
|
|
47
46
|
if (!icon && name) {
|
|
48
47
|
if (process.env.NODE_ENV !== "production") {
|
|
49
48
|
console.warn(
|
|
@@ -181,6 +181,7 @@ var TEMPLATE_GROUPS = [
|
|
|
181
181
|
children: [
|
|
182
182
|
{ title: "布局模板 AdminLayoutTemplate", link: "/template-components/admin-layout-template" },
|
|
183
183
|
{ title: "统计列表页 StatisticsListPage", link: "/template-components/statistics-list-page" },
|
|
184
|
+
{ title: "左树右表模板 TreeTableTemplate", link: "/template-components/tree-table-template" },
|
|
184
185
|
{ title: "智能列表模板 SmartListTemplate", link: "/template-components/smart-list-template" },
|
|
185
186
|
{ title: "表单页模板 FormPageTemplate", link: "/template-components/form-page-template" },
|
|
186
187
|
{
|
|
@@ -102,6 +102,11 @@ export interface StatisticsListPageProps<T = Record<string, unknown>> {
|
|
|
102
102
|
schemeId: string;
|
|
103
103
|
filters: Record<string, unknown>;
|
|
104
104
|
}) => void;
|
|
105
|
+
/**
|
|
106
|
+
* 视图切换器挂载容器(portal 提升):不传(undefined)时渲染在组件自带标题栏;
|
|
107
|
+
* 由外部模板(如 TreeTableTemplate)统一渲染标题栏时传入容器,将切换器提升渲染(分割线由宿主提供)
|
|
108
|
+
*/
|
|
109
|
+
viewSwitcherPortalContainer?: HTMLElement | null;
|
|
105
110
|
/** 自定义 className */
|
|
106
111
|
className?: string;
|
|
107
112
|
}
|
|
@@ -42,6 +42,7 @@ var import_shared_components = require("../../shared-components");
|
|
|
42
42
|
var import_tableActionColumn = require("../../shared-components/tableActionColumn");
|
|
43
43
|
var import_ColumnSettingsPanel = __toESM(require("../ColumnSettingsPanel"));
|
|
44
44
|
var import_useCompanyToken = require("../../theme/useCompanyToken");
|
|
45
|
+
var import_react_dom = require("react-dom");
|
|
45
46
|
var import_index = require("./index.scss");
|
|
46
47
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
48
|
var { Text } = import_antd.Typography;
|
|
@@ -99,6 +100,7 @@ var StatisticsListPage = (props) => {
|
|
|
99
100
|
toolbarRightExtra,
|
|
100
101
|
viewEndpoint,
|
|
101
102
|
onViewChange,
|
|
103
|
+
viewSwitcherPortalContainer,
|
|
102
104
|
className
|
|
103
105
|
} = props;
|
|
104
106
|
const [searchValue, setSearchValue] = (0, import_react.useState)("");
|
|
@@ -453,7 +455,7 @@ var StatisticsListPage = (props) => {
|
|
|
453
455
|
[filterParams]
|
|
454
456
|
);
|
|
455
457
|
const extraNode = titleExtra ?? titleSuffix;
|
|
456
|
-
const
|
|
458
|
+
const viewSwitcher = viewEndpoint ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
457
459
|
import_shared_components.ViewSwitcher,
|
|
458
460
|
{
|
|
459
461
|
viewEndpoint,
|
|
@@ -468,6 +470,7 @@ var StatisticsListPage = (props) => {
|
|
|
468
470
|
onSaveAsOpen: () => setViewModified(false)
|
|
469
471
|
}
|
|
470
472
|
) : null;
|
|
473
|
+
const viewSwitcherNode = !viewSwitcher ? null : viewSwitcherPortalContainer === void 0 ? viewSwitcher : viewSwitcherPortalContainer ? (0, import_react_dom.createPortal)(viewSwitcher, viewSwitcherPortalContainer) : null;
|
|
471
474
|
const titleExtraNode = viewSwitcherNode || extraNode ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "slp-title-extra", children: [
|
|
472
475
|
showTitleExtraDivider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "slp-divider" }),
|
|
473
476
|
viewSwitcherNode,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
3
|
+
import type { StatisticsListPageProps } from "../StatisticsListPage";
|
|
4
|
+
import "./index.scss";
|
|
5
|
+
/** 左树扁平节点:parent 为空表示顶级,组件内部按 parent 关系组装为树 */
|
|
6
|
+
export interface TreeTableNode {
|
|
7
|
+
/** 节点唯一标识 */
|
|
8
|
+
key: string;
|
|
9
|
+
/** 节点显示名称 */
|
|
10
|
+
label: string;
|
|
11
|
+
/** 父节点 key,为空表示顶级节点 */
|
|
12
|
+
parent?: string;
|
|
13
|
+
}
|
|
14
|
+
/** 虚拟根节点配置(如「全部组织」);不传则不渲染根入口 */
|
|
15
|
+
export interface TreeTableRootNode {
|
|
16
|
+
/** 根节点 key(选中根节点时 onTreeSelect 返回该 key) */
|
|
17
|
+
key: string;
|
|
18
|
+
/** 根节点显示名称 */
|
|
19
|
+
label: string;
|
|
20
|
+
/** 根入口图标,默认使用内置「全部应用」图标 */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** 左树右表模板 Props:列表区完整透传 StatisticsListPageProps(隐藏其内置标题栏,页面标题由模板统一渲染) */
|
|
24
|
+
export interface TreeTableTemplateProps<T = Record<string, unknown>> extends Omit<StatisticsListPageProps<T>, "title" | "titleSuffix" | "titleExtra" | "showTitleExtraDivider" | "titleActions" | "className" | "viewSwitcherPortalContainer"> {
|
|
25
|
+
/** 页面标题 */
|
|
26
|
+
title: ReactNode;
|
|
27
|
+
/** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、说明文字) */
|
|
28
|
+
titleExtra?: ReactNode;
|
|
29
|
+
/** 标题栏最右侧的独立操作区(如按钮组、说明+链接) */
|
|
30
|
+
titleActions?: ReactNode;
|
|
31
|
+
/** 左树节点数据(扁平结构,parent 为空表示顶级) */
|
|
32
|
+
treeData: TreeTableNode[];
|
|
33
|
+
/** 虚拟根节点配置(如「全部组织」),不传则不渲染根入口 */
|
|
34
|
+
rootNode?: TreeTableRootNode;
|
|
35
|
+
/** 左树搜索框占位符 */
|
|
36
|
+
treeSearchPlaceholder?: string;
|
|
37
|
+
/** 左树初始选中节点 key(含根节点 key;不传则初始不选中) */
|
|
38
|
+
defaultSelectedKey?: string;
|
|
39
|
+
/** 树节点选中变化回调(选中根节点时为其 key) */
|
|
40
|
+
onTreeSelect?: (key: string) => void;
|
|
41
|
+
/** 树节点 hover 操作:新增按钮回调 */
|
|
42
|
+
onNodeAdd?: (key: string) => void;
|
|
43
|
+
/** 树节点 hover 操作:编辑按钮回调 */
|
|
44
|
+
onNodeEdit?: (key: string) => void;
|
|
45
|
+
/** 树节点 hover 操作:删除按钮回调 */
|
|
46
|
+
onNodeDelete?: (key: string) => void;
|
|
47
|
+
/** 左树面板初始宽度(支持拖拽调节) */
|
|
48
|
+
treeWidth?: number;
|
|
49
|
+
/** 左树面板最小宽度(拖拽下限) */
|
|
50
|
+
minTreeWidth?: number;
|
|
51
|
+
/** 左树面板最大宽度(拖拽上限) */
|
|
52
|
+
maxTreeWidth?: number;
|
|
53
|
+
/** 自定义根容器 className */
|
|
54
|
+
className?: string;
|
|
55
|
+
/** 自定义根容器 style */
|
|
56
|
+
style?: CSSProperties;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 左树右表模板:左侧组织/分类树(搜索 + 虚拟根入口 + 节点 hover 操作 + 拖拽调宽),
|
|
60
|
+
* 右侧复用统计列表页(StatisticsListPage)承载列表区。
|
|
61
|
+
*/
|
|
62
|
+
export declare const TreeTableTemplate: <T extends Record<string, unknown>>(props: TreeTableTemplateProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/template-components/TreeTableTemplate/index.tsx
|
|
20
|
+
var TreeTableTemplate_exports = {};
|
|
21
|
+
__export(TreeTableTemplate_exports, {
|
|
22
|
+
TreeTableTemplate: () => TreeTableTemplate
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(TreeTableTemplate_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_icons = require("@ant-design/icons");
|
|
27
|
+
var import_basic_components = require("../../basic-components");
|
|
28
|
+
var import_shared_components = require("../../shared-components");
|
|
29
|
+
var import_StatisticsListPage = require("../StatisticsListPage");
|
|
30
|
+
var import_useCompanyToken = require("../../theme/useCompanyToken");
|
|
31
|
+
var import_index = require("./index.scss");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
function collectAllKeys(nodes) {
|
|
34
|
+
return nodes.flatMap((node) => [node.key, ...collectAllKeys(node.children)]);
|
|
35
|
+
}
|
|
36
|
+
function filterTree(nodes, keyword) {
|
|
37
|
+
const k = keyword.trim().toLowerCase();
|
|
38
|
+
if (!k)
|
|
39
|
+
return nodes;
|
|
40
|
+
const walk = (list) => list.filter((node) => node.title.toLowerCase().includes(k) || walk(node.children).length > 0).map((node) => ({ ...node, children: walk(node.children) }));
|
|
41
|
+
return walk(nodes);
|
|
42
|
+
}
|
|
43
|
+
var TreeTableTemplate = (props) => {
|
|
44
|
+
const token = (0, import_useCompanyToken.useCompanyToken)();
|
|
45
|
+
const {
|
|
46
|
+
title,
|
|
47
|
+
titleExtra,
|
|
48
|
+
titleActions,
|
|
49
|
+
viewEndpoint,
|
|
50
|
+
treeData,
|
|
51
|
+
rootNode,
|
|
52
|
+
treeSearchPlaceholder = "搜索",
|
|
53
|
+
defaultSelectedKey,
|
|
54
|
+
onTreeSelect,
|
|
55
|
+
onNodeAdd,
|
|
56
|
+
onNodeEdit,
|
|
57
|
+
onNodeDelete,
|
|
58
|
+
treeWidth = 232,
|
|
59
|
+
minTreeWidth = 200,
|
|
60
|
+
maxTreeWidth = 480,
|
|
61
|
+
className,
|
|
62
|
+
style,
|
|
63
|
+
...listProps
|
|
64
|
+
} = props;
|
|
65
|
+
const [selectedKey, setSelectedKey] = (0, import_react.useState)(defaultSelectedKey ?? "");
|
|
66
|
+
const [keyword, setKeyword] = (0, import_react.useState)("");
|
|
67
|
+
const assembledTree = (0, import_react.useMemo)(() => {
|
|
68
|
+
const nodeMap = /* @__PURE__ */ new Map();
|
|
69
|
+
(treeData || []).forEach((node) => {
|
|
70
|
+
nodeMap.set(node.key, { key: node.key, title: node.label, children: [] });
|
|
71
|
+
});
|
|
72
|
+
const roots = [];
|
|
73
|
+
(treeData || []).forEach((node) => {
|
|
74
|
+
const current = nodeMap.get(node.key);
|
|
75
|
+
if (!current)
|
|
76
|
+
return;
|
|
77
|
+
const parent = node.parent ? nodeMap.get(node.parent) : void 0;
|
|
78
|
+
if (parent)
|
|
79
|
+
parent.children.push(current);
|
|
80
|
+
else
|
|
81
|
+
roots.push(current);
|
|
82
|
+
});
|
|
83
|
+
return roots;
|
|
84
|
+
}, [treeData]);
|
|
85
|
+
const [expandedKeys, setExpandedKeys] = (0, import_react.useState)([]);
|
|
86
|
+
(0, import_react.useEffect)(() => {
|
|
87
|
+
setExpandedKeys(collectAllKeys(assembledTree));
|
|
88
|
+
}, [assembledTree]);
|
|
89
|
+
const shownTree = (0, import_react.useMemo)(() => filterTree(assembledTree, keyword), [assembledTree, keyword]);
|
|
90
|
+
const effectiveExpandedKeys = keyword.trim() ? collectAllKeys(shownTree) : expandedKeys;
|
|
91
|
+
const handleTreeSelect = (0, import_react.useCallback)(
|
|
92
|
+
(keys) => {
|
|
93
|
+
if (keys.length === 0)
|
|
94
|
+
return;
|
|
95
|
+
const key = String(keys[0]);
|
|
96
|
+
setSelectedKey(key);
|
|
97
|
+
onTreeSelect == null ? void 0 : onTreeSelect(key);
|
|
98
|
+
},
|
|
99
|
+
[onTreeSelect]
|
|
100
|
+
);
|
|
101
|
+
const handleRootSelect = (0, import_react.useCallback)(() => {
|
|
102
|
+
if (!rootNode)
|
|
103
|
+
return;
|
|
104
|
+
setSelectedKey(rootNode.key);
|
|
105
|
+
onTreeSelect == null ? void 0 : onTreeSelect(rootNode.key);
|
|
106
|
+
}, [rootNode, onTreeSelect]);
|
|
107
|
+
const hasNodeActions = Boolean(onNodeAdd || onNodeEdit || onNodeDelete);
|
|
108
|
+
const [viewSwitcherSlot, setViewSwitcherSlot] = (0, import_react.useState)(null);
|
|
109
|
+
const [panelWidth, setPanelWidth] = (0, import_react.useState)(treeWidth);
|
|
110
|
+
const dragStartRef = (0, import_react.useRef)(null);
|
|
111
|
+
const [dragging, setDragging] = (0, import_react.useState)(false);
|
|
112
|
+
const handleResizeStart = (0, import_react.useCallback)(
|
|
113
|
+
(e) => {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
dragStartRef.current = { startX: e.clientX, startWidth: panelWidth };
|
|
116
|
+
setDragging(true);
|
|
117
|
+
document.body.style.cursor = "col-resize";
|
|
118
|
+
document.body.style.userSelect = "none";
|
|
119
|
+
},
|
|
120
|
+
[panelWidth]
|
|
121
|
+
);
|
|
122
|
+
(0, import_react.useEffect)(() => {
|
|
123
|
+
if (!dragging)
|
|
124
|
+
return;
|
|
125
|
+
const onMove = (e) => {
|
|
126
|
+
const start = dragStartRef.current;
|
|
127
|
+
if (!start)
|
|
128
|
+
return;
|
|
129
|
+
const next = Math.min(
|
|
130
|
+
maxTreeWidth,
|
|
131
|
+
Math.max(minTreeWidth, start.startWidth + (e.clientX - start.startX))
|
|
132
|
+
);
|
|
133
|
+
setPanelWidth(next);
|
|
134
|
+
};
|
|
135
|
+
const onUp = () => {
|
|
136
|
+
dragStartRef.current = null;
|
|
137
|
+
setDragging(false);
|
|
138
|
+
document.body.style.cursor = "";
|
|
139
|
+
document.body.style.userSelect = "";
|
|
140
|
+
};
|
|
141
|
+
window.addEventListener("mousemove", onMove);
|
|
142
|
+
window.addEventListener("mouseup", onUp);
|
|
143
|
+
return () => {
|
|
144
|
+
window.removeEventListener("mousemove", onMove);
|
|
145
|
+
window.removeEventListener("mouseup", onUp);
|
|
146
|
+
document.body.style.cursor = "";
|
|
147
|
+
document.body.style.userSelect = "";
|
|
148
|
+
};
|
|
149
|
+
}, [dragging, minTreeWidth, maxTreeWidth]);
|
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
className: `tree-table-template${dragging ? " ttt-dragging" : ""}${className ? ` ${className}` : ""}`,
|
|
154
|
+
style,
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
|
+
import_shared_components.PageTitle,
|
|
158
|
+
{
|
|
159
|
+
title,
|
|
160
|
+
titleExtra: titleExtra || viewEndpoint ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ttt-title-extra", children: [
|
|
161
|
+
viewEndpoint && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ttt-divider" }),
|
|
162
|
+
viewEndpoint && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: setViewSwitcherSlot, className: "ttt-view-switcher-slot" }),
|
|
163
|
+
titleExtra
|
|
164
|
+
] }) : void 0,
|
|
165
|
+
actions: titleActions
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "ttt-body", children: [
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "ttt-tree-panel", style: { width: panelWidth }, children: [
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
171
|
+
import_basic_components.CompanyInput,
|
|
172
|
+
{
|
|
173
|
+
className: "ttt-tree-search",
|
|
174
|
+
allowClear: true,
|
|
175
|
+
value: keyword,
|
|
176
|
+
onChange: (e) => setKeyword(e.target.value),
|
|
177
|
+
placeholder: treeSearchPlaceholder,
|
|
178
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shared_components.SvgIcon, { href: "search", size: 16, style: { color: token == null ? void 0 : token.colorTextTertiary } })
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
rootNode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
182
|
+
"div",
|
|
183
|
+
{
|
|
184
|
+
className: selectedKey === rootNode.key ? "ttt-tree-root active" : "ttt-tree-root",
|
|
185
|
+
onClick: handleRootSelect,
|
|
186
|
+
children: [
|
|
187
|
+
rootNode.icon ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shared_components.SvgIcon, { href: "all-application", size: 14 }),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ttt-tree-root-label", children: rootNode.label })
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
193
|
+
import_basic_components.CompanyTree,
|
|
194
|
+
{
|
|
195
|
+
blockNode: true,
|
|
196
|
+
treeData: shownTree,
|
|
197
|
+
selectedKeys: selectedKey === (rootNode == null ? void 0 : rootNode.key) ? [] : [selectedKey],
|
|
198
|
+
expandedKeys: effectiveExpandedKeys,
|
|
199
|
+
onExpand: (keys) => setExpandedKeys(keys.map(String)),
|
|
200
|
+
onSelect: handleTreeSelect,
|
|
201
|
+
titleRender: (node) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ttt-tree-node", children: [
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
203
|
+
"span",
|
|
204
|
+
{
|
|
205
|
+
className: "ttt-tree-node-label",
|
|
206
|
+
title: typeof node.title === "string" ? node.title : void 0,
|
|
207
|
+
children: typeof node.title === "function" ? node.title(node) : node.title
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
hasNodeActions && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ttt-tree-node-actions", onClick: (e) => e.stopPropagation(), children: [
|
|
211
|
+
onNodeAdd && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyTooltip, { title: "新增", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
212
|
+
import_basic_components.CompanyButton,
|
|
213
|
+
{
|
|
214
|
+
type: "text",
|
|
215
|
+
size: "small",
|
|
216
|
+
className: "ttt-tree-action-btn",
|
|
217
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.PlusOutlined, {}),
|
|
218
|
+
onClick: () => onNodeAdd(String(node.key))
|
|
219
|
+
}
|
|
220
|
+
) }),
|
|
221
|
+
onNodeEdit && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyTooltip, { title: "编辑", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
222
|
+
import_basic_components.CompanyButton,
|
|
223
|
+
{
|
|
224
|
+
type: "text",
|
|
225
|
+
size: "small",
|
|
226
|
+
className: "ttt-tree-action-btn",
|
|
227
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditOutlined, {}),
|
|
228
|
+
onClick: () => onNodeEdit(String(node.key))
|
|
229
|
+
}
|
|
230
|
+
) }),
|
|
231
|
+
onNodeDelete && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyTooltip, { title: "删除", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
232
|
+
import_basic_components.CompanyButton,
|
|
233
|
+
{
|
|
234
|
+
type: "text",
|
|
235
|
+
size: "small",
|
|
236
|
+
className: "ttt-tree-action-btn",
|
|
237
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DeleteOutlined, {}),
|
|
238
|
+
onClick: () => onNodeDelete(String(node.key))
|
|
239
|
+
}
|
|
240
|
+
) })
|
|
241
|
+
] })
|
|
242
|
+
] })
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
] }),
|
|
246
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
247
|
+
import_StatisticsListPage.StatisticsListPage,
|
|
248
|
+
{
|
|
249
|
+
...listProps,
|
|
250
|
+
viewEndpoint,
|
|
251
|
+
viewSwitcherPortalContainer: viewSwitcherSlot
|
|
252
|
+
},
|
|
253
|
+
selectedKey
|
|
254
|
+
),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
256
|
+
"div",
|
|
257
|
+
{
|
|
258
|
+
className: dragging ? "ttt-resize-handle dragging" : "ttt-resize-handle",
|
|
259
|
+
style: { left: panelWidth - 3 },
|
|
260
|
+
onMouseDown: handleResizeStart
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
] })
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
};
|
|
268
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
269
|
+
0 && (module.exports = {
|
|
270
|
+
TreeTableTemplate
|
|
271
|
+
});
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// 左树右表模板:左树面板(搜索 + 虚拟根入口 + 树 + hover 操作 + 拖拽调宽)+ 右侧 StatisticsListPage
|
|
2
|
+
.tree-table-template {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
height: 100%;
|
|
6
|
+
min-height: 0;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
|
|
9
|
+
// 灰底白卡视觉层次(对齐 StatisticsListPage:灰底容器 + 白卡浮起)
|
|
10
|
+
padding: 0 calc(var(--spacing-sm, 12) * 1px);
|
|
11
|
+
background: var(--color-bg-layout);
|
|
12
|
+
|
|
13
|
+
// 抵消 SmartListTemplate 泄漏的全局 .page-title { font-weight: 600 }(会粗化标题右侧文字),恢复 PageTitle 默认表现
|
|
14
|
+
// 右侧留白与列表区 padding-right 对齐
|
|
15
|
+
> .page-title {
|
|
16
|
+
padding-right: calc(var(--spacing-sm, 12) * 1px);
|
|
17
|
+
font-weight: normal;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 页面标题右侧:视图切换器区域(前置分割线 + portal 挂载位,视觉对齐 StatisticsListPage .slp-title-extra)
|
|
21
|
+
.ttt-title-extra {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: calc(var(--spacing-md, 16) * 1px);
|
|
25
|
+
margin-left: calc(var(--spacing-xs, 8) * 1px);
|
|
26
|
+
|
|
27
|
+
.ttt-divider {
|
|
28
|
+
width: 1px;
|
|
29
|
+
height: 16px;
|
|
30
|
+
background: var(--color-border, rgba(5, 5, 5, 0.15));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// StatisticsListPage 视图切换器的 portal 挂载位
|
|
34
|
+
.ttt-view-switcher-slot {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.ttt-dragging {
|
|
41
|
+
cursor: col-resize;
|
|
42
|
+
user-select: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ttt-body {
|
|
46
|
+
position: relative;
|
|
47
|
+
flex: 1;
|
|
48
|
+
min-height: 0;
|
|
49
|
+
min-width: 0;
|
|
50
|
+
display: flex;
|
|
51
|
+
|
|
52
|
+
// 左树与右侧列表之间的灰底间隔(右侧列表 padding 已归零对齐根容器灰边,间隔统一由 body gap 提供)
|
|
53
|
+
gap: calc(var(--spacing-sm, 12) * 1px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 左树面板:白底卡片,圆角仅顶部(与列表区白卡卡片形态一致)
|
|
57
|
+
// box-sizing 显式声明:antd 6 无全局 reset,普通 div 默认 content-box 会导致
|
|
58
|
+
// width(panelWidth) + padding 撑出 24px,拖拽把手(left: panelWidth - 3)与面板右缘错位
|
|
59
|
+
.ttt-tree-panel {
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
padding: calc(var(--spacing-sm, 12) * 1px);
|
|
63
|
+
overflow: auto;
|
|
64
|
+
background: var(--color-bg-container);
|
|
65
|
+
border-radius: calc(var(--border-radius-base, 8) * 1px) calc(var(--border-radius-base, 8) * 1px)
|
|
66
|
+
0 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ttt-tree-search {
|
|
70
|
+
width: 100%;
|
|
71
|
+
margin-bottom: calc(var(--spacing-xs, 8) * 1px);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 虚拟根入口(如「全部组织」):hover / 选中背景与树节点视觉一致
|
|
75
|
+
.ttt-tree-root {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
margin-bottom: 2px;
|
|
79
|
+
font-size: calc(var(--font-size-base, 14) * 1px);
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
|
|
82
|
+
// 图标水平中心对齐树一级节点的展开/收起箭头(switcher 占位内居中)
|
|
83
|
+
> svg {
|
|
84
|
+
margin-left: 7px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ttt-tree-root-label {
|
|
88
|
+
flex: 1;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
margin-left: 13px;
|
|
94
|
+
padding: 0 8px;
|
|
95
|
+
line-height: 28px;
|
|
96
|
+
border-radius: 6px;
|
|
97
|
+
transition: all var(--motion-duration-fast, 0.2s)
|
|
98
|
+
var(--motion-ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:hover .ttt-tree-root-label {
|
|
102
|
+
background: var(--color-bg-layout);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.active .ttt-tree-root-label {
|
|
106
|
+
background: var(--color-primary-bg);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 树节点:hover 时在右侧显示操作按钮(新增 / 编辑 / 删除)
|
|
111
|
+
.ttt-tree-node {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
width: 100%;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
|
|
117
|
+
.ttt-tree-node-label {
|
|
118
|
+
flex: 1;
|
|
119
|
+
min-width: 0;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ttt-tree-node-actions {
|
|
126
|
+
display: none;
|
|
127
|
+
align-items: center;
|
|
128
|
+
flex-shrink: 0;
|
|
129
|
+
margin-right: 4px;
|
|
130
|
+
|
|
131
|
+
.ttt-tree-action-btn {
|
|
132
|
+
// 压缩按钮内边距,避免三个按钮挤占过宽
|
|
133
|
+
padding-inline: 2px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ttt-tree-panel .ant-tree-node-content-wrapper:hover .ttt-tree-node-actions {
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 右侧列表:复用 StatisticsListPage,隐藏其内置标题栏(页面标题由模板统一渲染)
|
|
143
|
+
.ttt-body > .statistics-list-page {
|
|
144
|
+
flex: 1;
|
|
145
|
+
min-width: 0;
|
|
146
|
+
|
|
147
|
+
// 灰底已由模板根容器提供,归零自带左右 padding,避免白卡距右边缘出现双边距(24px ≠ 左侧 12px)
|
|
148
|
+
padding: 0;
|
|
149
|
+
|
|
150
|
+
> .page-title {
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// 单元格单行省略,对齐左树右表场景的紧凑表格形态
|
|
155
|
+
.ant-table-cell {
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
text-overflow: ellipsis;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// 拖拽调宽把手:覆盖左右面板边界,hover / 拖拽中显示主色分割线
|
|
163
|
+
.ttt-resize-handle {
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: 0;
|
|
166
|
+
bottom: 0;
|
|
167
|
+
width: 6px;
|
|
168
|
+
cursor: col-resize;
|
|
169
|
+
z-index: 10;
|
|
170
|
+
|
|
171
|
+
&::after {
|
|
172
|
+
content: "";
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: 0;
|
|
175
|
+
bottom: 0;
|
|
176
|
+
left: 2px;
|
|
177
|
+
width: 2px;
|
|
178
|
+
background: transparent;
|
|
179
|
+
transition: background var(--motion-duration-fast, 0.2s)
|
|
180
|
+
var(--motion-ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&:hover::after,
|
|
184
|
+
&.dragging::after {
|
|
185
|
+
background: var(--color-primary);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -45,6 +45,7 @@ __export(template_components_exports, {
|
|
|
45
45
|
});
|
|
46
46
|
module.exports = __toCommonJS(template_components_exports);
|
|
47
47
|
__reExport(template_components_exports, require("./StatisticsListPage"), module.exports);
|
|
48
|
+
__reExport(template_components_exports, require("./TreeTableTemplate"), module.exports);
|
|
48
49
|
var import_ColumnSettingsPanel = __toESM(require("./ColumnSettingsPanel"));
|
|
49
50
|
var import_FilterForm = __toESM(require("./FilterForm"));
|
|
50
51
|
var import_SmartListTemplate = __toESM(require("./SmartListTemplate"));
|
|
@@ -71,5 +72,6 @@ var import_AiAssistantDock = __toESM(require("./AiAssistantDock"));
|
|
|
71
72
|
FormPageTemplate,
|
|
72
73
|
IconSelect,
|
|
73
74
|
SmartListTemplate,
|
|
74
|
-
...require("./StatisticsListPage")
|
|
75
|
+
...require("./StatisticsListPage"),
|
|
76
|
+
...require("./TreeTableTemplate")
|
|
75
77
|
});
|
|
@@ -9,7 +9,7 @@ import { Tabs, theme, ConfigProvider } from "antd";
|
|
|
9
9
|
import IconGallery from "../IconGallery";
|
|
10
10
|
import IconParkGallery from "../IconParkGallery";
|
|
11
11
|
import { iconNames } from "../SvgIcon/icons";
|
|
12
|
-
import {
|
|
12
|
+
import { useIconPark } from "../IconParkGallery/useIconPark";
|
|
13
13
|
import { companyTheme } from "../../theme";
|
|
14
14
|
import "./index.scss";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -20,6 +20,8 @@ export default function IconExplorer() {
|
|
|
20
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
21
|
activeKey = _useState2[0],
|
|
22
22
|
setActiveKey = _useState2[1];
|
|
23
|
+
var _useIconPark = useIconPark(),
|
|
24
|
+
data = _useIconPark.data;
|
|
23
25
|
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
24
26
|
theme: companyTheme,
|
|
25
27
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -48,7 +50,7 @@ export default function IconExplorer() {
|
|
|
48
50
|
})
|
|
49
51
|
}, {
|
|
50
52
|
key: "full",
|
|
51
|
-
label: "\u56FE\u6807\u5E93 Full (".concat(
|
|
53
|
+
label: "\u56FE\u6807\u5E93 Full".concat(data ? " (".concat(data.count, ")") : ""),
|
|
52
54
|
forceRender: true,
|
|
53
55
|
children: /*#__PURE__*/_jsx("div", {
|
|
54
56
|
id: "icon-full",
|
|
@@ -160,7 +160,7 @@ export default function IconParkGallery() {
|
|
|
160
160
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
161
161
|
while (1) switch (_context.prev = _context.next) {
|
|
162
162
|
case 0:
|
|
163
|
-
code = "<SvgIcon
|
|
163
|
+
code = "<SvgIcon href=\"".concat(name, "\" size={16} />");
|
|
164
164
|
_context.prev = 1;
|
|
165
165
|
_context.next = 4;
|
|
166
166
|
return navigator.clipboard.writeText(code);
|
|
@@ -197,7 +197,7 @@ export default function IconParkGallery() {
|
|
|
197
197
|
color: token.colorTextSecondary,
|
|
198
198
|
fontSize: 14
|
|
199
199
|
},
|
|
200
|
-
children: "\u52A0\u8F7D
|
|
200
|
+
children: "\u52A0\u8F7D\u56FE\u6807\u6570\u636E\u4E2D..."
|
|
201
201
|
})]
|
|
202
202
|
});
|
|
203
203
|
}
|
|
@@ -237,9 +237,9 @@ export default function IconParkGallery() {
|
|
|
237
237
|
style: {
|
|
238
238
|
color: token.colorTextQuaternary
|
|
239
239
|
},
|
|
240
|
-
children: ["\u56FE\u6807\u5E93\u57FA\u4E8E IconPark\uFF0C\
|
|
240
|
+
children: ["\u56FE\u6807\u5E93\u57FA\u4E8E IconPark\uFF0C\u4E1A\u52A1\u73AF\u5883\u4F7F\u7528", /*#__PURE__*/_jsxs("code", {
|
|
241
241
|
children: ["<SvgIcon name=", '"xxx"', " />"]
|
|
242
|
-
}), "
|
|
242
|
+
}), "\u6E32\u67D3\u5185\u7F6E\u7CBE\u9009\uFF1B\u6587\u6863\u7AD9\u56FE\u6807\u5E93\u9875\u901A\u8FC7 sprite \u52A0\u8F7D\u5168\u91CF\u56FE\u6807\u3002"]
|
|
243
243
|
})]
|
|
244
244
|
}), /*#__PURE__*/_jsx("div", {
|
|
245
245
|
className: "company-iconpark-gallery-body",
|