Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

118 Zeilen
3.7 KiB

  1. // material-ui
  2. import {
  3. Grid,
  4. Typography,
  5. Stack
  6. } from '@mui/material';
  7. import MainCard from "components/MainCard";
  8. import * as UrlUtils from "utils/ApiPathConst";
  9. import * as React from "react";
  10. import * as HttpUtils from "utils/HttpUtils";
  11. import * as DateUtils from "utils/DateUtils";
  12. import Loadable from 'components/Loadable';
  13. const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
  14. const SearchForm = Loadable(React.lazy(() => import('./SearchForm')));
  15. const EventTable = Loadable(React.lazy(() => import('./DataGrid')));
  16. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  17. import {FormattedMessage} from "react-intl";
  18. const BackgroundHead = {
  19. backgroundImage: `url(${titleBackgroundImg})`,
  20. width: '100%',
  21. height: '100%',
  22. backgroundSize:'contain',
  23. backgroundRepeat: 'no-repeat',
  24. backgroundColor: '#0C489E',
  25. backgroundPosition: 'right'
  26. }
  27. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  28. const UserSearchPage_Individual = () => {
  29. const [record,setRecord] = React.useState([]);
  30. const [issueCombo,setIssueCombo] = React.useState([]);
  31. const [searchCriteria, setSearchCriteria] = React.useState({
  32. dateTo: DateUtils.dateValue(new Date()),
  33. dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)),
  34. });
  35. const [onReady, setOnReady] = React.useState(false);
  36. React.useEffect(() => {
  37. getIssueCombo();
  38. }, []);
  39. React.useEffect(() => {
  40. setOnReady(true);
  41. }, [record]);
  42. React.useEffect(() => {
  43. loadGrid();
  44. }, [searchCriteria]);
  45. function loadGrid(){
  46. HttpUtils.get({
  47. url: UrlUtils.LIST_PROOF,
  48. params: searchCriteria,
  49. onSuccess: function(responseData){
  50. setRecord(responseData);
  51. }
  52. });
  53. }
  54. function getIssueCombo(){
  55. HttpUtils.get({
  56. url: UrlUtils.GET_ISSUE_COMBO,
  57. onSuccess: function(responseData){
  58. let combo = responseData;
  59. setIssueCombo(combo);
  60. }
  61. });
  62. }
  63. function applySearch(input) {
  64. setSearchCriteria(input);
  65. }
  66. return (
  67. !onReady ?
  68. <LoadingComponent/>
  69. :
  70. <Grid container sx={{minHeight: '85vh',backgroundColor:'#ffffff'}} direction="column">
  71. <Grid item xs={12}>
  72. <div style={BackgroundHead} >
  73. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center" >
  74. <Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}>
  75. <FormattedMessage id="proofRecord"/>
  76. </Typography>
  77. </Stack>
  78. </div>
  79. </Grid>
  80. {/*row 1*/}
  81. <Grid item xs={12} md={12} lg={12}>
  82. <SearchForm
  83. applySearch={applySearch}
  84. issueComboData={issueCombo}
  85. searchCriteria={searchCriteria}
  86. />
  87. </Grid>
  88. {/*row 2*/}
  89. <Grid item xs={12} sm={12} md={12} lg={12}>
  90. <MainCard elevation={0}
  91. border={false}
  92. content={false}
  93. sx={{width: "-webkit-fill-available"}}
  94. >
  95. <EventTable
  96. recordList={record}
  97. />
  98. </MainCard>
  99. </Grid>
  100. </Grid>
  101. );
  102. };
  103. export default UserSearchPage_Individual;