import './proj-config-list-mod.css'; import { Alert, Breadcrumb, Button, message, Table, TableProps, } from "antd"; import {Link, useNavigate, useParams} from "react-router-dom"; import {useEffect, useState} from "react"; import {EditOutlined, PlusOutlined, DeleteOutlined, SearchOutlined} from "@ant-design/icons"; import {del, get} from "../../../util/AjaxUtils.ts"; export const MAX_MOD_SIZE = 18; export const MIN_MOD_SIZE = 10 export const MAX_MOD_SIZE_FREE = 3 export const MIN_MOD_SIZE_FREE = 1 interface DataType { projModId: string; projId: string; modContext: string; modName: string; modUrl: string; modDesc: string; modIcon: string; } type PropType = { isFree?: boolean; } export default function ProjConfigModList(props: PropType) { const nav = useNavigate(); const pathParams = useParams(); const [messageApi, contextHolder] = message.useMessage(); const [dataArray, setDataArray] = useState(); const [modSize, setModSize] = useState(0); const minSize = props.isFree ? MIN_MOD_SIZE_FREE : MIN_MOD_SIZE; const maxSize = props.isFree ? MAX_MOD_SIZE_FREE : MAX_MOD_SIZE; const height = window.innerHeight - 165; const renderData = () => { get({ messageApi, url: '/api/proj-mod/list', config: { params: { projId: pathParams.projId } }, onSuccess({data}) { setDataArray([...data]); setModSize(data.length); } }) } const columns: TableProps['columns'] = [ { title: '菜单标题', dataIndex: 'modName', align: 'center', width: 180 }, { title: '菜单说明', dataIndex: 'modDesc', align: 'center', }, { title: '图标', dataIndex: 'modIcon', align: 'center', width: 80, render: (_text) => { return } }, { title: '菜单地址', dataIndex: 'menuUrl', align: 'center', }, { title: '创建时间', dataIndex: 'gmtCreate', align: 'center', width: 180 }, { title: '操作', dataIndex: 'option', align: 'center', width: 100, render: (_text, record) => { return ( <> { modSize < maxSize ? ( ) : ( ) } ) } }, ]; useEffect(() => { renderData(); }, []) return ( <> {contextHolder} 首页}, {title: 创建项目}, { title: { nav(-1) }}>编辑项目 }, {title: '系统菜单管理'}, ]} />
{ modSize < maxSize ? ( ) : <> }
) }