beer-assembly-biz 1.1.3-alpha.17 → 1.1.3-alpha.19
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/layout/AppLayout.d.ts +14 -2
- package/layout/AppLayout.js +13 -7
- package/package.json +1 -1
package/layout/AppLayout.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ export declare type App = {
|
|
|
19
19
|
/**
|
|
20
20
|
* App图标
|
|
21
21
|
*/
|
|
22
|
-
icon
|
|
22
|
+
icon?: string;
|
|
23
23
|
/**
|
|
24
24
|
* App描述
|
|
25
25
|
*/
|
|
26
|
-
description
|
|
26
|
+
description?: string;
|
|
27
27
|
/**
|
|
28
28
|
* 路径
|
|
29
29
|
*/
|
|
@@ -32,6 +32,10 @@ export declare type App = {
|
|
|
32
32
|
* App 默认路径
|
|
33
33
|
*/
|
|
34
34
|
defaultPath: string;
|
|
35
|
+
/**
|
|
36
|
+
* 配置.
|
|
37
|
+
*/
|
|
38
|
+
config?: {};
|
|
35
39
|
};
|
|
36
40
|
/**
|
|
37
41
|
* 用户信息实体.
|
|
@@ -78,6 +82,10 @@ export declare type LayoutProps = {
|
|
|
78
82
|
* 菜单类型.
|
|
79
83
|
*/
|
|
80
84
|
siderMenuType?: 'sub' | 'group';
|
|
85
|
+
/**
|
|
86
|
+
* 头像的标题.
|
|
87
|
+
*/
|
|
88
|
+
avatarTitle?: (userInfo: UserInfo | undefined) => ReactNode;
|
|
81
89
|
/**
|
|
82
90
|
* 布局内容
|
|
83
91
|
*/
|
|
@@ -127,6 +135,10 @@ export declare type LayoutProps = {
|
|
|
127
135
|
* 头部: 从右到左菜单
|
|
128
136
|
*/
|
|
129
137
|
headerMenus?: ReactNode[];
|
|
138
|
+
/**
|
|
139
|
+
* 头部: 从左到右菜单
|
|
140
|
+
*/
|
|
141
|
+
headerContentRender?: ReactNode[];
|
|
130
142
|
/**
|
|
131
143
|
* 切换菜单触发事件
|
|
132
144
|
* @param path 路径.
|
package/layout/AppLayout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { ProLayout } from '@ant-design/pro-components';
|
|
4
|
-
import { Alert, Dropdown, message, theme, Typography } from 'antd';
|
|
4
|
+
import { Alert, Dropdown, message, Space, theme, Typography } from 'antd';
|
|
5
5
|
import { Session } from 'beer-network/session';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
7
|
import Marquee from 'react-fast-marquee';
|
|
@@ -120,6 +120,10 @@ export const AppLayout = (props) => {
|
|
|
120
120
|
return React.createElement(React.Fragment, null,
|
|
121
121
|
contextHolder,
|
|
122
122
|
React.createElement(ProLayout, { theme: "light", className: css `
|
|
123
|
+
.ant-pro-global-header-logo {
|
|
124
|
+
margin-inline-end: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
.ant-pro-sider-logo {
|
|
124
128
|
.ant-pro-layout-apps-icon {
|
|
125
129
|
display: ${collapsed ? 'flex' : 'none'};
|
|
@@ -197,7 +201,7 @@ export const AppLayout = (props) => {
|
|
|
197
201
|
paddingInlinePageContainerContent: 0,
|
|
198
202
|
paddingBlockPageContainerContent: 0
|
|
199
203
|
}
|
|
200
|
-
}, siderMenuType: props?.siderMenuType ?? 'sub', fixedHeader: true, collapsedButtonRender: (
|
|
204
|
+
}, siderMenuType: props?.siderMenuType ?? 'sub', fixedHeader: true, collapsedButtonRender: (_collapsed, reactNode) => {
|
|
201
205
|
return isMobile || props?.siderMenuType === 'group' ? undefined : reactNode;
|
|
202
206
|
}, appList: (props.apps?.length || 0) > 1 || collapsed ? props.apps?.map(it => {
|
|
203
207
|
return {
|
|
@@ -207,7 +211,12 @@ export const AppLayout = (props) => {
|
|
|
207
211
|
desc: it.description,
|
|
208
212
|
url: it.defaultPath || it.path
|
|
209
213
|
};
|
|
210
|
-
}) : [],
|
|
214
|
+
}) : [], headerContentRender: () => {
|
|
215
|
+
if (props?.headerContentRender === undefined) {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
return React.createElement(Space, { size: 4 }, props?.headerContentRender?.map(item => item));
|
|
219
|
+
}, menuHeaderRender: (_logo, _title, props) => {
|
|
211
220
|
if (props !== undefined) {
|
|
212
221
|
setTimeout(() => {
|
|
213
222
|
setCollapsed(props?.collapsed === true);
|
|
@@ -295,10 +304,7 @@ export const AppLayout = (props) => {
|
|
|
295
304
|
React.createElement("img", { src: props?.logo?.path, alt: "" })), title: false, avatarProps: {
|
|
296
305
|
src: (userInfo?.avatar || '') === '' ? '/avatar.png' : userInfo?.avatar,
|
|
297
306
|
size: 'small',
|
|
298
|
-
title:
|
|
299
|
-
color: '#333',
|
|
300
|
-
fontSize: token.fontSize + 1
|
|
301
|
-
} }, userInfo?.nickName || '系统用户'),
|
|
307
|
+
title: props?.avatarTitle?.(userInfo),
|
|
302
308
|
render: (_props, dom) => {
|
|
303
309
|
return (React.createElement(Dropdown, { menu: {
|
|
304
310
|
items: [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beer-assembly-biz",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.3-alpha.
|
|
4
|
+
"version": "1.1.3-alpha.19",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
|
|
7
7
|
"copy": "cp -a src/rich/AIEditor.css dist/rich/AIEditor.css && cp -a src/icon dist/icon && cp -a src/images dist/images",
|