// material-ui import { Grid, Typography, Tab, Box, Button, Stack } from '@mui/material'; import { TabPanel, TabContext, TabList } from '@mui/lab'; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import * as React from "react"; import * as HttpUtils from "../../../utils/HttpUtils"; import * as UrlUtils from "../../../utils/ApiPathConst"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; const BaseGrid = Loadable(lazy(() => import('./BaseGrid'))); const PendingPaymentTab = Loadable(lazy(() => import('./PendingPaymentTab'))); const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); const SearchTab = Loadable(lazy(() => import('./SearchPublicNoticeTab'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const PublicNotice = () => { const [submittedList, setSubmittedList] = useState([]); const [pendingPaymentList, setPendingPaymentList] = useState([]); const [pendingPublishList, setPendingPublishList] = useState([]); const [isLoading, setLoding] = useState(true); const [selectedTab, setSelectedTab] = useState("1"); const navigate = useNavigate(); const _sx = { padding: "4 2 4 2", boxShadow: 1, border: 1, borderColor: '#DDD', '& .MuiDataGrid-cell': { borderTop: 1, borderBottom: 1, borderColor: "#EEE" }, '& .MuiDataGrid-footerContainer': { border: 1, borderColor: "#EEE" }, '& .MuiTabPanel-root': { padding: '0px', } } const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', height: '100%', backgroundSize: 'contain', backgroundRepeat: 'no-repeat', backgroundColor: '#0C489E', backgroundPosition: 'right' } useEffect(() => { loadData(); }, []); const reloadPage = () => { window.location.reload(false); } const loadData = () => { setLoding(true); HttpUtils.get({ url: `${UrlUtils.GET_PUBLIC_NOTICE_LIST_ListByStatus}`, onSuccess: function (response) { setSubmittedList(response["submitted"]); setPendingPaymentList(response["pendingPayment"]); setPendingPublishList(response["pendingPublish"]); } }); }; useEffect(() => { setLoding(false); }, [submittedList]); const handleChange = (event, newValue) => { setSelectedTab(newValue); } const onBtnClick = () => { navigate('/publicNotice/apply') } return ( isLoading ? :
我的公共啟事
{/*col 2*/} { JSON.parse(localStorage.getItem('userData')).creditor ? ( ) : ( ) }
); }; export default PublicNotice;