Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

102 строки
3.2 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 Index = () => {
  29. const [record,setRecord] = React.useState([]);
  30. const [searchCriteria, setSearchCriteria] = React.useState({
  31. dateTo: DateUtils.dateStr(new Date()),
  32. dateFrom: DateUtils.dateStr(new Date().setDate(new Date().getDate()-14)),
  33. });
  34. const [onReady, setOnReady] = React.useState(false);
  35. React.useEffect(() => {
  36. setOnReady(true);
  37. }, [record]);
  38. React.useEffect(() => {
  39. loadGrid();
  40. }, [searchCriteria]);
  41. function loadGrid(){
  42. HttpUtils.get({
  43. url: UrlUtils.GET_MSG_LIST,
  44. params: searchCriteria,
  45. onSuccess: function(responseData){
  46. setRecord(responseData);
  47. }
  48. });
  49. }
  50. function applySearch(input) {
  51. setSearchCriteria(input);
  52. }
  53. return (
  54. !onReady ?
  55. <LoadingComponent/>
  56. :
  57. <Grid container sx={{minHeight: '85vh',backgroundColor:'#ffffff'}} direction="column">
  58. <Grid item xs={12}>
  59. <div style={BackgroundHead}>
  60. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  61. <Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}>
  62. <FormattedMessage id="paymentHistory"/>
  63. </Typography>
  64. </Stack>
  65. </div>
  66. </Grid>
  67. {/*row 1*/}
  68. <Grid item xs={12} md={12} lg={12}>
  69. <SearchForm
  70. applySearch={applySearch}
  71. searchCriteria={searchCriteria}
  72. />
  73. </Grid>
  74. {/*row 2*/}
  75. <Grid item xs={12} md={12} lg={12}>
  76. <MainCard elevation={0}
  77. border={false}
  78. content={false}
  79. sx={{width: "-webkit-fill-available"}}
  80. >
  81. <EventTable
  82. recordList={record}
  83. />
  84. </MainCard>
  85. </Grid>
  86. </Grid>
  87. );
  88. };
  89. export default Index;