beer-assembly-biz 1.1.3-alpha.1 → 1.1.3-alpha.11
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/UploadModals.d.ts +12 -0
- package/UploadModals.js +233 -0
- package/auth/AuthStyle01.d.ts +2 -2
- package/auth/AuthStyle01.js +1 -1
- package/auth/AuthStyle02.d.ts +2 -2
- package/auth/AuthStyle02.js +1 -1
- package/config/index.js +76 -76
- package/index.d.ts +8 -4
- package/index.js +7 -3
- package/layout/AppLayout.js +4 -4
- package/layout/BackPageContainer.d.ts +1 -0
- package/layout/BackPageContainer.js +4 -1
- package/layout/SubMenusContainer.d.ts +27 -0
- package/layout/SubMenusContainer.js +71 -0
- package/media/Media.d.ts +84 -0
- package/media/Media.js +241 -0
- package/media/MediaModals.d.ts +17 -0
- package/media/MediaModals.js +172 -461
- package/package.json +3 -2
- package/promises.d.ts +45 -0
- package/promises.js +136 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Handler } from './type';
|
|
3
|
+
export type FileType = 'IMAGE' | 'GIT' | 'VIDEO' | 'DOCUMENT';
|
|
4
|
+
/**
|
|
5
|
+
* 文件上传模态框.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UploadModals {
|
|
8
|
+
/**
|
|
9
|
+
* 弹出文件上传.
|
|
10
|
+
*/
|
|
11
|
+
static useUpload(fileType: FileType[], key?: string): [Handler<File[]>, ReactNode];
|
|
12
|
+
}
|
package/UploadModals.js
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { Button, Checkbox, Modal, Space } from 'antd';
|
|
3
|
+
import { css } from '@emotion/css';
|
|
4
|
+
import ElementUtils from 'beer-network/elementUtils';
|
|
5
|
+
/**
|
|
6
|
+
* 文件上传模态框.
|
|
7
|
+
*/
|
|
8
|
+
export class UploadModals {
|
|
9
|
+
/**
|
|
10
|
+
* 弹出文件上传.
|
|
11
|
+
*/
|
|
12
|
+
static useUpload(fileType, key = 'DEFAULT') {
|
|
13
|
+
const [isOpenModal, setIsOpenModal] = useState(false);
|
|
14
|
+
const [isPop, setIsPop] = useState(false);
|
|
15
|
+
const callbackRef = useRef(undefined);
|
|
16
|
+
const getPopStatus = () => {
|
|
17
|
+
return localStorage.getItem('__UPLOAD_MODALS_' + key) !== '1';
|
|
18
|
+
};
|
|
19
|
+
const setPopStatus = (status) => {
|
|
20
|
+
if (status) {
|
|
21
|
+
localStorage.setItem('__UPLOAD_MODALS_' + key, '1');
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const filterFile = (files) => {
|
|
25
|
+
if (files === null) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
const result = [];
|
|
29
|
+
for (let i = 0; i < files.length; i += 1) {
|
|
30
|
+
const file = files.item(i) ?? undefined;
|
|
31
|
+
if (file === undefined) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const type = fileType.find(it => {
|
|
35
|
+
if (it === 'IMAGE' && ['image/png', 'image/jpeg', 'image/webp'].indexOf(file.type) > -1) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
const fileExtension = file.name.split('.')
|
|
39
|
+
?.pop()
|
|
40
|
+
?.toLowerCase() ?? 'none';
|
|
41
|
+
return it === 'VIDEO' && ['wmv', 'avi', '3gp', 'mov', 'mp4', 'flv', 'rmvb', 'mkv', 'm4v', 'x-flv'].indexOf(fileExtension) > -1;
|
|
42
|
+
});
|
|
43
|
+
if (type === undefined) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
let size = 0;
|
|
47
|
+
switch (type) {
|
|
48
|
+
case 'IMAGE':
|
|
49
|
+
size = 10 * 1024 * 1024;
|
|
50
|
+
break;
|
|
51
|
+
case 'VIDEO':
|
|
52
|
+
size = 300 * 1024 * 1024;
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
size = 50 * 1024 * 1024;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
if (file.size > size) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
result.push(file);
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
const onSelectFile = async () => {
|
|
66
|
+
const fileList = await ElementUtils.selectFile(true);
|
|
67
|
+
await callbackRef.current?.(filterFile(fileList));
|
|
68
|
+
};
|
|
69
|
+
const onConfirm = async () => {
|
|
70
|
+
if (callbackRef.current) {
|
|
71
|
+
setPopStatus(isPop);
|
|
72
|
+
onSelectFile()
|
|
73
|
+
.then();
|
|
74
|
+
setIsOpenModal(false);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
setIsOpenModal(false);
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
};
|
|
81
|
+
const handler = {
|
|
82
|
+
ok: (callback) => {
|
|
83
|
+
if (!getPopStatus()) {
|
|
84
|
+
onSelectFile()
|
|
85
|
+
.then();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
setIsPop(false);
|
|
89
|
+
setIsOpenModal(true);
|
|
90
|
+
callbackRef.current = callback;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return [handler, React.createElement(React.Fragment, null,
|
|
94
|
+
React.createElement(Modal, { title: "\u6587\u4EF6\u4E0A\u4F20\u8981\u6C42", width: 360, open: isOpenModal, onCancel: () => setIsOpenModal(false), styles: {
|
|
95
|
+
content: {
|
|
96
|
+
padding: 0
|
|
97
|
+
},
|
|
98
|
+
header: {
|
|
99
|
+
paddingBlock: '16px 0',
|
|
100
|
+
paddingInline: 20,
|
|
101
|
+
marginInlineStart: 0,
|
|
102
|
+
marginBlockEnd: 0
|
|
103
|
+
},
|
|
104
|
+
wrapper: {
|
|
105
|
+
padding: 0
|
|
106
|
+
},
|
|
107
|
+
body: {
|
|
108
|
+
paddingInline: 20,
|
|
109
|
+
paddingBlockStart: 8,
|
|
110
|
+
paddingBlockEnd: 4
|
|
111
|
+
},
|
|
112
|
+
footer: {
|
|
113
|
+
margin: 0,
|
|
114
|
+
paddingBlockEnd: 12
|
|
115
|
+
}
|
|
116
|
+
}, footer: React.createElement(Space, { style: {
|
|
117
|
+
width: '100%',
|
|
118
|
+
boxSizing: 'border-box',
|
|
119
|
+
justifyContent: 'space-between',
|
|
120
|
+
paddingInline: 20,
|
|
121
|
+
paddingBlock: 4
|
|
122
|
+
} },
|
|
123
|
+
React.createElement(Checkbox, { checked: isPop, onChange: (e) => setIsPop(e.target.checked) }, "\u4E0B\u6B21\u4E0D\u5728\u5F39\u51FA"),
|
|
124
|
+
React.createElement(Space, { size: 12 },
|
|
125
|
+
React.createElement(Button, { type: "primary", onClick: onConfirm }, "\u786E\u5B9A"),
|
|
126
|
+
React.createElement(Button, { onClick: () => setIsOpenModal(false) }, "\u53D6\u6D88"))) },
|
|
127
|
+
React.createElement("div", { className: css `
|
|
128
|
+
.title {
|
|
129
|
+
font-weight: 500;
|
|
130
|
+
font-size: 14px;
|
|
131
|
+
margin: 12px 0 4px 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.title:first-child {
|
|
135
|
+
margin-top: 4px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
ul {
|
|
139
|
+
margin: 0;
|
|
140
|
+
padding-left: 20px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
li {
|
|
144
|
+
padding-block: 2px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.desc {
|
|
148
|
+
margin: 4px 0;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
color: #444
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
code {
|
|
154
|
+
background: #EFEFEF;
|
|
155
|
+
padding: 2px 4px;
|
|
156
|
+
border-radius: 2px;
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
}
|
|
159
|
+
` },
|
|
160
|
+
fileType.find(it => it === 'IMAGE') !== undefined ? React.createElement(React.Fragment, null,
|
|
161
|
+
fileType.length === 1 ? undefined : React.createElement("div", { className: "title" }, "\u56FE\u7247"),
|
|
162
|
+
React.createElement("ul", null,
|
|
163
|
+
React.createElement("li", null, "\u5355\u5F20\u5927\u5C0F\uFF1A\u226410M"),
|
|
164
|
+
React.createElement("li", null,
|
|
165
|
+
"\u683C\u5F0F\uFF1A",
|
|
166
|
+
React.createElement("code", null, "JPEG"),
|
|
167
|
+
"\u3001",
|
|
168
|
+
React.createElement("code", null, "JPG"),
|
|
169
|
+
"\u3001",
|
|
170
|
+
React.createElement("code", null, "PNG"),
|
|
171
|
+
"\u3001",
|
|
172
|
+
React.createElement("code", null, "WEBP")))) : undefined,
|
|
173
|
+
fileType.find(it => it === 'GIT') !== undefined ? React.createElement(React.Fragment, null,
|
|
174
|
+
fileType.length === 1 ? undefined : React.createElement("div", { className: "title" }, "\u52A8\u56FE\uFF08GIF\uFF09"),
|
|
175
|
+
React.createElement("ul", null,
|
|
176
|
+
React.createElement("li", null, "\u5355\u4E2A\u5927\u5C0F\uFF1A\u226410M"),
|
|
177
|
+
React.createElement("li", null,
|
|
178
|
+
"\u683C\u5F0F\uFF1A",
|
|
179
|
+
React.createElement("code", null, "GIF")))) : undefined,
|
|
180
|
+
fileType.find(it => it === 'VIDEO') !== undefined ? React.createElement(React.Fragment, null,
|
|
181
|
+
fileType.length === 1 ? undefined : React.createElement("div", { className: "title" }, "\u89C6\u9891"),
|
|
182
|
+
React.createElement("ul", null,
|
|
183
|
+
React.createElement("li", null, "\u5355\u4E2A\u5927\u5C0F\uFF1A\u2264300M"),
|
|
184
|
+
React.createElement("li", null, "\u65F6\u957F\uFF1A\u226410\u5206\u949F"),
|
|
185
|
+
React.createElement("li", null,
|
|
186
|
+
"\u683C\u5F0F\uFF1A",
|
|
187
|
+
React.createElement("code", null, "WMV"),
|
|
188
|
+
"\u3001",
|
|
189
|
+
React.createElement("code", null, "AVI"),
|
|
190
|
+
"\u3001",
|
|
191
|
+
React.createElement("code", null, "3GP"),
|
|
192
|
+
"\u3001",
|
|
193
|
+
React.createElement("code", null, "MOV"),
|
|
194
|
+
"\u3001",
|
|
195
|
+
React.createElement("code", null, "MP4"),
|
|
196
|
+
"\u3001",
|
|
197
|
+
React.createElement("code", null, "FLV"),
|
|
198
|
+
"\u3001",
|
|
199
|
+
React.createElement("code", null, "RMVB"),
|
|
200
|
+
"\u3001",
|
|
201
|
+
React.createElement("code", null, "MKV"),
|
|
202
|
+
"\u3001",
|
|
203
|
+
React.createElement("code", null, "M4V"),
|
|
204
|
+
"\u3001",
|
|
205
|
+
React.createElement("code", null, "X-FLV")))) : undefined,
|
|
206
|
+
fileType.find(it => it === 'DOCUMENT') !== undefined ? React.createElement(React.Fragment, null,
|
|
207
|
+
fileType.length === 1 ? undefined : React.createElement("div", { className: "title" }, "\u6587\u6863"),
|
|
208
|
+
React.createElement("ul", null,
|
|
209
|
+
React.createElement("li", null, "\u5355\u4E2A\u5927\u5C0F\uFF1A\u226430M"),
|
|
210
|
+
React.createElement("li", null,
|
|
211
|
+
"\u683C\u5F0F\uFF1A",
|
|
212
|
+
React.createElement("code", null, "PDF"),
|
|
213
|
+
"\u3001",
|
|
214
|
+
React.createElement("code", null, "DOC"),
|
|
215
|
+
"\u3001",
|
|
216
|
+
React.createElement("code", null, "DOCX"),
|
|
217
|
+
"\u3001",
|
|
218
|
+
React.createElement("code", null, "XLS"),
|
|
219
|
+
"\u3001",
|
|
220
|
+
React.createElement("code", null, "XLSX"),
|
|
221
|
+
"\u3001",
|
|
222
|
+
React.createElement("code", null, "PPT"),
|
|
223
|
+
"\u3001",
|
|
224
|
+
React.createElement("code", null, "PPTX"),
|
|
225
|
+
"\u3001",
|
|
226
|
+
React.createElement("code", null, "TXT")))) : undefined,
|
|
227
|
+
React.createElement("div", { style: { marginTop: 12 } },
|
|
228
|
+
React.createElement("div", { className: "desc" },
|
|
229
|
+
React.createElement("span", { style: { fontWeight: 500 } }, "\u4E25\u7981\u4E0A\u4F20\u5BFC\u6D41\u3001\u8FDD\u89C4\u6216\u8FDD\u7981\u5185\u5BB9"),
|
|
230
|
+
"\uFF0C\u8FDD\u8005\u5C06\u5C01\u7981\u8D26\u53F7\u5904\u7406\u3002"),
|
|
231
|
+
React.createElement("div", { className: "desc" }, "\u8BF7\u786E\u4FDD\u6587\u4EF6\u7B26\u5408\u683C\u5F0F\u53CA\u5927\u5C0F\u8981\u6C42\uFF0C\u5426\u5219\u53EF\u80FD\u4E0A\u4F20\u5931\u8D25\u3002")))))];
|
|
232
|
+
}
|
|
233
|
+
}
|
package/auth/AuthStyle01.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Slider, SliderCodeToken } from '../slider/SliderCode';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type AuthStyle01Props = {
|
|
4
4
|
/**
|
|
5
5
|
* 主颜色.
|
|
6
6
|
*/
|
|
@@ -67,4 +67,4 @@ export declare type AuthStyleProps = {
|
|
|
67
67
|
*/
|
|
68
68
|
login?: (userInfo: any) => void;
|
|
69
69
|
};
|
|
70
|
-
export declare const
|
|
70
|
+
export declare const AuthStyle01: FC<AuthStyle01Props>;
|
package/auth/AuthStyle01.js
CHANGED
|
@@ -4,7 +4,7 @@ import { css } from '@emotion/css';
|
|
|
4
4
|
import { AuthPassword } from './AuthPassword';
|
|
5
5
|
import ImageBackground from '../images/assets_background_01.png';
|
|
6
6
|
import { Session } from './session';
|
|
7
|
-
export const
|
|
7
|
+
export const AuthStyle01 = (props) => {
|
|
8
8
|
const { token } = theme.useToken();
|
|
9
9
|
const [errorMessage, setErrorMessage] = useState('');
|
|
10
10
|
const onConfirmLogin = async (code, slider, params) => {
|
package/auth/AuthStyle02.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Slider, SliderCodeToken } from '../slider/SliderCode';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type AuthStyle02Props = {
|
|
4
4
|
/**
|
|
5
5
|
* 主颜色.
|
|
6
6
|
*/
|
|
@@ -63,4 +63,4 @@ export declare type AuthStyleProps = {
|
|
|
63
63
|
*/
|
|
64
64
|
login?: (userInfo: any) => void;
|
|
65
65
|
};
|
|
66
|
-
export declare const
|
|
66
|
+
export declare const AuthStyle02: FC<AuthStyle02Props>;
|
package/auth/AuthStyle02.js
CHANGED
|
@@ -4,7 +4,7 @@ import { css } from '@emotion/css';
|
|
|
4
4
|
import ImageBackground from '../images/assets_background_01.png';
|
|
5
5
|
import { Session } from './session';
|
|
6
6
|
import { AuthPassword } from './AuthPassword';
|
|
7
|
-
export const
|
|
7
|
+
export const AuthStyle02 = (props) => {
|
|
8
8
|
const { token } = theme.useToken();
|
|
9
9
|
const [errorMessage, setErrorMessage] = useState('');
|
|
10
10
|
const onConfirmLogin = async (code, slider, params) => {
|
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
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
export { AuthPassword, AuthPasswordProps } from './auth/AuthPassword';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { AuthStyle01, AuthStyle01Props } from './auth/AuthStyle01';
|
|
3
|
+
export { AuthStyle02, AuthStyle02Props } from './auth/AuthStyle02';
|
|
4
4
|
export { Config } from './config';
|
|
5
5
|
export { ParentContext } from './content/ParentContext';
|
|
6
6
|
export { PermissionContext } from './content/PermissionContext';
|
|
7
|
-
export { AppLayout } from './layout/AppLayout';
|
|
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';
|
|
11
|
+
export { MediaItem, DirectoryItem, Media, MediaProps } from './media/Media';
|
|
12
|
+
export { MediaModals } from './media/MediaModals';
|
|
10
13
|
export { Permission } from './permission/Permission';
|
|
11
14
|
export { AIEditor, AIEditorProps } from './rich/AIEditor';
|
|
12
15
|
export { Slider, SliderCode, SliderCodeToken } from './slider/SliderCode';
|
|
13
|
-
export { Promises } from './promises';
|
|
16
|
+
export { Promises, Async, NumberUtils, CascadeUtils, ArrayUtils, NavigateUtils } from './promises';
|
|
14
17
|
export { UserModals } from './UserModals';
|
|
18
|
+
export { UploadModals, FileType } from './UploadModals';
|
package/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
export { AuthPassword } from './auth/AuthPassword';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { AuthStyle01 } from './auth/AuthStyle01';
|
|
3
|
+
export { AuthStyle02 } from './auth/AuthStyle02';
|
|
4
4
|
export { Config } from './config';
|
|
5
5
|
export { ParentContext } from './content/ParentContext';
|
|
6
6
|
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';
|
|
11
|
+
export { Media } from './media/Media';
|
|
12
|
+
export { MediaModals } from './media/MediaModals';
|
|
10
13
|
export { Permission } from './permission/Permission';
|
|
11
14
|
export { AIEditor } from './rich/AIEditor';
|
|
12
15
|
export { SliderCode } from './slider/SliderCode';
|
|
13
|
-
export { Promises } from './promises';
|
|
16
|
+
export { Promises, Async, NumberUtils, CascadeUtils, ArrayUtils, NavigateUtils } from './promises';
|
|
14
17
|
export { UserModals } from './UserModals';
|
|
18
|
+
export { UploadModals } from './UploadModals';
|
package/layout/AppLayout.js
CHANGED
|
@@ -4,9 +4,9 @@ import { ProLayout } from '@ant-design/pro-components';
|
|
|
4
4
|
import { Dropdown, message, theme, Typography } from 'antd';
|
|
5
5
|
import { Session } from 'beer-network/session';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
|
-
import ImageLayout01 from '
|
|
8
|
-
import ImageLayout02 from '
|
|
9
|
-
import ImageLayout03 from '
|
|
7
|
+
import ImageLayout01 from '../images/layout_01.png';
|
|
8
|
+
import ImageLayout02 from '../images/layout_02.png';
|
|
9
|
+
import ImageLayout03 from '../images/layout_03.png';
|
|
10
10
|
dayjs.locale('zh-cn');
|
|
11
11
|
/**
|
|
12
12
|
* 通用布局.
|
|
@@ -215,7 +215,7 @@ export const AppLayout = (props) => {
|
|
|
215
215
|
textIndent: 10,
|
|
216
216
|
fontSize: token.fontSize + 2,
|
|
217
217
|
color: '#333',
|
|
218
|
-
fontWeight:
|
|
218
|
+
fontWeight: 600
|
|
219
219
|
} }, app?.name));
|
|
220
220
|
}, menu: {
|
|
221
221
|
collapsedShowTitle: false,
|
|
@@ -11,7 +11,10 @@ export const BackPageContainer = (props) => {
|
|
|
11
11
|
const navigate = useNavigate();
|
|
12
12
|
return React.createElement(React.Fragment, null,
|
|
13
13
|
React.createElement(PageContainer, { onBack: () => {
|
|
14
|
-
|
|
14
|
+
const defaultBack = () => {
|
|
15
|
+
return navigate(-1);
|
|
16
|
+
};
|
|
17
|
+
(props?.onBack ?? defaultBack)?.();
|
|
15
18
|
}, className: css `
|
|
16
19
|
.ant-page-header-heading {
|
|
17
20
|
padding-block-start: 0 !important;
|
|
@@ -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
|
+
};
|