beer-assembly-biz 1.1.1-alpha.9 → 1.1.2-alpha.1

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/AppLayout.d.ts CHANGED
@@ -78,6 +78,14 @@ export declare type LayoutProps = {
78
78
  * 子路径路径分割符号, 用去区分是否子路径判断子路径的菜单归属
79
79
  */
80
80
  pathPartition: string[];
81
+ /**
82
+ * 请求获取用户信息
83
+ */
84
+ requestUser: () => Promise<UserInfo>;
85
+ /**
86
+ * 登录页面.
87
+ */
88
+ authPath?: string;
81
89
  /**
82
90
  * 左侧: Logo样式
83
91
  */
@@ -90,6 +98,10 @@ export declare type LayoutProps = {
90
98
  * 高度
91
99
  */
92
100
  height?: number;
101
+ /**
102
+ * 跳转路径
103
+ */
104
+ link?: string;
93
105
  };
94
106
  /**
95
107
  * 右侧: 用户下拉选菜单
@@ -97,7 +109,7 @@ export declare type LayoutProps = {
97
109
  userMenus?: {
98
110
  key: string;
99
111
  type?: string;
100
- label: string;
112
+ label: ReactNode;
101
113
  }[];
102
114
  /**
103
115
  * 头部: 从右到左菜单
@@ -108,10 +120,6 @@ export declare type LayoutProps = {
108
120
  * @param path 路径.
109
121
  */
110
122
  toLink?: (path: string) => void;
111
- /**
112
- * 请求获取用户信息
113
- */
114
- requestUser?: () => Promise<UserInfo>;
115
123
  /**
116
124
  * 请求获取菜单信息
117
125
  * @param appCode 应用代码
package/AppLayout.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { css } from '@emotion/css';
3
- import { ProConfigProvider, ProLayout } from '@ant-design/pro-components';
3
+ import { ProLayout } from '@ant-design/pro-components';
4
4
  import { Dropdown, message, Typography } from 'antd';
5
5
  import { Session } from 'beer-network/session';
6
6
  import dayjs from 'dayjs';
@@ -16,6 +16,8 @@ const Component = (props) => {
16
16
  const [userInfo, setUserInfo] = useState();
17
17
  // 菜单是否折叠
18
18
  const [collapsed, setCollapsed] = useState(false);
19
+ // 是否是手机号
20
+ const [isMobile, setIsMobile] = useState(false);
19
21
  // 菜单的选择
20
22
  const [pathKeys, setPathKeys] = useState([]);
21
23
  // 获取参数参数
@@ -84,7 +86,7 @@ const Component = (props) => {
84
86
  messageApi.success('退出登录成功!')
85
87
  .then();
86
88
  setTimeout(() => {
87
- Session.logout('/auth/login');
89
+ Session.logout(props?.authPath || '/auth/login');
88
90
  }, 800);
89
91
  };
90
92
  // 更新属性触发: 应用
@@ -99,8 +101,8 @@ const Component = (props) => {
99
101
  }, [menus, props.path]);
100
102
  // 更新属性触发: 请求用户信息
101
103
  useEffect(() => {
102
- props?.requestUser?.()
103
- ?.then(userInfo => {
104
+ props.requestUser()
105
+ .then(userInfo => {
104
106
  // 更新缓存到Session
105
107
  if (userInfo === undefined || userInfo?.id === undefined) {
106
108
  return;
@@ -108,10 +110,10 @@ const Component = (props) => {
108
110
  setUserInfo(userInfo);
109
111
  sessionStorage.setItem('SESSION', JSON.stringify(userInfo));
110
112
  });
111
- }, [props?.requestUser]);
112
- return React.createElement(ProConfigProvider, { hashed: false },
113
+ }, []);
114
+ return React.createElement(React.Fragment, null,
113
115
  contextHolder,
114
- React.createElement(ProLayout, { className: css `
116
+ React.createElement(ProLayout, { theme: "light", className: css `
115
117
  .ant-pro-sider-logo {
116
118
  .ant-pro-layout-apps-icon {
117
119
  display: ${collapsed ? 'flex' : 'none'};
@@ -180,13 +182,16 @@ const Component = (props) => {
180
182
  paddingInlineLayoutMenu: 4,
181
183
  colorMenuBackground: '#fff',
182
184
  colorTextMenu: 'rgb(87, 89, 102)',
185
+ colorTextMenuSelected: 'rgb(51, 51, 51)',
183
186
  colorBgMenuItemSelected: 'rgba(0,0,0,0.08)'
184
187
  },
185
188
  pageContainer: {
186
189
  paddingInlinePageContainerContent: 0,
187
190
  paddingBlockPageContainerContent: 0
188
191
  }
189
- }, siderMenuType: 'sub', fixedHeader: true, appList: (props.apps?.length || 0) > 1 || collapsed ? props.apps?.map(it => {
192
+ }, siderMenuType: 'sub', fixedHeader: true, collapsedButtonRender: (collapsed, reactNode) => {
193
+ return isMobile ? undefined : reactNode;
194
+ }, appList: (props.apps?.length || 0) > 1 || collapsed ? props.apps?.map(it => {
190
195
  return {
191
196
  ...it,
192
197
  icon: React.createElement("img", { src: it.icon, alt: "" }),
@@ -195,11 +200,14 @@ const Component = (props) => {
195
200
  url: it.defaultPath || it.path
196
201
  };
197
202
  }) : [], menuHeaderRender: (_logo, _title, props) => {
198
- setTimeout(() => {
199
- setCollapsed(props?.collapsed === true);
200
- });
203
+ if (props !== undefined) {
204
+ setTimeout(() => {
205
+ setCollapsed(props?.collapsed === true);
206
+ setIsMobile(props?.isMobile === true);
207
+ });
208
+ }
201
209
  return React.createElement(React.Fragment, null, props?.collapsed ? undefined : React.createElement("div", { style: {
202
- padding: '2px 0',
210
+ padding: props?.isMobile ? '12px 10px' : '2px 0',
203
211
  textIndent: 10,
204
212
  fontSize: 15,
205
213
  color: '#333',
@@ -263,7 +271,13 @@ const Component = (props) => {
263
271
  display: block;
264
272
  margin: 0 6px;
265
273
  }
266
- ` },
274
+ `, onClick: () => {
275
+ const link = props?.logo?.link || '';
276
+ if (link === '') {
277
+ return;
278
+ }
279
+ window.location.href = link;
280
+ } },
267
281
  React.createElement("img", { src: props?.logo?.path, alt: "" })), title: false, avatarProps: {
268
282
  src: (userInfo?.avatar || '') === '' ? '/avatar.png' : userInfo?.avatar,
269
283
  size: 'small',
@@ -0,0 +1,7 @@
1
+ import React, { FC } from 'react';
2
+ export declare type BackPageContainerProps = {
3
+ title?: string | undefined;
4
+ children?: React.ReactNode | undefined;
5
+ };
6
+ export declare const Component: FC<BackPageContainerProps>;
7
+ export default Component;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { css } from '@emotion/css';
3
+ import { PageContainer } from '@ant-design/pro-components';
4
+ import { useNavigate } from 'react-router-dom';
5
+ export const Component = (props) => {
6
+ const navigate = useNavigate();
7
+ return React.createElement(React.Fragment, null,
8
+ React.createElement(PageContainer, { onBack: () => {
9
+ navigate(-1);
10
+ }, className: css `
11
+ .ant-page-header-heading {
12
+ padding-block-start: 0 !important;
13
+ }
14
+
15
+ .ant-page-header-heading-title {
16
+ font-size: 15px;
17
+ line-height: 1.5;
18
+ color: #333;
19
+ }
20
+ `, header: {
21
+ style: {
22
+ background: '#fff',
23
+ padding: '10px 24px 10px 24px',
24
+ borderBottom: '1px solid rgba(0, 0, 0, 0.06)'
25
+ }
26
+ }, title: props.title, ghost: true, childrenContentStyle: {
27
+ padding: '0'
28
+ } },
29
+ React.createElement("div", { className: css `
30
+ padding: 12px 16px;
31
+ ` }, props.children)));
32
+ };
33
+ export default Component;
@@ -0,0 +1,6 @@
1
+ import React, { FC } from 'react';
2
+ export declare type InlineContainer = {
3
+ children?: React.ReactNode;
4
+ };
5
+ export declare const Component: FC<InlineContainer>;
6
+ export default Component;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { App, ConfigProvider } from 'antd';
3
+ export const Component = (props) => {
4
+ return React.createElement(App, null,
5
+ React.createElement(ConfigProvider, { theme: {
6
+ token: {
7
+ fontSize: 12,
8
+ controlHeight: 26,
9
+ fontWeightStrong: 500
10
+ },
11
+ components: {
12
+ Table: {
13
+ motion: false,
14
+ headerColor: '#333',
15
+ rowHoverBg: '#f5f6f7',
16
+ rowSelectedBg: '#f4f5f6',
17
+ rowSelectedHoverBg: '#e6e7e8',
18
+ headerBg: '#fafafa',
19
+ cellPaddingInlineSM: 6,
20
+ cellPaddingBlockSM: 7
21
+ },
22
+ Switch: {
23
+ fontSize: 10
24
+ }
25
+ }
26
+ } }, props?.children));
27
+ };
28
+ export default Component;
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from 'react';
2
+ import { DirectorySelectProps } from 'beer-assembly/DirectorySelect';
3
+ export type Handler<T> = {
4
+ ok: (callback?: (params: T) => void) => void;
5
+ };
6
+ type DirectoryRequest = NonNullable<DirectorySelectProps['request']>;
7
+ export declare type MediaItem = {
8
+ id: string;
9
+ name: string;
10
+ type: 'DIRECTORY' | 'FILE';
11
+ url: string;
12
+ active: boolean;
13
+ };
14
+ export declare type RequestParams = {
15
+ /**
16
+ * 获取列表数据.
17
+ * @param parentId 父类ID.
18
+ */
19
+ requestList: (parentId: string) => Promise<MediaItem[]>;
20
+ rename: (id: string, name: string) => Promise<Boolean>;
21
+ copy: (id: string) => Promise<Boolean>;
22
+ move: (moveId: string, targetId: string) => Promise<Boolean>;
23
+ remove: (id: string) => Promise<Boolean>;
24
+ createDirectory: (parentId: string, name: string) => Promise<Boolean>;
25
+ putFile: (parentId: string, files: FileList) => Promise<Boolean>;
26
+ } & {
27
+ directory: DirectoryRequest;
28
+ };
29
+ export declare class MediaModals {
30
+ static useMedia(request?: RequestParams): [Handler<string[]>, ReactNode];
31
+ }
32
+ export {};
package/MediaModals.js ADDED
@@ -0,0 +1,372 @@
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import { css } from '@emotion/css';
3
+ import { Breadcrumb, Button, Dropdown, Input, message, Modal, Popconfirm, Space, Spin, Typography } from 'antd';
4
+ import ElementUtils from 'beer-network/elementUtils';
5
+ import Flux from 'beer-assembly/Flux';
6
+ import { CloudDownloadOutlined, CopyOutlined, DeleteOutlined, ExclamationCircleFilled, HighlightOutlined, RightCircleOutlined, ScissorOutlined } from '@ant-design/icons';
7
+ import DirectorySelect from 'beer-assembly/DirectorySelect';
8
+ import InlineContainer from './InlineContainer';
9
+ import IconDirectory from './icon/directory.svg';
10
+ import IconMedia from './icon/media.png';
11
+ export class MediaModals {
12
+ static useMedia(request) {
13
+ const [messageApi, contextHolder] = message.useMessage();
14
+ const [isOpenModal, setIsOpenModal] = useState(false);
15
+ const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);
16
+ const [isOpenRenameModal, setIsOpenRenameModal] = useState(false);
17
+ const [isOpenConfirmModal, setIsOpenConfirmModal] = useState(false);
18
+ const [isLoading, setIsLoading] = useState(false);
19
+ const [path, setPath] = useState([]);
20
+ const [dataList, setDataList] = useState([]);
21
+ const [selectId, setSelectId] = useState('');
22
+ const [selectName, setSelectName] = useState('');
23
+ const callbackRef = useRef(undefined);
24
+ const refreshData = (force) => {
25
+ const item = path[path.length - 1];
26
+ const chunkArray = (array, size) => {
27
+ const result = [];
28
+ for (let i = 0; i < array.length; i += size) {
29
+ result.push(array.slice(i, i + size));
30
+ }
31
+ return result;
32
+ };
33
+ setIsLoading(true);
34
+ if (force === true) {
35
+ setDataList([]);
36
+ }
37
+ request?.requestList?.(item.id)
38
+ .then(result => {
39
+ setIsLoading(false);
40
+ setDataList(chunkArray(result || [], 5));
41
+ })
42
+ .catch(() => {
43
+ setIsLoading(false);
44
+ });
45
+ };
46
+ const onActiveItem = (id) => {
47
+ setDataList(dataList?.map(item => {
48
+ return item.map(it => {
49
+ return {
50
+ ...it,
51
+ active: it.id === id
52
+ };
53
+ });
54
+ }));
55
+ };
56
+ const onDownload = async (name, url) => {
57
+ if ((url || '').trim() === '') {
58
+ return;
59
+ }
60
+ ElementUtils.download(url || '', name);
61
+ };
62
+ const onPutFile = async () => {
63
+ const files = await ElementUtils.selectFile();
64
+ if (files === null) {
65
+ return;
66
+ }
67
+ for (let i = 0; i < files.length; i += 1) {
68
+ const file = files[i];
69
+ if (file.size > (1048576 * 15)) {
70
+ messageApi.error(`文件 ${file.name} 太大,不能超过 15MB`);
71
+ return;
72
+ }
73
+ if (!['image/jpeg', 'image/png', 'image/gif', 'image/webp'].includes(file.type)) {
74
+ messageApi.error(`文件 ${file.name} 不是有效的图片格式`);
75
+ return;
76
+ }
77
+ }
78
+ const parentId = path[path.length - 1]?.id;
79
+ setIsLoading(true);
80
+ const result = await request?.putFile(parentId, files);
81
+ setIsLoading(false);
82
+ if (result === true) {
83
+ refreshData();
84
+ }
85
+ };
86
+ const onCreateDirectory = async (name) => {
87
+ const parentId = path[path.length - 1]?.id;
88
+ setIsLoading(true);
89
+ const result = await request?.createDirectory(parentId, name);
90
+ setIsLoading(false);
91
+ if (result === true) {
92
+ refreshData();
93
+ }
94
+ setSelectName('');
95
+ return true;
96
+ };
97
+ const onOpenDirectory = async (id, name) => {
98
+ if (isLoading) {
99
+ return;
100
+ }
101
+ const paths = [...getPaths(), {
102
+ id,
103
+ name
104
+ }];
105
+ setPaths(paths);
106
+ };
107
+ const onBackDirectory = async (id) => {
108
+ if (isLoading) {
109
+ return;
110
+ }
111
+ const paths = getPaths();
112
+ const index = paths.findIndex(it => it.id === id);
113
+ if (index < 0) {
114
+ return;
115
+ }
116
+ paths.splice(index + 1);
117
+ setPaths(paths);
118
+ };
119
+ const onSelectItem = async (id, name, url) => {
120
+ const current = callbackRef?.current;
121
+ if (current === undefined) {
122
+ return;
123
+ }
124
+ current?.([url || '']);
125
+ setIsOpenModal(false);
126
+ };
127
+ const onRename = async (id, name) => {
128
+ setIsOpenRenameModal(true);
129
+ setSelectId(id);
130
+ setSelectName(name);
131
+ };
132
+ const onConfirmRename = async () => {
133
+ if (await request?.rename(selectId, selectName)) {
134
+ refreshData();
135
+ setSelectName('');
136
+ setIsOpenRenameModal(false);
137
+ }
138
+ };
139
+ const onCopy = async (id) => {
140
+ const result = await request?.copy(id);
141
+ if (result === true) {
142
+ refreshData();
143
+ }
144
+ return result;
145
+ };
146
+ const onMove = async (id) => {
147
+ setIsOpenMoveModal(true);
148
+ setSelectId(id);
149
+ };
150
+ const onConfirmMove = async (targetId) => {
151
+ const result = await request?.move(selectId, targetId);
152
+ if (result === true) {
153
+ setIsOpenMoveModal(false);
154
+ refreshData();
155
+ }
156
+ };
157
+ const onRemove = async (id) => {
158
+ setIsOpenConfirmModal(true);
159
+ setSelectId(id);
160
+ };
161
+ const onConfirmRemove = async () => {
162
+ const result = await request?.remove(selectId);
163
+ if (result === true) {
164
+ setIsOpenConfirmModal(false);
165
+ refreshData();
166
+ }
167
+ return result;
168
+ };
169
+ const setPaths = (items) => {
170
+ setPath(items);
171
+ sessionStorage.setItem('MEDIA_MODALS_PATHS', JSON.stringify(items));
172
+ };
173
+ const getPaths = () => {
174
+ const paths = JSON.parse(sessionStorage.getItem('MEDIA_MODALS_PATHS') || '[]');
175
+ if (paths.length <= 0) {
176
+ paths.push({
177
+ id: '0',
178
+ name: '根目录'
179
+ });
180
+ }
181
+ return paths;
182
+ };
183
+ const Item = (props) => {
184
+ const directoryMenusItem = props.type === 'DIRECTORY' ? [
185
+ {
186
+ label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onOpenDirectory(props.id, props.name) },
187
+ React.createElement(RightCircleOutlined, null),
188
+ "\u6253\u5F00\u76EE\u5F55"),
189
+ key: '0'
190
+ },
191
+ {
192
+ type: 'divider'
193
+ }
194
+ ] : [
195
+ {
196
+ label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onDownload(props.name, props.src) },
197
+ React.createElement(CloudDownloadOutlined, null),
198
+ "\u4E0B\u8F7D\u6587\u4EF6"),
199
+ key: '0'
200
+ },
201
+ {
202
+ type: 'divider'
203
+ }
204
+ ];
205
+ const menusItems = [
206
+ ...directoryMenusItem,
207
+ {
208
+ label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onRename(props.id, props.name) },
209
+ React.createElement(HighlightOutlined, null),
210
+ "\u91CD\u547D\u540D"),
211
+ key: '1'
212
+ },
213
+ {
214
+ label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onCopy(props.id) },
215
+ React.createElement(CopyOutlined, null),
216
+ props?.type === 'DIRECTORY' ? '复制目录' : '复制文件'),
217
+ key: '2'
218
+ },
219
+ {
220
+ label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onMove(props.id) },
221
+ React.createElement(ScissorOutlined, null),
222
+ props?.type === 'DIRECTORY' ? '移动目录' : '移动文件'),
223
+ key: '3'
224
+ },
225
+ {
226
+ type: 'divider'
227
+ },
228
+ {
229
+ label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onRemove(props.id) },
230
+ React.createElement(DeleteOutlined, null),
231
+ props?.type === 'DIRECTORY' ? '删除目录' : '删除文件'),
232
+ key: '4',
233
+ danger: true
234
+ }
235
+ ];
236
+ return React.createElement(Dropdown, { menu: {
237
+ items: menusItems
238
+ }, trigger: ['contextMenu'] },
239
+ React.createElement("div", { style: {
240
+ padding: '8px 12px',
241
+ backgroundColor: props?.active ? '#e6f1ff' : undefined,
242
+ display: 'block',
243
+ cursor: 'pointer',
244
+ userSelect: 'none',
245
+ position: 'relative',
246
+ ...props.style
247
+ }, className: css `
248
+ border: ${props?.active ? '1px solid #cddef5' : '1px solid #fff'};
249
+
250
+ &:hover {
251
+ background-color: #eef1f5;
252
+ border: 1px solid ${props.active ? '#cddef5' : '#e6e6e6'};
253
+ }
254
+ `, onClick: () => {
255
+ setTimeout(() => onActiveItem(props.id), 10);
256
+ }, onDoubleClick: () => {
257
+ if (props.type === 'DIRECTORY') {
258
+ onOpenDirectory(props.id, props.name)
259
+ .then();
260
+ return;
261
+ }
262
+ onSelectItem(props.id, props.name, props.src)
263
+ .then();
264
+ } },
265
+ React.createElement("img", { src: props?.type === 'DIRECTORY' ? IconDirectory : props?.src, alt: "", style: {
266
+ width: 56,
267
+ height: 56,
268
+ margin: 'auto',
269
+ display: 'block',
270
+ overflow: 'hidden',
271
+ objectFit: props?.type === 'DIRECTORY' ? undefined : 'cover'
272
+ } }),
273
+ React.createElement(Typography.Text, { style: {
274
+ width: 70,
275
+ fontSize: 11,
276
+ display: 'block',
277
+ textAlign: 'center',
278
+ color: '#323232',
279
+ marginTop: props?.type === 'DIRECTORY' ? undefined : 1
280
+ }, ellipsis: true }, props?.name)));
281
+ };
282
+ const handler = {
283
+ ok: (callback) => {
284
+ setPath(getPaths());
285
+ setIsOpenModal(true);
286
+ if (callbackRef !== undefined) {
287
+ callbackRef.current = callback;
288
+ }
289
+ }
290
+ };
291
+ useEffect(() => {
292
+ if ((path || []).length <= 0) {
293
+ return;
294
+ }
295
+ refreshData(true);
296
+ }, [path]);
297
+ return [handler, React.createElement(React.Fragment, null,
298
+ React.createElement(InlineContainer, null,
299
+ React.createElement(Modal, { width: 565, footer: null, styles: {
300
+ content: { padding: 0 }
301
+ }, open: isOpenModal, maskClosable: false, onCancel: () => {
302
+ if (isLoading) {
303
+ return;
304
+ }
305
+ setIsOpenModal(false);
306
+ }, title: React.createElement("div", { style: {
307
+ padding: '16px 0 0 0'
308
+ } },
309
+ React.createElement("img", { style: {
310
+ marginInlineStart: 20,
311
+ display: 'block',
312
+ height: '17px',
313
+ padding: '2px 0 0 0'
314
+ }, alt: "", src: IconMedia })) },
315
+ React.createElement(Flux, { style: {
316
+ marginBottom: 6,
317
+ padding: '0 20px 10px 20px',
318
+ borderBottom: '1px solid #f3f3f3',
319
+ justifyContent: 'space-between'
320
+ } },
321
+ React.createElement(Breadcrumb, { items: path?.map((it, index) => {
322
+ return {
323
+ title: (index + 1 === path.length
324
+ ? React.createElement(Typography.Text, { style: {
325
+ maxWidth: 70,
326
+ fontSize: 12
327
+ }, ellipsis: true }, it.name)
328
+ : React.createElement("a", { onClick: () => onBackDirectory(it.id) },
329
+ React.createElement(Typography.Text, { style: {
330
+ maxWidth: 70,
331
+ fontSize: 12,
332
+ color: 'rgba(0, 0, 0, 0.45)'
333
+ }, ellipsis: true }, it.name)))
334
+ };
335
+ }) }),
336
+ React.createElement(Space, null,
337
+ React.createElement(Button, { type: "primary", onClick: () => onPutFile(), size: "small", style: {
338
+ height: 24,
339
+ fontSize: 12
340
+ }, loading: isLoading }, "\u4E0A\u4F20\u6587\u4EF6"),
341
+ React.createElement(Popconfirm, { title: "\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0", description: React.createElement(Input, { value: selectName, onChange: (e) => setSelectName(e.currentTarget.value) }), onCancel: () => setSelectName(''), onConfirm: () => onCreateDirectory(selectName), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" },
342
+ React.createElement(Button, { size: "small", style: {
343
+ height: 24,
344
+ fontSize: 12
345
+ }, loading: isLoading }, "\u65B0\u5EFA\u76EE\u5F55")))),
346
+ React.createElement(Spin, { spinning: isLoading },
347
+ React.createElement("div", { style: {
348
+ padding: '6px 0 24px 0',
349
+ height: 333,
350
+ maxHeight: 333,
351
+ overflowY: 'auto',
352
+ overflowX: 'hidden'
353
+ } }, dataList?.map((group, index) => (React.createElement("div", { key: index, style: {
354
+ padding: '0 20px 10px 20px',
355
+ display: 'flex'
356
+ } }, group?.map((item) => (React.createElement(Item, { id: item.id, key: item.id, active: item.active, style: { marginRight: 10 }, type: item.type, src: item.url, name: item.name })))))))))),
357
+ React.createElement(Modal, { title: "\u91CD\u547D\u540D", width: 340, open: isOpenRenameModal, onOk: () => onConfirmRename(), onCancel: () => setIsOpenRenameModal(false), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" },
358
+ React.createElement(Input, { value: selectName, onChange: (e) => setSelectName(e.currentTarget.value) })),
359
+ React.createElement(Modal, { title: React.createElement(React.Fragment, null,
360
+ React.createElement(ExclamationCircleFilled, { style: {
361
+ marginRight: 6,
362
+ fontSize: 16,
363
+ color: '#faad14'
364
+ } }),
365
+ "\u662F\u5426\u786E\u8BA4\u5220\u9664?"), width: 400, open: isOpenConfirmModal, onOk: () => onConfirmRemove(), onCancel: () => setIsOpenConfirmModal(false), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" }, "\u5220\u9664\u64CD\u4F5C\u4E0D\u80FD\u56DE\u590D\uFF0C\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684\u6587\u4EF6\u6216\u6587\u4EF6\u5939\u5417\uFF1F"),
366
+ React.createElement(DirectorySelect, { open: isOpenMoveModal, onCancel: () => {
367
+ refreshData();
368
+ setIsOpenMoveModal(false);
369
+ }, request: request?.directory, onOk: (value) => onConfirmMove(value) }),
370
+ contextHolder)];
371
+ }
372
+ }
@@ -0,0 +1,16 @@
1
+ import React, { FC } from 'react';
2
+ import { TabPaneProps } from 'antd';
3
+ export interface Tab extends Omit<TabPaneProps, 'tab'> {
4
+ key: string;
5
+ label: React.ReactNode;
6
+ }
7
+ export declare type MyPageContainerProps = {
8
+ title?: string | undefined;
9
+ children?: React.ReactNode | undefined;
10
+ tabList?: Tab[];
11
+ onTabChange?: (e: string) => void;
12
+ onRefresh?: () => void;
13
+ banner?: React.ReactNode;
14
+ };
15
+ export declare const Component: FC<MyPageContainerProps>;
16
+ export default Component;