// 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'
// ==============================|| DASHBOARD - DEFAULT ||============================== //
const PublicNotice = () => {
const [submittedList, setSubmittedList] = useState([]);
const [inProgressList, setInProgressList] = useState([]);
const [pendingPaymentList, setPendingPaymentList] = useState([]);
const [pendingPublishList, setPendingPublishList] = useState([]);
const [isLoading, setLoding] = useState(true);
const [selectedTab, setSelectedTab] = useState("1");
const navigate = useNavigate();
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"]);
setInProgressList(response["inProgress"]);
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;