diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js
index f3b96be..0500d58 100644
--- a/src/layout/MainLayout/Header/index.js
+++ b/src/layout/MainLayout/Header/index.js
@@ -74,62 +74,66 @@ function Header(props) {
isGLDLoggedIn() ?
- Dashboard
+ Dashboard
- Application
+ Application
- Proof
+ Proof
- Payment
+ Payment
- Client
+ Client
-
- Users (GLD)
+ Users (GLD)
-
- Users (Individual)
+ Users (Individual)
-
- Users (Organization)
+ Users (Organization)
-
- Organization
+ Organization
-
- User Group
+ User Group
+
- Logout
+ Email Template
+
+
+ Logout
:
- 主頁
+ 主頁
- 我的公共啟事
+ 我的公共啟事
- 校對記錄
+ 校對記錄
- 付款記錄
+ 付款記錄
- 設定
+ 設定
{isPrimaryLoggedIn() ?
:
@@ -137,7 +141,7 @@ function Header(props) {
}
- 登出
+ 登出
);
@@ -145,10 +149,10 @@ function Header(props) {
const logoutContent = (
- 登入
+ 登入
- 申請
+ 申請
);
diff --git a/src/pages/EmailTemplate/Detail_GLD/EmailTemplateDetails.js b/src/pages/EmailTemplate/Detail_GLD/EmailTemplateDetails.js
new file mode 100644
index 0000000..ff10def
--- /dev/null
+++ b/src/pages/EmailTemplate/Detail_GLD/EmailTemplateDetails.js
@@ -0,0 +1,311 @@
+// material-ui
+import {
+ FormControl,
+ Grid,
+ Typography,
+ FormLabel,
+ OutlinedInput,
+ Button,
+ // TextField,
+ // Autocomplete,
+} from '@mui/material';
+
+// import { useFormik } from 'formik';
+import * as React from "react";
+import Loadable from 'components/Loadable';
+const MainCard = Loadable(React.lazy(() => import('components/MainCard')));
+import { useForm } from 'react-hook-form';
+// ==============================|| DASHBOARD - DEFAULT ||============================== //
+const ApplicationDetailCard = ({
+ formData,
+ _onSubmit,
+ handleDelete
+}) => {
+
+ // const [data, setData] = React.useState({});
+
+ // React.useEffect(() => {
+ // if (formData) {
+ // setData(formData);
+ // }
+ // }, [formData]);
+
+ // const formik = useFormik({
+ // enableReinitialize: true,
+ // initialValues: data,
+ // });
+
+ const DisplayField = ({ name, width, value, rows = 1, disabled = false }) => {
+ return ;
+ }
+
+ const { register, handleSubmit } = useForm()
+
+
+
+ // const DisplaySelection = ({ name = "test", value = "", onChange }) => {
+ // return (
+ //
+ // )}
+ // />
+ // }
+ return (
+
+
+ Maintain Email Template
+
+
+
+ );
+};
+
+export default ApplicationDetailCard;
diff --git a/src/pages/EmailTemplate/Detail_GLD/index.js b/src/pages/EmailTemplate/Detail_GLD/index.js
new file mode 100644
index 0000000..78cf80f
--- /dev/null
+++ b/src/pages/EmailTemplate/Detail_GLD/index.js
@@ -0,0 +1,155 @@
+// material-ui
+import {
+ Grid,
+ Typography,
+ Stack,
+ Box,
+ Button
+} from '@mui/material';
+import * as UrlUtils from "utils/ApiPathConst";
+import * as React from "react";
+import ForwardIcon from '@mui/icons-material/Forward';
+
+import Loadable from 'components/Loadable';
+const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
+const EmailTemplate = Loadable(React.lazy(() => import('pages/EmailTemplate/Detail_GLD/EmailTemplateDetails')))
+import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
+import { useParams } from 'react-router-dom';
+import { useNavigate } from 'react-router-dom';
+import axios from 'axios';
+import { notifyDeleteSuccess, notifySaveSuccess } from 'utils/CommonFunction';
+const BackgroundHead = {
+ backgroundImage: `url(${titleBackgroundImg})`,
+ width: '100%',
+ height: '100%',
+ backgroundSize: 'contain',
+ backgroundRepeat: 'no-repeat',
+ backgroundColor: '#0C489E',
+ backgroundPosition: 'right'
+}
+
+// ==============================|| DASHBOARD - DEFAULT ||============================== //
+
+const Index = () => {
+
+ const [record, setRecord] = React.useState(null);
+ const [onReady, setOnReady] = React.useState(false);
+ const params = useParams()
+ const navigate = useNavigate()
+
+ React.useLayoutEffect(() => {
+ loadForm();
+ }, []);
+
+ React.useLayoutEffect(() => {
+ if(record !== null || params.id <= 0) setOnReady(true);
+ }, [record]);
+
+ const loadForm = () => {
+ if (params.id > 0) {
+ axios.get(`${UrlUtils.GET_EMAIL}/${params.id}`)
+ .then((response) => {
+ if (response.status === 200) {
+ console.log(response)
+ setRecord(response.data.data)
+ }
+ })
+ .catch(error => {
+ console.log(error);
+ return false;
+ });
+ }
+ // HttpUtils.get({
+ // url: UrlUtils.GET_EMAIL,
+ // params: {
+ // id: params.id
+ // },
+ // onSuccess: (responseData) => {
+ // setRecord(responseData);
+ // }
+ // });
+ }
+
+ const onSubmit = (data) => {
+ axios.post(`${UrlUtils.POST_EMAIL_SAVE}`,
+ {
+ id: params.id > 0 ? params.id : null,
+ contentChs: data?.contentChs,
+ contentCht: data?.contentCht,
+ contentEng: data?.contentEng,
+ description: data?.description,
+ tempKey: data?.tempKey,
+ params: data?.params,
+ subjectChs: data?.subjectChs,
+ subjectCht: data?.subjectCht,
+ subjectEng: data?.subjectEng
+ }
+ ).then((response) => {
+ if (response.status === 200) {
+ // location.reload();
+ navigate('/emailTemplate')
+ notifySaveSuccess()
+ }
+ })
+ .catch(error => {
+ console.log(error);
+ return false;
+ });
+ console.log(data)
+ }
+
+ const handleDelete = () => {
+ axios.delete(`${UrlUtils.DELETE_EMAIL}/${params.id}`,
+ )
+ .then((response) => {
+ console.log(response)
+ if (response.status === 204) {
+ // location.reload();
+ navigate('/emailTemplate');
+ notifyDeleteSuccess()
+ }
+ })
+ .catch(error => {
+ console.log(error);
+ return false;
+ });
+ }
+
+ return (
+ !onReady ?
+
+ :
+ (
+
+
+
+
+ Email Template
+
+
+
+
+
+
+ {/*row 1*/}
+
+
+
+
+
+
+
+
+ {/*row 2*/}
+
+ )
+ );
+};
+
+export default Index;
\ No newline at end of file
diff --git a/src/pages/EmailTemplate/Search_GLD/DataGrid.js b/src/pages/EmailTemplate/Search_GLD/DataGrid.js
new file mode 100644
index 0000000..542ce2e
--- /dev/null
+++ b/src/pages/EmailTemplate/Search_GLD/DataGrid.js
@@ -0,0 +1,100 @@
+// material-ui
+import * as React from 'react';
+import { GridActionsCellItem, } from "@mui/x-data-grid";
+import { FiDataGrid } from "components/FiDataGrid";
+import EditIcon from '@mui/icons-material/Edit';
+import { useEffect } from "react";
+import { useNavigate } from "react-router-dom";
+
+// ==============================|| EVENT TABLE ||============================== //
+
+export default function EmailTemplateTable({ recordList }) {
+ const [rows, setRows] = React.useState(recordList);
+
+ const navigate = useNavigate()
+
+ useEffect(() => {
+ setRows(recordList);
+ }, [recordList]);
+
+ const handleEditClick = (id) => () => {
+ navigate('/emailTemplate/' + id);
+ };
+
+ const columns = [
+ {
+ field: 'actions',
+ type: 'actions',
+ headerName: 'Actions',
+ width: 100,
+ cellClassName: 'actions',
+ getActions: ({ id }) => {
+ return [
+ }
+ label="Edit"
+ className="textPrimary"
+ onClick={handleEditClick(id)}
+ color="primary"
+ />]
+ },
+ },
+ {
+ id: 'tempKey',
+ field: 'tempKey',
+ headerName: 'Key',
+ flex: 1,
+ },
+ {
+ id: 'description',
+ field: 'description',
+ headerName: 'Description',
+ flex: 1,
+ },
+ {
+ id: 'params',
+ field: 'params',
+ headerName: 'Params',
+ flex: 1,
+ },
+ {
+ id: 'subjectCht',
+ field: 'subjectCht',
+ headerName: 'SubjectCht',
+ flex: 1,
+ },
+ {
+ id: 'subjectChs',
+ field: 'subjectChs',
+ headerName: 'SubjectChs',
+ flex: 1,
+ },
+ {
+ id: 'subjectEng',
+ field: 'subjectEng',
+ headerName: 'SubjectEng',
+ flex: 1,
+ },
+ ];
+
+ function handleRowDoubleClick(params) {
+ navigate('/emailTemplate/' + params.id);
+ }
+
+ return (
+
+ 'auto'}
+ />
+
+ );
+}
\ No newline at end of file
diff --git a/src/pages/EmailTemplate/Search_GLD/index.js b/src/pages/EmailTemplate/Search_GLD/index.js
new file mode 100644
index 0000000..2556ba1
--- /dev/null
+++ b/src/pages/EmailTemplate/Search_GLD/index.js
@@ -0,0 +1,100 @@
+// material-ui
+import {
+ Grid,
+ Typography,
+ Stack,
+ Button,
+} from '@mui/material';
+import * as UrlUtils from "utils/ApiPathConst";
+import * as React from "react";
+import * as HttpUtils from "utils/HttpUtils";
+
+import Loadable from 'components/Loadable';
+const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
+const EmailTemplateTable = Loadable(React.lazy(() => import('pages/EmailTemplate/Search_GLD/DataGrid')))
+import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
+import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';
+import MainCard from 'components/MainCard';
+const BackgroundHead = {
+ backgroundImage: `url(${titleBackgroundImg})`,
+ width: '100%',
+ height: '100%',
+ backgroundSize: 'contain',
+ backgroundRepeat: 'no-repeat',
+ backgroundColor: '#0C489E',
+ backgroundPosition: 'right'
+}
+import { useNavigate } from "react-router";
+
+// ==============================|| DASHBOARD - DEFAULT ||============================== //
+
+const Index = () => {
+
+ const [record, setRecord] = React.useState([]);
+ const [onReady, setOnReady] = React.useState(false);
+ const navigate = useNavigate()
+
+ React.useLayoutEffect(() => {
+ loadForm();
+ }, []);
+
+ React.useLayoutEffect(() => {
+ setOnReady(true);
+ }, [record]);
+
+ const loadForm = () => {
+ HttpUtils.get({
+ url: UrlUtils.GET_EMAIL_LIST,
+ onSuccess: (responseData) => {
+ setRecord(responseData);
+ }
+ });
+ }
+
+ return (
+ !onReady ?
+
+ :
+ (
+
+
+
+
+ Email Template
+
+
+
+ {/*row 1*/}
+
+
+
+
+
+
+
+
+
+
+
+ )
+ );
+};
+
+export default Index;
\ No newline at end of file
diff --git a/src/pages/User/SearchPage/UserSearchForm.js b/src/pages/User/SearchPage/UserSearchForm.js
index f172c32..c393d05 100644
--- a/src/pages/User/SearchPage/UserSearchForm.js
+++ b/src/pages/User/SearchPage/UserSearchForm.js
@@ -17,6 +17,8 @@ import Checkbox from "@mui/material/Checkbox";
import * as React from "react";
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';
import { useNavigate } from "react-router";
+import axios from "axios";
+import { GET_EMAIL_LIST } from 'utils/ApiPathConst';
// ==============================|| DASHBOARD - DEFAULT ||============================== //
@@ -53,6 +55,13 @@ const UserSearchForm = ({ applySearch }) => {
setType([]);
setLocked(false);
reset();
+ axios.get(`${GET_EMAIL_LIST}`)
+ .then(r => {
+ console.log(r)
+ })
+ .catch(err => {
+ console.log(err)
+ })
}
const handleNewUserClick = () => {
diff --git a/src/pages/pnspsNotifyTest/index.js b/src/pages/pnspsNotifyTest/index.js
index dcd6c23..f575a01 100644
--- a/src/pages/pnspsNotifyTest/index.js
+++ b/src/pages/pnspsNotifyTest/index.js
@@ -4,8 +4,8 @@ import axios from 'axios';
import { apiPath } from 'auth/utils';
const TestMailPage = () => {
- const [host, setHost] = useState(apiPath+'/test');
- const [mail, setMail] = useState('');
+ const [host, setHost] = useState(apiPath+'/email/test');
+ const [mail, setMail] = useState('register');
const hostChange = (event) => {
setHost(event.target.value);
@@ -16,8 +16,8 @@ const TestMailPage = () => {
};
const doMailTest = () => {
- axios.post(host, {
- email: mail
+ axios.get(host, {
+ tempKey: mail
})
.then((response) => {
console.log(response.data);
diff --git a/src/routes/SettingRoutes.js b/src/routes/SettingRoutes.js
index 048040e..1e712c4 100644
--- a/src/routes/SettingRoutes.js
+++ b/src/routes/SettingRoutes.js
@@ -20,6 +20,8 @@ const UserGroupDetailPage = Loadable(lazy(() => import('pages/pnspsUserGroupDeta
const OrganizationSearchPage = Loadable(lazy(() => import('pages/OrganizationSearchPage')));
const OrganizationDetailPage = Loadable(lazy(() => import('pages/OrganizationDetailPage')));
const OrganizationDetailPage_fromUser = Loadable(lazy(() => import('pages/OrganizationDetailPage_FromUser')));
+const EmailTemplatePage = Loadable(lazy(() => import('pages/EmailTemplate/Search_GLD')));
+const EmailTemplateDetailPage = Loadable(lazy(() => import('pages/EmailTemplate/Detail_GLD')));
// ==============================|| AUTH ROUTING ||============================== //
@@ -80,6 +82,14 @@ const SettingRoutes = {
path: 'passwordpolicy',
element:
},
+ {
+ path: 'emailTemplate',
+ element:
+ },
+ {
+ path: '/emailTemplate/:id',
+ element:
+ },
]
};
diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js
index cf6fb6d..ce1c0b0 100644
--- a/src/utils/ApiPathConst.js
+++ b/src/utils/ApiPathConst.js
@@ -91,4 +91,11 @@ export const PAYMENT_APP_LIST = apiPath+'/payment/applist';//POST
//User Group
-export const POST_AND_UPDATE_USER_GROUP = apiPath+'/group/save';
\ No newline at end of file
+export const POST_AND_UPDATE_USER_GROUP = apiPath+'/group/save';
+
+// Email
+export const GET_EMAIL_LIST = apiPath+'/email/list';
+export const GET_EMAIL_COMBO = apiPath+'/email/combo';
+export const GET_EMAIL = apiPath+'/email/load';
+export const POST_EMAIL_SAVE = apiPath+'/email/save';
+export const DELETE_EMAIL = apiPath+'/email/delete';
\ No newline at end of file