beer-assembly-biz 1.1.2-alpha.9 → 1.1.3-alpha.10
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/UserModals.d.ts +7 -3
- package/UserModals.js +6 -0
- package/auth/AuthPassword.d.ts +2 -3
- package/auth/AuthPassword.js +5 -5
- package/auth/AuthStyle01.d.ts +3 -4
- package/auth/AuthStyle01.js +4 -5
- package/auth/AuthStyle02.d.ts +3 -4
- package/auth/AuthStyle02.js +4 -5
- package/auth/AuthThirdPartyAuth.d.ts +2 -3
- package/auth/AuthThirdPartyAuth.js +1 -2
- package/content/ParentContext.d.ts +4 -2
- package/content/ParentContext.js +4 -2
- package/content/PermissionContext.d.ts +4 -2
- package/content/PermissionContext.js +4 -2
- package/icon/icon/directory.svg +12 -0
- package/icon/icon/empty.svg +43 -0
- package/icon/icon/media.png +0 -0
- package/icon/icon/volc.svg +96 -0
- 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/index.d.ts +18 -0
- package/index.js +18 -0
- package/{AppLayout.d.ts → layout/AppLayout.d.ts} +4 -2
- package/{AppLayout.js → layout/AppLayout.js} +7 -5
- package/{BackPageContainer.d.ts → layout/BackPageContainer.d.ts} +5 -2
- package/{BackPageContainer.js → layout/BackPageContainer.js} +8 -3
- package/{MyPageContainer.d.ts → layout/MyPageContainer.d.ts} +4 -2
- package/{MyPageContainer.js → layout/MyPageContainer.js} +5 -3
- package/{SubMenusContainer.d.ts → layout/SubMenusContainer.d.ts} +5 -5
- package/{SubMenusContainer.js → layout/SubMenusContainer.js} +2 -3
- 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 -0
- package/net-disk/DirectoryMenusPanel.d.ts +0 -0
- package/net-disk/DirectoryMenusPanel.js +337 -0
- package/net-disk/DirectorySelect.d.ts +0 -0
- package/net-disk/DirectorySelect.js +240 -0
- package/net-disk/FileItemList.d.ts +0 -0
- package/net-disk/FileItemList.js +126 -0
- package/net-disk/FileItemTable.d.ts +0 -0
- package/net-disk/FileItemTable.js +422 -0
- package/net-disk/FileNavigation.d.ts +0 -0
- package/net-disk/FileNavigation.js +43 -0
- package/net-disk/NetDisk.d.ts +0 -0
- package/net-disk/NetDisk.js +36 -0
- package/net-disk/NetDiskModals.d.ts +0 -0
- package/net-disk/NetDiskModals.js +40 -0
- package/package.json +30 -19
- package/{Permission.d.ts → permission/Permission.d.ts} +4 -2
- package/{Permission.js → permission/Permission.js} +5 -3
- package/promises.d.ts +48 -0
- package/promises.js +141 -0
- package/rich/AIEditor.css +1647 -0
- package/rich/AIEditor.d.ts +51 -0
- package/rich/AIEditor.js +90 -0
- package/slider/SliderCode.d.ts +23 -0
- package/slider/SliderCode.js +203 -0
- package/type.d.ts +3 -0
- package/type.js +1 -0
- package/InlineContainer.d.ts +0 -6
- package/InlineContainer.js +0 -28
- package/MediaModals.d.ts +0 -32
- package/MediaModals.js +0 -373
- package/NetDiskModals.d.ts +0 -15
- package/NetDiskModals.js +0 -28
- package/Upgrade.d.ts +0 -7
- package/Upgrade.js +0 -46
- package/fonts/harmony/HarmonyOS_Medium.a.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.a0.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.a1.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aa.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ab.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ac.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ad.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ae.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.af.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ag.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ah.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ai.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aj.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ak.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.al.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.am.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.an.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ao.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ap.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aq.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ar.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.as.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.at.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.au.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.av.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aw.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ax.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ay.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.az.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.b.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.c.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.d.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.e.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.f.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.g.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.h.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.i.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.j.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.k.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.l.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.m.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.n.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.o.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.p.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.q.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.r.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.s.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.t.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.u.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.v.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.w.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.x.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.y.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.z.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a0.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a1.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aa.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ab.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ac.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ad.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ae.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.af.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ag.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ah.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ai.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aj.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ak.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.al.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.am.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.an.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ao.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ap.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aq.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ar.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.as.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.at.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.au.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.av.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aw.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ax.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ay.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.az.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.b.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.c.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.d.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.e.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.f.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.g.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.h.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.i.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.j.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.k.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.l.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.m.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.n.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.o.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.p.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.q.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.r.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.s.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.t.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.u.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.v.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.w.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.x.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.y.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.z.woff2 +0 -0
- package/fonts/harmony/medium.css +0 -485
- package/fonts/harmony/regular.css +0 -485
package/MediaModals.js
DELETED
|
@@ -1,373 +0,0 @@
|
|
|
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, theme, 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 { token } = theme.useToken();
|
|
15
|
-
const [isOpenModal, setIsOpenModal] = useState(false);
|
|
16
|
-
const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);
|
|
17
|
-
const [isOpenRenameModal, setIsOpenRenameModal] = useState(false);
|
|
18
|
-
const [isOpenConfirmModal, setIsOpenConfirmModal] = useState(false);
|
|
19
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
20
|
-
const [path, setPath] = useState([]);
|
|
21
|
-
const [dataList, setDataList] = useState([]);
|
|
22
|
-
const [selectId, setSelectId] = useState('');
|
|
23
|
-
const [selectName, setSelectName] = useState('');
|
|
24
|
-
const callbackRef = useRef(undefined);
|
|
25
|
-
const refreshData = (force) => {
|
|
26
|
-
const item = path[path.length - 1];
|
|
27
|
-
const chunkArray = (array, size) => {
|
|
28
|
-
const result = [];
|
|
29
|
-
for (let i = 0; i < array.length; i += size) {
|
|
30
|
-
result.push(array.slice(i, i + size));
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
setIsLoading(true);
|
|
35
|
-
if (force === true) {
|
|
36
|
-
setDataList([]);
|
|
37
|
-
}
|
|
38
|
-
request?.requestList?.(item.id)
|
|
39
|
-
.then(result => {
|
|
40
|
-
setIsLoading(false);
|
|
41
|
-
setDataList(chunkArray(result || [], 5));
|
|
42
|
-
})
|
|
43
|
-
.catch(() => {
|
|
44
|
-
setIsLoading(false);
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
const onActiveItem = (id) => {
|
|
48
|
-
setDataList(dataList?.map(item => {
|
|
49
|
-
return item.map(it => {
|
|
50
|
-
return {
|
|
51
|
-
...it,
|
|
52
|
-
active: it.id === id
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
const onDownload = async (name, url) => {
|
|
58
|
-
if ((url || '').trim() === '') {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
ElementUtils.download(url || '', name);
|
|
62
|
-
};
|
|
63
|
-
const onPutFile = async () => {
|
|
64
|
-
const files = await ElementUtils.selectFile();
|
|
65
|
-
if (files === null) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
for (let i = 0; i < files.length; i += 1) {
|
|
69
|
-
const file = files[i];
|
|
70
|
-
if (file.size > (1048576 * 15)) {
|
|
71
|
-
messageApi.error(`文件 ${file.name} 太大,不能超过 15MB`);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (!['image/jpeg', 'image/png', 'image/gif', 'image/webp'].includes(file.type)) {
|
|
75
|
-
messageApi.error(`文件 ${file.name} 不是有效的图片格式`);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const parentId = path[path.length - 1]?.id;
|
|
80
|
-
setIsLoading(true);
|
|
81
|
-
const result = await request?.putFile(parentId, files);
|
|
82
|
-
setIsLoading(false);
|
|
83
|
-
if (result === true) {
|
|
84
|
-
refreshData();
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const onCreateDirectory = async (name) => {
|
|
88
|
-
const parentId = path[path.length - 1]?.id;
|
|
89
|
-
setIsLoading(true);
|
|
90
|
-
const result = await request?.createDirectory(parentId, name);
|
|
91
|
-
setIsLoading(false);
|
|
92
|
-
if (result === true) {
|
|
93
|
-
refreshData();
|
|
94
|
-
}
|
|
95
|
-
setSelectName('');
|
|
96
|
-
return true;
|
|
97
|
-
};
|
|
98
|
-
const onOpenDirectory = async (id, name) => {
|
|
99
|
-
if (isLoading) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const paths = [...getPaths(), {
|
|
103
|
-
id,
|
|
104
|
-
name
|
|
105
|
-
}];
|
|
106
|
-
setPaths(paths);
|
|
107
|
-
};
|
|
108
|
-
const onBackDirectory = async (id) => {
|
|
109
|
-
if (isLoading) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const paths = getPaths();
|
|
113
|
-
const index = paths.findIndex(it => it.id === id);
|
|
114
|
-
if (index < 0) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
paths.splice(index + 1);
|
|
118
|
-
setPaths(paths);
|
|
119
|
-
};
|
|
120
|
-
const onSelectItem = async (id, name, url) => {
|
|
121
|
-
const current = callbackRef?.current;
|
|
122
|
-
if (current === undefined) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
current?.([url || '']);
|
|
126
|
-
setIsOpenModal(false);
|
|
127
|
-
};
|
|
128
|
-
const onRename = async (id, name) => {
|
|
129
|
-
setIsOpenRenameModal(true);
|
|
130
|
-
setSelectId(id);
|
|
131
|
-
setSelectName(name);
|
|
132
|
-
};
|
|
133
|
-
const onConfirmRename = async () => {
|
|
134
|
-
if (await request?.rename(selectId, selectName)) {
|
|
135
|
-
refreshData();
|
|
136
|
-
setSelectName('');
|
|
137
|
-
setIsOpenRenameModal(false);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
const onCopy = async (id) => {
|
|
141
|
-
const result = await request?.copy(id);
|
|
142
|
-
if (result === true) {
|
|
143
|
-
refreshData();
|
|
144
|
-
}
|
|
145
|
-
return result;
|
|
146
|
-
};
|
|
147
|
-
const onMove = async (id) => {
|
|
148
|
-
setIsOpenMoveModal(true);
|
|
149
|
-
setSelectId(id);
|
|
150
|
-
};
|
|
151
|
-
const onConfirmMove = async (targetId) => {
|
|
152
|
-
const result = await request?.move(selectId, targetId);
|
|
153
|
-
if (result === true) {
|
|
154
|
-
setIsOpenMoveModal(false);
|
|
155
|
-
refreshData();
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
const onRemove = async (id) => {
|
|
159
|
-
setIsOpenConfirmModal(true);
|
|
160
|
-
setSelectId(id);
|
|
161
|
-
};
|
|
162
|
-
const onConfirmRemove = async () => {
|
|
163
|
-
const result = await request?.remove(selectId);
|
|
164
|
-
if (result === true) {
|
|
165
|
-
setIsOpenConfirmModal(false);
|
|
166
|
-
refreshData();
|
|
167
|
-
}
|
|
168
|
-
return result;
|
|
169
|
-
};
|
|
170
|
-
const setPaths = (items) => {
|
|
171
|
-
setPath(items);
|
|
172
|
-
sessionStorage.setItem('MEDIA_MODALS_PATHS', JSON.stringify(items));
|
|
173
|
-
};
|
|
174
|
-
const getPaths = () => {
|
|
175
|
-
const paths = JSON.parse(sessionStorage.getItem('MEDIA_MODALS_PATHS') || '[]');
|
|
176
|
-
if (paths.length <= 0) {
|
|
177
|
-
paths.push({
|
|
178
|
-
id: '0',
|
|
179
|
-
name: '根目录'
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
return paths;
|
|
183
|
-
};
|
|
184
|
-
const Item = (props) => {
|
|
185
|
-
const directoryMenusItem = props.type === 'DIRECTORY' ? [
|
|
186
|
-
{
|
|
187
|
-
label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onOpenDirectory(props.id, props.name) },
|
|
188
|
-
React.createElement(RightCircleOutlined, null),
|
|
189
|
-
"\u6253\u5F00\u76EE\u5F55"),
|
|
190
|
-
key: '0'
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
type: 'divider'
|
|
194
|
-
}
|
|
195
|
-
] : [
|
|
196
|
-
{
|
|
197
|
-
label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onDownload(props.name, props.src) },
|
|
198
|
-
React.createElement(CloudDownloadOutlined, null),
|
|
199
|
-
"\u4E0B\u8F7D\u6587\u4EF6"),
|
|
200
|
-
key: '0'
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
type: 'divider'
|
|
204
|
-
}
|
|
205
|
-
];
|
|
206
|
-
const menusItems = [
|
|
207
|
-
...directoryMenusItem,
|
|
208
|
-
{
|
|
209
|
-
label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onRename(props.id, props.name) },
|
|
210
|
-
React.createElement(HighlightOutlined, null),
|
|
211
|
-
"\u91CD\u547D\u540D"),
|
|
212
|
-
key: '1'
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onCopy(props.id) },
|
|
216
|
-
React.createElement(CopyOutlined, null),
|
|
217
|
-
props?.type === 'DIRECTORY' ? '复制目录' : '复制文件'),
|
|
218
|
-
key: '2'
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onMove(props.id) },
|
|
222
|
-
React.createElement(ScissorOutlined, null),
|
|
223
|
-
props?.type === 'DIRECTORY' ? '移动目录' : '移动文件'),
|
|
224
|
-
key: '3'
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
type: 'divider'
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
label: React.createElement(Space, { style: { width: 100 }, size: 5, onClick: () => onRemove(props.id) },
|
|
231
|
-
React.createElement(DeleteOutlined, null),
|
|
232
|
-
props?.type === 'DIRECTORY' ? '删除目录' : '删除文件'),
|
|
233
|
-
key: '4',
|
|
234
|
-
danger: true
|
|
235
|
-
}
|
|
236
|
-
];
|
|
237
|
-
return React.createElement(Dropdown, { menu: {
|
|
238
|
-
items: menusItems
|
|
239
|
-
}, trigger: ['contextMenu'] },
|
|
240
|
-
React.createElement("div", { style: {
|
|
241
|
-
padding: '8px 12px',
|
|
242
|
-
backgroundColor: props?.active ? '#e6f1ff' : undefined,
|
|
243
|
-
display: 'block',
|
|
244
|
-
cursor: 'pointer',
|
|
245
|
-
userSelect: 'none',
|
|
246
|
-
position: 'relative',
|
|
247
|
-
...props.style
|
|
248
|
-
}, className: css `
|
|
249
|
-
border: ${props?.active ? '1px solid #cddef5' : '1px solid #fff'};
|
|
250
|
-
|
|
251
|
-
&:hover {
|
|
252
|
-
background-color: #eef1f5;
|
|
253
|
-
border: 1px solid ${props.active ? '#cddef5' : '#e6e6e6'};
|
|
254
|
-
}
|
|
255
|
-
`, onClick: () => {
|
|
256
|
-
setTimeout(() => onActiveItem(props.id), 10);
|
|
257
|
-
}, onDoubleClick: () => {
|
|
258
|
-
if (props.type === 'DIRECTORY') {
|
|
259
|
-
onOpenDirectory(props.id, props.name)
|
|
260
|
-
.then();
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
onSelectItem(props.id, props.name, props.src)
|
|
264
|
-
.then();
|
|
265
|
-
} },
|
|
266
|
-
React.createElement("img", { src: props?.type === 'DIRECTORY' ? IconDirectory : props?.src, alt: "", style: {
|
|
267
|
-
width: 56,
|
|
268
|
-
height: 56,
|
|
269
|
-
margin: 'auto',
|
|
270
|
-
display: 'block',
|
|
271
|
-
overflow: 'hidden',
|
|
272
|
-
objectFit: props?.type === 'DIRECTORY' ? undefined : 'cover'
|
|
273
|
-
} }),
|
|
274
|
-
React.createElement(Typography.Text, { style: {
|
|
275
|
-
width: 70,
|
|
276
|
-
fontSize: 11,
|
|
277
|
-
display: 'block',
|
|
278
|
-
textAlign: 'center',
|
|
279
|
-
color: '#323232',
|
|
280
|
-
marginTop: props?.type === 'DIRECTORY' ? undefined : 1
|
|
281
|
-
}, ellipsis: true }, props?.name)));
|
|
282
|
-
};
|
|
283
|
-
const handler = {
|
|
284
|
-
ok: (callback) => {
|
|
285
|
-
setPath(getPaths());
|
|
286
|
-
setIsOpenModal(true);
|
|
287
|
-
if (callbackRef !== undefined) {
|
|
288
|
-
callbackRef.current = callback;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
useEffect(() => {
|
|
293
|
-
if ((path || []).length <= 0) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
refreshData(true);
|
|
297
|
-
}, [path]);
|
|
298
|
-
return [handler, React.createElement(React.Fragment, null,
|
|
299
|
-
React.createElement(InlineContainer, null,
|
|
300
|
-
React.createElement(Modal, { width: 565, footer: null, styles: {
|
|
301
|
-
content: { padding: 0 }
|
|
302
|
-
}, open: isOpenModal, maskClosable: false, onCancel: () => {
|
|
303
|
-
if (isLoading) {
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
setIsOpenModal(false);
|
|
307
|
-
}, title: React.createElement("div", { style: {
|
|
308
|
-
padding: '16px 0 0 0'
|
|
309
|
-
} },
|
|
310
|
-
React.createElement("img", { style: {
|
|
311
|
-
marginInlineStart: 20,
|
|
312
|
-
display: 'block',
|
|
313
|
-
height: '17px',
|
|
314
|
-
padding: '2px 0 0 0'
|
|
315
|
-
}, alt: "", src: IconMedia })) },
|
|
316
|
-
React.createElement(Flux, { style: {
|
|
317
|
-
marginBottom: 6,
|
|
318
|
-
padding: '0 20px 10px 20px',
|
|
319
|
-
borderBottom: '1px solid #f3f3f3',
|
|
320
|
-
justifyContent: 'space-between'
|
|
321
|
-
} },
|
|
322
|
-
React.createElement(Breadcrumb, { items: path?.map((it, index) => {
|
|
323
|
-
return {
|
|
324
|
-
title: (index + 1 === path.length
|
|
325
|
-
? React.createElement(Typography.Text, { style: {
|
|
326
|
-
maxWidth: 70,
|
|
327
|
-
fontSize: 12
|
|
328
|
-
}, ellipsis: true }, it.name)
|
|
329
|
-
: React.createElement("a", { onClick: () => onBackDirectory(it.id) },
|
|
330
|
-
React.createElement(Typography.Text, { style: {
|
|
331
|
-
maxWidth: 70,
|
|
332
|
-
fontSize: 12,
|
|
333
|
-
color: 'rgba(0, 0, 0, 0.45)'
|
|
334
|
-
}, ellipsis: true }, it.name)))
|
|
335
|
-
};
|
|
336
|
-
}) }),
|
|
337
|
-
React.createElement(Space, null,
|
|
338
|
-
React.createElement(Button, { type: "primary", onClick: () => onPutFile(), size: "small", style: {
|
|
339
|
-
height: 24,
|
|
340
|
-
fontSize: token.fontSize - 1
|
|
341
|
-
}, loading: isLoading }, "\u4E0A\u4F20\u6587\u4EF6"),
|
|
342
|
-
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" },
|
|
343
|
-
React.createElement(Button, { size: "small", style: {
|
|
344
|
-
height: 24,
|
|
345
|
-
fontSize: 12
|
|
346
|
-
}, loading: isLoading }, "\u65B0\u5EFA\u76EE\u5F55")))),
|
|
347
|
-
React.createElement(Spin, { spinning: isLoading },
|
|
348
|
-
React.createElement("div", { style: {
|
|
349
|
-
padding: '6px 0 24px 0',
|
|
350
|
-
height: 333,
|
|
351
|
-
maxHeight: 333,
|
|
352
|
-
overflowY: 'auto',
|
|
353
|
-
overflowX: 'hidden'
|
|
354
|
-
} }, dataList?.map((group, index) => (React.createElement("div", { key: index, style: {
|
|
355
|
-
padding: '0 20px 10px 20px',
|
|
356
|
-
display: 'flex'
|
|
357
|
-
} }, 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 })))))))))),
|
|
358
|
-
React.createElement(Modal, { title: "\u91CD\u547D\u540D", width: 340, open: isOpenRenameModal, onOk: () => onConfirmRename(), onCancel: () => setIsOpenRenameModal(false), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" },
|
|
359
|
-
React.createElement(Input, { value: selectName, onChange: (e) => setSelectName(e.currentTarget.value) })),
|
|
360
|
-
React.createElement(Modal, { title: React.createElement(React.Fragment, null,
|
|
361
|
-
React.createElement(ExclamationCircleFilled, { style: {
|
|
362
|
-
marginRight: 6,
|
|
363
|
-
fontSize: 16,
|
|
364
|
-
color: '#faad14'
|
|
365
|
-
} }),
|
|
366
|
-
"\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"),
|
|
367
|
-
React.createElement(DirectorySelect, { open: isOpenMoveModal, onCancel: () => {
|
|
368
|
-
refreshData();
|
|
369
|
-
setIsOpenMoveModal(false);
|
|
370
|
-
}, request: request?.directory, onOk: (value) => onConfirmMove(value) }),
|
|
371
|
-
contextHolder)];
|
|
372
|
-
}
|
|
373
|
-
}
|
package/NetDiskModals.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { FileItemTableProps } from 'beer-assembly/FileItemTable';
|
|
3
|
-
import { DirectorySelectProps } from 'beer-assembly/DirectorySelect';
|
|
4
|
-
export type Handler<T> = {
|
|
5
|
-
ok: (callback: (params: T) => Promise<boolean>, args?: {}, initialValues?: {}) => void;
|
|
6
|
-
};
|
|
7
|
-
type FileItemTableRequest = NonNullable<FileItemTableProps['request']>;
|
|
8
|
-
type DirectoryRequest = NonNullable<DirectorySelectProps['request']>;
|
|
9
|
-
export type NetDiskRequest = FileItemTableRequest & {
|
|
10
|
-
directory: DirectoryRequest;
|
|
11
|
-
};
|
|
12
|
-
export declare class NetDiskModals {
|
|
13
|
-
static useNetDisk(netDiskRequest: NetDiskRequest, fileFormat?: string[], errorMessage?: ReactNode): [Handler<boolean>, ReactNode];
|
|
14
|
-
}
|
|
15
|
-
export {};
|
package/NetDiskModals.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import NetDisk from 'beer-assembly/NetDisk';
|
|
3
|
-
export class NetDiskModals {
|
|
4
|
-
static useNetDisk(netDiskRequest, fileFormat, errorMessage) {
|
|
5
|
-
const [isOpenModal, setIsOpenModal] = useState(false);
|
|
6
|
-
const handler = {
|
|
7
|
-
ok: (_callback) => {
|
|
8
|
-
setIsOpenModal(true);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
return [handler, React.createElement(React.Fragment, null,
|
|
12
|
-
React.createElement(NetDisk, { open: isOpenModal, onCancel: () => setIsOpenModal(false), tableProps: {
|
|
13
|
-
request: {
|
|
14
|
-
...netDiskRequest
|
|
15
|
-
},
|
|
16
|
-
directoryProps: {
|
|
17
|
-
request: {
|
|
18
|
-
...netDiskRequest.directory
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
uploadFormat: fileFormat || ['xls', 'xlsx', 'doc', 'docx', 'pdf'],
|
|
22
|
-
uploadSize: 20,
|
|
23
|
-
uploadFormatMessage: errorMessage || React.createElement(React.Fragment, null,
|
|
24
|
-
"\u62B1\u6B49\uFF0C\u6587\u4EF6\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u4E0A\u4F20",
|
|
25
|
-
React.createElement("span", { style: { fontWeight: 500 } }, "\u6587\u6863\u6587\u4EF6"))
|
|
26
|
-
} }))];
|
|
27
|
-
}
|
|
28
|
-
}
|
package/Upgrade.d.ts
DELETED
package/Upgrade.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { Modal } from 'antd';
|
|
3
|
-
const TIME_KEY = 'VERSION_TIME';
|
|
4
|
-
const App = (props) => {
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
// 每5分钟执行一次
|
|
7
|
-
setTimeout(async () => {
|
|
8
|
-
// 读取缓存的上次弹出更新时间
|
|
9
|
-
const lastTime = Number(localStorage.getItem(TIME_KEY) || 0);
|
|
10
|
-
if (Number.isNaN(lastTime)) {
|
|
11
|
-
localStorage.removeItem(TIME_KEY);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
// 30分钟执行一次
|
|
15
|
-
if (new Date().getTime() <= lastTime + 1800000) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
// 更新刷新时间
|
|
19
|
-
localStorage.setItem(TIME_KEY, new Date().getTime()
|
|
20
|
-
.toString());
|
|
21
|
-
const newVersion = await props.request?.();
|
|
22
|
-
if (newVersion === undefined || newVersion === '') {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (newVersion === props.localVersion) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// 弹出提示框
|
|
29
|
-
Modal.confirm({
|
|
30
|
-
title: '版本更新提示',
|
|
31
|
-
content: React.createElement(React.Fragment, null,
|
|
32
|
-
React.createElement("p", { style: {
|
|
33
|
-
fontSize: '15px',
|
|
34
|
-
lineHeight: '26px'
|
|
35
|
-
} }, "\u60A8\u5DF2\u7ECF\u957F\u65F6\u95F4\u672A\u4F7F\u7528\u6B64\u9875\u9762\uFF0C\u5728\u6B64\u671F\u95F4\u5E73\u53F0\u6709\u8FC7\u66F4\u65B0\uFF0C\u5982\u60A8\u6B64\u65F6\u5728\u9875\u9762\u4E2D\u6CA1\u6709\u586B\u5199\u76F8\u5173\u4FE1\u606F\u7B49\u64CD\u4F5C\uFF0C\u8BF7\u70B9\u51FB\u5237\u65B0\u9875\u9762\u4F7F\u7528\u6700\u65B0\u7248\u672C\uFF01")),
|
|
36
|
-
okText: '确定',
|
|
37
|
-
cancelText: '取消',
|
|
38
|
-
onOk: () => {
|
|
39
|
-
window.location.reload();
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}, 5000);
|
|
43
|
-
}, []);
|
|
44
|
-
return React.createElement(React.Fragment, null);
|
|
45
|
-
};
|
|
46
|
-
export default App;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|