import { useModel,history } from "@umijs/max"; import { useEffect, useState } from "react"; // @mui import { Box, ListItemIcon, Typography } from "@mui/material"; // mock import { styled } from "@mui/material/styles"; // components import navConfig from "@/layouts/dashboard/nav/config"; import { doFetch } from "@/utils/doFetch"; import { useRequest } from "ahooks"; import { Badge, Card, Divider } from "antd"; const StyledNavItemIcon = styled(ListItemIcon)({ width: 48, height: 48, color: "inherit", display: "flex", alignItems: "center", justifyContent: "center", color:"#448ee2" }); export default function Welcome() { const [navConfigs, setNavConfigs] = useState(navConfig); const { initialState: { nav, currentUser, menuNum }, setInitialState, } = useModel("@@initialState"); const { data } = useRequest(async () => { let res = await doFetch({ url: "/system/message", params: {} }); let result = {}; res?.data?.dataList?.map((it) => { result[it?.menu] = it?.count; }); return result; }); useEffect(() => { if (!data) { return; } setNavConfigs(() => { let news = navConfig?.map((it) => { return { ...it, children: it?.children?.map((item) => { const info = menuNum?.[item?.key ?? ""] === 0 ? {} : menuNum?.[item?.key ?? ""] ? { info: (