import('./SubmittedTab')));
+ const InProgressTab = Loadable(lazy(() => import('./InProgressTab')));
+ const PendingPaymentTab = Loadable(lazy(() => import('./PendingPaymentTab')));
+ const PendingPublishTab = Loadable(lazy(() => import('./PendingPublishTab')));
+ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
+ const SearchTab = Loadable(lazy(() => import('./SearchTab')));
+
+
+// ==============================|| 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();
+
+
+ useEffect(()=>{
+ loadData();
+ },[]);
+
+ const reloadPage=()=>{
+ window.location.reload(false);
+ }
+
+ const loadData = ()=>{
+ setLoding(true);
+ HttpUtils.get({
+ url: `${UrlUtils.GET_PUBLIC_NOTICE_LIST}`,
+ onSuccess: function(response){
+ setSubmittedList(response.data["submitted"]);
+ setInProgressList(response.data["inProgress"]);
+ setPendingPaymentList(response.data["pendingPayment"]);
+ setPendingPublishList(response.data["pendingPublish"]);
+ }
+ });
+ };
+
+ useEffect(() => {
+ setLoding(false);
+ }, [submittedList]);
+
+ const handleChange = (event, newValue)=>{
+ setSelectedTab(newValue);
+ }
+
+ const onBtnClick=()=>{
+ navigate('/publicNotice/apply')
+ }
+
+ return (
+ isLoading ?
+
+ :
+
+
+ 我的公共啟事
+
+
+
+
+ {/*col 2*/}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+
+export default PublicNotice;
diff --git a/src/pages/PublicNotice/index.js b/src/pages/PublicNotice/index.js
deleted file mode 100644
index 4cee95b..0000000
--- a/src/pages/PublicNotice/index.js
+++ /dev/null
@@ -1,166 +0,0 @@
-// material-ui
-import {
- // Grid,
- Typography,
- Tabs,
- Tab,
- Box
-} from '@mui/material';
-// import {TabPanel, TabContext, TabList } from '@mui/lab';
-// import {useEffect, useState} from "react";
-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 SubmittedTab = Loadable(lazy(() => import('./SubmittedTab')));
-// const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent')));
-
-
-// ==============================|| DASHBOARD - DEFAULT ||============================== //
-function a11yProps(index) {
- return {
- id: `simple-tab-${index}`,
- 'aria-controls': `simple-tabpanel-${index}`,
- };
- }
-
-function CustomTabPanel(props) {
- const { children, value, index, ...other } = props;
-
- return (
-
- {value === index && (
-
- {children}
-
- )}
-
- );
- }
-
- export default function BasicTabs() {
- const [value, setValue] = React.useState(0);
-
- const handleChange = (event, newValue) => {
- setValue(newValue);
- };
-
- return (
- <>
-
- 123
-
-
-
-
-
-
-
-
-
-
-
- Item One
-
-
- Item Two
-
-
- Item Three
-
-
- >
- );
- }
-
-// 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");
-
-
-// useEffect(()=>{
-// loadData();
-// },[]);
-
-// const reloadPage=()=>{
-// window.location.reload(false);
-// }
-
-// const loadData = ()=>{
-// setLoding(true);
-// HttpUtils.get({
-// url: `${UrlUtils.GET_PUBLIC_NOTICE_LIST}`,
-// onSuccess: function(response){
-// setSubmittedList(response.data["submitted"]);
-// // setInProgressList(response.data["inProgress"]);
-// // setPendingPaymentList(response.data["pendingPayment"]);
-// // setPendingPublishList(response.data["pendingPublish"]);
-// }
-// });
-// };
-
-
-// useEffect(() => {
-// setLoding(false);
-// }, [submittedList]);
-
-// const handleChange = (event, newValue)=>{
-// setSelectedTab(newValue);
-// }
-
-// return (
-// isLoading ?
-//
-// :
-//
-//
-// 我的公共啟事
-//
-// {/*col 2*/}
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-// TODO
-//
-//
-// TODO
-//
-//
-// TODO
-//
-// TODO
-//
-//
-//
-// );
-// };
-
-
-// export default PublicNotice;
diff --git a/src/routes/PublicUserRoutes.js b/src/routes/PublicUserRoutes.js
index a4343be..99bdae7 100644
--- a/src/routes/PublicUserRoutes.js
+++ b/src/routes/PublicUserRoutes.js
@@ -8,7 +8,8 @@ const MainLayout = Loadable(lazy(() => import('layout/MainLayout')));
// render - dashboard
const DashboardDefault = Loadable(lazy(() => import('pages/publicDashboard')));
const ManageOrgUser = Loadable(lazy(() => import('pages/ManageOrgUserPage')));
-const PublicNotice = Loadable(lazy(() => import('pages/PublicNotice')));
+const PublicNotice = Loadable(lazy(() => import('pages/PublicNotice/ListPanel')));
+const PublicNoticeApplyForm = Loadable(lazy(() => import('pages/PublicNotice/ApplyForm')));
// ==============================|| MAIN ROUTING ||============================== //
@@ -34,6 +35,10 @@ const PublicDashboard = {
{
path: 'publicNotice',
element:
+ },
+ {
+ path: 'publicNotice/apply',
+ element:
}
]
},
diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js
index 3280202..a98a190 100644
--- a/src/utils/ApiPathConst.js
+++ b/src/utils/ApiPathConst.js
@@ -49,6 +49,8 @@ export const GET_SET_UN_PRIMARY_USER = apiPath+'/user/un-primary';
export const GET_PUBLIC_NOTICE_LIST = apiPath+'/application/list';
export const GET_PUBLIC_NOTICE_LIST_ListByStatus = apiPath+'/application/status-list';
+export const GET_PUBLIC_NOTICE_getApplyUser = apiPath+'/application/get-apply-user';
+export const POST_PUBLIC_NOTICE_SAVE = apiPath+'/application/save';
//GLD User
export const POST_ADMIN_USER_REGISTER = apiPath+'/user/registry';
diff --git a/src/utils/FieldUtils.js b/src/utils/FieldUtils.js
index 49418bb..7ed1c84 100644
--- a/src/utils/FieldUtils.js
+++ b/src/utils/FieldUtils.js
@@ -177,4 +177,4 @@ export const initField=({type, valueName, form, disabled, placeholder, inputProp
},
}}
/>
-}
\ No newline at end of file
+}
diff --git a/src/utils/HttpUtils.js b/src/utils/HttpUtils.js
index db616f7..cd5b093 100644
--- a/src/utils/HttpUtils.js
+++ b/src/utils/HttpUtils.js
@@ -20,12 +20,14 @@ export const put = ({url,params, onSuccess, onFail, onError}) =>{
});
};
-export const post = ({url, params, onSuccess, onFail, onError}) =>{
+export const post = ({url, params, onSuccess, onFail, onError, headers}) =>{
+ headers = headers?headers:{
+ "Content-Type":"application/json"
+ };
+
axios.post(url,params,
{
- headers: {
- "Content-Type":"application/json"
- }
+ headers:headers
}).then(
(response)=>{onResponse(response, onSuccess, onFail);}
).catch(error => {