Ver a proveniência

message details

master
Anna Ho há 1 ano
ascendente
cometimento
ad9c7595bc
11 ficheiros alterados com 207 adições e 30 eliminações
  1. +117
    -0
      src/pages/Message/Details/index.js
  2. +1
    -1
      src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js
  3. +40
    -6
      src/pages/dashboard/Public/Message.js
  4. +8
    -5
      src/pages/dashboard/Public/index.js
  5. +2
    -0
      src/pages/iAmSmart/DirectLoginCallback/index.js
  6. +26
    -18
      src/routes/PublicUserRoutes.js
  7. +6
    -0
      src/themes/palette.js
  8. +1
    -0
      src/translations/en.json
  9. +1
    -0
      src/translations/zh-CN.json
  10. +1
    -0
      src/translations/zh-HK.json
  11. +4
    -0
      src/utils/ApiPathConst.js

+ 117
- 0
src/pages/Message/Details/index.js Ver ficheiro

@@ -0,0 +1,117 @@
// material-ui
import {
Grid,
Typography,
Stack,
Button,
} from '@mui/material';

import * as React from "react";
import * as HttpUtils from "utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst";
import * as DateUtils from "utils/DateUtils";
import { useParams, useNavigate } from "react-router-dom";

import Loadable from 'components/Loadable';
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));

import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import { FormattedMessage } from "react-intl";
const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`,
width: '100%',
height: '100%',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundColor: '#0C489E',
backgroundPosition: 'right'
}

// ==============================|| DASHBOARD - DEFAULT ||============================== //

const Index = () => {
const params = useParams();
const navigate = useNavigate()

const [record, setRecord] = React.useState();
const [onReady, setOnReady] = React.useState(false);

React.useEffect(() => {
loadForm();
}, []);

React.useEffect(() => {
setOnReady(true);
}, [record]);


const loadForm = () => {
if (params.id > 0) {
HttpUtils.get({
url: UrlUtils.GET_MSG_DETAILS + "/" + params.id,
onSuccess: (responseData) => {
if (!responseData?.sentDate) {
navigate("/");
}
setRecord(responseData);
}
});
}
}

return (
!onReady ?
<LoadingComponent />
:
(
<Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
<Grid item xs={12} width="100%">
<div style={BackgroundHead} width="100%">
<Stack direction="row" height='70px'>
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>
<FormattedMessage id="msgDetails" />
</Typography>
</Stack>
</div>
</Grid>
{/*row 1*/}
<Grid item xs={12} md={12} >
<Grid container justifyContent="flex-start" alignItems="center" >
<center>
<Grid item xs={12} md={12} sx={{p:2}} >
<Typography variant="h2" sx={{ textAlign: "left", borderBottom: "1px solid black" }}>
{record?.subject}
</Typography>
<Typography sx={{p:1}} align="justify">{DateUtils.datetimeStr(record?.sentDate)}</Typography>
<Typography variant="body1" sx={{ p:4, textAlign: "left" }} align="justify" backgroundColor="#f8f8f8">
<div dangerouslySetInnerHTML={{__html: record?.content}}></div>
</Typography>

<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
<Button
component="span"
variant="contained"
size="large"
sx={{ m: 4 }}
onClick={() => {
navigate(-1);
}}
>
<FormattedMessage id="back" />
</Button>
</Typography>
</Grid>
</center>
</Grid>
</Grid>
{/*row 2*/}
</Grid >


)


);
};

export default Index;

+ 1
- 1
src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js Ver ficheiro

@@ -139,7 +139,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
</div>
</Grid>
<Grid item xs={12} width={{xs:"90%", sm:"90%", md:"60%", lg:"60%"}}>
<Button title={intl.formatMessage({id: 'back'})} sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/publicNotice") }}>
<Button title={intl.formatMessage({id: 'back'})} sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1) }}>
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} />
</Button>
</Grid>


+ 40
- 6
src/pages/dashboard/Public/Message.js Ver ficheiro

@@ -1,15 +1,51 @@
// material-ui
import {
Stack,
Typography
Typography,
Button
} from '@mui/material';
import MainCard from "components/MainCard";
import * as React from "react";
import * as HttpUtils from "utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst";
import * as DateUtils from "utils/DateUtils";

import { useNavigate } from "react-router-dom";

// ==============================|| DASHBOARD - DEFAULT ||============================== //


const SearchDemandNoteForm = () => {
const navigate = useNavigate()
const [itemList, setItemList] = React.useState([]);

React.useEffect(() => {
loadData();
}, []);

const loadData = () => {

HttpUtils.get({
url: UrlUtils.GET_MSG_DESHBOARD,
onSuccess: function (response) {
let list = []
response.map((item) => {
list.push(
<Button onClick={()=>{navigate("/msg/details/"+item.id);}} color={item.readTime?"gray":"black"} style={{justifyContent: "flex-start"}} sx={{p:2}}>
<Stack direction="column" >
<Typography variant='h4' align="justify"><b>{item.subject}</b></Typography>
<Typography align="justify">{DateUtils.datetimeStr(item.sentDate)}</Typography>
</Stack>
</Button>
)
});

setItemList(list);

}
});
};


return (
<MainCard xs={12} md={12} lg={12}
@@ -17,14 +53,12 @@ const SearchDemandNoteForm = () => {
content={false}
sx={{ backgroundColor: '#fff' }}
>
<Stack direction="column" spacing={3}>
<Stack direction="row" spacing={3}>
<Typography></Typography>
<Typography align="justify"></Typography>
</Stack>
<Stack direction="column" spacing={1}>
{itemList}
</Stack>
</MainCard>
);

};

export default SearchDemandNoteForm;

+ 8
- 5
src/pages/dashboard/Public/index.js Ver ficheiro

@@ -10,16 +10,19 @@ import {
} from '@mui/material';
import { isORGLoggedIn, } from "utils/Utils";
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {FormattedMessage} from "react-intl";
import { FormattedMessage } from "react-intl";
import AdsClickRoundedIcon from '@mui/icons-material/AdsClickRounded';
import * as React from "react";
import Loadable from 'components/Loadable';
const Message = Loadable(React.lazy(() => import('./Message')));
const Notice = Loadable(React.lazy(() => import('./Notice')));

import { useNavigate } from "react-router-dom";

// ==============================|| DASHBOARD - DEFAULT ||============================== //

const DashboardDefault = () => {
const navigate = useNavigate()
const userData = JSON.parse(localStorage.getItem("userData"));
const BackgroundHead = {
// backgroundColor: '#0d47a1',
@@ -37,8 +40,8 @@ const DashboardDefault = () => {
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
{/* <Typography variant="h5">我的公共啟事</Typography> */}
<Typography color='#FFF' variant="h5" sx={{ ml:10, display:{ xs: 'none', sm:'none', md:'block'}}}>
{isORGLoggedIn() ?userData.fullenName:userData.fullchName}, <FormattedMessage id="welcomeMsg"/>
<Typography color='#FFF' variant="h5" sx={{ ml: 10, display: { xs: 'none', sm: 'none', md: 'block' } }}>
{isORGLoggedIn() ? userData.fullenName : userData.fullchName}, <FormattedMessage id="welcomeMsg" />
</Typography>
</Stack>
</div>
@@ -46,7 +49,7 @@ const DashboardDefault = () => {
<Grid item xs={12} md={12} sx={{ textAlign: "center" }}>
<Grid container justifyContent="center" spacing={2} sx={{ pt: 2 }} alignitems="stretch" >
<Grid item xs={12} lg={5} sx={{ pt: 2 }} style={{ height: '100%' }}>
<Box xs={12} md={12} sx={{ p: 4, border: '3px solid #e1edfc', borderRadius: '10px', backgroundColor: "#e1edfc" }} >
<Button xs={12} onClick={()=>{ navigate("/publicNotice/apply");}} style={{ justifyContent: "flex-start" }} sx={{ width: "100%", p: 4, border: '3px solid #e1edfc', borderRadius: '10px', backgroundColor: "#e1edfc" }} >
<Stack direction="row" spacing={2}>
<AdsClickRoundedIcon />
<Stack direction="column" alignItems="start">
@@ -58,7 +61,7 @@ const DashboardDefault = () => {
</Typography>
</Stack>
</Stack>
</Box>
</Button>
<Stack direction="row" justifyContent="space-between" sx={{ pl: 2, pr: 2, pt: 2 }} >
<Typography variant="h4">
<FormattedMessage id="announcement" />


+ 2
- 0
src/pages/iAmSmart/DirectLoginCallback/index.js Ver ficheiro

@@ -58,6 +58,8 @@ const Index = () => {
console.log(error);
}
});
}else{
window.location.assign("/iamsmart/loginFail");
}
}



+ 26
- 18
src/routes/PublicUserRoutes.js Ver ficheiro

@@ -25,7 +25,11 @@ const PaymentDetails_Public = Loadable(lazy(() => import('pages/Payment/Details_
const DemandNote_Public = Loadable(lazy(() => import('pages/DemandNote/Search_Public')));
const UserMaintainPage_Individual = Loadable(lazy(() => import('pages/User/DetailsPage_Individual')));
const UserMaintainPage_Organization = Loadable(lazy(() => import('pages/User/DetailsPage_Organization')));
<<<<<<< HEAD
const OrganizationDetailPage = Loadable(lazy(() => import('pages/Organization/DetailPage')));
=======
const Msg_Details = Loadable(lazy(() => import('pages/Message/Details')));
>>>>>>> d1c9a54 (message details)

// ==============================|| MAIN ROUTING ||============================== //

@@ -46,80 +50,84 @@ const PublicDashboard = {
},
{
path: 'setting/manageUser',
element: <ManageOrgUser/>
element: <ManageOrgUser />
},
{
path: 'publicNotice',
element: <PublicNotice/>
element: <PublicNotice />
},
{
path: 'publicNotice/apply',
element: <PublicNoticeApplyForm/>
element: <PublicNoticeApplyForm />
},
{
path: 'publicNotice/:id',
element: <PublicNoticeDetail/>
element: <PublicNoticeDetail />
},
{
path: 'proof/reply/:id',
element: <ProofReply/>
element: <ProofReply />
},
{
path: 'proof/search',
element: <ProofSearch/>
element: <ProofSearch />
},
{
path: 'proof/pay/:id',
element: <ProofPayment/>
element: <ProofPayment />
},
{
path: 'paymentPage',
element: <Payment_Multi/>
element: <Payment_Multi />
},
{
path: 'paymentPage/fps',
element: <Payment_FPS/>
element: <Payment_FPS />
},
{
path: 'paymentPage/card',
element: <Payment_Card/>
element: <Payment_Card />
},
{
path: 'paymentPage/callback',
element: <Payment_Callback/>
element: <Payment_Callback />
},
{
path: 'paymentPage/fps/fpscallback',
element: <Payment_FPS_CallBack/>
element: <Payment_FPS_CallBack />
},
{
path: 'paymentPage/fps/ackpage',
element: <Payment_FPS_Ackpage/>
element: <Payment_FPS_Ackpage />
},
{
path: 'paymentPage/search',
element: <PaymentSearch_Public/>
element: <PaymentSearch_Public />
},
{
path: 'paymentPage/details/:id',
element: <PaymentDetails_Public/>
element: <PaymentDetails_Public />
},
{
path: 'paymentPage/demandNote',
element: <DemandNote_Public/>
element: <DemandNote_Public />
},
{
path: '/indUser',
element: <UserMaintainPage_Individual />
},
{
path: '/orgUser',
element: <UserMaintainPage_Organization />
path: '/orgUser',
element: <UserMaintainPage_Organization />
},
{
path: '/org',
element: <OrganizationDetailPage />
},
{
path: '/msg/details/:id',
element: <Msg_Details />
},
]
},
]


+ 6
- 0
src/themes/palette.js Ver ficheiro

@@ -53,6 +53,12 @@ const Palette = (mode) => {
paper: paletteColor.grey[0],
default: paletteColor.grey.A50
},
black: {
main: '#000',
light: '#000',
dark: '#000',
contrastText: '#FFF',
},
gray: {
main: '#777',
light: '#777',


+ 1
- 0
src/translations/en.json Ver ficheiro

@@ -341,6 +341,7 @@
"viewAllAnnouncement": "Show all announcements",
"systemMessage": "System message",
"viewAllSystemMessage": "Show all messages",
"msgDetails": "Message Details",

"Dashboard": "Dashboard",
"event": "Event"

+ 1
- 0
src/translations/zh-CN.json Ver ficheiro

@@ -340,6 +340,7 @@
"viewAllAnnouncement": "显示所有公告",
"systemMessage": "系统消息",
"viewAllSystemMessage": "显示所有消息",
"msgDetails": "消息详情",

"Dashboard": "仪表板",
"event": "活动"

+ 1
- 0
src/translations/zh-HK.json Ver ficheiro

@@ -340,6 +340,7 @@
"viewAllAnnouncement": "顯示所有公告",
"systemMessage": "系統消息",
"viewAllSystemMessage": "顯示所有消息",
"msgDetails": "消息詳情",

"Dashboard": "儀表板",
"event": "活動"

+ 4
- 0
src/utils/ApiPathConst.js Ver ficheiro

@@ -38,6 +38,10 @@ export const GET_ORG_MARK_AS_CREDITOR = apiPath+'/org/mark-as-creditor';
export const GET_ORG_MARK_AS_NON_CREDITOR = apiPath+'/org/mark-as-non-creditor';
export const GET_ORG_EXPORT = apiPath+'/org/export';

export const GET_MSG_DETAILS = apiPath+'/msg/details';
export const GET_MSG_LIST = apiPath+'/msg/list';
export const GET_MSG_DESHBOARD = apiPath+'/msg/list/deshboard';



//File Up/Download


Carregando…
Cancelar
Guardar