aldehyde 0.2.339 → 0.2.342
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/controls/action/index.d.ts +2 -0
- package/lib/controls/action/index.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.d.ts +2 -0
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/collapse-card/index.d.ts +2 -0
- package/lib/controls/collapse-card/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.d.ts +2 -0
- package/lib/controls/color-picker/index.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts +2 -0
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts +2 -0
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.d.ts +2 -0
- package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts +2 -0
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +123 -3
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.js +11 -11
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.js.map +1 -1
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.json +210 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.ttf +0 -0
- package/lib/controls/password-setter/index.d.ts +2 -0
- package/lib/controls/password-setter/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.d.ts +2 -0
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/rfield/index.d.ts +2 -0
- package/lib/controls/rfield/index.d.ts.map +1 -1
- package/lib/controls/select/index.d.ts +2 -0
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/signature/index.d.ts +2 -0
- package/lib/controls/signature/index.d.ts.map +1 -1
- package/lib/controls/text/ellipsis-text.d.ts +2 -0
- package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
- package/lib/controls/upload/index.d.ts +2 -0
- package/lib/controls/upload/index.d.ts.map +1 -1
- package/lib/controls/upload/mult-file-upload.d.ts +2 -0
- package/lib/controls/upload/mult-file-upload.d.ts.map +1 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +2 -0
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.d.ts +2 -0
- package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/cquery-button-bar.d.ts +2 -0
- package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
- package/lib/detail/button/fix-right-submit-button-bar.d.ts +2 -0
- package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/edit/fields-edit-card.d.ts +2 -0
- package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts +2 -0
- package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
- package/lib/detail/edit/popover-edit-card.d.ts +2 -0
- package/lib/detail/edit/popover-edit-card.d.ts.map +1 -1
- package/lib/detail/rightbar/index.d.ts +2 -0
- package/lib/detail/rightbar/index.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts +2 -0
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/field-view-group.d.ts +2 -0
- package/lib/detail/view/field-view-group.d.ts.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts +2 -0
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts +2 -0
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/detail/view/tab-act-dtmpl-view.d.ts +2 -0
- package/lib/detail/view/tab-act-dtmpl-view.d.ts.map +1 -1
- package/lib/export/export-frame.d.ts +2 -0
- package/lib/export/export-frame.d.ts.map +1 -1
- package/lib/export/select-code-export-frame.d.ts +2 -0
- package/lib/export/select-code-export-frame.d.ts.map +1 -1
- package/lib/form/dtmpl-form.d.ts +2 -0
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/field-group-form.d.ts +2 -0
- package/lib/form/field-group-form.d.ts.map +1 -1
- package/lib/form/form-Item-group.d.ts +2 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/import/excel-import.d.ts +2 -0
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/layout/menu/block.d.ts +2 -0
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.d.ts +3 -1
- package/lib/layout/menu/l2menu-message-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.js +8 -10
- package/lib/layout/menu/l2menu-message-bar.js.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts +4 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.js +4 -9
- package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
- package/lib/layout/menu/menu-2layers.d.ts +2 -0
- package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
- package/lib/layout/menu/reset-password.d.ts +2 -0
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.d.ts +2 -0
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.d.ts +2 -0
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout2/components/theme-button.js +1 -1
- package/lib/layout2/components/theme-button.js.map +1 -1
- package/lib/layout2/components/user-button.d.ts.map +1 -1
- package/lib/layout2/components/user-button.js +10 -3
- package/lib/layout2/components/user-button.js.map +1 -1
- package/lib/layout2/header.js +5 -5
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +10 -7
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout3/header.js +3 -3
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout3/page.js +3 -3
- package/lib/layout3/page.js.map +1 -1
- package/lib/layout4/header.js +3 -3
- package/lib/layout4/header.js.map +1 -1
- package/lib/layout4/page.js +3 -3
- package/lib/layout4/page.js.map +1 -1
- package/lib/layout5/css/header.css +32 -0
- package/lib/layout5/header.d.ts +9 -0
- package/lib/layout5/header.d.ts.map +1 -0
- package/lib/layout5/header.js +123 -0
- package/lib/layout5/header.js.map +1 -0
- package/lib/layout5/imgs/home.png +0 -0
- package/lib/layout5/page.d.ts +7 -0
- package/lib/layout5/page.d.ts.map +1 -0
- package/lib/layout5/page.js +54 -0
- package/lib/layout5/page.js.map +1 -0
- package/lib/layout5/sider.d.ts +10 -0
- package/lib/layout5/sider.d.ts.map +1 -0
- package/lib/layout5/sider.js +150 -0
- package/lib/layout5/sider.js.map +1 -0
- package/lib/locale/LocaleProvider.d.ts +2 -0
- package/lib/locale/LocaleProvider.d.ts.map +1 -1
- package/lib/locale/LocaleProvider.js +8 -1
- package/lib/locale/LocaleProvider.js.map +1 -1
- package/lib/locale/useLocale.d.ts +2 -0
- package/lib/locale/useLocale.d.ts.map +1 -1
- package/lib/locale/useLocale.js +3 -1
- package/lib/locale/useLocale.js.map +1 -1
- package/lib/login/login.d.ts +2 -0
- package/lib/login/login.d.ts.map +1 -1
- package/lib/lowcode-components/base-table/index.js +3 -2
- package/lib/lowcode-components/base-table/index.js.map +1 -1
- package/lib/module/dtmpl-edit-card.d.ts +2 -0
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts +4 -0
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +46 -31
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/ltmpl-modal.d.ts +2 -0
- package/lib/module/ltmpl-modal.d.ts.map +1 -1
- package/lib/module/ltmpl-table.d.ts +2 -0
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/table/act-table.d.ts +2 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.d.ts +2 -0
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/pagination.d.ts +2 -0
- package/lib/table/pagination.d.ts.map +1 -1
- package/lib/table/query-table.d.ts +2 -0
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/relation-table.d.ts +2 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/select-table.d.ts +2 -0
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/selected-rows-card.d.ts +2 -0
- package/lib/table/selected-rows-card.d.ts.map +1 -1
- package/lib/table/stat/restat.d.ts +2 -0
- package/lib/table/stat/restat.d.ts.map +1 -1
- package/lib/tree/act-tree.d.ts +2 -0
- package/lib/tree/act-tree.d.ts.map +1 -1
- package/lib/tree/block-menu-auth-tree.d.ts +2 -0
- package/lib/tree/block-menu-auth-tree.d.ts.map +1 -1
- package/lib/tree/tmpl-tree.d.ts +2 -0
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/welcome/quick-entrance.d.ts +2 -0
- package/lib/welcome/quick-entrance.d.ts.map +1 -1
- package/lib/welcome/workbench.d.ts +2 -0
- package/lib/welcome/workbench.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +123 -3
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.js +1 -1
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.json +210 -0
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.ttf +0 -0
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.woff +0 -0
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.woff2 +0 -0
- package/src/aldehyde/index.tsx +5 -1
- package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +38 -14
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +34 -17
- package/src/aldehyde/layout2/components/theme-button.tsx +1 -1
- package/src/aldehyde/layout2/components/user-button.tsx +10 -2
- package/src/aldehyde/layout2/header.tsx +5 -5
- package/src/aldehyde/layout2/page.tsx +13 -8
- package/src/aldehyde/layout3/header.tsx +3 -3
- package/src/aldehyde/layout3/page.tsx +3 -3
- package/src/aldehyde/layout4/header.tsx +3 -3
- package/src/aldehyde/layout4/page.tsx +3 -3
- package/src/aldehyde/layout5/css/header.css +32 -0
- package/src/aldehyde/layout5/header.tsx +169 -0
- package/src/aldehyde/layout5/imgs/home.png +0 -0
- package/src/aldehyde/layout5/page.tsx +79 -0
- package/src/aldehyde/layout5/sider.tsx +214 -0
- package/src/aldehyde/locale/LocaleProvider.tsx +21 -10
- package/src/aldehyde/locale/useLocale.ts +6 -3
- package/src/aldehyde/lowcode-components/base-table/index.tsx +2 -2
- package/src/aldehyde/module/dtmpl-edit-page.tsx +76 -57
|
@@ -10,6 +10,7 @@ import IconFont from "../../layout2/components/icon-font";
|
|
|
10
10
|
|
|
11
11
|
interface L2MenuQuickBarProps {
|
|
12
12
|
backgroudColor?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
interface QuickBar {
|
|
@@ -76,7 +77,7 @@ class L2MenuQuickBar extends React.PureComponent<
|
|
|
76
77
|
};
|
|
77
78
|
|
|
78
79
|
renderQuickBar = (quickBars: QuickBar[]) => {
|
|
79
|
-
const { backgroudColor } = this.props;
|
|
80
|
+
const { backgroudColor, style = {} } = this.props;
|
|
80
81
|
let total: number = 0;
|
|
81
82
|
const syyy: CSSProperties = {
|
|
82
83
|
"--message-bar-backgroupd": backgroudColor,
|
|
@@ -105,27 +106,43 @@ class L2MenuQuickBar extends React.PureComponent<
|
|
|
105
106
|
if (!quickBars || quickBars.length == 0) {
|
|
106
107
|
return;
|
|
107
108
|
} else if (quickBars.length == 1) {
|
|
108
|
-
let
|
|
109
|
-
const l2Menu = quickBar.l2Menu;
|
|
109
|
+
let l2Menu = quickBars[0].l2Menu;
|
|
110
110
|
return (
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
<Button
|
|
112
|
+
onClick={() => this.showDraw(l2Menu.id)}
|
|
113
|
+
icon={<AppstoreOutlined />}
|
|
114
|
+
shape="default"
|
|
115
|
+
size="large"
|
|
116
|
+
type="text"
|
|
117
|
+
style={{
|
|
118
|
+
width: "100%",
|
|
119
|
+
height: "100%",
|
|
120
|
+
boxSizing: "border-box",
|
|
121
|
+
padding: 0,
|
|
122
|
+
borderRadius: 0,
|
|
123
|
+
...syyy,
|
|
124
|
+
...style
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
120
127
|
);
|
|
121
128
|
} else {
|
|
122
129
|
return (
|
|
123
130
|
<Dropdown overlay={menu} placement="bottomCenter">
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
<Button
|
|
132
|
+
icon={<AppstoreOutlined />}
|
|
133
|
+
shape="default"
|
|
134
|
+
size="large"
|
|
135
|
+
type="text"
|
|
136
|
+
style={{
|
|
137
|
+
width: "100%",
|
|
138
|
+
height: "100%",
|
|
139
|
+
boxSizing: "border-box",
|
|
140
|
+
padding: 0,
|
|
141
|
+
borderRadius: 0,
|
|
142
|
+
...syyy,
|
|
143
|
+
...style
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
129
146
|
</Dropdown>
|
|
130
147
|
);
|
|
131
148
|
}
|
|
@@ -7,7 +7,7 @@ import { KeepAliveTab } from "../../hooks/use-tabs";
|
|
|
7
7
|
const { useToken } = theme;
|
|
8
8
|
|
|
9
9
|
const regex = /#\/v\d+\/(.*)/;
|
|
10
|
-
const themes = [{ label: "默认", value: "v2" }, { label: "科技风一", value: "v3" }, { label: "科技风二", value: "v4" }];
|
|
10
|
+
const themes = [{ label: "默认", value: "v2" }, { label: "科技风一", value: "v3" }, { label: "科技风二", value: "v4" }, { label: "侧边布局", value: "v5" }];
|
|
11
11
|
|
|
12
12
|
const ThemeButton = (props: ButtonProps) => {
|
|
13
13
|
const { token } = useToken();
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
SettingOutlined,
|
|
8
8
|
UnlockOutlined,
|
|
9
9
|
UserOutlined,
|
|
10
|
+
CompressOutlined
|
|
10
11
|
} from "@ant-design/icons";
|
|
11
12
|
import { Button, ButtonProps, Dropdown, GetProp, MenuProps } from "antd";
|
|
12
13
|
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
@@ -35,7 +36,7 @@ interface Props extends ButtonProps {
|
|
|
35
36
|
const UserButton: React.FC<Props> = (props) => {
|
|
36
37
|
const { logoutUrl = "/login2", customRender } = props;
|
|
37
38
|
// translate
|
|
38
|
-
const { translate, changeSiderCollapsed, getSiderCollapsed } = useLocale();
|
|
39
|
+
const { translate, changeSiderCollapsed, getSiderCollapsed, compactTheme, changeCompactTheme } = useLocale();
|
|
39
40
|
const [keepAliveTabs, setKeepAliveTabs] = useSessionStorageState<KeepAliveTab[]>('keepAliveTabs', {
|
|
40
41
|
defaultValue: [],
|
|
41
42
|
});
|
|
@@ -139,7 +140,14 @@ const UserButton: React.FC<Props> = (props) => {
|
|
|
139
140
|
show: () => {
|
|
140
141
|
return isLogin && userConfig.cleanCachable;
|
|
141
142
|
},
|
|
142
|
-
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: <span onClick={() => changeCompactTheme()}>{compactTheme ? "默认主题" : "紧凑主题"}</span>,
|
|
146
|
+
key: "compactTheme",
|
|
147
|
+
icon: <CompressOutlined />,
|
|
148
|
+
show: () => isLogin,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
143
151
|
label: (
|
|
144
152
|
<span onClick={() => changeSiderCollapsed()}>
|
|
145
153
|
{getSiderCollapsed() ? translate("${显示侧边栏}") : translate("${隐藏侧边栏}")}
|
|
@@ -239,9 +239,9 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
239
239
|
flexDirection: "row",
|
|
240
240
|
}}
|
|
241
241
|
>
|
|
242
|
-
<Space size=
|
|
243
|
-
<L2MenuQuickBar />
|
|
244
|
-
<L2MenuMessageBar />
|
|
242
|
+
<Space size="large">
|
|
243
|
+
<L2MenuQuickBar style={{ color: "#fff" }} />
|
|
244
|
+
<L2MenuMessageBar version="v2" style={{ color: "#fff" }} />
|
|
245
245
|
<LocaleButton
|
|
246
246
|
shape="default"
|
|
247
247
|
size="large"
|
|
@@ -250,7 +250,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
250
250
|
width: "100%",
|
|
251
251
|
height: "100%",
|
|
252
252
|
boxSizing: "border-box",
|
|
253
|
-
padding:
|
|
253
|
+
padding: 0,
|
|
254
254
|
borderRadius: 0,
|
|
255
255
|
color: "#fff",
|
|
256
256
|
}}
|
|
@@ -262,7 +262,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
262
262
|
width: "100%",
|
|
263
263
|
height: "100%",
|
|
264
264
|
boxSizing: "border-box",
|
|
265
|
-
padding:
|
|
265
|
+
padding: 0,
|
|
266
266
|
borderRadius: 0,
|
|
267
267
|
color: "#fff",
|
|
268
268
|
}} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Layout, theme } from "antd";
|
|
1
|
+
import { Layout, theme, ConfigProvider } from "antd";
|
|
2
2
|
import React, {
|
|
3
3
|
useEffect,
|
|
4
4
|
useRef,
|
|
@@ -173,7 +173,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
173
173
|
documentTitle,
|
|
174
174
|
updateMenuItemIdToFirstFloorIdxMap,
|
|
175
175
|
} = useLayoutContext();
|
|
176
|
-
const { getSiderCollapsed } = useLocale();
|
|
176
|
+
const { getSiderCollapsed, compactTheme } = useLocale();
|
|
177
177
|
const {
|
|
178
178
|
token: { colorPrimary },
|
|
179
179
|
} = useToken();
|
|
@@ -213,13 +213,18 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
213
213
|
position: "absolute",
|
|
214
214
|
}}
|
|
215
215
|
>
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
<ConfigProvider
|
|
217
|
+
theme={{
|
|
218
|
+
algorithm: compactTheme ? [theme.compactAlgorithm] : [],
|
|
219
|
+
}}>
|
|
220
|
+
<Layout style={{ height: "100%" }} className={compactTheme ? "layout-compactTheme" : undefined}>
|
|
221
|
+
<Header systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
|
|
222
|
+
<Layout>
|
|
223
|
+
<Sider menuList={menu} collapsed={getSiderCollapsed()}></Sider>
|
|
224
|
+
<Main>{props.children}</Main>
|
|
225
|
+
</Layout>
|
|
221
226
|
</Layout>
|
|
222
|
-
</
|
|
227
|
+
</ConfigProvider>
|
|
223
228
|
</div>
|
|
224
229
|
</DocumentTitle>
|
|
225
230
|
);
|
|
@@ -126,9 +126,9 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList }) => {
|
|
|
126
126
|
<div className="header-time"><Time /></div>
|
|
127
127
|
<div className="header-title">{translate("${" + systemName + "}")}</div>
|
|
128
128
|
<div className="header-right" >
|
|
129
|
-
<Space size=
|
|
130
|
-
<L2MenuQuickBar />
|
|
131
|
-
<L2MenuMessageBar />
|
|
129
|
+
<Space size="large" >
|
|
130
|
+
<L2MenuQuickBar style={{ color: "#009BFF" }} />
|
|
131
|
+
<L2MenuMessageBar version="v3" style={{ color: "#009BFF" }} />
|
|
132
132
|
<LocaleButton
|
|
133
133
|
shape="default"
|
|
134
134
|
size="large"
|
|
@@ -28,7 +28,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
28
28
|
//清空缓存
|
|
29
29
|
const [keepAliveTabs, setKeepAliveTabs] = useSessionStorageState<KeepAliveTab[]>('keepAliveTabs', { defaultValue: [] });
|
|
30
30
|
const { documentTitle, updateMenuItemIdToFirstFloorIdxMap } = useLayoutContext();
|
|
31
|
-
const { getSiderCollapsed } = useLocale();
|
|
31
|
+
const { getSiderCollapsed, compactTheme } = useLocale();
|
|
32
32
|
const { token: { colorPrimary } } = useToken();
|
|
33
33
|
|
|
34
34
|
useEffect(() => {
|
|
@@ -51,7 +51,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
51
51
|
<ConfigProvider
|
|
52
52
|
getPopupContainer={() => pageRef.current}
|
|
53
53
|
theme={{
|
|
54
|
-
algorithm: [theme.darkAlgorithm],
|
|
54
|
+
algorithm: compactTheme ? [theme.darkAlgorithm, theme.compactAlgorithm] : [theme.darkAlgorithm],
|
|
55
55
|
token: { colorBgBase: "#041B3B" },
|
|
56
56
|
components: {
|
|
57
57
|
Tabs: {
|
|
@@ -64,7 +64,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
64
64
|
modal={{ className: "v3-antd-modal" }}
|
|
65
65
|
card={{ className: "v3-antd-card" }}
|
|
66
66
|
>
|
|
67
|
-
<Layout style={{ height: "100%" }}>
|
|
67
|
+
<Layout style={{ height: "100%" }} className={compactTheme ? "layout-compactTheme" : undefined}>
|
|
68
68
|
<Header systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
|
|
69
69
|
<Layout>
|
|
70
70
|
<Sider menuList={menu} collapsed={getSiderCollapsed()}></Sider>
|
|
@@ -138,9 +138,9 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList }) => {
|
|
|
138
138
|
/>
|
|
139
139
|
</div>
|
|
140
140
|
<div className="header-right" >
|
|
141
|
-
<Space size=
|
|
142
|
-
<L2MenuQuickBar />
|
|
143
|
-
<L2MenuMessageBar />
|
|
141
|
+
<Space size="large">
|
|
142
|
+
<L2MenuQuickBar style={{ color: colorPrimary, fontSize: "20px" }} />
|
|
143
|
+
<L2MenuMessageBar version="v4" style={{ color: colorPrimary, fontSize: "20px" }} />
|
|
144
144
|
<LocaleButton
|
|
145
145
|
shape="default"
|
|
146
146
|
size="large"
|
|
@@ -28,7 +28,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
28
28
|
//清空缓存
|
|
29
29
|
const [keepAliveTabs, setKeepAliveTabs] = useSessionStorageState<KeepAliveTab[]>('keepAliveTabs', { defaultValue: [] });
|
|
30
30
|
const { documentTitle, updateMenuItemIdToFirstFloorIdxMap } = useLayoutContext();
|
|
31
|
-
const { getSiderCollapsed } = useLocale();
|
|
31
|
+
const { getSiderCollapsed, compactTheme } = useLocale();
|
|
32
32
|
const { token: { colorPrimary } } = useToken();
|
|
33
33
|
|
|
34
34
|
useEffect(() => {
|
|
@@ -51,7 +51,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
51
51
|
<ConfigProvider
|
|
52
52
|
getPopupContainer={() => pageRef.current}
|
|
53
53
|
theme={{
|
|
54
|
-
algorithm: [theme.darkAlgorithm],
|
|
54
|
+
algorithm: compactTheme ? [theme.darkAlgorithm, theme.compactAlgorithm] : [theme.darkAlgorithm],
|
|
55
55
|
token: {
|
|
56
56
|
colorBgBase: "#001325",
|
|
57
57
|
colorBorderSecondary: "#17375e",
|
|
@@ -67,7 +67,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
67
67
|
modal={{ className: "v4-antd-modal" }}
|
|
68
68
|
card={{ className: "v4-antd-card" }}
|
|
69
69
|
>
|
|
70
|
-
<Layout style={{ height: "100%" }}>
|
|
70
|
+
<Layout style={{ height: "100%" }} className={compactTheme ? "layout-compactTheme" : undefined}>
|
|
71
71
|
<Header systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
|
|
72
72
|
<Layout>
|
|
73
73
|
<Sider menuList={menu} collapsed={getSiderCollapsed()}></Sider>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.v5-layout-header {
|
|
2
|
+
position: relative;
|
|
3
|
+
z-index: 10;
|
|
4
|
+
padding: 0 16px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: end;
|
|
8
|
+
background-color: #ffffff;
|
|
9
|
+
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
|
|
10
|
+
height: 32px;
|
|
11
|
+
line-height: normal;
|
|
12
|
+
|
|
13
|
+
.sider-collapsed-button {
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 101;
|
|
16
|
+
width: 24px;
|
|
17
|
+
height: 24px;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
text-align: center;
|
|
20
|
+
border-radius: 40px;
|
|
21
|
+
inset-inline-start: -13px;
|
|
22
|
+
transition: transform 0.3s;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
color: rgba(0, 0, 0, 0.25);
|
|
28
|
+
background-color: #ffffff;
|
|
29
|
+
border: 1px solid rgba(0, 21, 41, 0.08);
|
|
30
|
+
box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 4px -1px rgba(25, 15, 15, 0.07), 0 0 1px 0 rgba(0, 0, 0, 0.08);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import { Layout, Space, theme, Button, MenuProps, Dropdown } from "antd";
|
|
3
|
+
import { NavLink, useParams, useSearchParams } from "react-router-dom";
|
|
4
|
+
import { LeftOutlined, RightOutlined, UnorderedListOutlined } from '@ant-design/icons';
|
|
5
|
+
import L2MenuQuickBar from "../layout/menu/l2menu-quick-bar";
|
|
6
|
+
import L2MenuMessageBar from "../layout/menu/l2menu-message-bar";
|
|
7
|
+
import LocaleButton from "../locale/LocaleButton";
|
|
8
|
+
import ThemeButton from "../layout2/components/theme-button";
|
|
9
|
+
import UserButton from "../layout2/components/user-button";
|
|
10
|
+
import { MenuType } from "../layout2/type/layout-type";
|
|
11
|
+
import { useLocale } from "../locale/useLocale";
|
|
12
|
+
import { getLeftMostRouteInfo, handlePropsMenuToAntdMenu } from "../layout2/util/menu-util";
|
|
13
|
+
import IconFont from "../layout2/components/icon-font";
|
|
14
|
+
import "./css/header.css";
|
|
15
|
+
|
|
16
|
+
const { useToken } = theme;
|
|
17
|
+
|
|
18
|
+
// 查找当前选中菜单的顶层菜单id
|
|
19
|
+
const findPathToRoot = (menus, targetId) => {
|
|
20
|
+
// 使用栈来存储需要遍历的节点及其从根节点到该节点的路径
|
|
21
|
+
const stack = [];
|
|
22
|
+
// 初始化栈:将每个根节点及其路径(初始只包含自身ID)入栈
|
|
23
|
+
for (const node of menus) {
|
|
24
|
+
stack.push({ node, path: [node.id] });
|
|
25
|
+
}
|
|
26
|
+
while (stack.length > 0) {
|
|
27
|
+
const { node, path } = stack.pop(); // 弹出栈顶元素
|
|
28
|
+
// 检查当前节点是否是目标节点
|
|
29
|
+
if (node.id === targetId) {
|
|
30
|
+
return path[0]; // 返回路径的第一个元素,即最顶层根节点ID
|
|
31
|
+
}
|
|
32
|
+
// 如果当前节点有子节点,则将它们全部入栈,并记录从根到该子节点的路径
|
|
33
|
+
if (node.children && node.children.length > 0) {
|
|
34
|
+
for (const child of node.children) {
|
|
35
|
+
stack.push({ node: child, path: [...path, child.id] }); // 将子节点和新的路径入栈
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type HeaderPropsType = {
|
|
43
|
+
menuList: MenuType[];
|
|
44
|
+
};
|
|
45
|
+
type MenuItem = Required<MenuProps>["items"][number];
|
|
46
|
+
|
|
47
|
+
const Header: React.FC<HeaderPropsType> = ({ menuList }) => {
|
|
48
|
+
const { token: { colorPrimary } } = useToken();
|
|
49
|
+
const { translate, getLocale } = useLocale();
|
|
50
|
+
const { changeSiderCollapsed, getSiderCollapsed } = useLocale();
|
|
51
|
+
const [menu, setMenu] = useState<MenuItem[]>([]);
|
|
52
|
+
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
53
|
+
const [selParentId, setSelParentId] = useState<string>();
|
|
54
|
+
const { sourceId } = useParams();
|
|
55
|
+
const [search] = useSearchParams();
|
|
56
|
+
const menuId: string = search.get("menuId");
|
|
57
|
+
|
|
58
|
+
const handleMenu = (menuItem, floor) => {
|
|
59
|
+
const { disabled, label, children, icon } = menuItem;
|
|
60
|
+
const renderIcon = icon ? <IconFont type={icon} className="menu-icon" /> : "";
|
|
61
|
+
const renderItem = <div style={{ textAlign: "left" }}><Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space></div>;
|
|
62
|
+
if (disabled) {
|
|
63
|
+
return <div style={{ cursor: "not-allowed" }}>{renderItem}</div>;
|
|
64
|
+
}
|
|
65
|
+
const { path, target } = getLeftMostRouteInfo(menuItem);
|
|
66
|
+
if (floor === 0) {
|
|
67
|
+
return path === null ? (
|
|
68
|
+
renderItem
|
|
69
|
+
) : (
|
|
70
|
+
<NavLink
|
|
71
|
+
to={`/${path}`}
|
|
72
|
+
target={target}
|
|
73
|
+
>
|
|
74
|
+
{renderItem}
|
|
75
|
+
</NavLink>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
if (Array.isArray(children) && !children.length) {
|
|
79
|
+
return (
|
|
80
|
+
<NavLink to={`/${path}`} target={target} >
|
|
81
|
+
{renderItem}
|
|
82
|
+
</NavLink>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return renderItem;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (menuId !== undefined) setSelectedKeys([menuId]);
|
|
90
|
+
}, [menuId]);
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (menuList?.length && selParentId) {
|
|
94
|
+
setMenu(handlePropsMenuToAntdMenu(menuList, handleMenu));
|
|
95
|
+
}
|
|
96
|
+
}, [menuList, getLocale(), selParentId]);
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (sourceId === undefined) {
|
|
100
|
+
if (menuList[0] !== undefined) {
|
|
101
|
+
setSelectedKeys([menuList[0].id]);
|
|
102
|
+
setSelParentId(menuList[0].id);
|
|
103
|
+
}
|
|
104
|
+
} else if (menuList?.length) {
|
|
105
|
+
setSelectedKeys([sourceId]);
|
|
106
|
+
setSelParentId(findPathToRoot(menuList, sourceId));
|
|
107
|
+
}
|
|
108
|
+
}, [menuList, sourceId]);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<Layout.Header className="v5-layout-header" >
|
|
112
|
+
<div className="sider-collapsed-button" style={{ insetInlineStart: getSiderCollapsed() ? 6 : -13 }} onClick={() => changeSiderCollapsed()}>
|
|
113
|
+
{getSiderCollapsed() ? <RightOutlined /> : <LeftOutlined />}
|
|
114
|
+
</div>
|
|
115
|
+
<Space size="large" style={{ height: "100%" }}>
|
|
116
|
+
{menu?.length > 1 &&
|
|
117
|
+
<Dropdown menu={{ items: menu, selectedKeys }}>
|
|
118
|
+
<Button
|
|
119
|
+
shape="circle"
|
|
120
|
+
icon={<UnorderedListOutlined />}
|
|
121
|
+
size="large"
|
|
122
|
+
type="text"
|
|
123
|
+
style={{
|
|
124
|
+
width: "100%",
|
|
125
|
+
height: "100%",
|
|
126
|
+
boxSizing: "border-box",
|
|
127
|
+
padding: 0,
|
|
128
|
+
borderRadius: 0,
|
|
129
|
+
minWidth: 0,
|
|
130
|
+
color: colorPrimary,
|
|
131
|
+
}}
|
|
132
|
+
/>
|
|
133
|
+
</Dropdown>
|
|
134
|
+
}
|
|
135
|
+
<L2MenuQuickBar style={{ color: colorPrimary }} />
|
|
136
|
+
<L2MenuMessageBar version="v5" style={{ color: colorPrimary }} />
|
|
137
|
+
<LocaleButton
|
|
138
|
+
shape="default"
|
|
139
|
+
size="large"
|
|
140
|
+
type="text"
|
|
141
|
+
style={{
|
|
142
|
+
width: "100%",
|
|
143
|
+
height: "100%",
|
|
144
|
+
boxSizing: "border-box",
|
|
145
|
+
padding: 0,
|
|
146
|
+
borderRadius: 0,
|
|
147
|
+
color: colorPrimary,
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
<ThemeButton
|
|
151
|
+
shape="default"
|
|
152
|
+
size="large"
|
|
153
|
+
type="text"
|
|
154
|
+
style={{
|
|
155
|
+
width: "100%",
|
|
156
|
+
height: "100%",
|
|
157
|
+
boxSizing: "border-box",
|
|
158
|
+
padding: 0,
|
|
159
|
+
borderRadius: 0,
|
|
160
|
+
color: colorPrimary,
|
|
161
|
+
}}
|
|
162
|
+
/>
|
|
163
|
+
<UserButton logoutUrl="/login2" style={{ padding: 0, color: "#000" }} />
|
|
164
|
+
</Space>
|
|
165
|
+
</Layout.Header>
|
|
166
|
+
);
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export default Header;
|
|
Binary file
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Layout, theme, ConfigProvider } from "antd";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import DocumentTitle from "react-document-title";
|
|
4
|
+
import { useSessionStorageState } from "ahooks";
|
|
5
|
+
import { generate } from "@ant-design/colors";
|
|
6
|
+
import Header from "./header";
|
|
7
|
+
import Sider from "./sider";
|
|
8
|
+
import Main from "../layout2/main";
|
|
9
|
+
import { useVarCssColor } from "../hooks/useVarCssColor";
|
|
10
|
+
import { LayoutProvider, useLayoutContext } from "../layout2/layout-context";
|
|
11
|
+
import { MenuType } from "../layout2/type/layout-type";
|
|
12
|
+
import Units from '../units';
|
|
13
|
+
import { useLocale } from "../locale/useLocale";
|
|
14
|
+
import { KeepAliveTab } from "../hooks/use-tabs";
|
|
15
|
+
import { getMenuConfig } from "../layout2/page";
|
|
16
|
+
|
|
17
|
+
const { useToken } = theme;
|
|
18
|
+
|
|
19
|
+
type PagePropsType = {
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
24
|
+
const [systemName, setSystemName] = useState("");
|
|
25
|
+
const [menu, setMenu] = useState<MenuType[]>([]);
|
|
26
|
+
const pageRef = useRef<HTMLDivElement>(undefined); // page ref
|
|
27
|
+
//清空缓存
|
|
28
|
+
const [keepAliveTabs, setKeepAliveTabs] = useSessionStorageState<KeepAliveTab[]>('keepAliveTabs', { defaultValue: [] });
|
|
29
|
+
const { documentTitle, updateMenuItemIdToFirstFloorIdxMap } = useLayoutContext();
|
|
30
|
+
const { getSiderCollapsed, compactTheme } = useLocale();
|
|
31
|
+
const { token: { colorPrimary } } = useToken();
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
getMenuConfig("v5").then(({ menu, systemName: name }) => {
|
|
35
|
+
setSystemName(name);
|
|
36
|
+
setMenu(menu);
|
|
37
|
+
updateMenuItemIdToFirstFloorIdxMap(menu);
|
|
38
|
+
});
|
|
39
|
+
useVarCssColor(generate(colorPrimary));
|
|
40
|
+
localStorage.setItem("version", "v5");
|
|
41
|
+
window.addEventListener('beforeunload', () => { setKeepAliveTabs([]); });
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<DocumentTitle title={documentTitle}>
|
|
46
|
+
<div
|
|
47
|
+
ref={pageRef}
|
|
48
|
+
style={{
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: "100%",
|
|
51
|
+
position: "absolute",
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<ConfigProvider
|
|
55
|
+
theme={{
|
|
56
|
+
algorithm: compactTheme ? [theme.compactAlgorithm] : [],
|
|
57
|
+
}}>
|
|
58
|
+
<Layout style={{ height: "100%" }} className={compactTheme ? "layout-compactTheme" : undefined}>
|
|
59
|
+
<Sider menuList={menu} collapsed={getSiderCollapsed()} systemName={systemName ? systemName : Units.programName_NavLeft()} />
|
|
60
|
+
<Layout>
|
|
61
|
+
<Header menuList={menu} />
|
|
62
|
+
<Main>{props.children}</Main>
|
|
63
|
+
</Layout>
|
|
64
|
+
</Layout>
|
|
65
|
+
</ConfigProvider>
|
|
66
|
+
</div>
|
|
67
|
+
</DocumentTitle>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const ContextPage: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
72
|
+
return (
|
|
73
|
+
<LayoutProvider>
|
|
74
|
+
<Page>{props.children}</Page>
|
|
75
|
+
</LayoutProvider>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default ContextPage;
|