beer-assembly-biz 1.1.3-alpha.18 → 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.
@@ -82,6 +82,10 @@ export declare type LayoutProps = {
82
82
  * 菜单类型.
83
83
  */
84
84
  siderMenuType?: 'sub' | 'group';
85
+ /**
86
+ * 头像的标题.
87
+ */
88
+ avatarTitle?: (userInfo: UserInfo | undefined) => ReactNode;
85
89
  /**
86
90
  * 布局内容
87
91
  */
@@ -131,6 +135,10 @@ export declare type LayoutProps = {
131
135
  * 头部: 从右到左菜单
132
136
  */
133
137
  headerMenus?: ReactNode[];
138
+ /**
139
+ * 头部: 从左到右菜单
140
+ */
141
+ headerContentRender?: ReactNode[];
134
142
  /**
135
143
  * 切换菜单触发事件
136
144
  * @param path 路径.
@@ -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: (collapsed, reactNode) => {
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
- }) : [], menuHeaderRender: (_logo, _title, props) => {
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: React.createElement("span", { style: {
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.18",
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",