beer-assembly-biz 1.1.3-alpha.9 → 1.1.5
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/ProgressModal.d.ts +7 -0
- package/ProgressModal.js +34 -0
- package/UploadModals.js +6 -0
- package/auth/AuthPassword.d.ts +1 -1
- package/auth/AuthPassword.js +1 -1
- package/config/index.js +76 -76
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/layout/AppLayout.d.ts +38 -2
- package/layout/AppLayout.js +45 -26
- package/layout/SubMenusContainer.d.ts +27 -0
- package/layout/SubMenusContainer.js +71 -0
- package/package.json +35 -33
- package/promises.js +4 -6
- package/rich/AIEditor.js +4 -3
- package/icon/icon/directory.svg +0 -12
- package/icon/icon/empty.svg +0 -43
- package/icon/icon/media.png +0 -0
- package/icon/icon/volc.svg +0 -96
- package/images/images/assets_background_01.png +0 -0
- package/images/images/avatar.png +0 -0
- package/images/images/layout_01.png +0 -0
- package/images/images/layout_02.png +0 -0
- package/images/images/layout_03.png +0 -0
- package/net-disk/DirectoryMenusPanel.d.ts +0 -0
- package/net-disk/DirectoryMenusPanel.js +0 -337
- package/net-disk/DirectorySelect.d.ts +0 -0
- package/net-disk/DirectorySelect.js +0 -240
- package/net-disk/FileItemList.d.ts +0 -0
- package/net-disk/FileItemList.js +0 -126
- package/net-disk/FileItemTable.d.ts +0 -0
- package/net-disk/FileItemTable.js +0 -422
- package/net-disk/FileNavigation.d.ts +0 -0
- package/net-disk/FileNavigation.js +0 -43
- package/net-disk/NetDisk.d.ts +0 -0
- package/net-disk/NetDisk.js +0 -36
- package/net-disk/NetDiskModals.d.ts +0 -0
- package/net-disk/NetDiskModals.js +0 -40
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type ProgressCallback = (progress: number, message?: string) => void;
|
|
3
|
+
export declare type ProgressProps = {
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
prompt?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const ProgressModal: (props?: ProgressProps) => [() => ProgressCallback, ReactNode];
|
package/ProgressModal.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Modal, Progress } from 'antd';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
export const ProgressModal = (props) => {
|
|
5
|
+
const [isOpenModal, setIsOpenModal] = useState(false);
|
|
6
|
+
const [message, setMessage] = useState('');
|
|
7
|
+
const [progress, setProgress] = useState(0);
|
|
8
|
+
const handler = () => {
|
|
9
|
+
setProgress(0);
|
|
10
|
+
setMessage('');
|
|
11
|
+
setIsOpenModal(true);
|
|
12
|
+
return (progress, message) => {
|
|
13
|
+
if (progress >= 100) {
|
|
14
|
+
setIsOpenModal(false);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setProgress(progress);
|
|
18
|
+
setMessage(message ?? '');
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
return [handler, React.createElement(React.Fragment, null,
|
|
22
|
+
React.createElement(Modal, { title: props?.title ?? '提交数据中', width: 360, maskClosable: false, closable: false, open: isOpenModal, onCancel: () => setIsOpenModal(false), footer: false, styles: {
|
|
23
|
+
body: { padding: '0' }
|
|
24
|
+
} },
|
|
25
|
+
React.createElement(Progress, { percent: progress }),
|
|
26
|
+
React.createElement("div", { style: {
|
|
27
|
+
color: Config.colors.danger,
|
|
28
|
+
marginTop: 4,
|
|
29
|
+
padding: '2px 0'
|
|
30
|
+
} }, props?.prompt ?? '处理过程中请不要刷新(关闭)浏览器'),
|
|
31
|
+
React.createElement("div", { style: {
|
|
32
|
+
color: '#888'
|
|
33
|
+
} }, (message ?? '') === '' ? '连接服务器...' : message)))];
|
|
34
|
+
};
|
package/UploadModals.js
CHANGED
|
@@ -38,6 +38,9 @@ export class UploadModals {
|
|
|
38
38
|
const fileExtension = file.name.split('.')
|
|
39
39
|
?.pop()
|
|
40
40
|
?.toLowerCase() ?? 'none';
|
|
41
|
+
if (it === 'DOCUMENT' && ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf', 'txt'].indexOf(fileExtension) > -1) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
41
44
|
return it === 'VIDEO' && ['wmv', 'avi', '3gp', 'mov', 'mp4', 'flv', 'rmvb', 'mkv', 'm4v', 'x-flv'].indexOf(fileExtension) > -1;
|
|
42
45
|
});
|
|
43
46
|
if (type === undefined) {
|
|
@@ -48,6 +51,9 @@ export class UploadModals {
|
|
|
48
51
|
case 'IMAGE':
|
|
49
52
|
size = 10 * 1024 * 1024;
|
|
50
53
|
break;
|
|
54
|
+
case 'DOCUMENT':
|
|
55
|
+
size = 30 * 1024 * 1024;
|
|
56
|
+
break;
|
|
51
57
|
case 'VIDEO':
|
|
52
58
|
size = 300 * 1024 * 1024;
|
|
53
59
|
break;
|
package/auth/AuthPassword.d.ts
CHANGED
package/auth/AuthPassword.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, Checkbox, Dropdown, Form, Input, theme } from 'antd';
|
|
2
|
-
import { SliderCode } from '../slider/SliderCode';
|
|
3
2
|
import { css } from '@emotion/css';
|
|
4
3
|
import React, { useState } from 'react';
|
|
5
4
|
import { useForm } from 'antd/es/form/Form';
|
|
5
|
+
import { SliderCode } from '../slider/SliderCode';
|
|
6
6
|
export const AuthPassword = (props) => {
|
|
7
7
|
const { token } = theme.useToken();
|
|
8
8
|
const [form] = useForm();
|
package/config/index.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
export class Config {
|
|
2
|
+
static colors = {
|
|
3
|
+
primary: '#108ee9',
|
|
4
|
+
success: '#389e0d',
|
|
5
|
+
danger: '#cf1322',
|
|
6
|
+
warning: '#faad14',
|
|
7
|
+
info: '#0958d9',
|
|
8
|
+
light: '#999'
|
|
9
|
+
};
|
|
10
|
+
static loadingText = [
|
|
11
|
+
'请稍候,正在加载数据...',
|
|
12
|
+
'系统准备中,请稍等...',
|
|
13
|
+
'准备您的体验,马上回来...',
|
|
14
|
+
'系统正在整理文件...',
|
|
15
|
+
'在与未来建立联系...',
|
|
16
|
+
'正在构建您的旅程...',
|
|
17
|
+
'数据正在装载,请耐心等待...',
|
|
18
|
+
'读取档案中,请稍候...',
|
|
19
|
+
'正在开启您的应用...',
|
|
20
|
+
'加载中,请稍后...',
|
|
21
|
+
'系统正在同步,请耐心等候...',
|
|
22
|
+
'正在准备您的界面...',
|
|
23
|
+
'系统正在激活中...',
|
|
24
|
+
'正在处理中,请稍后...',
|
|
25
|
+
'一切都在准备中,马上见...',
|
|
26
|
+
'正在初始化设置...',
|
|
27
|
+
'在计算最优路径...',
|
|
28
|
+
'数据加载中,稍等片刻...',
|
|
29
|
+
'正在准备资源...',
|
|
30
|
+
'正在收集信息,请稍候...',
|
|
31
|
+
'在构建数字世界...',
|
|
32
|
+
'载入中,请稍等...',
|
|
33
|
+
'正在启动服务...',
|
|
34
|
+
'数据处理中,请稍后...',
|
|
35
|
+
'正在连接网络...',
|
|
36
|
+
'在获取最新信息...',
|
|
37
|
+
'加载模块中,请耐心等候...',
|
|
38
|
+
'系统优化中,请稍后...',
|
|
39
|
+
'正在初始化,请稍等...',
|
|
40
|
+
'快要完成了,谢谢您的耐心...'
|
|
41
|
+
];
|
|
42
|
+
static goodMorning = [
|
|
43
|
+
'早安!愿您拥有愉快的一天。',
|
|
44
|
+
'早上好!开启新的一天。',
|
|
45
|
+
'早晨的阳光给你带来美好的一天。',
|
|
46
|
+
'愿您今天充满活力,早上好!',
|
|
47
|
+
'早安!新的一天,新的希望。',
|
|
48
|
+
'早上好!一起迎接新的开始。',
|
|
49
|
+
'早晨的微风让您的心情更加愉快。',
|
|
50
|
+
'早上好!迎接美好的一天。',
|
|
51
|
+
'早安!享受这美好的清晨。',
|
|
52
|
+
'早上好!愿您有个美好的一天。'
|
|
53
|
+
];
|
|
54
|
+
static goodAfternoon = [
|
|
55
|
+
'下午好!下午的时光给您带来温暖。',
|
|
56
|
+
'愿您度过一个愉快的下午。',
|
|
57
|
+
'下午好!保持积极的心态。',
|
|
58
|
+
'下午的阳光洒满大地,祝您心情愉悦。',
|
|
59
|
+
'下午好!希望今天的一切都顺利。',
|
|
60
|
+
'祝您度过一个轻松的下午。',
|
|
61
|
+
'下午好!享受这片刻的宁静。',
|
|
62
|
+
'下午是小憩的好时光,祝您下午愉快。',
|
|
63
|
+
'下午好!愿您今天过得顺利。',
|
|
64
|
+
'下午是忙碌中的小憩时光,祝您愉快。'
|
|
65
|
+
];
|
|
66
|
+
static goodEvening = [
|
|
67
|
+
'晚上好!愿您度过一个愉快的夜晚。',
|
|
68
|
+
'夜幕降临,祝您晚上愉快。',
|
|
69
|
+
'晚上好!希望您有一个美好的夜晚。',
|
|
70
|
+
'在星光下,愿您心情愉悦。',
|
|
71
|
+
'晚上好!祝您一晚安宁。',
|
|
72
|
+
'夜晚的宁静带给您舒适的感觉。',
|
|
73
|
+
'愿您度过一个平静的夜晚,晚上好!',
|
|
74
|
+
'晚上好!请享受这宁静的夜晚。',
|
|
75
|
+
'在星光的陪伴下,祝您晚安。',
|
|
76
|
+
'晚上好!愿您有个温馨的夜晚。'
|
|
77
|
+
];
|
|
2
78
|
}
|
|
3
|
-
Config.colors = {
|
|
4
|
-
primary: '#108ee9',
|
|
5
|
-
success: '#389e0d',
|
|
6
|
-
danger: '#cf1322',
|
|
7
|
-
warning: '#faad14',
|
|
8
|
-
info: '#0958d9',
|
|
9
|
-
light: '#999'
|
|
10
|
-
};
|
|
11
|
-
Config.loadingText = [
|
|
12
|
-
'请稍候,正在加载数据...',
|
|
13
|
-
'系统准备中,请稍等...',
|
|
14
|
-
'准备您的体验,马上回来...',
|
|
15
|
-
'系统正在整理文件...',
|
|
16
|
-
'在与未来建立联系...',
|
|
17
|
-
'正在构建您的旅程...',
|
|
18
|
-
'数据正在装载,请耐心等待...',
|
|
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
|
-
Config.goodMorning = [
|
|
44
|
-
'早安!愿您拥有愉快的一天。',
|
|
45
|
-
'早上好!开启新的一天。',
|
|
46
|
-
'早晨的阳光给你带来美好的一天。',
|
|
47
|
-
'愿您今天充满活力,早上好!',
|
|
48
|
-
'早安!新的一天,新的希望。',
|
|
49
|
-
'早上好!一起迎接新的开始。',
|
|
50
|
-
'早晨的微风让您的心情更加愉快。',
|
|
51
|
-
'早上好!迎接美好的一天。',
|
|
52
|
-
'早安!享受这美好的清晨。',
|
|
53
|
-
'早上好!愿您有个美好的一天。'
|
|
54
|
-
];
|
|
55
|
-
Config.goodAfternoon = [
|
|
56
|
-
'下午好!下午的时光给您带来温暖。',
|
|
57
|
-
'愿您度过一个愉快的下午。',
|
|
58
|
-
'下午好!保持积极的心态。',
|
|
59
|
-
'下午的阳光洒满大地,祝您心情愉悦。',
|
|
60
|
-
'下午好!希望今天的一切都顺利。',
|
|
61
|
-
'祝您度过一个轻松的下午。',
|
|
62
|
-
'下午好!享受这片刻的宁静。',
|
|
63
|
-
'下午是小憩的好时光,祝您下午愉快。',
|
|
64
|
-
'下午好!愿您今天过得顺利。',
|
|
65
|
-
'下午是忙碌中的小憩时光,祝您愉快。'
|
|
66
|
-
];
|
|
67
|
-
Config.goodEvening = [
|
|
68
|
-
'晚上好!愿您度过一个愉快的夜晚。',
|
|
69
|
-
'夜幕降临,祝您晚上愉快。',
|
|
70
|
-
'晚上好!希望您有一个美好的夜晚。',
|
|
71
|
-
'在星光下,愿您心情愉悦。',
|
|
72
|
-
'晚上好!祝您一晚安宁。',
|
|
73
|
-
'夜晚的宁静带给您舒适的感觉。',
|
|
74
|
-
'愿您度过一个平静的夜晚,晚上好!',
|
|
75
|
-
'晚上好!请享受这宁静的夜晚。',
|
|
76
|
-
'在星光的陪伴下,祝您晚安。',
|
|
77
|
-
'晚上好!愿您有个温馨的夜晚。'
|
|
78
|
-
];
|
package/index.d.ts
CHANGED
|
@@ -7,11 +7,13 @@ export { PermissionContext } from './content/PermissionContext';
|
|
|
7
7
|
export { AppLayout, App, UserInfo } from './layout/AppLayout';
|
|
8
8
|
export { BackPageContainer } from './layout/BackPageContainer';
|
|
9
9
|
export { MyPageContainer } from './layout/MyPageContainer';
|
|
10
|
+
export { SubMenusContainer, SubMenusItem, SubMenusProps } from './layout/SubMenusContainer';
|
|
10
11
|
export { MediaItem, DirectoryItem, Media, MediaProps } from './media/Media';
|
|
11
12
|
export { MediaModals } from './media/MediaModals';
|
|
12
13
|
export { Permission } from './permission/Permission';
|
|
13
14
|
export { AIEditor, AIEditorProps } from './rich/AIEditor';
|
|
14
15
|
export { Slider, SliderCode, SliderCodeToken } from './slider/SliderCode';
|
|
15
16
|
export { Promises, Async, NumberUtils, CascadeUtils, ArrayUtils, NavigateUtils } from './promises';
|
|
17
|
+
export { ProgressModal, ProgressCallback, ProgressProps } from './ProgressModal';
|
|
16
18
|
export { UserModals } from './UserModals';
|
|
17
19
|
export { UploadModals, FileType } from './UploadModals';
|
package/index.js
CHANGED
|
@@ -7,11 +7,13 @@ export { PermissionContext } from './content/PermissionContext';
|
|
|
7
7
|
export { AppLayout } from './layout/AppLayout';
|
|
8
8
|
export { BackPageContainer } from './layout/BackPageContainer';
|
|
9
9
|
export { MyPageContainer } from './layout/MyPageContainer';
|
|
10
|
+
export { SubMenusContainer } from './layout/SubMenusContainer';
|
|
10
11
|
export { Media } from './media/Media';
|
|
11
12
|
export { MediaModals } from './media/MediaModals';
|
|
12
13
|
export { Permission } from './permission/Permission';
|
|
13
14
|
export { AIEditor } from './rich/AIEditor';
|
|
14
15
|
export { SliderCode } from './slider/SliderCode';
|
|
15
16
|
export { Promises, Async, NumberUtils, CascadeUtils, ArrayUtils, NavigateUtils } from './promises';
|
|
17
|
+
export { ProgressModal } from './ProgressModal';
|
|
16
18
|
export { UserModals } from './UserModals';
|
|
17
19
|
export { UploadModals } from './UploadModals';
|
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
|
* 用户信息实体.
|
|
@@ -66,6 +70,22 @@ export declare type LayoutProps = {
|
|
|
66
70
|
* App列表 (切换应用)
|
|
67
71
|
*/
|
|
68
72
|
apps: App[];
|
|
73
|
+
/**
|
|
74
|
+
* 菜单宽度.
|
|
75
|
+
*/
|
|
76
|
+
siderWidth?: number;
|
|
77
|
+
/**
|
|
78
|
+
* 菜单选项高度.
|
|
79
|
+
*/
|
|
80
|
+
siderMenusItemHeight?: number;
|
|
81
|
+
/**
|
|
82
|
+
* 菜单类型.
|
|
83
|
+
*/
|
|
84
|
+
siderMenuType?: 'sub' | 'group';
|
|
85
|
+
/**
|
|
86
|
+
* 头像的标题.
|
|
87
|
+
*/
|
|
88
|
+
avatarTitle?: (userInfo: UserInfo | undefined) => ReactNode;
|
|
69
89
|
/**
|
|
70
90
|
* 布局内容
|
|
71
91
|
*/
|
|
@@ -98,6 +118,10 @@ export declare type LayoutProps = {
|
|
|
98
118
|
* 高度
|
|
99
119
|
*/
|
|
100
120
|
height?: number;
|
|
121
|
+
/**
|
|
122
|
+
* 宽度
|
|
123
|
+
*/
|
|
124
|
+
width?: number;
|
|
101
125
|
/**
|
|
102
126
|
* 跳转路径
|
|
103
127
|
*/
|
|
@@ -115,6 +139,10 @@ export declare type LayoutProps = {
|
|
|
115
139
|
* 头部: 从右到左菜单
|
|
116
140
|
*/
|
|
117
141
|
headerMenus?: ReactNode[];
|
|
142
|
+
/**
|
|
143
|
+
* 头部: 从左到右菜单
|
|
144
|
+
*/
|
|
145
|
+
headerContentRender?: ReactNode;
|
|
118
146
|
/**
|
|
119
147
|
* 切换菜单触发事件
|
|
120
148
|
* @param path 路径.
|
|
@@ -125,6 +153,14 @@ export declare type LayoutProps = {
|
|
|
125
153
|
* @param appCode 应用代码
|
|
126
154
|
*/
|
|
127
155
|
requestMenus?: (appCode: string) => Promise<MenuDataItem[]>;
|
|
156
|
+
/**
|
|
157
|
+
* 全局消息弹框(走马灯效果)
|
|
158
|
+
*/
|
|
159
|
+
alter?: {
|
|
160
|
+
enable: boolean;
|
|
161
|
+
marquee: boolean;
|
|
162
|
+
message: ReactNode;
|
|
163
|
+
};
|
|
128
164
|
};
|
|
129
165
|
/**
|
|
130
166
|
* 通用布局.
|
package/layout/AppLayout.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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 { Dropdown, message, theme, Typography } from 'antd';
|
|
4
|
+
import { Alert, Dropdown, message, theme, Typography } from 'antd';
|
|
5
5
|
import { Session } from 'beer-network/session';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
|
+
import Marquee from 'react-fast-marquee';
|
|
7
8
|
import ImageLayout01 from '../images/layout_01.png';
|
|
8
9
|
import ImageLayout02 from '../images/layout_02.png';
|
|
9
10
|
import ImageLayout03 from '../images/layout_03.png';
|
|
@@ -103,6 +104,7 @@ export const AppLayout = (props) => {
|
|
|
103
104
|
refreshPath()
|
|
104
105
|
.then();
|
|
105
106
|
}, [menus, props.path]);
|
|
107
|
+
// 更新属性触发: 菜单
|
|
106
108
|
// 更新属性触发: 请求用户信息
|
|
107
109
|
useEffect(() => {
|
|
108
110
|
props.requestUser()
|
|
@@ -118,6 +120,10 @@ export const AppLayout = (props) => {
|
|
|
118
120
|
return React.createElement(React.Fragment, null,
|
|
119
121
|
contextHolder,
|
|
120
122
|
React.createElement(ProLayout, { theme: "light", className: css `
|
|
123
|
+
.ant-pro-global-header-logo {
|
|
124
|
+
margin-inline-end: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
121
127
|
.ant-pro-sider-logo {
|
|
122
128
|
.ant-pro-layout-apps-icon {
|
|
123
129
|
display: ${collapsed ? 'flex' : 'none'};
|
|
@@ -156,7 +162,9 @@ export const AppLayout = (props) => {
|
|
|
156
162
|
.ant-pro-sider-collapsed-button {
|
|
157
163
|
inset-block-start: 15px;
|
|
158
164
|
}
|
|
159
|
-
`,
|
|
165
|
+
`, style: {
|
|
166
|
+
minWidth: 1000
|
|
167
|
+
}, selectedKeys: pathKeys, locale: "zh-CN", navTheme: "light", fixSiderbar: true, layout: "mix", contentWidth: "Fluid", splitMenus: false, bgLayoutImgList: [
|
|
160
168
|
{
|
|
161
169
|
src: ImageLayout01,
|
|
162
170
|
left: 85,
|
|
@@ -175,26 +183,26 @@ export const AppLayout = (props) => {
|
|
|
175
183
|
left: 0,
|
|
176
184
|
width: '331px'
|
|
177
185
|
}
|
|
178
|
-
], siderWidth:
|
|
179
|
-
bgLayout: '#
|
|
186
|
+
], siderWidth: props?.siderWidth ?? 190, breakpoint: props?.siderMenuType === 'group' ? 'xs' : undefined, token: {
|
|
187
|
+
bgLayout: '#F5F7FA',
|
|
180
188
|
header: {
|
|
181
189
|
heightLayoutHeader: 48
|
|
182
190
|
},
|
|
183
191
|
sider: {
|
|
184
|
-
menuHeight: token.controlHeight
|
|
192
|
+
menuHeight: props?.siderMenusItemHeight ?? token.controlHeight,
|
|
185
193
|
paddingBlockLayoutMenu: 4,
|
|
186
194
|
paddingInlineLayoutMenu: 4,
|
|
187
195
|
colorMenuBackground: '#fff',
|
|
188
|
-
colorTextMenu: '
|
|
189
|
-
colorTextMenuSelected: 'rgba(0,0,0,0.
|
|
196
|
+
colorTextMenu: 'rgba(0,0,0,0.75)',
|
|
197
|
+
colorTextMenuSelected: 'rgba(0,0,0,0.85)',
|
|
190
198
|
colorBgMenuItemSelected: 'rgba(0,0,0,0.08)'
|
|
191
199
|
},
|
|
192
200
|
pageContainer: {
|
|
193
201
|
paddingInlinePageContainerContent: 0,
|
|
194
202
|
paddingBlockPageContainerContent: 0
|
|
195
203
|
}
|
|
196
|
-
}, siderMenuType: 'sub', fixedHeader: true, collapsedButtonRender: (
|
|
197
|
-
return isMobile ? undefined : reactNode;
|
|
204
|
+
}, siderMenuType: props?.siderMenuType ?? 'sub', fixedHeader: true, collapsedButtonRender: (_collapsed, reactNode) => {
|
|
205
|
+
return isMobile || props?.siderMenuType === 'group' ? undefined : reactNode;
|
|
198
206
|
}, appList: (props.apps?.length || 0) > 1 || collapsed ? props.apps?.map(it => {
|
|
199
207
|
return {
|
|
200
208
|
...it,
|
|
@@ -203,7 +211,9 @@ export const AppLayout = (props) => {
|
|
|
203
211
|
desc: it.description,
|
|
204
212
|
url: it.defaultPath || it.path
|
|
205
213
|
};
|
|
206
|
-
}) : [],
|
|
214
|
+
}) : [], headerContentRender: () => {
|
|
215
|
+
return props?.headerContentRender;
|
|
216
|
+
}, menuHeaderRender: (_logo, _title, props) => {
|
|
207
217
|
if (props !== undefined) {
|
|
208
218
|
setTimeout(() => {
|
|
209
219
|
setCollapsed(props?.collapsed === true);
|
|
@@ -215,7 +225,8 @@ export const AppLayout = (props) => {
|
|
|
215
225
|
textIndent: 10,
|
|
216
226
|
fontSize: token.fontSize + 2,
|
|
217
227
|
color: '#333',
|
|
218
|
-
fontWeight:
|
|
228
|
+
fontWeight: 600,
|
|
229
|
+
minWidth: ((props?.siderWidth ?? 190) - 30)
|
|
219
230
|
} }, app?.name));
|
|
220
231
|
}, menu: {
|
|
221
232
|
collapsedShowTitle: false,
|
|
@@ -224,35 +235,40 @@ export const AppLayout = (props) => {
|
|
|
224
235
|
request: async () => {
|
|
225
236
|
return requestMenuItems();
|
|
226
237
|
}
|
|
227
|
-
}, subMenuItemRender: (
|
|
238
|
+
}, subMenuItemRender: (menuDataItemProps, _defaultDom, menuProps) => {
|
|
239
|
+
if (props?.siderMenuType === 'group') {
|
|
240
|
+
return React.createElement("span", { style: {
|
|
241
|
+
marginLeft: 4,
|
|
242
|
+
color: 'rgba(0,0,0,0.55)',
|
|
243
|
+
fontSize: token.fontSize - 2
|
|
244
|
+
} }, menuDataItemProps.name);
|
|
245
|
+
}
|
|
228
246
|
return React.createElement("div", { style: {
|
|
229
|
-
height: token.controlHeight
|
|
247
|
+
height: props?.siderMenusItemHeight ?? token.controlHeight,
|
|
230
248
|
fontSize: token.fontSize,
|
|
231
249
|
display: 'flex',
|
|
232
250
|
alignItems: 'center',
|
|
233
251
|
justifyContent: menuProps.collapsed ? 'center' : undefined,
|
|
234
252
|
cursor: 'pointer',
|
|
235
|
-
width: '100%'
|
|
236
|
-
color: '#0c0d0e'
|
|
253
|
+
width: '100%'
|
|
237
254
|
} },
|
|
238
|
-
React.createElement("img", { src: (
|
|
255
|
+
React.createElement("img", { src: (menuDataItemProps.icon || '') === '' ? undefined : menuDataItemProps.icon?.toString(), style: {
|
|
239
256
|
width: 20,
|
|
240
257
|
display: 'block',
|
|
241
|
-
marginInlineEnd:
|
|
258
|
+
marginInlineEnd: menuDataItemProps.collapsed ? 0 : 4
|
|
242
259
|
}, alt: "" }),
|
|
243
|
-
menuProps.collapsed ? undefined :
|
|
260
|
+
menuProps.collapsed ? undefined : menuDataItemProps.name);
|
|
244
261
|
}, menuItemRender: (props, defaultDom, menuProps) => {
|
|
245
262
|
const isSub = (props.locale?.toString()
|
|
246
263
|
?.split('.') || []).length > 2;
|
|
247
264
|
return React.createElement("a", { style: {
|
|
248
265
|
fontSize: token.fontSize,
|
|
249
266
|
userSelect: 'none',
|
|
250
|
-
height: token.controlHeight
|
|
267
|
+
height: props?.siderMenusItemHeight ?? token.controlHeight,
|
|
251
268
|
display: 'flex',
|
|
252
269
|
alignItems: 'center',
|
|
253
270
|
justifyContent: menuProps.collapsed && !isSub ? 'center' : undefined,
|
|
254
|
-
cursor: 'pointer'
|
|
255
|
-
color: '#0c0d0e'
|
|
271
|
+
cursor: 'pointer'
|
|
256
272
|
}, onClick: (e) => {
|
|
257
273
|
e.preventDefault();
|
|
258
274
|
if (props.isUrl || !props.path) {
|
|
@@ -269,6 +285,8 @@ export const AppLayout = (props) => {
|
|
|
269
285
|
}, logo: React.createElement("div", { className: css `
|
|
270
286
|
display: flex;
|
|
271
287
|
align-items: center;
|
|
288
|
+
${props?.logo?.width === undefined ? undefined : `min-width: ${props?.logo?.width}px`};
|
|
289
|
+
${props?.logo?.width === undefined ? undefined : `max-width: ${props?.logo?.width}px`};
|
|
272
290
|
|
|
273
291
|
& > img {
|
|
274
292
|
height: ${props?.logo?.height || 28}px;
|
|
@@ -285,10 +303,7 @@ export const AppLayout = (props) => {
|
|
|
285
303
|
React.createElement("img", { src: props?.logo?.path, alt: "" })), title: false, avatarProps: {
|
|
286
304
|
src: (userInfo?.avatar || '') === '' ? '/avatar.png' : userInfo?.avatar,
|
|
287
305
|
size: 'small',
|
|
288
|
-
title:
|
|
289
|
-
color: '#333',
|
|
290
|
-
fontSize: token.fontSize + 1
|
|
291
|
-
} }, userInfo?.nickName || '系统用户'),
|
|
306
|
+
title: props?.avatarTitle?.(userInfo),
|
|
292
307
|
render: (_props, dom) => {
|
|
293
308
|
return (React.createElement(Dropdown, { menu: {
|
|
294
309
|
items: [
|
|
@@ -336,5 +351,9 @@ export const AppLayout = (props) => {
|
|
|
336
351
|
return [];
|
|
337
352
|
}
|
|
338
353
|
return props?.headerMenus || [];
|
|
339
|
-
} },
|
|
354
|
+
} },
|
|
355
|
+
props?.alter?.enable === true ? React.createElement(Alert, { banner: true, style: {
|
|
356
|
+
paddingInline: 24
|
|
357
|
+
}, message: props?.alter?.marquee === true ? React.createElement(Marquee, { pauseOnHover: true, gradient: false }, props?.alter?.message) : props?.alter?.message }) : undefined,
|
|
358
|
+
props.children));
|
|
340
359
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { CSSProperties, FC } from 'react';
|
|
2
|
+
import type { ComponentToken as MenuComponentToken } from 'antd/es/menu/style';
|
|
3
|
+
export declare type SubMenusItem = {
|
|
4
|
+
key?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
label: string | React.ReactNode;
|
|
7
|
+
children: SubMenusItem[];
|
|
8
|
+
};
|
|
9
|
+
export declare type SubMenusProps = {
|
|
10
|
+
items: SubMenusItem[];
|
|
11
|
+
token?: MenuComponentToken | undefined;
|
|
12
|
+
gap?: number | undefined;
|
|
13
|
+
height?: number | string | undefined;
|
|
14
|
+
width?: number | undefined;
|
|
15
|
+
padding?: number | string | undefined;
|
|
16
|
+
styles?: {
|
|
17
|
+
menus?: CSSProperties | undefined;
|
|
18
|
+
body?: CSSProperties | undefined;
|
|
19
|
+
};
|
|
20
|
+
header?: React.ReactNode | undefined;
|
|
21
|
+
children?: React.ReactNode | undefined;
|
|
22
|
+
value?: string | undefined;
|
|
23
|
+
openKeys?: string[] | undefined;
|
|
24
|
+
onChange?: (key: string) => void;
|
|
25
|
+
onOpenChange?: (keys: string[]) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const SubMenusContainer: FC<SubMenusProps>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { ConfigProvider, Menu } from 'antd';
|
|
3
|
+
export const SubMenusContainer = (props) => {
|
|
4
|
+
const [selectKeys, setSelectKeys] = useState([]);
|
|
5
|
+
const [openKeys, setOpenKeys] = useState([]);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (props?.value === undefined) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
setSelectKeys([props.value]);
|
|
11
|
+
}, [props?.value]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (props?.openKeys === undefined) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setOpenKeys(props.openKeys);
|
|
17
|
+
}, [props?.openKeys]);
|
|
18
|
+
return React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement(ConfigProvider, { theme: {
|
|
20
|
+
components: {
|
|
21
|
+
Menu: props?.token || {
|
|
22
|
+
itemHeight: 36,
|
|
23
|
+
itemBorderRadius: 0,
|
|
24
|
+
iconMarginInlineEnd: 0,
|
|
25
|
+
itemMarginBlock: 0,
|
|
26
|
+
itemMarginInline: 0,
|
|
27
|
+
itemPaddingInline: 0,
|
|
28
|
+
subMenuItemBg: 'transparent',
|
|
29
|
+
itemHoverBg: 'rgba(22,100,255,.04)',
|
|
30
|
+
itemHoverColor: '#000',
|
|
31
|
+
itemActiveBg: 'rgba(22,100,255,.08)',
|
|
32
|
+
itemSelectedBg: 'rgba(22,100,255,.08)'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} },
|
|
36
|
+
React.createElement("div", { style: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
gap: `${props?.gap || 12}px`,
|
|
39
|
+
alignItems: 'flex-start',
|
|
40
|
+
width: '100%'
|
|
41
|
+
} },
|
|
42
|
+
React.createElement("div", { style: {
|
|
43
|
+
width: props?.width || 200,
|
|
44
|
+
backgroundColor: '#fff',
|
|
45
|
+
height: props?.height || '100vh',
|
|
46
|
+
userSelect: 'none',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
...(props?.styles?.menus || {})
|
|
49
|
+
} },
|
|
50
|
+
props?.header !== undefined ? React.createElement("div", { style: {
|
|
51
|
+
padding: '12px 0',
|
|
52
|
+
fontWeight: 500,
|
|
53
|
+
borderInlineEnd: '1px solid rgba(5,5,5,.06)',
|
|
54
|
+
borderBlockEnd: '1px solid rgba(5,5,5,.06)'
|
|
55
|
+
} }, props?.header) : undefined,
|
|
56
|
+
React.createElement(Menu, { style: {
|
|
57
|
+
height: '100%'
|
|
58
|
+
}, onClick: (e) => {
|
|
59
|
+
props?.onChange?.(e.key);
|
|
60
|
+
}, onOpenChange: (e) => {
|
|
61
|
+
props?.onOpenChange?.(e);
|
|
62
|
+
}, subMenuCloseDelay: 0, selectedKeys: selectKeys, openKeys: openKeys, mode: "inline", inlineIndent: 16, items: props?.items })),
|
|
63
|
+
React.createElement("div", { style: {
|
|
64
|
+
width: `calc(100% - ${(props?.width || 200) + (props?.gap || 12) + (props?.gap || 12)}px)`,
|
|
65
|
+
marginRight: (props?.gap || 12),
|
|
66
|
+
height: '100%',
|
|
67
|
+
padding: props?.padding || '12px 0',
|
|
68
|
+
...(props?.styles?.body || {}),
|
|
69
|
+
overflow: 'auto'
|
|
70
|
+
} }, props?.children))));
|
|
71
|
+
};
|