import './list-proj.css' import CardProj from "../card/CardProj.tsx"; import {useRef, MutableRefObject, useState, useEffect} from "react"; import {Input, Pagination} from 'antd'; import type {SearchProps} from 'antd/es/input/Search'; import {Axios} from "../../util/AjaxUtils.ts"; const {Search} = Input; const onSearch: SearchProps['onSearch'] = (value, _e, info) => { console.log(info?.source, value) }; export default function ListProj() { const listProjRef: MutableRefObject = useRef(null); const listRef: MutableRefObject = useRef(null); const [page, _setPage] = useState(1); const [total, _setTotal] = useState(0); const [projs, _setProjs] = useState([]); const domHeight = window.innerHeight - 280; const renderData = () => { Axios.get('/api/proj/listpage/self', { params: { page: page, rows: 20 } }).then(res => { const data = res.data; _setProjs(data.page); _setTotal(data.total); _setProjs(data.rows); }).catch(res => { console.log(res); }) } const renderList = () => { return projs.map((item, index) => ); } useEffect(() => { renderData(); }, []) return (
{renderList()}
) }