aldehyde 0.2.326 → 0.2.328
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/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +8 -0
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/icon-selector/app-icon-selector.d.ts +10 -0
- package/lib/controls/icon-selector/app-icon-selector.d.ts.map +1 -0
- package/lib/controls/icon-selector/app-icon-selector.js +27 -0
- package/lib/controls/icon-selector/app-icon-selector.js.map +1 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +23 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.d.ts +1 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.d.ts.map +1 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.js +20 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.js.map +1 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.json +23 -0
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.ttf +0 -0
- package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +19 -0
- package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.d.ts +1 -0
- package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.d.ts.map +1 -0
- package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.js +20 -0
- package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.js.map +1 -0
- package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.json +16 -0
- package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.ttf +0 -0
- package/lib/controls/icon-selector/pc-icon-selector.d.ts +10 -0
- package/lib/controls/icon-selector/pc-icon-selector.d.ts.map +1 -0
- package/lib/controls/icon-selector/pc-icon-selector.js +27 -0
- package/lib/controls/icon-selector/pc-icon-selector.js.map +1 -0
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.js +9 -4
- package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
- package/lib/layout2/components/icon-font.d.ts +4 -0
- package/lib/layout2/components/icon-font.d.ts.map +1 -0
- package/lib/layout2/components/icon-font.js +4 -0
- package/lib/layout2/components/icon-font.js.map +1 -0
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +11 -43
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +2 -1
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout2/sider.d.ts.map +1 -1
- package/lib/layout2/sider.js +6 -5
- package/lib/layout2/sider.js.map +1 -1
- package/lib/layout2/type/layout-type.d.ts +1 -0
- package/lib/layout2/type/layout-type.d.ts.map +1 -1
- package/lib/layout3/header.d.ts.map +1 -1
- package/lib/layout3/header.js +7 -2
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout3/sider.d.ts.map +1 -1
- package/lib/layout3/sider.js +5 -4
- package/lib/layout3/sider.js.map +1 -1
- package/lib/tmpl/interface.d.ts +2 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/welcome/quick-entrance.d.ts.map +1 -1
- package/lib/welcome/quick-entrance.js +3 -1
- package/lib/welcome/quick-entrance.js.map +1 -1
- package/lib/welcome/workbench.d.ts.map +1 -1
- package/lib/welcome/workbench.js +3 -1
- package/lib/welcome/workbench.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entry-control.tsx +8 -0
- package/src/aldehyde/controls/icon-selector/app-icon-selector.tsx +67 -0
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +23 -0
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.js +1 -0
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.json +23 -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/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +19 -0
- package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.js +1 -0
- package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.json +16 -0
- package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.ttf +0 -0
- package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.woff +0 -0
- package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.woff2 +0 -0
- package/src/aldehyde/controls/icon-selector/pc-icon-selector.tsx +67 -0
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +9 -4
- package/src/aldehyde/layout2/components/icon-font.tsx +6 -0
- package/src/aldehyde/layout2/header.tsx +12 -59
- package/src/aldehyde/layout2/page.tsx +3 -1
- package/src/aldehyde/layout2/sider.tsx +11 -13
- package/src/aldehyde/layout2/type/layout-type.ts +1 -0
- package/src/aldehyde/layout3/header.tsx +4 -2
- package/src/aldehyde/layout3/sider.tsx +5 -4
- package/src/aldehyde/tmpl/interface.tsx +2 -0
- package/src/aldehyde/welcome/quick-entrance.tsx +4 -2
- package/src/aldehyde/welcome/workbench.tsx +4 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "5037133",
|
|
3
|
+
"name": "aldehyde-menu-icon",
|
|
4
|
+
"font_family": "iconfont",
|
|
5
|
+
"css_prefix_text": "icon-",
|
|
6
|
+
"description": "",
|
|
7
|
+
"glyphs": [
|
|
8
|
+
{
|
|
9
|
+
"icon_id": "11487981",
|
|
10
|
+
"name": "all",
|
|
11
|
+
"font_class": "all",
|
|
12
|
+
"unicode": "e743",
|
|
13
|
+
"unicode_decimal": 59203
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"icon_id": "15838501",
|
|
17
|
+
"name": "menu",
|
|
18
|
+
"font_class": "menu",
|
|
19
|
+
"unicode": "e677",
|
|
20
|
+
"unicode_decimal": 58999
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "iconfont"; /* Project id 5037136 */
|
|
3
|
+
src: url('iconfont.woff2?t=1760081625440') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1760081625440') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1760081625440') format('truetype');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.iconfont {
|
|
9
|
+
font-family: "iconfont" !important;
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.icon-menu:before {
|
|
17
|
+
content: "\e677";
|
|
18
|
+
}
|
|
19
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window._iconfont_svg_string_5037136='<svg><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M170.666667 213.333333m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" ></path><path d="M170.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" ></path><path d="M170.666667 810.666667m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" ></path><path d="M896 778.666667H362.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h533.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM362.666667 245.333333h533.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32H362.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32zM896 480H362.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h533.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z" ></path></symbol></svg>',(n=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var o,i,c,a,d,s=function(t,e){e.parentNode.insertBefore(t,e)};if(t&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(t){console&&console.log(t)}}o=function(){var t,e=document.createElement("div");e.innerHTML=n._iconfont_svg_string_5037136,(e=e.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",e=e,(t=document.body).firstChild?s(e,t.firstChild):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(o,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),o()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(c=o,a=n.document,d=!1,r(),a.onreadystatechange=function(){"complete"==a.readyState&&(a.onreadystatechange=null,l())})}function l(){d||(d=!0,c())}function r(){try{a.documentElement.doScroll("left")}catch(t){return void setTimeout(r,50)}l()}})(window);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "5037136",
|
|
3
|
+
"name": "phonenode-menu-icon",
|
|
4
|
+
"font_family": "iconfont",
|
|
5
|
+
"css_prefix_text": "icon-",
|
|
6
|
+
"description": "",
|
|
7
|
+
"glyphs": [
|
|
8
|
+
{
|
|
9
|
+
"icon_id": "15838501",
|
|
10
|
+
"name": "menu",
|
|
11
|
+
"font_class": "menu",
|
|
12
|
+
"unicode": "e677",
|
|
13
|
+
"unicode_decimal": 58999
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { createFromIconfontCN } from '@ant-design/icons';
|
|
3
|
+
import { Select, Empty, Row, Col } from "antd";
|
|
4
|
+
import iconEnum from "./icon/aldehyde-menu-icon/iconfont.json";
|
|
5
|
+
import { EControlProps } from "../../tmpl/interface";
|
|
6
|
+
import { useLocale } from "../../locale/useLocale";
|
|
7
|
+
|
|
8
|
+
const IconFont = createFromIconfontCN({ scriptUrl: "./icon/aldehyde-menu-icon/iconfont.js" });
|
|
9
|
+
|
|
10
|
+
const options = iconEnum.glyphs.map(item => ({ value: `icon-${item.font_class}`, label: <IconFont type={`icon-${item.font_class}`} /> }))
|
|
11
|
+
|
|
12
|
+
interface Props extends EControlProps {
|
|
13
|
+
value?: string;
|
|
14
|
+
onChange?: (data: string) => void;
|
|
15
|
+
id?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Index = (props: Props) => {
|
|
19
|
+
const { value, onChange, fieldConfig, id } = props;
|
|
20
|
+
const [filterOptions, setFilterOptions] = useState<{ value: string, label: React.ReactNode }[]>(options);
|
|
21
|
+
const [open, setOpen] = useState(false);
|
|
22
|
+
const { translate } = useLocale();
|
|
23
|
+
const placeholder = !fieldConfig.disabled
|
|
24
|
+
? translate("${请选择}${" + fieldConfig.title + "}")
|
|
25
|
+
: translate("${无需选择}");
|
|
26
|
+
|
|
27
|
+
const handleSearch = (val) => {
|
|
28
|
+
setFilterOptions(val ? options.filter(item => item.value.includes(val)) : options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return <Select
|
|
32
|
+
allowClear={true}
|
|
33
|
+
open={open}
|
|
34
|
+
showSearch={true}
|
|
35
|
+
id={id}
|
|
36
|
+
disabled={fieldConfig.disabled}
|
|
37
|
+
value={value}
|
|
38
|
+
options={options}
|
|
39
|
+
onChange={onChange}
|
|
40
|
+
onSearch={handleSearch}
|
|
41
|
+
onOpenChange={setOpen}
|
|
42
|
+
popupMatchSelectWidth={false}
|
|
43
|
+
placeholder={placeholder}
|
|
44
|
+
popupRender={() => {
|
|
45
|
+
return <div style={{ padding: 4, maxWidth: 240 }}>
|
|
46
|
+
{filterOptions.length === 0 ? (
|
|
47
|
+
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
48
|
+
) : (
|
|
49
|
+
<Row gutter={12}>
|
|
50
|
+
{filterOptions.map((opt) => (
|
|
51
|
+
<Col
|
|
52
|
+
style={{ textAlign: "center", cursor: "pointer" }}
|
|
53
|
+
onClick={() => {
|
|
54
|
+
onChange(opt.value);
|
|
55
|
+
setOpen(false);
|
|
56
|
+
}}>
|
|
57
|
+
{opt.label}
|
|
58
|
+
</Col>
|
|
59
|
+
))}
|
|
60
|
+
</Row>
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
}}
|
|
64
|
+
/>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default Index;
|
|
@@ -6,6 +6,7 @@ import { Level2Menu } from "../../tmpl/interface";
|
|
|
6
6
|
import HCDataSource from "../../tmpl/hc-data-source";
|
|
7
7
|
import LtmplTable from "../../module/ltmpl-table";
|
|
8
8
|
import { LocaleContext } from "../../locale/LocaleProvider";
|
|
9
|
+
import IconFont from "../../layout2/components/icon-font";
|
|
9
10
|
|
|
10
11
|
interface L2MenuQuickBarProps {
|
|
11
12
|
backgroudColor?: string;
|
|
@@ -86,10 +87,14 @@ class L2MenuQuickBar extends React.PureComponent<
|
|
|
86
87
|
if (quickBar.count) {
|
|
87
88
|
total = total + quickBar.count;
|
|
88
89
|
}
|
|
90
|
+
const renderIcon = quickBar.l2Menu.icon ? <IconFont type={quickBar.l2Menu.icon} /> : "";
|
|
89
91
|
return (
|
|
90
|
-
<Menu.Item key={index}>
|
|
92
|
+
<Menu.Item key={index} style={{ textAlign: "left" }}>
|
|
91
93
|
<span onClick={() => this.showDraw(quickBar.l2Menu.id)}>
|
|
92
|
-
|
|
94
|
+
<Space>
|
|
95
|
+
{renderIcon}
|
|
96
|
+
{quickBar.l2Menu.title}
|
|
97
|
+
</Space>
|
|
93
98
|
</span>
|
|
94
99
|
</Menu.Item>
|
|
95
100
|
);
|
|
@@ -108,7 +113,7 @@ class L2MenuQuickBar extends React.PureComponent<
|
|
|
108
113
|
style={syyy}
|
|
109
114
|
onClick={() => this.showDraw(quickBar.l2Menu.id)}
|
|
110
115
|
>
|
|
111
|
-
<span style={{ fontSize: "20px"
|
|
116
|
+
<span style={{ fontSize: "20px" }}>
|
|
112
117
|
<AppstoreOutlined />
|
|
113
118
|
</span>
|
|
114
119
|
</div>
|
|
@@ -117,7 +122,7 @@ class L2MenuQuickBar extends React.PureComponent<
|
|
|
117
122
|
return (
|
|
118
123
|
<Dropdown overlay={menu} placement="bottomCenter">
|
|
119
124
|
<div className={"message-bar"} style={syyy}>
|
|
120
|
-
<span style={{ fontSize: "20px"
|
|
125
|
+
<span style={{ fontSize: "20px" }}>
|
|
121
126
|
<AppstoreOutlined />
|
|
122
127
|
</span>
|
|
123
128
|
</div>
|
|
@@ -23,8 +23,7 @@ import { useLocale } from "../locale/useLocale";
|
|
|
23
23
|
import { generate } from "@ant-design/colors";
|
|
24
24
|
import { useLayoutContext } from "./layout-context";
|
|
25
25
|
import ThemeButton from "./components/theme-button";
|
|
26
|
-
|
|
27
|
-
import Units from "../units";
|
|
26
|
+
import IconFont from "./components/icon-font";
|
|
28
27
|
|
|
29
28
|
type HeaderPropsType = {
|
|
30
29
|
systemName: string;
|
|
@@ -57,7 +56,8 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
57
56
|
handlePropsMenuToAntdMenu(
|
|
58
57
|
menuList,
|
|
59
58
|
(menuItem, floor) => {
|
|
60
|
-
const { disabled, label, children,
|
|
59
|
+
const { disabled, label, children, icon } = menuItem;
|
|
60
|
+
const renderIcon = icon ? <IconFont type={icon} /> : "";
|
|
61
61
|
if (disabled)
|
|
62
62
|
return (
|
|
63
63
|
<div
|
|
@@ -68,7 +68,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
68
68
|
display: "block",
|
|
69
69
|
}}
|
|
70
70
|
>
|
|
71
|
-
<Space size={"small"}>{
|
|
71
|
+
<Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>
|
|
72
72
|
</div>
|
|
73
73
|
);
|
|
74
74
|
const { path, target } = getLeftMostRouteInfo(menuItem);
|
|
@@ -94,7 +94,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
94
94
|
height: "100%",
|
|
95
95
|
display: "block",
|
|
96
96
|
}}
|
|
97
|
-
><Space size={"small"}>{
|
|
97
|
+
><Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>
|
|
98
98
|
</NavLink>
|
|
99
99
|
);
|
|
100
100
|
if (Array.isArray(children) && !children.length)
|
|
@@ -113,7 +113,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
113
113
|
</NavLink>
|
|
114
114
|
);
|
|
115
115
|
|
|
116
|
-
return <Space size={"small"}>{
|
|
116
|
+
return <Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>;
|
|
117
117
|
},
|
|
118
118
|
"layout2-header-menu-item"
|
|
119
119
|
)
|
|
@@ -239,37 +239,9 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
239
239
|
flexDirection: "row",
|
|
240
240
|
}}
|
|
241
241
|
>
|
|
242
|
-
<
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
height: "100%",
|
|
246
|
-
display: "flex",
|
|
247
|
-
justifyContent: "center",
|
|
248
|
-
alignItems: "center",
|
|
249
|
-
}}
|
|
250
|
-
>
|
|
251
|
-
<L2MenuQuickBar></L2MenuQuickBar>
|
|
252
|
-
</div>
|
|
253
|
-
<div
|
|
254
|
-
style={{
|
|
255
|
-
width: "64px",
|
|
256
|
-
height: "100%",
|
|
257
|
-
display: "flex",
|
|
258
|
-
justifyContent: "center",
|
|
259
|
-
alignItems: "center",
|
|
260
|
-
}}
|
|
261
|
-
>
|
|
262
|
-
<L2MenuMessageBar></L2MenuMessageBar>
|
|
263
|
-
</div>
|
|
264
|
-
<div
|
|
265
|
-
style={{
|
|
266
|
-
width: "64px",
|
|
267
|
-
height: "100%",
|
|
268
|
-
display: "flex",
|
|
269
|
-
justifyContent: "center",
|
|
270
|
-
alignItems: "center",
|
|
271
|
-
}}
|
|
272
|
-
>
|
|
242
|
+
<Space size={28}>
|
|
243
|
+
<L2MenuQuickBar />
|
|
244
|
+
<L2MenuMessageBar />
|
|
273
245
|
<LocaleButton
|
|
274
246
|
shape="default"
|
|
275
247
|
size="large"
|
|
@@ -282,17 +254,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
282
254
|
borderRadius: 0,
|
|
283
255
|
color: "#fff",
|
|
284
256
|
}}
|
|
285
|
-
|
|
286
|
-
</div>
|
|
287
|
-
<div
|
|
288
|
-
style={{
|
|
289
|
-
width: "64px",
|
|
290
|
-
height: "100%",
|
|
291
|
-
display: "flex",
|
|
292
|
-
justifyContent: "center",
|
|
293
|
-
alignItems: "center",
|
|
294
|
-
}}
|
|
295
|
-
>
|
|
257
|
+
/>
|
|
296
258
|
<ThemeButton shape="default"
|
|
297
259
|
size="large"
|
|
298
260
|
type="text"
|
|
@@ -304,17 +266,8 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
304
266
|
borderRadius: 0,
|
|
305
267
|
color: "#fff",
|
|
306
268
|
}} />
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
style={{
|
|
310
|
-
height: "100%",
|
|
311
|
-
display: "flex",
|
|
312
|
-
justifyContent: "center",
|
|
313
|
-
alignItems: "center",
|
|
314
|
-
}}
|
|
315
|
-
>
|
|
316
|
-
<UserButton></UserButton>
|
|
317
|
-
</div>
|
|
269
|
+
<UserButton />
|
|
270
|
+
</Space>
|
|
318
271
|
</div>
|
|
319
272
|
</div>
|
|
320
273
|
</Layout.Header>
|
|
@@ -103,7 +103,8 @@ const handleMenuRes = (menuList: MenuConfigAPIType["blocks"], version: string):
|
|
|
103
103
|
linkTarget,
|
|
104
104
|
defaultCriteriaValue,
|
|
105
105
|
items,
|
|
106
|
-
fullScreen
|
|
106
|
+
fullScreen,
|
|
107
|
+
icon
|
|
107
108
|
} of menuList) {
|
|
108
109
|
if (!(hiddenOnDisabled === true && disabled === true)) {
|
|
109
110
|
const menu: MenuType = {
|
|
@@ -113,6 +114,7 @@ const handleMenuRes = (menuList: MenuConfigAPIType["blocks"], version: string):
|
|
|
113
114
|
url: handleMenuItemUrl(id, pageType, defaultCriteriaValue, customPath, dragDropPageId, fullScreen, version),
|
|
114
115
|
linkTarget,
|
|
115
116
|
children: items?.length ? handleMenuRes(items, version) : [],
|
|
117
|
+
icon,
|
|
116
118
|
};
|
|
117
119
|
|
|
118
120
|
retList.push(menu);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ConfigProvider, Layout, Menu, MenuProps, Space, theme, Tooltip} from "antd";
|
|
1
|
+
import { ConfigProvider, Layout, Menu, MenuProps, Space, theme, Tooltip } from "antd";
|
|
2
2
|
import React, { useEffect, useRef, useState } from "react";
|
|
3
3
|
|
|
4
4
|
import { MenuType } from "./type/layout-type";
|
|
@@ -10,16 +10,13 @@ import {
|
|
|
10
10
|
} from "./util/menu-util";
|
|
11
11
|
import { useLocale } from "../locale/useLocale";
|
|
12
12
|
import { generate } from "@ant-design/colors";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
} from "./layout-context";
|
|
16
|
-
import {AppstoreOutlined, SettingOutlined} from "@ant-design/icons";
|
|
17
|
-
import Units from "../units";
|
|
13
|
+
import { useLayoutContext } from "./layout-context";
|
|
14
|
+
import IconFont from "./components/icon-font";
|
|
18
15
|
|
|
19
16
|
type SiderPropsType = {
|
|
20
17
|
menuList: MenuType[];
|
|
21
|
-
|
|
22
|
-
collapsed:boolean;
|
|
18
|
+
// style?: typeof Layout.Sider.defaultProps.style;
|
|
19
|
+
collapsed: boolean;
|
|
23
20
|
};
|
|
24
21
|
|
|
25
22
|
type MenuItem = Required<MenuProps>["items"][number];
|
|
@@ -54,7 +51,7 @@ const getSecoundFloorMenuList = (
|
|
|
54
51
|
|
|
55
52
|
const { useToken } = theme;
|
|
56
53
|
|
|
57
|
-
const Sider: React.FC<SiderPropsType> = ({ menuList,collapsed }) => {
|
|
54
|
+
const Sider: React.FC<SiderPropsType> = ({ menuList, collapsed }) => {
|
|
58
55
|
const { setDocumentTitle, menuItemIdToFirstFloorIdxMap } = useLayoutContext();
|
|
59
56
|
|
|
60
57
|
// token
|
|
@@ -77,7 +74,8 @@ const Sider: React.FC<SiderPropsType> = ({ menuList,collapsed }) => {
|
|
|
77
74
|
secoundFloorMenu: SecoundFloorMenuList[number]
|
|
78
75
|
) => {
|
|
79
76
|
return handlePropsMenuToAntdMenu(secoundFloorMenu, (menuItem, floor) => {
|
|
80
|
-
const { disabled, label, children,
|
|
77
|
+
const { disabled, label, children, icon } = menuItem;
|
|
78
|
+
const renderIcon = icon ? <IconFont type={icon} /> : "";
|
|
81
79
|
|
|
82
80
|
if (disabled)
|
|
83
81
|
return (
|
|
@@ -110,12 +108,12 @@ const Sider: React.FC<SiderPropsType> = ({ menuList,collapsed }) => {
|
|
|
110
108
|
overflow: "hidden",
|
|
111
109
|
}}
|
|
112
110
|
>
|
|
113
|
-
<Space size={"small"}>{
|
|
111
|
+
<Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>
|
|
114
112
|
</NavLink>
|
|
115
113
|
</Tooltip>
|
|
116
114
|
);
|
|
117
115
|
|
|
118
|
-
return <Space size={"small"}>{
|
|
116
|
+
return <Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>;
|
|
119
117
|
});
|
|
120
118
|
};
|
|
121
119
|
|
|
@@ -163,7 +161,7 @@ const Sider: React.FC<SiderPropsType> = ({ menuList,collapsed }) => {
|
|
|
163
161
|
setSelectedKeys([...openKeys]);
|
|
164
162
|
};
|
|
165
163
|
return (
|
|
166
|
-
<Layout.Sider
|
|
164
|
+
<Layout.Sider collapsed={collapsed} collapsedWidth={0}
|
|
167
165
|
style={{
|
|
168
166
|
background: colors[0],
|
|
169
167
|
// color: "#FFFFFF",
|
|
@@ -14,6 +14,7 @@ import UserButton from "../layout2/components/user-button";
|
|
|
14
14
|
import headerBgImg from "./imgs/header-bg.png";
|
|
15
15
|
import homeBgImg from "./imgs/home-bg.png";
|
|
16
16
|
import Time from "./components/time";
|
|
17
|
+
import IconFont from "../layout2/components/icon-font";
|
|
17
18
|
import "./css/header.css";
|
|
18
19
|
|
|
19
20
|
// 查找当前选中菜单的顶层菜单id
|
|
@@ -59,8 +60,9 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList }) => {
|
|
|
59
60
|
const menuId: string = search.get("menuId");
|
|
60
61
|
|
|
61
62
|
const renderMenuItem = (menuItem) => {
|
|
62
|
-
const { label, id, disabled } = menuItem;
|
|
63
|
-
|
|
63
|
+
const { label, id, disabled, icon } = menuItem;
|
|
64
|
+
const renderIcon = icon ? <IconFont type={icon} /> : "";
|
|
65
|
+
return <div className={`menu-item ${disabled ? "menu-disabled" : ""}`}><div className={selParentId === id ? "menu-item-border-sel" : "menu-item-border"}><Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space></div></div>;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
const handleMenu = (menuItem, floor) => {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { useLayoutContext } from "../layout2/layout-context";
|
|
10
10
|
import { MenuType } from "../layout2/type/layout-type";
|
|
11
11
|
import { useLocale } from "../locale/useLocale";
|
|
12
|
-
import
|
|
12
|
+
import IconFont from "../layout2/components/icon-font";
|
|
13
13
|
import "./css/sider.css"
|
|
14
14
|
|
|
15
15
|
type SiderPropsType = {
|
|
@@ -59,7 +59,8 @@ const Sider: React.FC<SiderPropsType> = ({ menuList, collapsed }) => {
|
|
|
59
59
|
// menu
|
|
60
60
|
const getMenuWithSecoundFloor = (secoundFloorMenu: SecoundFloorMenuList[number]) => {
|
|
61
61
|
return handlePropsMenuToAntdMenu(secoundFloorMenu, (menuItem) => {
|
|
62
|
-
const { disabled, label, children,
|
|
62
|
+
const { disabled, label, children, icon } = menuItem;
|
|
63
|
+
const renderIcon = icon ? <IconFont type={icon} /> : "";
|
|
63
64
|
if (disabled)
|
|
64
65
|
return (
|
|
65
66
|
<div
|
|
@@ -89,11 +90,11 @@ const Sider: React.FC<SiderPropsType> = ({ menuList, collapsed }) => {
|
|
|
89
90
|
overflow: "hidden",
|
|
90
91
|
}}
|
|
91
92
|
>
|
|
92
|
-
<Space size={"small"}>{
|
|
93
|
+
<Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>
|
|
93
94
|
</NavLink>
|
|
94
95
|
</Tooltip>
|
|
95
96
|
);
|
|
96
|
-
return <Space size={"small"}>{
|
|
97
|
+
return <Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>;
|
|
97
98
|
});
|
|
98
99
|
};
|
|
99
100
|
|
|
@@ -225,6 +225,7 @@ export interface Level2Menu extends MenuBase {
|
|
|
225
225
|
pageType: "列表" | "详情" | "编辑" | "添加" | "编辑或添加" | "树" | "导入" | "报表";
|
|
226
226
|
programAuths?: ProgramAuth[];
|
|
227
227
|
linkTarget?: HTMLAttributeAnchorTarget;
|
|
228
|
+
icon?: string;
|
|
228
229
|
}
|
|
229
230
|
|
|
230
231
|
export interface Level1Menu extends MenuBase {
|
|
@@ -766,4 +767,5 @@ export interface BlockType {
|
|
|
766
767
|
linkTarget?: HTMLAttributeAnchorTarget; // 页面跳转方式
|
|
767
768
|
items?: BlockType[];
|
|
768
769
|
fullScreen?: boolean; // 是否全屏展示
|
|
770
|
+
icon?: string;
|
|
769
771
|
}
|
|
@@ -6,8 +6,9 @@ import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
|
6
6
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
7
|
import { Level2Menu } from "../tmpl/interface";
|
|
8
8
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
9
|
+
import IconFont from "../layout2/components/icon-font";
|
|
9
10
|
|
|
10
|
-
interface QuickEntranceProps extends CardProps {}
|
|
11
|
+
interface QuickEntranceProps extends CardProps { }
|
|
11
12
|
|
|
12
13
|
interface QuickEntranceState {
|
|
13
14
|
l2Menus?: Level2Menu[];
|
|
@@ -69,11 +70,12 @@ class QuickEntrance extends React.PureComponent<
|
|
|
69
70
|
if (l2Menu.disabled) {
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
73
|
+
const renderIcon = l2Menu.icon ? <IconFont type={l2Menu.icon} /> : <CodeTwoTone />;
|
|
72
74
|
let comp = (
|
|
73
75
|
<Badge key={l2Menu.id} count={l2Menu.count}>
|
|
74
76
|
<Button
|
|
75
77
|
shape="round"
|
|
76
|
-
icon={
|
|
78
|
+
icon={renderIcon}
|
|
77
79
|
href={`#/${l2Menu.id}/act-table?menuId=${l2Menu.id}`}
|
|
78
80
|
size="large"
|
|
79
81
|
>
|
|
@@ -6,8 +6,9 @@ import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
|
6
6
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
7
|
import { Level2Menu } from "../tmpl/interface";
|
|
8
8
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
9
|
+
import IconFont from "../layout2/components/icon-font";
|
|
9
10
|
|
|
10
|
-
interface WorkbenchProps extends CardProps {}
|
|
11
|
+
interface WorkbenchProps extends CardProps { }
|
|
11
12
|
|
|
12
13
|
interface WorkbenchState {
|
|
13
14
|
l2Menus?: Level2Menu[];
|
|
@@ -65,10 +66,11 @@ class Workbench extends React.PureComponent<WorkbenchProps, WorkbenchState> {
|
|
|
65
66
|
if (l2Menu.disabled) {
|
|
66
67
|
return null;
|
|
67
68
|
}
|
|
69
|
+
const renderIcon = l2Menu.icon ? <IconFont type={l2Menu.icon} /> : <RocketTwoTone />;
|
|
68
70
|
let comp = (
|
|
69
71
|
<Card size={"small"} key={l2Menu.id}>
|
|
70
72
|
<Statistic
|
|
71
|
-
prefix={
|
|
73
|
+
prefix={renderIcon}
|
|
72
74
|
title={l2Menu.title}
|
|
73
75
|
value={l2Menu.count}
|
|
74
76
|
/>
|