@spacego/fe-components 0.0.1-alpha.5 → 0.0.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/fe-layouts/basics-layout/components/basics-layout/header.js +89 -76
- package/lib/fe-layouts/basics-layout/components/basics-layout/sidebar.js +30 -19
- package/lib/fe-layouts/basics-layout/components/basics-layout/tabs.js +54 -50
- package/lib/fe-layouts/basics-layout/index.js +104 -65
- package/lib/fe-layouts/context/global-context.provider.js +18 -16
- package/lib/index.css +1 -1
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/header.d.ts +16 -1
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/sidebar.d.ts +3 -0
- package/lib/types/fe-layouts/basics-layout/components/basics-layout/tabs.d.ts +3 -0
- package/lib/types/fe-layouts/context/global-context.d.ts +246 -0
- package/lib/types/typings/index.d.ts +59 -0
- package/lib/types/typings/shims-axios.d.ts +38 -0
- package/package.json +1 -1
|
@@ -1,102 +1,115 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { LogoutOutlined as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
import { LogoutOutlined as S } from "@ant-design/icons";
|
|
3
|
+
import { Breadcrumb as T, Space as R, Popover as B, Badge as C, Dropdown as M, Avatar as j } from "antd";
|
|
4
|
+
import { useState as z } from "react";
|
|
5
|
+
import { IoMoon as A } from "react-icons/io5";
|
|
6
|
+
import { MdWbSunny as I } from "react-icons/md";
|
|
7
|
+
import { Link as L } from "react-router-dom";
|
|
8
|
+
import O from "../../../../assets/svg/icon-arrows-right.svg.js";
|
|
9
|
+
import D from "../../../../assets/svg/icon-bell.svg.js";
|
|
10
|
+
import W from "../../../../assets/svg/icon-system.svg.js";
|
|
11
|
+
import { applyThemeWithTransition as H } from "../../../../utils/theme.js";
|
|
12
|
+
import P from "./setting-drawer.js";
|
|
13
|
+
function $(i) {
|
|
14
|
+
const {
|
|
15
|
+
breadcrumbItems: l,
|
|
16
|
+
appName: c,
|
|
17
|
+
logo: s,
|
|
18
|
+
headerActionsRender: m,
|
|
19
|
+
breadcrumbBeforeRender: d,
|
|
20
|
+
searchRender: h,
|
|
21
|
+
noticeRender: g,
|
|
22
|
+
isNotice: p,
|
|
23
|
+
userInfo: r,
|
|
24
|
+
userMenuItems: u = [],
|
|
25
|
+
theme: a,
|
|
26
|
+
onToggleTheme: x,
|
|
27
|
+
onLogout: f
|
|
28
|
+
} = i, [b, n] = z(!1), v = (y) => {
|
|
29
|
+
const o = y.currentTarget.getBoundingClientRect(), k = o.left + o.width / 2, w = o.top + o.height / 2;
|
|
30
|
+
H(a === "light" ? "dark" : "light", k, w).then(() => {
|
|
31
|
+
x();
|
|
23
32
|
});
|
|
24
|
-
},
|
|
25
|
-
...
|
|
33
|
+
}, N = [
|
|
34
|
+
...u,
|
|
26
35
|
{
|
|
27
36
|
key: "logout",
|
|
28
37
|
label: "退出登录",
|
|
29
|
-
icon: /* @__PURE__ */ e(
|
|
38
|
+
icon: /* @__PURE__ */ e(S, {}),
|
|
30
39
|
onClick: () => {
|
|
31
|
-
|
|
40
|
+
f();
|
|
32
41
|
}
|
|
33
42
|
}
|
|
34
43
|
];
|
|
35
44
|
return /* @__PURE__ */ t("header", { className: "layout-header h-[50px] px-4 flex items-center justify-between bg-(--global-background-color) border-b border-(--border-color) z-10", children: [
|
|
36
45
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
37
|
-
/* @__PURE__ */ e("div", { className: "min-w-[204px]", children: /* @__PURE__ */ t(
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */ e("span", { className: "text-lg font-semibold text-gray-800 dark:text-[#f2f2f2] tracking-wide", children:
|
|
46
|
+
/* @__PURE__ */ e("div", { className: "min-w-[204px]", children: /* @__PURE__ */ t(L, { to: "/", className: "flex items-center gap-2 no-underline", children: [
|
|
47
|
+
s,
|
|
48
|
+
/* @__PURE__ */ e("span", { className: "text-lg font-semibold text-gray-800 dark:text-[#f2f2f2] tracking-wide", children: c })
|
|
40
49
|
] }) }),
|
|
50
|
+
d,
|
|
41
51
|
/* @__PURE__ */ e(
|
|
42
|
-
|
|
52
|
+
T,
|
|
43
53
|
{
|
|
44
|
-
items:
|
|
54
|
+
items: l,
|
|
45
55
|
className: "items-center basics-breadcrumb text-sm! hidden md:flex",
|
|
46
|
-
separator: /* @__PURE__ */ e(
|
|
56
|
+
separator: /* @__PURE__ */ e(O, { className: "w-4 h-4 text-gray-400" })
|
|
47
57
|
}
|
|
48
58
|
)
|
|
49
59
|
] }),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
className: "cursor-pointer w-8 h-8 text-(--icon-text-color) hover:text-primary transition-colors p-2 rounded-full hover:bg-(--hover-background-color) hover-scale-animation",
|
|
56
|
-
onClick: () => i(!0),
|
|
57
|
-
children: /* @__PURE__ */ e(B, {})
|
|
58
|
-
}
|
|
59
|
-
),
|
|
60
|
-
/* @__PURE__ */ e(
|
|
61
|
-
"div",
|
|
62
|
-
{
|
|
63
|
-
onClick: g,
|
|
64
|
-
className: "cursor-pointer w-8 h-8 text-(--icon-text-color) hover:text-primary transition-colors p-2 rounded-full hover:bg-(--hover-background-color) hover-scale-animation flex items-center justify-center",
|
|
65
|
-
title: a === "light" ? "切换到暗色主题" : "切换到亮色主题",
|
|
66
|
-
children: a === "light" ? /* @__PURE__ */ e(C, { className: "text-lg" }) : /* @__PURE__ */ e(G, { className: "text-lg" })
|
|
67
|
-
}
|
|
68
|
-
),
|
|
69
|
-
/* @__PURE__ */ e("div", { className: "cursor-pointer w-8 h-8 text-(--icon-text-color) hover:text-primary transition-colors p-2 rounded-full hover:bg-(--hover-background-color) hover-scale-animation", children: /* @__PURE__ */ e(
|
|
70
|
-
w,
|
|
71
|
-
{
|
|
72
|
-
placement: "bottom",
|
|
73
|
-
arrow: !1,
|
|
74
|
-
trigger: "click",
|
|
75
|
-
classNames: {
|
|
76
|
-
container: "p-0!"
|
|
77
|
-
},
|
|
78
|
-
content: 1,
|
|
79
|
-
children: /* @__PURE__ */ e(T, { dot: !0, color: "var(--color-primary)", children: /* @__PURE__ */ e(A, {}) })
|
|
80
|
-
}
|
|
81
|
-
) }),
|
|
82
|
-
/* @__PURE__ */ e(S, { menu: { items: u }, placement: "bottomRight", arrow: !0, children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2 cursor-pointer hover:bg-(--hover-background-color) px-2 py-1 rounded-full transition-all border border-transparent", children: [
|
|
60
|
+
/* @__PURE__ */ t("div", { className: "flex items-center", children: [
|
|
61
|
+
h,
|
|
62
|
+
/* @__PURE__ */ t(R, { size: 6, className: "ml-2", children: [
|
|
63
|
+
m,
|
|
83
64
|
/* @__PURE__ */ e(
|
|
84
|
-
|
|
65
|
+
"div",
|
|
85
66
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
67
|
+
className: "cursor-pointer w-8 h-8 text-(--icon-text-color) hover:text-primary transition-colors p-2 rounded-full hover:bg-(--hover-background-color) hover-scale-animation",
|
|
68
|
+
onClick: () => n(!0),
|
|
69
|
+
children: /* @__PURE__ */ e(W, {})
|
|
89
70
|
}
|
|
90
71
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
72
|
+
/* @__PURE__ */ e(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
onClick: v,
|
|
76
|
+
className: "cursor-pointer w-8 h-8 text-(--icon-text-color) hover:text-primary transition-colors p-2 rounded-full hover:bg-(--hover-background-color) hover-scale-animation flex items-center justify-center",
|
|
77
|
+
title: a === "light" ? "切换到暗色主题" : "切换到亮色主题",
|
|
78
|
+
children: a === "light" ? /* @__PURE__ */ e(A, { className: "text-lg" }) : /* @__PURE__ */ e(I, { className: "text-lg" })
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
p && /* @__PURE__ */ e("div", { className: "cursor-pointer w-8 h-8 text-(--icon-text-color) hover:text-primary transition-colors p-2 rounded-full hover:bg-(--hover-background-color) hover-scale-animation", children: /* @__PURE__ */ e(
|
|
82
|
+
B,
|
|
83
|
+
{
|
|
84
|
+
placement: "bottom",
|
|
85
|
+
arrow: !1,
|
|
86
|
+
trigger: "click",
|
|
87
|
+
classNames: {
|
|
88
|
+
container: "p-0!"
|
|
89
|
+
},
|
|
90
|
+
content: g,
|
|
91
|
+
children: /* @__PURE__ */ e(C, { dot: !0, color: "var(--color-primary)", children: /* @__PURE__ */ e(D, {}) })
|
|
92
|
+
}
|
|
93
|
+
) }),
|
|
94
|
+
/* @__PURE__ */ e(M, { menu: { items: N }, placement: "bottomRight", arrow: !0, children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2 cursor-pointer hover:bg-(--hover-background-color) px-2 py-1 rounded-full transition-all border border-transparent", children: [
|
|
95
|
+
/* @__PURE__ */ e(
|
|
96
|
+
j,
|
|
97
|
+
{
|
|
98
|
+
size: "default",
|
|
99
|
+
className: "bg-primary/10 text-primary border border-primary/20",
|
|
100
|
+
src: r == null ? void 0 : r.avatar
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ t("div", { className: "hidden lg:flex flex-col items-start", children: [
|
|
104
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-gray-700 dark:text-[#f2f2f2] leading-tight", children: r == null ? void 0 : r.username }),
|
|
105
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-gray-400 dark:text-[#a1a1aa] leading-tight", children: r == null ? void 0 : r.roleName })
|
|
106
|
+
] })
|
|
107
|
+
] }) })
|
|
108
|
+
] })
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ e(P, { open: b, onClose: () => n(!1) })
|
|
98
111
|
] });
|
|
99
112
|
}
|
|
100
113
|
export {
|
|
101
|
-
|
|
114
|
+
$ as default
|
|
102
115
|
};
|
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { Layout as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { MdOutlineKeyboardDoubleArrowRight as
|
|
5
|
-
import { renderIcon as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { Layout as y, Menu as x } from "antd";
|
|
3
|
+
import { useState as g, useEffect as v, useMemo as k } from "react";
|
|
4
|
+
import { MdOutlineKeyboardDoubleArrowRight as K, MdOutlineKeyboardDoubleArrowLeft as w } from "react-icons/md";
|
|
5
|
+
import { renderIcon as M } from "../../../../utils/icon.js";
|
|
6
6
|
import "../../../../store/modules/layout-config.store.js";
|
|
7
7
|
import "../../../../store/modules/theme.store.js";
|
|
8
|
-
const { Sider:
|
|
9
|
-
function
|
|
10
|
-
const {
|
|
11
|
-
|
|
8
|
+
const { Sider: N } = y;
|
|
9
|
+
function D(a) {
|
|
10
|
+
const {
|
|
11
|
+
collapsed: l,
|
|
12
|
+
menus: n = [],
|
|
13
|
+
activeKey: s,
|
|
14
|
+
openKeys: o = [],
|
|
15
|
+
onMenuClick: d,
|
|
16
|
+
onCollapse: c,
|
|
17
|
+
beforeRender: f,
|
|
18
|
+
afterRender: m
|
|
19
|
+
} = a, [u, i] = g(o);
|
|
20
|
+
v(() => {
|
|
12
21
|
o.length > 0 && i(o);
|
|
13
22
|
}, [o]);
|
|
14
|
-
const
|
|
15
|
-
const t = (
|
|
23
|
+
const b = k(() => {
|
|
24
|
+
const t = (h) => h.map((r) => ({
|
|
16
25
|
key: r.key,
|
|
17
26
|
label: r.label,
|
|
18
|
-
icon:
|
|
27
|
+
icon: M(r.icon),
|
|
19
28
|
children: r.children ? t(r.children) : void 0
|
|
20
29
|
}));
|
|
21
30
|
return t(n);
|
|
22
31
|
}, [n]);
|
|
23
32
|
return /* @__PURE__ */ e(
|
|
24
|
-
|
|
33
|
+
N,
|
|
25
34
|
{
|
|
26
35
|
trigger: null,
|
|
27
36
|
collapsible: !0,
|
|
@@ -29,26 +38,28 @@ function A(a) {
|
|
|
29
38
|
width: 224,
|
|
30
39
|
className: "layout-sidebar border-r border-(--border-color) bg-(--global-background-color)! h-full relative",
|
|
31
40
|
theme: "light",
|
|
32
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ p("div", { className: "h-full flex flex-col", children: [
|
|
42
|
+
f,
|
|
33
43
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto overflow-x-hidden py-2 custom-scrollbar", children: /* @__PURE__ */ e(
|
|
34
|
-
|
|
44
|
+
x,
|
|
35
45
|
{
|
|
36
46
|
mode: "inline",
|
|
37
47
|
selectedKeys: [s],
|
|
38
|
-
openKeys:
|
|
48
|
+
openKeys: u,
|
|
39
49
|
onOpenChange: i,
|
|
40
|
-
items:
|
|
50
|
+
items: b,
|
|
41
51
|
onClick: ({ key: t }) => d(t),
|
|
42
52
|
className: "sidebar-menu border-none",
|
|
43
53
|
inlineIndent: 16
|
|
44
54
|
}
|
|
45
55
|
) }),
|
|
56
|
+
m,
|
|
46
57
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-start pl-4 mb-2", children: /* @__PURE__ */ e(
|
|
47
58
|
"div",
|
|
48
59
|
{
|
|
49
60
|
onClick: () => c(!l),
|
|
50
61
|
className: "text-gray-500 dark:text-[#a1a1a2] text-xl hover:text-[#323639] dark:hover:text-[#f0f0f0] hover:bg-[#dfe3e4] dark:hover:bg-[#333538] transition-all duration-300 w-7 h-7 rounded-sm bg-[#f4f4f5] dark:bg-[#292a2d] cursor-pointer flex items-center justify-center",
|
|
51
|
-
children: l ? /* @__PURE__ */ e(
|
|
62
|
+
children: l ? /* @__PURE__ */ e(K, {}) : /* @__PURE__ */ e(w, {})
|
|
52
63
|
}
|
|
53
64
|
) })
|
|
54
65
|
] })
|
|
@@ -56,5 +67,5 @@ function A(a) {
|
|
|
56
67
|
);
|
|
57
68
|
}
|
|
58
69
|
export {
|
|
59
|
-
|
|
70
|
+
D as default
|
|
60
71
|
};
|
|
@@ -1,60 +1,64 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as l, jsx as r, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { classnames as s } from "@spacego/turbo-utils";
|
|
3
|
-
import { Divider as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { MdClear as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
function
|
|
9
|
-
const { tabs: o, activeKey: d, onChange: f, onClose: h } = c, n =
|
|
3
|
+
import { Divider as b } from "antd";
|
|
4
|
+
import { useRef as g, useState as k, useEffect as y } from "react";
|
|
5
|
+
import { MdClear as w } from "react-icons/md";
|
|
6
|
+
import C from "../../../../assets/svg/chrome-bg-after.svg.js";
|
|
7
|
+
import N from "../../../../assets/svg/chrome-bg-before.svg.js";
|
|
8
|
+
function L(c) {
|
|
9
|
+
const { tabs: o, activeKey: d, onChange: f, onClose: m, beforeRender: h, afterRender: p } = c, n = g(null), [i, u] = k(!1), a = () => {
|
|
10
10
|
const e = n.current;
|
|
11
11
|
if (e) {
|
|
12
12
|
const t = e.scrollWidth > e.clientWidth;
|
|
13
|
-
|
|
13
|
+
u(t);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
return
|
|
16
|
+
return y(() => (a(), window.addEventListener("resize", a), () => {
|
|
17
17
|
window.removeEventListener("resize", a);
|
|
18
|
-
}), [o]), /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
18
|
+
}), [o]), /* @__PURE__ */ l("div", { className: "flex items-center bg-(--global-background-color) border-b border-(--border-color)", children: [
|
|
19
|
+
h,
|
|
20
|
+
/* @__PURE__ */ r(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref: n,
|
|
24
|
+
className: s("layout-tabs flex-1 overflow-x-auto overflow-y-hidden relative transition-all duration-300", {
|
|
25
|
+
"h-[38px]": !i,
|
|
26
|
+
// 出现滚动条时增加高度,留出滚动条的空间,防止挤压内容
|
|
27
|
+
"h-[46px]": i
|
|
28
|
+
}),
|
|
29
|
+
children: /* @__PURE__ */ r("div", { className: "flex items-center h-[38px] px-2 pt-1 min-w-fit", children: o.map((e, t) => /* @__PURE__ */ l(v, { children: [
|
|
30
|
+
/* @__PURE__ */ l(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: s("layout-tabs-item group cursor-pointer px-[16px] h-full flex items-center justify-center rounded-tl-[8px] rounded-tr-[8px] transition-all duration-500 relative hover:bg-[#f4f4f5] dark:hover:bg-[#292a2d] shrink-0", {
|
|
34
|
+
"bg-(--background-primary-light)! text-(--color-primary) dark:text-[#f9f9f9]! is-active": d === e.key
|
|
35
|
+
}),
|
|
36
|
+
onClick: () => f(e.key),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ r(N, {}),
|
|
39
|
+
e.label,
|
|
40
|
+
/* @__PURE__ */ r(C, {}),
|
|
41
|
+
e.closable !== !1 && /* @__PURE__ */ r(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "w-4 h-4 flex ml-1 mr-[-10px] items-center justify-center text-[#18181bcc] hover:text-[#18181b] hover:bg-[#f4f4f5] dark:hover:bg-transparent rounded-full transition-all duration-300",
|
|
45
|
+
onClick: (x) => {
|
|
46
|
+
x.stopPropagation(), m(e.key);
|
|
47
|
+
},
|
|
48
|
+
children: /* @__PURE__ */ r(w, { className: "text-xs text-[#333333] dark:text-[#cfd0d0] hover:text-black dark:hover:text-white transition-all" })
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
`${e.key}-${t}`
|
|
54
|
+
),
|
|
55
|
+
t !== o.length - 1 && /* @__PURE__ */ r(b, { orientation: "vertical", className: "mx-1! shrink-0" })
|
|
56
|
+
] }, `${e.key}-${t}`)) })
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
p
|
|
60
|
+
] });
|
|
57
61
|
}
|
|
58
62
|
export {
|
|
59
|
-
|
|
63
|
+
L as default
|
|
60
64
|
};
|
|
@@ -1,98 +1,137 @@
|
|
|
1
|
-
import { jsxs as f, jsx as
|
|
2
|
-
import { useSelector as
|
|
3
|
-
import { Layout as g, Spin as
|
|
4
|
-
import { useMemo as d, useEffect as
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import {
|
|
7
|
-
import "../../store/modules/
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useSelector as y } from "@spacego/zustand";
|
|
3
|
+
import { Layout as g, Spin as Z } from "antd";
|
|
4
|
+
import { useMemo as d, useEffect as $ } from "react";
|
|
5
|
+
import { useLocation as ee, useNavigate as te, Outlet as oe } from "react-router-dom";
|
|
6
|
+
import { useAuth as ne } from "../../hooks/use-auth.hook.js";
|
|
7
|
+
import { useLayoutConfigStore as re } from "../../store/modules/layout-config.store.js";
|
|
8
|
+
import { useThemeStore as ae } from "../../store/modules/theme.store.js";
|
|
9
|
+
import { useGlobal as se } from "../context/context.js";
|
|
10
|
+
import ie from "./components/basics-layout/header.js";
|
|
11
|
+
import le from "./components/basics-layout/sidebar.js";
|
|
12
|
+
import ce from "./components/basics-layout/tabs.js";
|
|
13
|
+
import { findRouteByPath as b, findMenuParentKeys as ue, buildRouteMap as fe, findParentRoutes as de, findMenuByKey as me } from "./components/utils/index.js";
|
|
13
14
|
/* empty css */
|
|
14
15
|
/* empty css */
|
|
15
|
-
const { Content:
|
|
16
|
-
function
|
|
17
|
-
const
|
|
16
|
+
const { Content: he } = g;
|
|
17
|
+
function Se() {
|
|
18
|
+
const r = ee(), m = te(), { logout: R } = ne(), {
|
|
19
|
+
token: T,
|
|
20
|
+
menus: a = [],
|
|
21
|
+
routes: o = [],
|
|
22
|
+
appName: _,
|
|
23
|
+
logo: L,
|
|
24
|
+
headerActionsRender: v,
|
|
25
|
+
breadcrumbBeforeRender: M,
|
|
26
|
+
searchRender: x,
|
|
27
|
+
noticeRender: B,
|
|
28
|
+
isNotice: S,
|
|
29
|
+
userInfo: K,
|
|
30
|
+
userMenuItems: k,
|
|
31
|
+
sidebarBefore: N,
|
|
32
|
+
sidebarAfter: D,
|
|
33
|
+
tabsBefore: I,
|
|
34
|
+
tabsAfter: w
|
|
35
|
+
} = se(), { tabsAttribute: O, sidebarCollapsed: G, loadingConfig: P, ADD_TAB: V, REMOVE_TAB: j, SET_ACTIVE_TAB_KEY: E, SET_SIDEBAR_COLLAPSED: H } = re(y(["tabsAttribute", "sidebarCollapsed", "loadingConfig", "ADD_TAB", "REMOVE_TAB", "SET_ACTIVE_TAB_KEY", "SET_SIDEBAR_COLLAPSED"])), { tabsList: h, tabsActiveKey: i } = O, { theme: Y, TOGGLE_THEME: z } = ae(y(["theme", "TOGGLE_THEME"])), l = d(() => {
|
|
18
36
|
var t;
|
|
19
|
-
if (!
|
|
20
|
-
return
|
|
21
|
-
const e = b(
|
|
22
|
-
return e && (((t = e.handle) == null ? void 0 : t.activeRouteMenuId) || e.id) ||
|
|
23
|
-
}, [
|
|
37
|
+
if (!o || o.length === 0)
|
|
38
|
+
return i;
|
|
39
|
+
const e = b(r.pathname, o);
|
|
40
|
+
return e && (((t = e.handle) == null ? void 0 : t.activeRouteMenuId) || e.id) || i;
|
|
41
|
+
}, [r.pathname, o, i]), q = d(() => {
|
|
24
42
|
const e = [];
|
|
25
|
-
if (!
|
|
43
|
+
if (!a || a.length === 0 || !l)
|
|
26
44
|
return e;
|
|
27
|
-
const t =
|
|
45
|
+
const t = ue(l, a);
|
|
28
46
|
return t && e.push(...t), e;
|
|
29
|
-
}, [l,
|
|
47
|
+
}, [l, a]), F = d(() => {
|
|
30
48
|
const e = [];
|
|
31
|
-
if (!
|
|
32
|
-
return
|
|
33
|
-
const t =
|
|
34
|
-
return c ?
|
|
35
|
-
var
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
}) :
|
|
39
|
-
}, [
|
|
40
|
-
var
|
|
41
|
-
const t =
|
|
42
|
-
m(((
|
|
43
|
-
},
|
|
49
|
+
if (!o || o.length === 0)
|
|
50
|
+
return r.pathname === "/" && e.push({ title: "首页" }), e;
|
|
51
|
+
const t = o, n = fe(t), c = b(r.pathname, t);
|
|
52
|
+
return c ? de(c, n).forEach((u) => {
|
|
53
|
+
var C;
|
|
54
|
+
const A = ((C = u.handle) == null ? void 0 : C.title) || u.id || "";
|
|
55
|
+
A && e.push({ title: A });
|
|
56
|
+
}) : r.pathname === "/" && e.push({ title: "首页" }), e;
|
|
57
|
+
}, [r.pathname, o]), J = (e) => {
|
|
58
|
+
var n;
|
|
59
|
+
const t = me(e, a);
|
|
60
|
+
m(((n = t == null ? void 0 : t.routeNode) == null ? void 0 : n.path) ?? "/");
|
|
61
|
+
}, Q = (e) => {
|
|
44
62
|
E(e);
|
|
45
|
-
const t = h.find((
|
|
63
|
+
const t = h.find((n) => n.key === e);
|
|
46
64
|
t && m(t.path);
|
|
47
|
-
},
|
|
48
|
-
const t =
|
|
65
|
+
}, U = (e) => {
|
|
66
|
+
const t = j(e);
|
|
49
67
|
m(t.path ?? "/");
|
|
50
|
-
}, p = d(() => !
|
|
68
|
+
}, p = d(() => !o || o.length === 0 ? null : (e) => b(e, o), [o]), W = () => {
|
|
51
69
|
var t;
|
|
52
|
-
const e = p == null ? void 0 : p(
|
|
70
|
+
const e = p == null ? void 0 : p(r.pathname);
|
|
53
71
|
if (e && e.id && !["root", "blank", "auth"].includes(e.id)) {
|
|
54
|
-
const
|
|
55
|
-
h.find((u) => u.key ===
|
|
56
|
-
key:
|
|
72
|
+
const n = e.id, c = ((t = e.handle) == null ? void 0 : t.title) || e.id;
|
|
73
|
+
h.find((u) => u.key === n) ? E(n) : V({
|
|
74
|
+
key: n,
|
|
57
75
|
label: c,
|
|
58
|
-
path:
|
|
76
|
+
path: r.pathname
|
|
59
77
|
});
|
|
60
78
|
}
|
|
61
79
|
};
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
/* @__PURE__ */
|
|
80
|
+
return $(() => {
|
|
81
|
+
T && W();
|
|
82
|
+
}, [r.pathname, T]), /* @__PURE__ */ f(g, { className: "basics-layout w-full h-screen overflow-hidden flex flex-col", children: [
|
|
83
|
+
/* @__PURE__ */ s(
|
|
84
|
+
ie,
|
|
85
|
+
{
|
|
86
|
+
breadcrumbItems: F,
|
|
87
|
+
appName: _,
|
|
88
|
+
logo: L,
|
|
89
|
+
headerActionsRender: v,
|
|
90
|
+
breadcrumbBeforeRender: M,
|
|
91
|
+
searchRender: x,
|
|
92
|
+
noticeRender: B,
|
|
93
|
+
isNotice: S,
|
|
94
|
+
userInfo: K,
|
|
95
|
+
userMenuItems: k,
|
|
96
|
+
theme: Y,
|
|
97
|
+
onToggleTheme: z,
|
|
98
|
+
onLogout: R
|
|
99
|
+
}
|
|
100
|
+
),
|
|
66
101
|
/* @__PURE__ */ f(g, { className: "flex-1 overflow-hidden", children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
102
|
+
/* @__PURE__ */ s(
|
|
103
|
+
le,
|
|
69
104
|
{
|
|
70
|
-
collapsed:
|
|
71
|
-
onCollapse:
|
|
72
|
-
menus:
|
|
105
|
+
collapsed: G,
|
|
106
|
+
onCollapse: H,
|
|
107
|
+
menus: a,
|
|
73
108
|
activeKey: l,
|
|
74
|
-
openKeys:
|
|
75
|
-
onMenuClick:
|
|
109
|
+
openKeys: q,
|
|
110
|
+
onMenuClick: J,
|
|
111
|
+
beforeRender: N,
|
|
112
|
+
afterRender: D
|
|
76
113
|
}
|
|
77
114
|
),
|
|
78
|
-
/* @__PURE__ */ f(
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
115
|
+
/* @__PURE__ */ f(he, { className: "flex flex-col flex-1 overflow-hidden bg-[#eff1f4] dark:bg-[#141619]", children: [
|
|
116
|
+
/* @__PURE__ */ s(
|
|
117
|
+
ce,
|
|
81
118
|
{
|
|
82
119
|
tabs: h,
|
|
83
|
-
activeKey:
|
|
84
|
-
onChange:
|
|
85
|
-
onClose:
|
|
120
|
+
activeKey: i,
|
|
121
|
+
onChange: Q,
|
|
122
|
+
onClose: U,
|
|
123
|
+
beforeRender: I,
|
|
124
|
+
afterRender: w
|
|
86
125
|
}
|
|
87
126
|
),
|
|
88
127
|
/* @__PURE__ */ f("div", { className: "flex-1 overflow-auto p-3 custom-scrollbar relative", children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
128
|
+
/* @__PURE__ */ s(oe, {}),
|
|
129
|
+
P.show && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-9999 flex items-center justify-center bg-white/80 dark:bg-[#1a1c1f]/80", children: /* @__PURE__ */ s(Z, { spinning: !0 }) })
|
|
91
130
|
] })
|
|
92
131
|
] })
|
|
93
132
|
] })
|
|
94
133
|
] });
|
|
95
134
|
}
|
|
96
135
|
export {
|
|
97
|
-
|
|
136
|
+
Se as default
|
|
98
137
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import { useState as t } from "react";
|
|
3
|
-
import { GlobalContext as
|
|
4
|
-
function
|
|
5
|
-
const [n,
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
3
|
+
import { GlobalContext as F } from "./context.js";
|
|
4
|
+
function Q(e) {
|
|
5
|
+
const [n, s] = t(e.appName), [r, o] = t(e.logo), [c, i] = t(e.noticeRender), [a, d] = t(e.description), [f, u] = t(e.descriptionDetail), [b, m] = t(e.copyright), [l, R] = t(e.userMenuItems), [h, A] = t(e.userInfo), [B, I] = t(e.sidebarBefore), [N, g] = t(e.sidebarAfter), [D, x] = t(e.tabsBefore), [M, S] = t(e.tabsAfter), [k, v] = t(e.headerActionsRender), [y, C] = t(e.searchRender), [T, G] = t(e.breadcrumbBeforeRender), [P, U] = t(e.token), [j, H] = t(e.menus), [L, q] = t(e.routes), [w, z] = t(e.isNotice ?? !0);
|
|
6
|
+
return /* @__PURE__ */ E(
|
|
7
|
+
F.Provider,
|
|
8
8
|
{
|
|
9
9
|
value: {
|
|
10
10
|
appName: n,
|
|
11
|
-
logo:
|
|
11
|
+
logo: r,
|
|
12
12
|
noticeRender: c,
|
|
13
13
|
description: a,
|
|
14
14
|
descriptionDetail: f,
|
|
@@ -16,16 +16,17 @@ function K(e) {
|
|
|
16
16
|
userMenuItems: l,
|
|
17
17
|
userInfo: h,
|
|
18
18
|
sidebarBefore: B,
|
|
19
|
-
sidebarAfter:
|
|
20
|
-
tabsBefore:
|
|
21
|
-
tabsAfter:
|
|
19
|
+
sidebarAfter: N,
|
|
20
|
+
tabsBefore: D,
|
|
21
|
+
tabsAfter: M,
|
|
22
22
|
headerActionsRender: k,
|
|
23
23
|
searchRender: y,
|
|
24
24
|
breadcrumbBeforeRender: T,
|
|
25
25
|
token: P,
|
|
26
26
|
menus: j,
|
|
27
27
|
routes: L,
|
|
28
|
-
|
|
28
|
+
isNotice: w,
|
|
29
|
+
setAppName: s,
|
|
29
30
|
setLogo: o,
|
|
30
31
|
setNoticeRender: i,
|
|
31
32
|
setDescription: d,
|
|
@@ -33,21 +34,22 @@ function K(e) {
|
|
|
33
34
|
setCopyright: m,
|
|
34
35
|
setUserMenuItems: R,
|
|
35
36
|
setUserInfo: A,
|
|
36
|
-
setSidebarBefore:
|
|
37
|
-
setSidebarAfter:
|
|
38
|
-
setTabsBefore:
|
|
37
|
+
setSidebarBefore: I,
|
|
38
|
+
setSidebarAfter: g,
|
|
39
|
+
setTabsBefore: x,
|
|
39
40
|
setTabsAfter: S,
|
|
40
41
|
setHeaderActionsRender: v,
|
|
41
42
|
setSearchRender: C,
|
|
42
43
|
setBreadcrumbBeforeRender: G,
|
|
43
44
|
setToken: U,
|
|
44
45
|
setMenus: H,
|
|
45
|
-
setRoutes: q
|
|
46
|
+
setRoutes: q,
|
|
47
|
+
setIsNotice: z
|
|
46
48
|
},
|
|
47
49
|
children: e.children
|
|
48
50
|
}
|
|
49
51
|
);
|
|
50
52
|
}
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
Q as default
|
|
53
55
|
};
|
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.bg-background-deep{background-color:#f1f3f6}.bg-background-deep .login-background{background:linear-gradient(154deg,#07070915 30%,color-mix(in srgb,var(--color-primary) 30%,transparent) 48%,#07070915 64%);filter:blur(100px)}.bg-background-deep .-enter-x{animation:enter-x-animation .3s ease-in-out .2s forwards;opacity:0;transform:translate(-50px)}.bg-background-deep .animate-float{animation:float 5s linear 0s infinite}.login-side .side-content{animation-name:slide-right;animation-duration:.3s;animation-timing-function:cubic-bezier(.16,1,.3,1)}.login-side .side-content.exit-x{animation-name:exit-x-animation;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-fill-mode:forwards}@keyframes enter-x-animation{to{opacity:1;transform:translate(0)}}@keyframes float{0%{transform:translateY(0)}50%{transform:translateY(-20px)}to{transform:translateY(0)}}@keyframes slide-right{0%{opacity:0;transform:translate(50px)}to{opacity:1;transform:translate(0)}}@keyframes exit-x-animation{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(50px)}}@keyframes scale-pulse{0%{transform:scale(1)}50%{transform:scale(.9)}to{transform:scale(1)}}.hover-scale-animation:hover{animation:scale-pulse .3s cubic-bezier(.4,0,.2,1)}@custom-variant dark (&:where(.dark,.dark *));:root{--color-primary: #006BE6;--global-background-color: white;--border-color: #e4e4e7;--text-color: #323639}[data-theme=dark]{--global-background-color: #1a1c1f;--border-color: #36363a;--text-color: #f2f2f2}html{background-color:var(--global-background-color);--hover-primary-color: color-mix(in srgb, var(--color-primary) 80%, transparent)}#root,body,html{height:100%;width:100%}body{min-height:100vh}.spin-wrapper-full,.spin-wrapper-full .ant-spin-container{width:100%;height:100%}.spin-wrapper-full .ant-spin{max-height:100%!important}.basics-layout{--sidebar-width: 220px;--header-height: 64px;--tabs-height: 44px;--background-primary-light: color-mix(in srgb, var(--color-primary) 10%, transparent);--hover-background-color: #f4f4f5;--icon-text-color: #323639}[data-theme=dark] .basics-layout{--hover-background-color: #2e3033;--icon-text-color: #dddddd;--background-primary-light: #292a2d}.basics-layout .layout-header{flex-shrink:0}.basics-layout .layout-header .basics-breadcrumb .ant-breadcrumb-separator{display:flex;align-items:center;margin-inline:6px}.basics-layout .layout-sidebar{z-index:20;flex-shrink:0}.basics-layout .layout-sidebar .sidebar-menu{background:var(--global-background-color);border:none}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item{margin:4px 8px;width:calc(100% - 16px);border-radius:8px;transition:all .3s cubic-bezier(.4,0,.2,1);padding-inline:30%}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item:hover{background:var(--hover-background-color)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item:hover .ant-menu-item-icon{transition:transform .3s cubic-bezier(.4,0,.2,1);transform:scale(1.18)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item.ant-menu-item-selected{background-color:var(--background-primary-light);color:var(--color-primary)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item .ant-menu-title-content{margin-inline-start:8px}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-submenu-title{margin:4px 8px;width:calc(100% - 16px);border-radius:8px;padding-inline:30%}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-submenu-title:hover{background-color:var(--hover-background-color)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-submenu-title:hover .ant-menu-item-icon{transition:transform .3s cubic-bezier(.4,0,.2,1);transform:scale(1.18)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-sub{background:transparent}.basics-layout .custom-scrollbar::-webkit-scrollbar{width:8px;height:8px}.basics-layout .custom-scrollbar::-webkit-scrollbar-track{background:transparent}.basics-layout .custom-scrollbar::-webkit-scrollbar-thumb{background:#0000004d;border-radius:4px}.basics-layout .custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#00000080}.basics-layout .layout-tabs{position:relative;scrollbar-width:thin}
|
|
1
|
+
.bg-background-deep{background-color:#f1f3f6}.bg-background-deep .login-background{background:linear-gradient(154deg,#07070915 30%,color-mix(in srgb,var(--color-primary) 30%,transparent) 48%,#07070915 64%);filter:blur(100px)}.bg-background-deep .-enter-x{animation:enter-x-animation .3s ease-in-out .2s forwards;opacity:0;transform:translate(-50px)}.bg-background-deep .animate-float{animation:float 5s linear 0s infinite}.login-side .side-content{animation-name:slide-right;animation-duration:.3s;animation-timing-function:cubic-bezier(.16,1,.3,1)}.login-side .side-content.exit-x{animation-name:exit-x-animation;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-fill-mode:forwards}/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--leading-tight:1.25;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-3xl:1.5rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-3{right:calc(var(--spacing)*3)}.right-\[-7px\]{right:-7px}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-3{bottom:calc(var(--spacing)*3)}.left-0{left:calc(var(--spacing)*0)}.left-\[-7px\]{left:-7px}.z-1{z-index:1}.z-10{z-index:10}.z-9999{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\!{margin-inline:calc(var(--spacing)*1)!important}.mx-9{margin-inline:calc(var(--spacing)*9)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-20{margin-right:calc(var(--spacing)*20)}.mr-\[-10px\]{margin-right:-10px}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-\[2px\]{margin-bottom:2px}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.aspect-\[2\]{aspect-ratio:2}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-5{width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}.size-\[10px\]{width:10px;height:10px}.size-full{width:100%;height:100%}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-64{height:calc(var(--spacing)*64)}.h-\[16px\]{height:16px}.h-\[18px\]{height:18px}.h-\[38px\]{height:38px}.h-\[46px\]{height:46px}.h-\[50px\]{height:50px}.h-full{height:100%}.h-screen{height:100vh}.min-h-full{min-height:100%}.w-0{width:calc(var(--spacing)*0)}.w-2\/5{width:40%}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-\[16px\]{width:16px}.w-\[18px\]{width:18px}.w-full{width:100%}.min-w-\[204px\]{min-width:204px}.min-w-fit{min-width:fit-content}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-right{transform-origin:100%}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x)var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-tl-\[8px\]{border-top-left-radius:8px}.rounded-tr-\[8px\]{border-top-right-radius:8px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-\(--border-color\){border-color:var(--border-color)}.border-\(--color-primary\){border-color:var(--color-primary)}.border-transparent{border-color:#0000}.bg-\(--background-primary-light\)\!{background-color:var(--background-primary-light)!important}.bg-\(--global-background-color\){background-color:var(--global-background-color)}.bg-\(--global-background-color\)\!{background-color:var(--global-background-color)!important}.bg-\[\#eff1f4\]{background-color:#eff1f4}.bg-\[\#f4f4f5\]{background-color:#f4f4f5}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.fill-transparent{fill:#0000}.p-0\!{padding:calc(var(--spacing)*0)!important}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-\[16px\]{padding-inline:16px}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-10{padding-block:calc(var(--spacing)*10)}.pt-1{padding-top:calc(var(--spacing)*1)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-sm\!{font-size:var(--text-sm)!important;line-height:var(--tw-leading,var(--text-sm--line-height))!important}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.whitespace-nowrap{white-space:nowrap}.text-\(--color-primary\){color:var(--color-primary)}.text-\(--color-primary\)\!{color:var(--color-primary)!important}.text-\(--icon-text-color\){color:var(--icon-text-color)}.text-\(--text-color\){color:var(--text-color)}.text-\[\#2d2f32\]{color:#2d2f32}.text-\[\#333\]{color:#333}.text-\[\#18181bcc\]{color:#18181bcc}.text-\[\#71717a\]{color:#71717a}.text-\[\#323639\]{color:#323639}.text-\[\#323639cc\]{color:#323639cc}.text-\[\#333333\]{color:#333}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-white{color:var(--color-white)}.no-underline{text-decoration-line:none}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-2{outline-style:var(--tw-outline-style);outline-width:2px}.outline-\(--color-primary\){outline-color:var(--color-primary)}.outline-\[\#e4e4e7\]{outline-color:#e4e4e7}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:scale-100:is(:where(.group):hover *){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-\[\.is-active\]\:fill-\(--background-primary-light\):is(:where(.group).is-active *){fill:var(--background-primary-light)}@media(hover:hover){.hover\:bg-\(--hover-background-color\):hover{background-color:var(--hover-background-color)}.hover\:bg-\[\#dfe3e4\]:hover{background-color:#dfe3e4}.hover\:bg-\[\#f4f4f5\]:hover{background-color:#f4f4f5}.hover\:text-\(--hover-primary-color\)\!:hover{color:var(--hover-primary-color)!important}.hover\:text-\[\#18181b\]:hover{color:#18181b}.hover\:text-\[\#323639\]:hover{color:#323639}.hover\:text-black:hover{color:var(--color-black)}}@media(min-width:40rem){.sm\:top-6{top:calc(var(--spacing)*6)}.sm\:left-6{left:calc(var(--spacing)*6)}}@media(min-width:48rem){.md\:flex{display:flex}}@media(min-width:64rem){.lg\:block{display:block}.lg\:flex{display:flex}.lg\:flex-initial{flex:0 auto}.lg\:px-8{padding-inline:calc(var(--spacing)*8)}.lg\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}.dark\:bg-\[\#1a1c1f\]\!:where(.dark,.dark *){background-color:#1a1c1f!important}.dark\:bg-\[\#1a1c1f\]\/80:where(.dark,.dark *){background-color:#1a1c1fcc}.dark\:bg-\[\#2e3033\]:where(.dark,.dark *){background-color:#2e3033}.dark\:bg-\[\#292a2d\]:where(.dark,.dark *){background-color:#292a2d}.dark\:bg-\[\#14161a\]:where(.dark,.dark *){background-color:#14161a}.dark\:bg-\[\#070709\]\!:where(.dark,.dark *){background-color:#070709!important}.dark\:bg-\[\#141619\]:where(.dark,.dark *){background-color:#141619}.dark\:text-\[\#a1a1a2\]:where(.dark,.dark *){color:#a1a1a2}.dark\:text-\[\#a1a1aa\]:where(.dark,.dark *){color:#a1a1aa}.dark\:text-\[\#cfd0d0\]:where(.dark,.dark *){color:#cfd0d0}.dark\:text-\[\#f0f0f0\]:where(.dark,.dark *){color:#f0f0f0}.dark\:text-\[\#f2f2f2\]:where(.dark,.dark *){color:#f2f2f2}.dark\:text-\[\#f9f9f9\]\!:where(.dark,.dark *){color:#f9f9f9!important}.dark\:outline-\[\#36363a\]:where(.dark,.dark *){outline-color:#36363a}@media(hover:hover){.dark\:hover\:bg-\[\#292a2d\]:where(.dark,.dark *):hover{background-color:#292a2d}.dark\:hover\:bg-\[\#333538\]:where(.dark,.dark *):hover{background-color:#333538}.dark\:hover\:bg-transparent:where(.dark,.dark *):hover{background-color:#0000}.dark\:hover\:text-\[\#f0f0f0\]:where(.dark,.dark *):hover{color:#f0f0f0}.dark\:hover\:text-white:where(.dark,.dark *):hover{color:var(--color-white)}}}@keyframes enter-x-animation{to{opacity:1;transform:translate(0)}}@keyframes float{0%{transform:translateY(0)}50%{transform:translateY(-20px)}to{transform:translateY(0)}}@keyframes slide-right{0%{opacity:0;transform:translate(50px)}to{opacity:1;transform:translate(0)}}@keyframes exit-x-animation{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(50px)}}@keyframes scale-pulse{0%{transform:scale(1)}50%{transform:scale(.9)}to{transform:scale(1)}}.hover-scale-animation:hover{animation:.3s cubic-bezier(.4,0,.2,1) scale-pulse}:root{--color-primary:#006be6;--global-background-color:white;--border-color:#e4e4e7;--text-color:#323639}[data-theme=dark]{--global-background-color:#1a1c1f;--border-color:#36363a;--text-color:#f2f2f2}html{background-color:var(--global-background-color);--hover-primary-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){html{--hover-primary-color:color-mix(in srgb,var(--color-primary)80%,transparent)}}#root,body,html{width:100%;height:100%}body{min-height:100vh}.spin-wrapper-full,.spin-wrapper-full .ant-spin-container{width:100%;height:100%}.spin-wrapper-full .ant-spin{max-height:100%!important}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}.basics-layout{--sidebar-width: 220px;--header-height: 64px;--tabs-height: 44px;--background-primary-light: color-mix(in srgb, var(--color-primary) 10%, transparent);--hover-background-color: #f4f4f5;--icon-text-color: #323639}[data-theme=dark] .basics-layout{--hover-background-color: #2e3033;--icon-text-color: #dddddd;--background-primary-light: #292a2d}.basics-layout .layout-header{flex-shrink:0}.basics-layout .layout-header .basics-breadcrumb .ant-breadcrumb-separator{display:flex;align-items:center;margin-inline:6px}.basics-layout .layout-sidebar{z-index:20;flex-shrink:0}.basics-layout .layout-sidebar .sidebar-menu{background:var(--global-background-color);border:none}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item{margin:4px 8px;width:calc(100% - 16px);border-radius:8px;transition:all .3s cubic-bezier(.4,0,.2,1);padding-inline:30%}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item:hover{background:var(--hover-background-color)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item:hover .ant-menu-item-icon{transition:transform .3s cubic-bezier(.4,0,.2,1);transform:scale(1.18)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item.ant-menu-item-selected{background-color:var(--background-primary-light);color:var(--color-primary)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-item .ant-menu-title-content{margin-inline-start:8px}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-submenu-title{margin:4px 8px;width:calc(100% - 16px);border-radius:8px;padding-inline:30%}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-submenu-title:hover{background-color:var(--hover-background-color)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-submenu-title:hover .ant-menu-item-icon{transition:transform .3s cubic-bezier(.4,0,.2,1);transform:scale(1.18)}.basics-layout .layout-sidebar .sidebar-menu .ant-menu-sub{background:transparent}.basics-layout .custom-scrollbar::-webkit-scrollbar{width:8px;height:8px}.basics-layout .custom-scrollbar::-webkit-scrollbar-track{background:transparent}.basics-layout .custom-scrollbar::-webkit-scrollbar-thumb{background:#0000004d;border-radius:4px}.basics-layout .custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#00000080}.basics-layout .layout-tabs{position:relative;scrollbar-width:thin}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
import { MenuProps } from 'antd';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { IUserInfo } from '../../../context';
|
|
1
4
|
interface HeaderProps {
|
|
2
5
|
breadcrumbItems: {
|
|
3
6
|
title: string;
|
|
4
7
|
}[];
|
|
8
|
+
appName?: ReactNode;
|
|
9
|
+
logo?: ReactNode;
|
|
10
|
+
headerActionsRender?: ReactNode;
|
|
11
|
+
breadcrumbBeforeRender?: ReactNode;
|
|
12
|
+
searchRender?: ReactNode;
|
|
13
|
+
noticeRender?: ReactNode;
|
|
14
|
+
isNotice?: boolean;
|
|
15
|
+
userInfo?: IUserInfo;
|
|
16
|
+
userMenuItems?: MenuProps['items'];
|
|
17
|
+
theme: string;
|
|
18
|
+
onToggleTheme: () => void;
|
|
19
|
+
onLogout: () => void;
|
|
5
20
|
}
|
|
6
|
-
export default function Header(
|
|
21
|
+
export default function Header(props: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
22
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { MenuItem } from '../../../../router';
|
|
2
3
|
interface SidebarProps {
|
|
3
4
|
collapsed: boolean;
|
|
@@ -6,6 +7,8 @@ interface SidebarProps {
|
|
|
6
7
|
openKeys?: string[];
|
|
7
8
|
onMenuClick: (key: string) => void;
|
|
8
9
|
onCollapse: (collapsed: boolean) => void;
|
|
10
|
+
beforeRender?: ReactNode;
|
|
11
|
+
afterRender?: ReactNode;
|
|
9
12
|
}
|
|
10
13
|
export default function Sidebar(props: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { TabItem } from '../../../../store/modules/layout-config.store';
|
|
2
3
|
interface TabsComponentProps {
|
|
3
4
|
tabs: TabItem[];
|
|
4
5
|
activeKey: string;
|
|
5
6
|
onChange: (key: string) => void;
|
|
6
7
|
onClose: (key: string) => void;
|
|
8
|
+
beforeRender?: ReactNode;
|
|
9
|
+
afterRender?: ReactNode;
|
|
7
10
|
}
|
|
8
11
|
export default function TabsComponent(props: TabsComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
export {};
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { MenuProps } from 'antd';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { RouteObject } from 'react-router-dom';
|
|
4
|
+
import { MenuItem } from '../../router';
|
|
5
|
+
export interface IUserInfo {
|
|
6
|
+
username?: string;
|
|
7
|
+
avatar?: string;
|
|
8
|
+
roleName?: string;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IGlobalContextProps {
|
|
13
|
+
/**
|
|
14
|
+
* @name 项目名称
|
|
15
|
+
*/
|
|
16
|
+
appName?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* @name 项目logo
|
|
19
|
+
*/
|
|
20
|
+
logo?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* @name 通知的reactNode
|
|
23
|
+
*/
|
|
24
|
+
noticeRender?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* @name 项目说明
|
|
27
|
+
*/
|
|
28
|
+
description?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* @name 项目详细说明
|
|
31
|
+
*/
|
|
32
|
+
descriptionDetail?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* @name Copyright
|
|
35
|
+
*/
|
|
36
|
+
copyright?: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* @name 用户菜单
|
|
39
|
+
*/
|
|
40
|
+
userMenuItems?: MenuProps['items'];
|
|
41
|
+
/**
|
|
42
|
+
* @name 用户信息
|
|
43
|
+
*/
|
|
44
|
+
userInfo?: IUserInfo;
|
|
45
|
+
/**
|
|
46
|
+
* @name 侧边栏前置内容
|
|
47
|
+
*/
|
|
48
|
+
sidebarBefore?: ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* @name 侧边栏后置内容
|
|
51
|
+
*/
|
|
52
|
+
sidebarAfter?: ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* @name tabs前置内容
|
|
55
|
+
*/
|
|
56
|
+
tabsBefore?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* @name tabs后置内容
|
|
59
|
+
*/
|
|
60
|
+
tabsAfter?: ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* @name header按钮组render
|
|
63
|
+
*/
|
|
64
|
+
headerActionsRender?: ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* @name 搜索框render
|
|
67
|
+
*/
|
|
68
|
+
searchRender?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* @name 面包屑前置render
|
|
71
|
+
*/
|
|
72
|
+
breadcrumbBeforeRender?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* @name 登录凭证
|
|
75
|
+
*/
|
|
76
|
+
token?: string;
|
|
77
|
+
/**
|
|
78
|
+
* @name 菜单列表
|
|
79
|
+
*/
|
|
80
|
+
menus?: MenuItem[];
|
|
81
|
+
/**
|
|
82
|
+
* @name 路由配置
|
|
83
|
+
*/
|
|
84
|
+
routes?: RouteObject[];
|
|
85
|
+
/**
|
|
86
|
+
* @name 是否显示通知按钮
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
isNotice?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface IGlobalContext {
|
|
93
|
+
/**
|
|
94
|
+
* @name 项目名称
|
|
95
|
+
*/
|
|
96
|
+
appName?: ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* @name 通知的reactNode
|
|
99
|
+
*/
|
|
100
|
+
noticeRender?: ReactNode;
|
|
101
|
+
/**
|
|
102
|
+
* @name 项目logo
|
|
103
|
+
*/
|
|
104
|
+
logo?: ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* @name 项目说明
|
|
107
|
+
*/
|
|
108
|
+
description?: ReactNode;
|
|
109
|
+
/**
|
|
110
|
+
* @name 项目详细说明
|
|
111
|
+
*/
|
|
112
|
+
descriptionDetail?: ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* @name Copyright
|
|
115
|
+
*/
|
|
116
|
+
copyright?: ReactNode;
|
|
117
|
+
/**
|
|
118
|
+
* @name 用户菜单
|
|
119
|
+
*/
|
|
120
|
+
userMenuItems?: MenuProps['items'];
|
|
121
|
+
/**
|
|
122
|
+
* @name 用户信息
|
|
123
|
+
*/
|
|
124
|
+
userInfo?: IUserInfo;
|
|
125
|
+
/**
|
|
126
|
+
* @name 设置项目名称
|
|
127
|
+
*/
|
|
128
|
+
setAppName: (name?: ReactNode) => void;
|
|
129
|
+
/**
|
|
130
|
+
* @name 设置通知的reactNode,用于在顶部通知图标点击显示通知
|
|
131
|
+
*/
|
|
132
|
+
setNoticeRender: (render?: ReactNode) => void;
|
|
133
|
+
/**
|
|
134
|
+
* @name 设置项目logo
|
|
135
|
+
*/
|
|
136
|
+
setLogo: (logo?: ReactNode) => void;
|
|
137
|
+
/**
|
|
138
|
+
* @name 设置项目说明
|
|
139
|
+
*/
|
|
140
|
+
setDescription: (description?: ReactNode) => void;
|
|
141
|
+
/**
|
|
142
|
+
* @name 设置项目详细说明
|
|
143
|
+
*/
|
|
144
|
+
setDescriptionDetail: (descriptionDetail?: ReactNode) => void;
|
|
145
|
+
/**
|
|
146
|
+
* @name 设置Copyright
|
|
147
|
+
*/
|
|
148
|
+
setCopyright: (copyright?: ReactNode) => void;
|
|
149
|
+
/**
|
|
150
|
+
* @name 设置用户菜单
|
|
151
|
+
*/
|
|
152
|
+
setUserMenuItems: (items?: MenuProps['items']) => void;
|
|
153
|
+
/**
|
|
154
|
+
* @name 设置用户信息
|
|
155
|
+
*/
|
|
156
|
+
setUserInfo: (info?: IUserInfo) => void;
|
|
157
|
+
/**
|
|
158
|
+
* @name 侧边栏前置内容
|
|
159
|
+
*/
|
|
160
|
+
sidebarBefore?: ReactNode;
|
|
161
|
+
/**
|
|
162
|
+
* @name 侧边栏后置内容
|
|
163
|
+
*/
|
|
164
|
+
sidebarAfter?: ReactNode;
|
|
165
|
+
/**
|
|
166
|
+
* @name tabs前置内容
|
|
167
|
+
*/
|
|
168
|
+
tabsBefore?: ReactNode;
|
|
169
|
+
/**
|
|
170
|
+
* @name tabs后置内容
|
|
171
|
+
*/
|
|
172
|
+
tabsAfter?: ReactNode;
|
|
173
|
+
/**
|
|
174
|
+
* @name header按钮组render
|
|
175
|
+
*/
|
|
176
|
+
headerActionsRender?: ReactNode;
|
|
177
|
+
/**
|
|
178
|
+
* @name 搜索框render
|
|
179
|
+
*/
|
|
180
|
+
searchRender?: ReactNode;
|
|
181
|
+
/**
|
|
182
|
+
* @name 面包屑前置render
|
|
183
|
+
*/
|
|
184
|
+
breadcrumbBeforeRender?: ReactNode;
|
|
185
|
+
/**
|
|
186
|
+
* @name 设置侧边栏前置内容
|
|
187
|
+
*/
|
|
188
|
+
setSidebarBefore: (content?: ReactNode) => void;
|
|
189
|
+
/**
|
|
190
|
+
* @name 设置侧边栏后置内容
|
|
191
|
+
*/
|
|
192
|
+
setSidebarAfter: (content?: ReactNode) => void;
|
|
193
|
+
/**
|
|
194
|
+
* @name 设置tabs前置内容
|
|
195
|
+
*/
|
|
196
|
+
setTabsBefore: (content?: ReactNode) => void;
|
|
197
|
+
/**
|
|
198
|
+
* @name 设置tabs后置内容
|
|
199
|
+
*/
|
|
200
|
+
setTabsAfter: (content?: ReactNode) => void;
|
|
201
|
+
/**
|
|
202
|
+
* @name 设置header按钮组render
|
|
203
|
+
*/
|
|
204
|
+
setHeaderActionsRender: (render?: ReactNode) => void;
|
|
205
|
+
/**
|
|
206
|
+
* @name 设置搜索框render
|
|
207
|
+
*/
|
|
208
|
+
setSearchRender: (render?: ReactNode) => void;
|
|
209
|
+
/**
|
|
210
|
+
* @name 设置面包屑前置render
|
|
211
|
+
*/
|
|
212
|
+
setBreadcrumbBeforeRender: (render?: ReactNode) => void;
|
|
213
|
+
/**
|
|
214
|
+
* @name 登录凭证
|
|
215
|
+
*/
|
|
216
|
+
token?: string;
|
|
217
|
+
/**
|
|
218
|
+
* @name 菜单列表
|
|
219
|
+
*/
|
|
220
|
+
menus?: MenuItem[];
|
|
221
|
+
/**
|
|
222
|
+
* @name 路由配置
|
|
223
|
+
*/
|
|
224
|
+
routes?: RouteObject[];
|
|
225
|
+
/**
|
|
226
|
+
* @name 设置登录凭证
|
|
227
|
+
*/
|
|
228
|
+
setToken: (token?: string) => void;
|
|
229
|
+
/**
|
|
230
|
+
* @name 设置菜单列表
|
|
231
|
+
*/
|
|
232
|
+
setMenus: (menus?: MenuItem[]) => void;
|
|
233
|
+
/**
|
|
234
|
+
* @name 设置路由配置
|
|
235
|
+
*/
|
|
236
|
+
setRoutes: (routes?: RouteObject[]) => void;
|
|
237
|
+
/**
|
|
238
|
+
* @name 是否显示通知按钮
|
|
239
|
+
* @default true
|
|
240
|
+
*/
|
|
241
|
+
isNotice?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* @name 设置是否显示通知按钮
|
|
244
|
+
*/
|
|
245
|
+
setIsNotice: (isNotice?: boolean) => void;
|
|
246
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: dushuai
|
|
3
|
+
* @Date: 2026-01-13 20:55:57
|
|
4
|
+
* @LastEditors: dushuai
|
|
5
|
+
* @LastEditTime: 2026-01-26 23:49:50
|
|
6
|
+
* @description: 类型声明
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="vite-plugin-svgr/client" />
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 菜单类型枚举
|
|
12
|
+
* @1 目录 - 仅用于菜单分组,不对应实际页面
|
|
13
|
+
* @2 菜单 - 对应实际页面路由
|
|
14
|
+
* @3 按钮 - 页面内的按钮权限
|
|
15
|
+
*/
|
|
16
|
+
export type MenuType = 1 | 2 | 3;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 路由类型
|
|
20
|
+
*/
|
|
21
|
+
export interface IRoute {
|
|
22
|
+
/** 数据库主键id */
|
|
23
|
+
id: number
|
|
24
|
+
/** 菜单类型:1目录、2菜单、3按钮 */
|
|
25
|
+
menuType: MenuType
|
|
26
|
+
/** 菜单唯一标识,必填且唯一 */
|
|
27
|
+
menuId: string
|
|
28
|
+
/** 路由路径 */
|
|
29
|
+
path?: string
|
|
30
|
+
/**
|
|
31
|
+
* 菜单标识
|
|
32
|
+
* - 菜单类型:对应 pages 目录下文件夹名称(如 home、system/user)
|
|
33
|
+
* - 按钮类型:权限标识(如 user:add、user:edit)
|
|
34
|
+
*/
|
|
35
|
+
menuCode?: string
|
|
36
|
+
/** 父级菜单的menuId */
|
|
37
|
+
parentId?: string
|
|
38
|
+
/** 是否受保护,默认true */
|
|
39
|
+
protected?: boolean
|
|
40
|
+
/** 是否是首页(仅菜单类型有效) */
|
|
41
|
+
index?: boolean
|
|
42
|
+
/** 路由/菜单标题 */
|
|
43
|
+
title?: string
|
|
44
|
+
/** 路由/菜单图标 */
|
|
45
|
+
icon?: string
|
|
46
|
+
/** 排序,数字越小越靠前 */
|
|
47
|
+
sort?: number
|
|
48
|
+
/** 是否在侧边栏菜单中显示,默认true(详情页等不需要显示在菜单中的页面设为false) */
|
|
49
|
+
isShowMenu?: boolean
|
|
50
|
+
/** 是否独立菜单 */
|
|
51
|
+
isIndependentMenu?: boolean
|
|
52
|
+
/** 激活路由的menuId */
|
|
53
|
+
activeRouteMenuId?: string
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 更新store
|
|
58
|
+
*/
|
|
59
|
+
export type TUpdateStore<T> = T | Partial<T> | ((state: T) => T | Partial<T>);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: dushuai
|
|
3
|
+
* @Date: 2025-12-07 16:31:57
|
|
4
|
+
* @LastEditors: dushuai
|
|
5
|
+
* @LastEditTime: 2026-01-13 22:14:53
|
|
6
|
+
* @description: 请求config配置
|
|
7
|
+
*/
|
|
8
|
+
declare module 'axios' {
|
|
9
|
+
export interface AxiosRequestConfig {
|
|
10
|
+
/**
|
|
11
|
+
* @name 是否单独处理请求数据,true:返回结构为Response类型(且不处理错误码),false:返回结构为data类型,默认false
|
|
12
|
+
*/
|
|
13
|
+
isCheck?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @name 是否加载loading
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
showLoading?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @name 加载loading的文本,最多七个字
|
|
21
|
+
*/
|
|
22
|
+
loadingText?: string;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface IResponse<T = unknown> {
|
|
27
|
+
code: number;
|
|
28
|
+
data: T;
|
|
29
|
+
msg: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface IRecord<T = unknown> {
|
|
33
|
+
pageNum: number;
|
|
34
|
+
pageSize: number;
|
|
35
|
+
records: T[];
|
|
36
|
+
total: number;
|
|
37
|
+
totalPage?: number;
|
|
38
|
+
}
|