您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

70 行
2.0 KiB

  1. // material-ui
  2. import {
  3. Stack,
  4. Typography,
  5. Divider
  6. } from '@mui/material';
  7. import MainCard from "components/MainCard";
  8. import * as React from "react";
  9. import * as HttpUtils from "utils/HttpUtils";
  10. import * as UrlUtils from "utils/ApiPathConst";
  11. import * as DateUtils from "utils/DateUtils";
  12. import { useIntl} from "react-intl";
  13. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  14. const SearchDemandNoteForm = () => {
  15. const [itemList, setItemList] = React.useState([]);
  16. const [listData, setListData] = React.useState([]);
  17. const intl = useIntl();
  18. const { locale } = intl;
  19. React.useEffect(() => {
  20. loadData();
  21. }, []);
  22. React.useEffect(() => {
  23. let list = []
  24. if(listData == []) return;
  25. listData.map((item) => {
  26. list.push(
  27. <Stack direction="column" >
  28. <Typography variant='h4' align="justify"><b>{locale === 'en' ?item.subjectEng:locale === 'zh-HK' ?item.subjectCht:item.subjectChs}</b></Typography>
  29. <Typography align="justify">{DateUtils.dateStr(item.announceDate)}</Typography>
  30. <Typography align="justify"sx={{ pt: 1 }}>{locale === 'en' ?item.contentEng:locale === 'zh-HK' ?item.contentCht:item.contentChs}</Typography>
  31. <Divider fullWidth sx={{ pt: 1 }}></Divider>
  32. </Stack>
  33. )
  34. });
  35. setItemList(list);
  36. }, [listData,intl]);
  37. const loadData = () => {
  38. HttpUtils.get({
  39. url: UrlUtils.GET_ANNOUNCE_DASHBOARD,
  40. onSuccess: function (response) {
  41. setListData(response);
  42. }
  43. });
  44. };
  45. return (
  46. <MainCard xs={12} md={12} lg={12}
  47. border={false}
  48. content={false}
  49. sx={{ backgroundColor: '#fff' }}
  50. >
  51. <Stack direction="column" spacing={4}>
  52. {itemList}
  53. </Stack>
  54. </MainCard>
  55. );
  56. };
  57. export default SearchDemandNoteForm;