feat: 添加我的分享页面
This commit is contained in:
BIN
src/assets/images/myshare.png
Normal file
BIN
src/assets/images/myshare.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
@@ -1,24 +0,0 @@
|
|||||||
/** @format */
|
|
||||||
|
|
||||||
import { Tree, TreeDataNode } from "antd";
|
|
||||||
import React from "react";
|
|
||||||
const { DirectoryTree } = Tree;
|
|
||||||
interface FileDirectoryTreeProps {
|
|
||||||
treeData: TreeDataNode[];
|
|
||||||
}
|
|
||||||
|
|
||||||
const FileDirectoryTree: React.FC<FileDirectoryTreeProps> = (props: any) => {
|
|
||||||
return (
|
|
||||||
<DirectoryTree
|
|
||||||
style={{ width: "20%", fontSize: "20px" }}
|
|
||||||
multiple={false}
|
|
||||||
defaultExpandAll
|
|
||||||
treeData={props.treeData}
|
|
||||||
blockNode={true}
|
|
||||||
showIcon={true}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default FileDirectoryTree;
|
|
@@ -1,393 +1,393 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { FunctionComponent, useEffect, useState } from "react";
|
import { FunctionComponent, useEffect, useState } from "react";
|
||||||
import { CheckCard, ProCard } from "@ant-design/pro-components";
|
import { CheckCard, ProCard } from "@ant-design/pro-components";
|
||||||
import styles from "./index.module.less";
|
import styles from "./index.module.less";
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
Divider,
|
Divider,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
FloatButton,
|
FloatButton,
|
||||||
message,
|
message,
|
||||||
Select,
|
Select,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import ali from "@/assets/icons/aliyun.svg";
|
import ali from "@/assets/icons/aliyun.svg";
|
||||||
import bucket from "@/assets/icons/bucket.svg";
|
import bucket from "@/assets/icons/bucket.svg";
|
||||||
import tencent from "@/assets/icons/tencent.svg";
|
import tencent from "@/assets/icons/tencent.svg";
|
||||||
import {
|
import {
|
||||||
CommentOutlined,
|
CommentOutlined,
|
||||||
CustomerServiceOutlined,
|
CustomerServiceOutlined,
|
||||||
EllipsisOutlined,
|
EllipsisOutlined,
|
||||||
LeftOutlined,
|
LeftOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import standard_dir from "@/assets/icons/standard_directory.svg";
|
import standard_dir from "@/assets/icons/standard_directory.svg";
|
||||||
import useStore from "@/utils/store/useStore.tsx";
|
import useStore from "@/utils/store/useStore.tsx";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import FileIcon from "@/context/file-icon.ts";
|
import FileIcon from "@/context/file-icon.ts";
|
||||||
import file_icon from "@/assets/icons/files/file.svg";
|
import file_icon from "@/assets/icons/files/file.svg";
|
||||||
const dataList: any = [
|
const dataList: any = [
|
||||||
{
|
{
|
||||||
name: "demo01.java",
|
name: "demo01.java",
|
||||||
isDir: false,
|
isDir: false,
|
||||||
path: "demo0.java",
|
path: "demo0.java",
|
||||||
length: "346",
|
length: "346",
|
||||||
createTime: "2024-06-26T08:22:13.244Z",
|
createTime: "2024-06-26T08:22:13.244Z",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "测试.pdf",
|
name: "测试.pdf",
|
||||||
isDir: false,
|
isDir: false,
|
||||||
path: "测试.pdf",
|
path: "测试.pdf",
|
||||||
length: "346",
|
length: "346",
|
||||||
createTime: "2024-06-26T08:22:13.244Z",
|
createTime: "2024-06-26T08:22:13.244Z",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "test.jpg",
|
name: "test.jpg",
|
||||||
isDir: false,
|
isDir: false,
|
||||||
path: "test.jpg",
|
path: "test.jpg",
|
||||||
length: "2057535",
|
length: "2057535",
|
||||||
createTime: "2024-06-27T02:27:05.472Z",
|
createTime: "2024-06-27T02:27:05.472Z",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "test1.png",
|
name: "test1.png",
|
||||||
isDir: false,
|
isDir: false,
|
||||||
path: "test1.png",
|
path: "test1.png",
|
||||||
length: "1766511",
|
length: "1766511",
|
||||||
createTime: "2024-06-29T10:28:03.224Z",
|
createTime: "2024-06-29T10:28:03.224Z",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "schisandra",
|
name: "schisandra",
|
||||||
isDir: true,
|
isDir: true,
|
||||||
path: "schisandra/",
|
path: "schisandra/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "测试文件夹",
|
name: "测试文件夹",
|
||||||
isDir: true,
|
isDir: true,
|
||||||
path: "测试文件夹/",
|
path: "测试文件夹/",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const fileList: any = [
|
const fileList: any = [
|
||||||
{
|
{
|
||||||
name: "test1.png",
|
name: "test1.png",
|
||||||
isDir: false,
|
isDir: false,
|
||||||
path: "test1.png",
|
path: "test1.png",
|
||||||
length: "1766511",
|
length: "1766511",
|
||||||
createTime: "2024-06-29T10:28:03.224Z",
|
createTime: "2024-06-29T10:28:03.224Z",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "schisandra",
|
name: "schisandra",
|
||||||
isDir: true,
|
isDir: true,
|
||||||
path: "schisandra/",
|
path: "schisandra/",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const File: FunctionComponent = () => {
|
const File: FunctionComponent = () => {
|
||||||
const store = useStore("file");
|
const store = useStore("file");
|
||||||
const [files, setFiles] = useState<any>([]);
|
const [files, setFiles] = useState<any>([]);
|
||||||
async function getFile() {
|
async function getFile() {
|
||||||
setFiles(dataList);
|
setFiles(dataList);
|
||||||
}
|
}
|
||||||
function getFileExtension(filename: any): string {
|
function getFileExtension(filename: any): string {
|
||||||
const dotIndex = filename.lastIndexOf(".");
|
const dotIndex = filename.lastIndexOf(".");
|
||||||
return dotIndex !== -1 ? filename.slice(dotIndex + 1) : "";
|
return dotIndex !== -1 ? filename.slice(dotIndex + 1) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getFile().then();
|
getFile().then();
|
||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.file_main}>
|
<div className={styles.file_main}>
|
||||||
<div className={styles.file_content_left}>
|
<div className={styles.file_content_left}>
|
||||||
<ProCard bordered boxShadow style={{ height: "75vh" }}>
|
<ProCard bordered boxShadow style={{ height: "75vh" }}>
|
||||||
<Select
|
<Select
|
||||||
size="large"
|
size="large"
|
||||||
status="warning"
|
status="warning"
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
showSearch={true}
|
showSearch={true}
|
||||||
allowClear={true}
|
allowClear={true}
|
||||||
notFoundContent={"未找到,请先配置存储商"}
|
notFoundContent={"未找到,请先配置存储商"}
|
||||||
placeholder={"请选择存储商"}>
|
placeholder={"请选择存储商"}>
|
||||||
<Select.Option value="ali">
|
<Select.Option value="ali">
|
||||||
<Card
|
<Card
|
||||||
bordered={false}
|
bordered={false}
|
||||||
style={{
|
style={{
|
||||||
height: 35,
|
height: 35,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
}}
|
}}
|
||||||
size={"small"}>
|
size={"small"}>
|
||||||
<Avatar src={ali} size={"small"} />{" "}
|
<Avatar src={ali} size={"small"} />{" "}
|
||||||
<span style={{ marginLeft: "10px", fontWeight: "bolder" }}>
|
<span style={{ marginLeft: "10px", fontWeight: "bolder" }}>
|
||||||
阿里云OSS
|
阿里云OSS
|
||||||
</span>
|
</span>
|
||||||
</Card>
|
</Card>
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
<Select.Option value="腾讯">
|
<Select.Option value="腾讯">
|
||||||
<Card
|
<Card
|
||||||
style={{
|
style={{
|
||||||
height: 35,
|
height: 35,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
}}
|
}}
|
||||||
bordered={false}
|
bordered={false}
|
||||||
size={"small"}>
|
size={"small"}>
|
||||||
<Avatar src={tencent} size={"small"} />{" "}
|
<Avatar src={tencent} size={"small"} />{" "}
|
||||||
<span style={{ marginLeft: "10px", fontWeight: "bolder" }}>
|
<span style={{ marginLeft: "10px", fontWeight: "bolder" }}>
|
||||||
腾讯云COS
|
腾讯云COS
|
||||||
</span>
|
</span>
|
||||||
</Card>
|
</Card>
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
<Divider></Divider>
|
<Divider></Divider>
|
||||||
<div>
|
<div>
|
||||||
<CheckCard.Group
|
<CheckCard.Group
|
||||||
defaultValue="A"
|
defaultValue="A"
|
||||||
size={"small"}
|
size={"small"}
|
||||||
style={{ width: "100%" }}>
|
style={{ width: "100%" }}>
|
||||||
<CheckCard
|
<CheckCard
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
title="schisandra"
|
title="schisandra"
|
||||||
avatar={bucket}
|
avatar={bucket}
|
||||||
description="100Mb"
|
description="100Mb"
|
||||||
value="schisandra"
|
value="schisandra"
|
||||||
extra={
|
extra={
|
||||||
<Dropdown
|
<Dropdown
|
||||||
placement="top"
|
placement="top"
|
||||||
menu={{
|
menu={{
|
||||||
onClick: ({ domEvent }) => {
|
onClick: ({ domEvent }) => {
|
||||||
domEvent.stopPropagation();
|
domEvent.stopPropagation();
|
||||||
message.info("menu click");
|
message.info("menu click");
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: "删除",
|
label: "删除",
|
||||||
key: "1",
|
key: "1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "编辑",
|
label: "编辑",
|
||||||
key: "2",
|
key: "2",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}}>
|
}}>
|
||||||
<EllipsisOutlined
|
<EllipsisOutlined
|
||||||
style={{ fontSize: 22, color: "rgba(0,0,0,0.5)" }}
|
style={{ fontSize: 22, color: "rgba(0,0,0,0.5)" }}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
/>
|
/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<CheckCard
|
<CheckCard
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
title="schisandra2"
|
title="schisandra2"
|
||||||
avatar={bucket}
|
avatar={bucket}
|
||||||
description="100Mb"
|
description="100Mb"
|
||||||
value="schisandra2"
|
value="schisandra2"
|
||||||
extra={
|
extra={
|
||||||
<Dropdown
|
<Dropdown
|
||||||
placement="top"
|
placement="top"
|
||||||
menu={{
|
menu={{
|
||||||
onClick: ({ domEvent }) => {
|
onClick: ({ domEvent }) => {
|
||||||
domEvent.stopPropagation();
|
domEvent.stopPropagation();
|
||||||
message.info("menu click");
|
message.info("menu click");
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: "删除",
|
label: "删除",
|
||||||
key: "1",
|
key: "1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "编辑",
|
label: "编辑",
|
||||||
key: "2",
|
key: "2",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}}>
|
}}>
|
||||||
<EllipsisOutlined
|
<EllipsisOutlined
|
||||||
style={{ fontSize: 22, color: "rgba(0,0,0,0.5)" }}
|
style={{ fontSize: 22, color: "rgba(0,0,0,0.5)" }}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
/>
|
/>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</CheckCard.Group>
|
</CheckCard.Group>
|
||||||
</div>
|
</div>
|
||||||
</ProCard>
|
</ProCard>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.file_content_right}>
|
<div className={styles.file_content_right}>
|
||||||
<ProCard bordered boxShadow style={{ height: "75vh" }}>
|
<ProCard bordered boxShadow style={{ height: "75vh" }}>
|
||||||
<div className={styles.file_right_header}>
|
<div className={styles.file_right_header}>
|
||||||
<Button
|
<Button
|
||||||
shape="circle"
|
shape="circle"
|
||||||
icon={<LeftOutlined />}
|
icon={<LeftOutlined />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setFiles(dataList);
|
setFiles(dataList);
|
||||||
store.clearFilePath();
|
store.clearFilePath();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Breadcrumb items={store.getFilePath()} style={{ marginLeft: 15 }} />
|
<Breadcrumb items={store.getFilePath()} style={{ marginLeft: 15 }} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.file_right_content}>
|
<div className={styles.file_right_content}>
|
||||||
<CheckCard.Group
|
<CheckCard.Group
|
||||||
multiple={true}
|
multiple={true}
|
||||||
bordered={false}
|
bordered={false}
|
||||||
className={styles.file_right_content}>
|
className={styles.file_right_content}>
|
||||||
{files.map((file: any, index: any) => {
|
{files.map((file: any, index: any) => {
|
||||||
if (file.isDir) {
|
if (file.isDir) {
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
key={index}
|
key={index}
|
||||||
menu={{
|
menu={{
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: "删除",
|
label: "删除",
|
||||||
key: "1",
|
key: "1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "编辑",
|
label: "编辑",
|
||||||
key: "2",
|
key: "2",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
trigger={["contextMenu"]}>
|
trigger={["contextMenu"]}>
|
||||||
<div
|
<div
|
||||||
style={{ marginLeft: 10 }}
|
style={{ marginLeft: 10 }}
|
||||||
onDoubleClick={() => {
|
onDoubleClick={() => {
|
||||||
store.setFilePath({
|
store.setFilePath({
|
||||||
title: file.name,
|
title: file.name,
|
||||||
});
|
});
|
||||||
setFiles(fileList);
|
setFiles(fileList);
|
||||||
}}>
|
}}>
|
||||||
<CheckCard
|
<CheckCard
|
||||||
size={"small"}
|
size={"small"}
|
||||||
value={file.name}
|
value={file.name}
|
||||||
avatar={
|
avatar={
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}>
|
}}>
|
||||||
<Avatar
|
<Avatar
|
||||||
src={standard_dir}
|
src={standard_dir}
|
||||||
shape={"square"}
|
shape={"square"}
|
||||||
size={"large"}
|
size={"large"}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={file.name}
|
title={file.name}
|
||||||
placement={"bottom"}
|
placement={"bottom"}
|
||||||
color={"lime"}>
|
color={"lime"}>
|
||||||
<span
|
<span
|
||||||
className={
|
className={
|
||||||
styles.file_name
|
styles.file_name
|
||||||
}>
|
}>
|
||||||
{file.name}
|
{file.name}
|
||||||
</span>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
className={styles.file_card}
|
className={styles.file_card}
|
||||||
style={{
|
style={{
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
key={index}
|
key={index}
|
||||||
menu={{
|
menu={{
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: "删除",
|
label: "删除",
|
||||||
key: "1",
|
key: "1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "编辑",
|
label: "编辑",
|
||||||
key: "2",
|
key: "2",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
trigger={["contextMenu"]}>
|
trigger={["contextMenu"]}>
|
||||||
<div style={{ marginLeft: 10 }}>
|
<div style={{ marginLeft: 10 }}>
|
||||||
<CheckCard
|
<CheckCard
|
||||||
size={"small"}
|
size={"small"}
|
||||||
value={file.name}
|
value={file.name}
|
||||||
bodyStyle={{ overflow: "hidden" }}
|
bodyStyle={{ overflow: "hidden" }}
|
||||||
avatar={
|
avatar={
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
}}>
|
}}>
|
||||||
<Avatar
|
<Avatar
|
||||||
src={
|
src={
|
||||||
FileIcon[
|
FileIcon[
|
||||||
getFileExtension(
|
getFileExtension(
|
||||||
file.name,
|
file.name,
|
||||||
)
|
)
|
||||||
] || file_icon
|
] || file_icon
|
||||||
}
|
}
|
||||||
shape={"square"}
|
shape={"square"}
|
||||||
size={"large"}
|
size={"large"}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={file.name}
|
title={file.name}
|
||||||
color={"lime"}
|
color={"lime"}
|
||||||
autoAdjustOverflow={true}
|
autoAdjustOverflow={true}
|
||||||
placement={"bottom"}>
|
placement={"bottom"}>
|
||||||
<span
|
<span
|
||||||
className={
|
className={
|
||||||
styles.file_name
|
styles.file_name
|
||||||
}>
|
}>
|
||||||
{file.name}
|
{file.name}
|
||||||
</span>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
className={styles.file_card}
|
className={styles.file_card}
|
||||||
style={{
|
style={{
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</CheckCard.Group>
|
</CheckCard.Group>
|
||||||
</div>
|
</div>
|
||||||
</ProCard>
|
</ProCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FloatButton.Group
|
<FloatButton.Group
|
||||||
trigger="click"
|
trigger="click"
|
||||||
type="primary"
|
type="primary"
|
||||||
style={{ right: "5%" }}
|
style={{ right: "5%" }}
|
||||||
icon={<CustomerServiceOutlined />}>
|
icon={<CustomerServiceOutlined />}>
|
||||||
<FloatButton />
|
<FloatButton />
|
||||||
<FloatButton icon={<CommentOutlined />} />
|
<FloatButton icon={<CommentOutlined />} />
|
||||||
</FloatButton.Group>
|
</FloatButton.Group>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default observer(File);
|
export default observer(File);
|
||||||
|
0
src/components/Main/User/MyShare/index.module.less
Normal file
0
src/components/Main/User/MyShare/index.module.less
Normal file
132
src/components/Main/User/MyShare/index.tsx
Normal file
132
src/components/Main/User/MyShare/index.tsx
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import { ProCard } from "@ant-design/pro-components";
|
||||||
|
import { Avatar, Divider, Flex, List, Skeleton, Tag } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import styles from "./index.module.less";
|
||||||
|
import InfiniteScroll from "react-infinite-scroll-component";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { CommentOutlined, EyeOutlined, HeartOutlined } from "@ant-design/icons";
|
||||||
|
import logo from "@/assets/icons/aliyun.svg";
|
||||||
|
interface DataType {
|
||||||
|
gender: string;
|
||||||
|
name: {
|
||||||
|
title: string;
|
||||||
|
first: string;
|
||||||
|
last: string;
|
||||||
|
};
|
||||||
|
email: string;
|
||||||
|
picture: {
|
||||||
|
large: string;
|
||||||
|
medium: string;
|
||||||
|
thumbnail: string;
|
||||||
|
};
|
||||||
|
nat: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [data, setData] = useState<DataType[]>([]);
|
||||||
|
const loadMoreData = () => {
|
||||||
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setLoading(true);
|
||||||
|
fetch("https://randomuser.me/api/?results=10&inc=name,gender,email,nat,picture&noinfo")
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((body) => {
|
||||||
|
setData([...data, ...body.results]);
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadMoreData();
|
||||||
|
}, []);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className={styles.share_list_main}>
|
||||||
|
<ProCard bordered={true} boxShadow={true}>
|
||||||
|
<InfiniteScroll
|
||||||
|
dataLength={data.length}
|
||||||
|
next={loadMoreData}
|
||||||
|
hasMore={data.length < 50}
|
||||||
|
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
|
||||||
|
endMessage={<Divider plain>It is all, nothing more 🤐</Divider>}
|
||||||
|
scrollableTarget="scrollableDiv">
|
||||||
|
<List
|
||||||
|
dataSource={data}
|
||||||
|
renderItem={(item) => (
|
||||||
|
<List.Item key={item.email}>
|
||||||
|
<List.Item.Meta
|
||||||
|
avatar={<Avatar src={item.picture.large} />}
|
||||||
|
title={
|
||||||
|
<>
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/main/share/detail/1");
|
||||||
|
}}>
|
||||||
|
{item.name.last}
|
||||||
|
</a>
|
||||||
|
<Tag
|
||||||
|
bordered={false}
|
||||||
|
color="processing"
|
||||||
|
style={{ marginLeft: 10 }}>
|
||||||
|
IDM
|
||||||
|
</Tag>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
description={
|
||||||
|
<>
|
||||||
|
<Flex
|
||||||
|
vertical={false}
|
||||||
|
justify={"space-between"}
|
||||||
|
align={"center"}>
|
||||||
|
{item.email}
|
||||||
|
<Flex
|
||||||
|
vertical={false}
|
||||||
|
align={"center"}
|
||||||
|
justify={"space-between"}
|
||||||
|
style={{ width: "250px" }}>
|
||||||
|
<Avatar src={logo} size={"small"} />
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
fontSize: 12,
|
||||||
|
color: "gray",
|
||||||
|
}}>
|
||||||
|
landaiqing
|
||||||
|
</span>
|
||||||
|
<HeartOutlined />
|
||||||
|
<span
|
||||||
|
style={{ fontSize: 12, color: "gray" }}>
|
||||||
|
1024
|
||||||
|
</span>
|
||||||
|
<CommentOutlined />
|
||||||
|
<span
|
||||||
|
style={{ fontSize: 12, color: "gray" }}>
|
||||||
|
1024
|
||||||
|
</span>
|
||||||
|
<EyeOutlined style={{ color: "gray" }} />{" "}
|
||||||
|
<span
|
||||||
|
style={{ fontSize: 12, color: "gray" }}>
|
||||||
|
1024
|
||||||
|
</span>
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{/*<div>Content</div>*/}
|
||||||
|
</List.Item>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</InfiniteScroll>
|
||||||
|
</ProCard>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
11
src/router/modules/main/user/myShare/index.ts
Normal file
11
src/router/modules/main/user/myShare/index.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import { lazy } from "react";
|
||||||
|
|
||||||
|
const MyShare = lazy(
|
||||||
|
() =>
|
||||||
|
new Promise((resolve: any) => {
|
||||||
|
resolve(import("@/components/Main/User/MyShare/index.tsx"));
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
export default MyShare;
|
@@ -1,11 +1,11 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { lazy } from "react";
|
import { lazy } from "react";
|
||||||
|
|
||||||
const MainUserInfo = lazy(
|
const MainUserInfo = lazy(
|
||||||
() =>
|
() =>
|
||||||
new Promise((resolve: any) => {
|
new Promise((resolve: any) => {
|
||||||
resolve(import("@/components/Main/User/UserInfo"));
|
resolve(import("@/components/Main/User/UserInfo"));
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
export default MainUserInfo;
|
export default MainUserInfo;
|
@@ -1,11 +1,11 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { lazy } from "react";
|
import { lazy } from "react";
|
||||||
|
|
||||||
const MainUserSetting = lazy(
|
const MainUserSetting = lazy(
|
||||||
() =>
|
() =>
|
||||||
new Promise((resolve: any) => {
|
new Promise((resolve: any) => {
|
||||||
resolve(import("@/components/Main/User/UserSetting"));
|
resolve(import("@/components/Main/User/UserSetting"));
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
export default MainUserSetting;
|
export default MainUserSetting;
|
@@ -13,8 +13,8 @@ import Home from "@/router/modules/home";
|
|||||||
import MainHome from "@/router/modules/main/home";
|
import MainHome from "@/router/modules/main/home";
|
||||||
import MainBucket from "@/router/modules/main/bucket";
|
import MainBucket from "@/router/modules/main/bucket";
|
||||||
import MainFile from "@/router/modules/main/file";
|
import MainFile from "@/router/modules/main/file";
|
||||||
import MainUserInfo from "@/router/modules/main/userInfo";
|
import MainUserInfo from "@/router/modules/main/user/userInfo";
|
||||||
import MainUserSetting from "@/router/modules/main/userSetting";
|
import MainUserSetting from "@/router/modules/main/user/userSetting";
|
||||||
import MainShare from "@/router/modules/main/share";
|
import MainShare from "@/router/modules/main/share";
|
||||||
import MainSetting from "@/router/modules/main/settings";
|
import MainSetting from "@/router/modules/main/settings";
|
||||||
import Ali from "@/router/modules/main/settings/ali/ali.ts";
|
import Ali from "@/router/modules/main/settings/ali/ali.ts";
|
||||||
@@ -47,6 +47,7 @@ import ucloudBucket from "@/router/modules/main/bucket/createBuckets/ucloud.ts";
|
|||||||
import upBucket from "@/router/modules/main/bucket/createBuckets/up.ts";
|
import upBucket from "@/router/modules/main/bucket/createBuckets/up.ts";
|
||||||
import wangyiBucket from "@/router/modules/main/bucket/createBuckets/wangyi.ts";
|
import wangyiBucket from "@/router/modules/main/bucket/createBuckets/wangyi.ts";
|
||||||
import ShareAdd from "@/router/modules/main/share/modules/shareAdd.tsx";
|
import ShareAdd from "@/router/modules/main/share/modules/shareAdd.tsx";
|
||||||
|
import MyShare from "@/router/modules/main/user/myShare";
|
||||||
|
|
||||||
const routes: RouteObject[] = [
|
const routes: RouteObject[] = [
|
||||||
{
|
{
|
||||||
@@ -144,6 +145,10 @@ const routes: RouteObject[] = [
|
|||||||
path: "/main/file",
|
path: "/main/file",
|
||||||
Component: MainFile,
|
Component: MainFile,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/main/file/:bucket",
|
||||||
|
Component: MainFile,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/main/user/info",
|
path: "/main/user/info",
|
||||||
Component: MainUserInfo,
|
Component: MainUserInfo,
|
||||||
@@ -152,6 +157,10 @@ const routes: RouteObject[] = [
|
|||||||
path: "/main/user/setting",
|
path: "/main/user/setting",
|
||||||
Component: MainUserSetting,
|
Component: MainUserSetting,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/main/user/myshare",
|
||||||
|
Component: MyShare,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/main/share",
|
path: "/main/share",
|
||||||
Component: MainShare,
|
Component: MainShare,
|
||||||
|
@@ -1,179 +1,184 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
// import dashboard from "@/assets/images/dashboard.png";
|
// import dashboard from "@/assets/images/dashboard.png";
|
||||||
// import bucket from "@/assets/images/bucket.png";
|
// import bucket from "@/assets/images/bucket.png";
|
||||||
// import file_icon from "@/assets/images/file.png";
|
// import file_icon from "@/assets/images/file.png";
|
||||||
// import share_icon from "@/assets/images/share.png";
|
// import share_icon from "@/assets/images/share.png";
|
||||||
// import user from "@/assets/images/user.png";
|
// import user from "@/assets/images/user.png";
|
||||||
// import user_info_icon from "@/assets/images/userInfo.png";
|
// import user_info_icon from "@/assets/images/userInfo.png";
|
||||||
// import setting from "@/assets/images/setting.png";
|
// import setting from "@/assets/images/setting.png";
|
||||||
// import storage_setting from "@/assets/images/storage_setting.png";
|
// import storage_setting from "@/assets/images/storage_setting.png";
|
||||||
import aliyun from "@/assets/icons/aliyun.svg";
|
import aliyun from "@/assets/icons/aliyun.svg";
|
||||||
import tencent from "@/assets/icons/tencent.svg";
|
import tencent from "@/assets/icons/tencent.svg";
|
||||||
import huawei from "@/assets/icons/huawei.svg";
|
import huawei from "@/assets/icons/huawei.svg";
|
||||||
import baiduyun from "@/assets/icons/baiduyun.svg";
|
import baiduyun from "@/assets/icons/baiduyun.svg";
|
||||||
import minio from "@/assets/icons/minio.svg";
|
import minio from "@/assets/icons/minio.svg";
|
||||||
import jdyun from "@/assets/icons/jdyun.svg";
|
import jdyun from "@/assets/icons/jdyun.svg";
|
||||||
import aws from "@/assets/icons/aws.svg";
|
import aws from "@/assets/icons/aws.svg";
|
||||||
import wangyi from "@/assets/icons/wangyi.svg";
|
import wangyi from "@/assets/icons/wangyi.svg";
|
||||||
import qiniu from "@/assets/icons/qiniu.svg";
|
import qiniu from "@/assets/icons/qiniu.svg";
|
||||||
import upyun from "@/assets/icons/upyun.svg";
|
import upyun from "@/assets/icons/upyun.svg";
|
||||||
import pinanyun from "@/assets/icons/pinanyun.svg";
|
import pinanyun from "@/assets/icons/pinanyun.svg";
|
||||||
import qingyun from "@/assets/icons/qingyun.svg";
|
import qingyun from "@/assets/icons/qingyun.svg";
|
||||||
import ucloud from "@/assets/icons/ucloud.svg";
|
import ucloud from "@/assets/icons/ucloud.svg";
|
||||||
import jinshan from "@/assets/icons/jinshan.svg";
|
import jinshan from "@/assets/icons/jinshan.svg";
|
||||||
export default {
|
export default {
|
||||||
route: {
|
route: {
|
||||||
path: "/",
|
path: "/",
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
index: true,
|
index: true,
|
||||||
path: "main/home",
|
path: "main/home",
|
||||||
name: "仪表盘",
|
name: "仪表盘",
|
||||||
icon: "https://pic.imgdb.cn/item/668b9176d9c307b7e99e51b9.png",
|
icon: "https://pic.imgdb.cn/item/668b9176d9c307b7e99e51b9.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "main/setting",
|
path: "main/setting",
|
||||||
name: "存储商",
|
name: "存储商",
|
||||||
icon: "https://pic.imgdb.cn/item/668b918cd9c307b7e99e7fbc.png",
|
icon: "https://pic.imgdb.cn/item/668b918cd9c307b7e99e7fbc.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "main/bucket",
|
path: "main/bucket",
|
||||||
name: "存储桶",
|
name: "存储桶",
|
||||||
icon: "https://pic.imgdb.cn/item/668b91a5d9c307b7e99ea40d.png",
|
icon: "https://pic.imgdb.cn/item/668b91a5d9c307b7e99ea40d.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "main/file",
|
path: "main/file",
|
||||||
name: "文件",
|
name: "文件",
|
||||||
icon: "https://pic.imgdb.cn/item/668b91b7d9c307b7e99eb9fb.png",
|
icon: "https://pic.imgdb.cn/item/668b91b7d9c307b7e99eb9fb.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "main/share",
|
path: "main/share",
|
||||||
name: "分享圈",
|
name: "分享圈",
|
||||||
icon: "https://pic.imgdb.cn/item/668b91d1d9c307b7e99edb1c.png",
|
icon: "https://pic.imgdb.cn/item/668b91d1d9c307b7e99edb1c.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
name: "个人中心",
|
name: "个人中心",
|
||||||
icon: "https://pic.imgdb.cn/item/668b91e1d9c307b7e99eed3a.png",
|
icon: "https://pic.imgdb.cn/item/668b91e1d9c307b7e99eed3a.png",
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
index: true,
|
index: true,
|
||||||
path: "main/user/info",
|
path: "main/user/info",
|
||||||
name: "用户信息",
|
name: "用户信息",
|
||||||
icon: "https://pic.imgdb.cn/item/668b91fbd9c307b7e99f0f90.png",
|
icon: "https://pic.imgdb.cn/item/668b91fbd9c307b7e99f0f90.png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "main/user/setting",
|
path: "main/user/setting",
|
||||||
name: "用户设置",
|
name: "用户设置",
|
||||||
icon: "https://pic.imgdb.cn/item/668b921ad9c307b7e99f35b2.png",
|
icon: "https://pic.imgdb.cn/item/668b921ad9c307b7e99f35b2.png",
|
||||||
},
|
},
|
||||||
],
|
{
|
||||||
},
|
path: "main/user/myshare",
|
||||||
],
|
name: "我的分享",
|
||||||
},
|
icon: "https://pic.imgdb.cn/item/668f8e5fd9c307b7e9f079bf.png",
|
||||||
location: {
|
},
|
||||||
pathname: "/main/home",
|
],
|
||||||
},
|
},
|
||||||
appList: [
|
],
|
||||||
{
|
},
|
||||||
icon: aliyun,
|
location: {
|
||||||
title: "阿里云OSS",
|
pathname: "/main/home",
|
||||||
desc: "一款海量、安全、低成本、高可靠的云存储服务",
|
},
|
||||||
url: "https://www.aliyun.com/product/oss",
|
appList: [
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: aliyun,
|
||||||
{
|
title: "阿里云OSS",
|
||||||
icon: tencent,
|
desc: "一款海量、安全、低成本、高可靠的云存储服务",
|
||||||
title: "腾讯云COS",
|
url: "https://www.aliyun.com/product/oss",
|
||||||
desc: "由腾讯云推出的分布式存储服务。",
|
target: "_blank",
|
||||||
url: "https://cloud.tencent.com/product/cos",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: tencent,
|
||||||
{
|
title: "腾讯云COS",
|
||||||
icon: huawei,
|
desc: "由腾讯云推出的分布式存储服务。",
|
||||||
title: "华为云OBS",
|
url: "https://cloud.tencent.com/product/cos",
|
||||||
desc: "安全稳定、性能领先、无限弹性扩展的存储能力",
|
target: "_blank",
|
||||||
url: "https://www.huaweicloud.com/intl/zh-cn/product/obs.html",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: huawei,
|
||||||
{
|
title: "华为云OBS",
|
||||||
icon: baiduyun,
|
desc: "安全稳定、性能领先、无限弹性扩展的存储能力",
|
||||||
title: "百度云BOS",
|
url: "https://www.huaweicloud.com/intl/zh-cn/product/obs.html",
|
||||||
desc: "一款稳定、安全、高效、高可拓展的云存储服务",
|
target: "_blank",
|
||||||
url: "https://cloud.baidu.com/product/bos.html",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: baiduyun,
|
||||||
|
title: "百度云BOS",
|
||||||
{
|
desc: "一款稳定、安全、高效、高可拓展的云存储服务",
|
||||||
icon: minio,
|
url: "https://cloud.baidu.com/product/bos.html",
|
||||||
title: "MinIO",
|
target: "_blank",
|
||||||
desc: "MinIO 是一款高性能、兼容 S3 的对象存储。",
|
},
|
||||||
url: "https://min.io/",
|
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: minio,
|
||||||
{
|
title: "MinIO",
|
||||||
icon: jdyun,
|
desc: "MinIO 是一款高性能、兼容 S3 的对象存储。",
|
||||||
title: "京东云OSS",
|
url: "https://min.io/",
|
||||||
desc: "京东云自研的存储海量数据的分布式存储服务",
|
target: "_blank",
|
||||||
url: "https://www.jdcloud.com/cn/products/object-storage-service",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: jdyun,
|
||||||
{
|
title: "京东云OSS",
|
||||||
icon: aws,
|
desc: "京东云自研的存储海量数据的分布式存储服务",
|
||||||
title: "亚马逊S3 ",
|
url: "https://www.jdcloud.com/cn/products/object-storage-service",
|
||||||
desc: "专为任意位置检索任意数量数据的对象存储",
|
target: "_blank",
|
||||||
url: "https://aws.amazon.com/cn/s3/?nc2=h_ql_prod_st_s3",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: aws,
|
||||||
{
|
title: "亚马逊S3 ",
|
||||||
icon: wangyi,
|
desc: "专为任意位置检索任意数量数据的对象存储",
|
||||||
title: "网易数帆NOS",
|
url: "https://aws.amazon.com/cn/s3/?nc2=h_ql_prod_st_s3",
|
||||||
desc: "高可用、高可靠、高性能的云端存储服务",
|
target: "_blank",
|
||||||
url: "https://sf.163.com/product/nos",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: wangyi,
|
||||||
{
|
title: "网易数帆NOS",
|
||||||
icon: qiniu,
|
desc: "高可用、高可靠、高性能的云端存储服务",
|
||||||
title: "七牛云 Kodo",
|
url: "https://sf.163.com/product/nos",
|
||||||
desc: "非结构化数据存储管理平台,支持中心和边缘存储",
|
target: "_blank",
|
||||||
url: "https://www.qiniu.com/products/kodo",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: qiniu,
|
||||||
{
|
title: "七牛云 Kodo",
|
||||||
icon: upyun,
|
desc: "非结构化数据存储管理平台,支持中心和边缘存储",
|
||||||
title: "又拍云 USS",
|
url: "https://www.qiniu.com/products/kodo",
|
||||||
desc: "面向非结构化数据的对象存储服务",
|
target: "_blank",
|
||||||
url: "https://www.upyun.com/products/file-storage",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: upyun,
|
||||||
{
|
title: "又拍云 USS",
|
||||||
icon: pinanyun,
|
desc: "面向非结构化数据的对象存储服务",
|
||||||
title: "平安云OBS",
|
url: "https://www.upyun.com/products/file-storage",
|
||||||
desc: "基于大规模分布式高并发存储框架的云存储服务",
|
target: "_blank",
|
||||||
url: "https://yun.pingan.com/ssr/products/OBS",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: pinanyun,
|
||||||
{
|
title: "平安云OBS",
|
||||||
icon: qingyun,
|
desc: "基于大规模分布式高并发存储框架的云存储服务",
|
||||||
title: "青云",
|
url: "https://yun.pingan.com/ssr/products/OBS",
|
||||||
desc: "安全可靠、低成本的云端存储服务",
|
target: "_blank",
|
||||||
url: "https://www.qingcloud.com/products/objectstorage/",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: qingyun,
|
||||||
{
|
title: "青云",
|
||||||
icon: ucloud,
|
desc: "安全可靠、低成本的云端存储服务",
|
||||||
title: "优刻得US3",
|
url: "https://www.qingcloud.com/products/objectstorage/",
|
||||||
desc: "为互联网应用提供非结构化文件云存储的服务",
|
target: "_blank",
|
||||||
url: "https://www.ucloud.cn/site/product/ufile.html",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: ucloud,
|
||||||
{
|
title: "优刻得US3",
|
||||||
icon: jinshan,
|
desc: "为互联网应用提供非结构化文件云存储的服务",
|
||||||
title: "金山云OBS",
|
url: "https://www.ucloud.cn/site/product/ufile.html",
|
||||||
desc: "金山云分布式对象存储 KingStorage-OBS",
|
target: "_blank",
|
||||||
url: "https://www.ksyun.com/nv/product/ES10000.html",
|
},
|
||||||
target: "_blank",
|
{
|
||||||
},
|
icon: jinshan,
|
||||||
],
|
title: "金山云OBS",
|
||||||
};
|
desc: "金山云分布式对象存储 KingStorage-OBS",
|
||||||
|
url: "https://www.ksyun.com/nv/product/ES10000.html",
|
||||||
|
target: "_blank",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user