import React, { useEffect, useState } from "react"; import { ProTable, PageContainer } from "@ant-design/pro-components"; import { Col, Row, Button, Breadcrumb, Empty, Modal, Tree } from "antd"; import { useRequest } from "umi"; import { AppstoreOutlined, MenuOutlined } from "@ant-design/icons"; import { RecentFile } from "@/api/systemDesigner"; import ProjectCard from "./ProjectCard"; import { graphOptions } from "./data"; import { GraphType } from "@/enum"; export default function Recently({ updateKey }: { updateKey: number }) { const [display, setDisplay] = useState("card"); const [dataSource, setDataSource] = useState([]); const [total, setTotal] = useState(0); const [searchName, setSearchName] = useState(""); const [currentPage, setCurrentPage] = useState(1); const [open, setOpen] = useState(false); const { loading, run, refresh } = useRequest(RecentFile, { onSuccess: (res) => { const list = res?.result || []; setDataSource(list); setTotal(list.length); }, }); useEffect(() => { run(); }, [updateKey]); const FolderIcon = function () { return ( ); }; const folderTreeData = [ { key: "1", title: ( 我的文件(当前) ), icon: , children: [ { key: "1-1", title: "文件夹1", icon: , }, ], }, ]; // 搜索文件 const handleSearch = () => { setCurrentPage(1); run(); }; // 搜索图形类型 const setSearchGraphType = (type: GraphType) => {}; return ( <>
{display === "card" ? ( <> {dataSource.map((item, index) => { return ( {}} hideRemove={true} /> ); })} {dataSource.length == 0 ? : null} ) : ( a.updateTime - b.updateTime, }, ]} dataSource={dataSource} rowKey={"id"} search={false} pagination={{ total: total, pageSize: 10, current: currentPage, pageSizeOptions: ["12", "24", "36"], onChange: (page, pageSize) => { setCurrentPage(page); }, }} /> )}
setOpen(false)} centered footer={
} >
); }