Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

132 righe
4.4 KiB

  1. import {
  2. useEffect,
  3. useState
  4. } from "react";
  5. // material-ui
  6. import {
  7. Grid,
  8. Typography,
  9. Stack,
  10. Box
  11. } from '@mui/material';
  12. import Loadable from 'components/Loadable';
  13. import { lazy } from 'react';
  14. import {
  15. // useNavigate,
  16. useParams
  17. } from "react-router-dom";
  18. import axios from "axios";
  19. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  20. const ApplicationDetailCard = Loadable(lazy(() => import('./ApplicationDetailCard')));
  21. const GazetteDetailCard = Loadable(lazy(() => import('./GazetteDetailCard')));
  22. const ClientDetailCard = Loadable(lazy(() => import('./ClientDetailCard')));
  23. const TabTableDetail = Loadable(lazy(() => import('./tabTableDetail/TabTable')));
  24. import {
  25. GET_PUBLIC_NOTICE_APPLY_DETAIL,
  26. } from "utils/ApiPathConst";
  27. // ==============================|| Body - DEFAULT ||============================== //
  28. const DashboardDefault = () => {
  29. const params = useParams();
  30. const [applicationDetailData, setApplicationDetailData] = useState({});
  31. // const [refApplicationDetailData, setRefApplicationDetailData] = React.useState({});
  32. const BackgroundHead = {
  33. backgroundImage: `url(${titleBackgroundImg})`,
  34. width: '100%',
  35. height: '100%',
  36. backgroundSize:'cover'
  37. }
  38. const appNo = "G2023-343"
  39. const gazetteIssue = "2023 Vol 027"
  40. const issueNo = "No. 36"
  41. const issueDate = "A001"
  42. useEffect(() => {
  43. if(params.id > 0 ){
  44. axios.get(`${GET_PUBLIC_NOTICE_APPLY_DETAIL}/${params.id}`)
  45. .then((response) => {
  46. if (response.status === 200) {
  47. setApplicationDetailData(response.data);
  48. // setRefApplicationDetailData(response.data);
  49. }
  50. })
  51. .catch(error => {
  52. console.log(error);
  53. return false;
  54. });
  55. }
  56. }, []);
  57. return (
  58. <Grid container sx={{maxnHeight: '500vh',backgroundColor:'#ffffff'}} direction="column">
  59. <Grid item xs={12}>
  60. <div style={BackgroundHead}>
  61. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  62. <Typography ml={15} color='#FFF' variant="h4">Application</Typography>
  63. </Stack>
  64. </div>
  65. </Grid>
  66. <Grid item xs={12} >
  67. <Stack direction="row" height='20px' justifyContent="flex-start" alignItems="center">
  68. <Typography ml={4} mt={3} variant="h4">Application / {appNo}, {gazetteIssue}, {issueNo} , {issueDate}</Typography>
  69. </Stack>
  70. </Grid>
  71. <Grid item xs={12} >
  72. <Grid container direction="row">
  73. <Grid item xs={12} md={10}>
  74. <Grid container direction="column">
  75. <Grid item>
  76. <Box xs={12} ml={4} mt={3} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px'}}>
  77. <ApplicationDetailCard
  78. // updateUserObject={updateUserObject}
  79. applicationDetailData={applicationDetailData}
  80. // isCollectData={isCollectData}
  81. // isNewRecord={isNewRecord}
  82. />
  83. </Box>
  84. </Grid>
  85. <Grid item xs={12}>
  86. <Box xs={12} ml={4} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px'}}>
  87. <GazetteDetailCard
  88. // updateUserObject={updateUserObject}
  89. applicationDetailData={applicationDetailData}
  90. // isCollectData={isCollectData}
  91. // isNewRecord={isNewRecord}
  92. />
  93. </Box>
  94. </Grid>
  95. <Grid item xs={12}>
  96. <Box xs={12} ml={4} mt={3}>
  97. <TabTableDetail applicationDetailData={applicationDetailData}/>
  98. </Box>
  99. </Grid>
  100. </Grid>
  101. </Grid>
  102. <Grid item xs={12} md={2} lg={2}>
  103. <Grid container>
  104. <Grid item xs={12}>
  105. <Box ml={1} mt={3} mr={1} height='800px' sx={{ p: 2, border: '3px groove grey', borderRadius: '10px'}}>
  106. <ClientDetailCard
  107. // updateUserObject={updateUserObject}
  108. applicationDetailData={applicationDetailData}
  109. // isCollectData={isCollectData}
  110. // isNewRecord={isNewRecord}
  111. />
  112. </Box>
  113. </Grid>
  114. </Grid>
  115. </Grid>
  116. </Grid>
  117. </Grid>
  118. </Grid>
  119. );
  120. };
  121. export default DashboardDefault;